All Packages Class Hierarchy This Package Previous Next Index
Class espresso.syntaxtree.ExpressionNode
java.lang.Object
|
+----espresso.syntaxtree.SyntaxTreeNode
|
+----espresso.syntaxtree.ExpressionNode
- public abstract class ExpressionNode
- extends SyntaxTreeNode
-
falseList_d
-
-
leftValue_d
-
-
statementExp_d
-
-
trueList_d
-
-
type_d
-
-
ExpressionNode()
-
-
addFalseList(InstructionHandle)
- Add an instruction to the false list for backpatching.
-
addTrueList(InstructionHandle)
- Add an instruction to the true list for backpatching.
-
appendToFalseList(InstructionList)
- Append a list to the false list.
-
appendToTrueList(InstructionList)
- Append a list to the true list.
-
backPatch(InstructionList, InstructionHandle)
- Backpatch a true or a false list.
-
desynthesize(ClassGen, MethodGen)
-
-
evaluate(SymbolTable)
-
-
evaluateExp()
-
-
leftValue()
- Determines if the expression is an lvalue.
-
lookupPrimop(SymbolTable, int, MethodType)
-
-
superExp()
- Determines if the expression is 'super'.
-
synthesize(ClassGen, MethodGen)
-
Synthesize a boolean expression, i.e., either push a 0 or 1 onto the
operand stack for the next statement to succeed.
-
thisExp()
- Determines if the expression is 'this'.
-
thisOrSuperExp()
- Determines if the expression refers to this or super.
-
translate(ClassGen, MethodGen)
-
-
translateSynthesized(ClassGen, MethodGen)
- First translate the expression and then synthesize it.
-
type()
-
-
typeCheck(SymbolTable)
-
-
typeExp()
- Determines if the expression refers to a type.
-
variableExp()
- Determines if the expression is an access to a local or a formal param.
type_d
public Type type_d
trueList_d
public InstructionList trueList_d
falseList_d
public InstructionList falseList_d
leftValue_d
public boolean leftValue_d
statementExp_d
public boolean statementExp_d
ExpressionNode
public ExpressionNode()
typeCheck
public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError
- Overrides:
- typeCheck in class SyntaxTreeNode
type
public Type type()
evaluateExp
public BigDecimal evaluateExp()
evaluate
public BigDecimal evaluate(SymbolTable stable) throws NotConstant
translate
public void translate(ClassGen classGen,
MethodGen methodGen)
translateSynthesized
public BranchHandle translateSynthesized(ClassGen classGen,
MethodGen methodGen)
- First translate the expression and then synthesize it. This method
is redefined in those expressions that already synthesize their
result to avoid synthesize, de-synthesize, synthesize sequences.
synthesize
public BranchHandle synthesize(ClassGen classGen,
MethodGen methodGen)
- Synthesize a boolean expression, i.e., either push a 0 or 1 onto the
operand stack for the next statement to succeed. Returns the handle
of the instruction to be backpatched.
desynthesize
public void desynthesize(ClassGen classGen,
MethodGen methodGen)
lookupPrimop
public MethodType lookupPrimop(SymbolTable stable,
int op,
MethodType ctype)
variableExp
public boolean variableExp()
- Determines if the expression is an access to a local or a formal param.
Redefined in the VariableExpNode class.
leftValue
public boolean leftValue()
- Determines if the expression is an lvalue. TODO -> check if it is final.
typeExp
public boolean typeExp()
- Determines if the expression refers to a type.
thisExp
public boolean thisExp()
- Determines if the expression is 'this'.
superExp
public boolean superExp()
- Determines if the expression is 'super'.
thisOrSuperExp
public boolean thisOrSuperExp()
- Determines if the expression refers to this or super.
backPatch
public static void backPatch(InstructionList list,
InstructionHandle target)
- Backpatch a true or a false list.
addTrueList
public InstructionList addTrueList(InstructionHandle ih)
- Add an instruction to the true list for backpatching.
addFalseList
public InstructionList addFalseList(InstructionHandle ih)
- Add an instruction to the false list for backpatching.
appendToTrueList
public InstructionList appendToTrueList(InstructionList right)
- Append a list to the true list.
appendToFalseList
public InstructionList appendToFalseList(InstructionList right)
- Append a list to the false list.
All Packages Class Hierarchy This Package Previous Next Index