com.adamcornett.cminus.tree
Class OpTree

java.lang.Object
  extended by org.antlr.runtime.tree.BaseTree
      extended by org.antlr.runtime.tree.CommonTree
          extended by com.adamcornett.cminus.tree.CMTree
              extended by com.adamcornett.cminus.tree.ExprNode
                  extended by com.adamcornett.cminus.tree.OpTree
All Implemented Interfaces:
TypeNode, org.antlr.runtime.tree.Tree

public class OpTree
extends ExprNode

An arithmetic operation node

Author:
Adam Cornett

Nested Class Summary
static class OpTree.OperationType
           
 
Field Summary
private  ExprNode lhs
           
private  boolean noExe
           
private  OpTree.OperationType op
           
private  ExprNode rhs
           
 
Fields inherited from class com.adamcornett.cminus.tree.CMTree
log
 
Fields inherited from class org.antlr.runtime.tree.CommonTree
childIndex, parent, startIndex, stopIndex, token
 
Fields inherited from class org.antlr.runtime.tree.BaseTree
children
 
Fields inherited from interface org.antlr.runtime.tree.Tree
INVALID_NODE
 
Constructor Summary
OpTree(org.antlr.runtime.Token t)
           
 
Method Summary
 void emitCode(ClassGenerator classGenerator)
           
 ExprNode getLHS()
           
 Type getOperandType()
           
 int getRequiredStack()
           
 Type getReturnType()
           
 ExprNode getRHS()
           
 void setNoExe()
           
 void setReturnType(Type t)
           
 
Methods inherited from class com.adamcornett.cminus.tree.CMTree
emitLineInfo, getMaxTreeDepth, getNextLabelNumber
 
Methods inherited from class org.antlr.runtime.tree.CommonTree
dupNode, getCharPositionInLine, getChildIndex, getLine, getParent, getText, getToken, getTokenStartIndex, getTokenStopIndex, getType, isNil, setChildIndex, setParent, setTokenStartIndex, setTokenStopIndex, setUnknownTokenBoundaries, toString
 
Methods inherited from class org.antlr.runtime.tree.BaseTree
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, getAncestor, getAncestors, getChild, getChildCount, getChildren, getFirstChildWithType, hasAncestor, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, toStringTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lhs

private ExprNode lhs

rhs

private ExprNode rhs

noExe

private boolean noExe

op

private OpTree.OperationType op
Constructor Detail

OpTree

public OpTree(org.antlr.runtime.Token t)
Method Detail

emitCode

public void emitCode(ClassGenerator classGenerator)
Overrides:
emitCode in class CMTree

getRequiredStack

public int getRequiredStack()
Overrides:
getRequiredStack in class CMTree

getOperandType

public Type getOperandType()
Overrides:
getOperandType in class ExprNode

getReturnType

public Type getReturnType()

setNoExe

public void setNoExe()

setReturnType

public void setReturnType(Type t)

getLHS

public ExprNode getLHS()

getRHS

public ExprNode getRHS()