coins.ffront
Class ComplexConstNode

java.lang.Object
  extended bycoins.ffront.Pair
      extended bycoins.ffront.ComplexConstNode
All Implemented Interfaces:
HasConstValue, Node

public class ComplexConstNode
extends Pair
implements HasConstValue

Complex constant


Field Summary
 
Fields inherited from class coins.ffront.Pair
fHir, left, right
 
Constructor Summary
ComplexConstNode(Node pReal, Node pImag, FirToHir pfHir)
           
 
Method Summary
 FNumber getConstValue()
           
(package private)  Node getImag()
           
(package private)  Node getReal()
           
 Exp makeArgAddr(FStmt pCallStmt)
          Make HIR Exp node from this complex constant as a call-by-address parameter in pCallStmt.
 Exp makeExp()
          Make HIR Exp node of this complex constant.
(package private)  Exp makeRealExp(Node pNode)
           
 void print(int level, java.lang.String spaces)
           
 
Methods inherited from class coins.ffront.Pair
getLeft, getRight, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexConstNode

public ComplexConstNode(Node pReal,
                        Node pImag,
                        FirToHir pfHir)
Method Detail

getReal

Node getReal()

getImag

Node getImag()

print

public void print(int level,
                  java.lang.String spaces)
Specified by:
print in interface Node
Overrides:
print in class Pair

makeExp

public Exp makeExp()
Make HIR Exp node of this complex constant.

Specified by:
makeExp in interface Node
Overrides:
makeExp in class Pair
Returns:
HIR Exp.

makeArgAddr

public Exp makeArgAddr(FStmt pCallStmt)
Make HIR Exp node from this complex constant as a call-by-address parameter in pCallStmt. typedef struct { float _real; float _imag; } _complex_struct; _complex_struct dummyName; dummyName._real = left; dummyName._imag = right; return Exp node of address of dummyName

Specified by:
makeArgAddr in interface Node
Overrides:
makeArgAddr in class Pair
Parameters:
pCallStmt -
Returns:
HIR Exp.

makeRealExp

Exp makeRealExp(Node pNode)

getConstValue

public FNumber getConstValue()
Specified by:
getConstValue in interface HasConstValue