coins.ffront
Class PowerNode

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

public class PowerNode
extends BinaryNode

Powered expression left ** right


Field Summary
(package private)  HirUtility fHirUtil
           
 
Fields inherited from class coins.ffront.BinaryNode
fDeclMgr, fESMgr, fTypeUtil, hir
 
Fields inherited from class coins.ffront.Pair
fHir, left, right
 
Constructor Summary
PowerNode(Node left, Node right, FirToHir pfHir)
           
 
Method Summary
 FNumber getConstValue()
           
 Exp makeExp()
          Return Exp of "left ** right".
 void print(int level, java.lang.String spaces)
           
 java.lang.String toString()
           
 
Methods inherited from class coins.ffront.BinaryNode
character_operation, makeArgAddr, opString
 
Methods inherited from class coins.ffront.Pair
getLeft, getRight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fHirUtil

HirUtility fHirUtil
Constructor Detail

PowerNode

public PowerNode(Node left,
                 Node right,
                 FirToHir pfHir)
Method Detail

print

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

toString

public java.lang.String toString()
Specified by:
toString in interface Node
Overrides:
toString in class BinaryNode

makeExp

public Exp makeExp()
Return Exp of "left ** right". If right == 0 return 1 right == 1 return left right == 2 return left * left right == 3 return left * left * left right == 4 return (left * left) * (left * left) else return SubscrOrFunCall("_power", (left, right))

Specified by:
makeExp in interface Node
Overrides:
makeExp in class BinaryNode
Returns:
power expression.

getConstValue

public FNumber getConstValue()
Specified by:
getConstValue in interface HasConstValue
Overrides:
getConstValue in class BinaryNode