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

Variable Index

 o falseList_d
 o leftValue_d
 o statementExp_d
 o trueList_d
 o type_d

Constructor Index

 o ExpressionNode()

Method Index

 o addFalseList(InstructionHandle)
Add an instruction to the false list for backpatching.
 o addTrueList(InstructionHandle)
Add an instruction to the true list for backpatching.
 o appendToFalseList(InstructionList)
Append a list to the false list.
 o appendToTrueList(InstructionList)
Append a list to the true list.
 o backPatch(InstructionList, InstructionHandle)
Backpatch a true or a false list.
 o desynthesize(ClassGen, MethodGen)
 o evaluate(SymbolTable)
 o evaluateExp()
 o leftValue()
Determines if the expression is an lvalue.
 o lookupPrimop(SymbolTable, int, MethodType)
 o superExp()
Determines if the expression is 'super'.
 o 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.
 o thisExp()
Determines if the expression is 'this'.
 o thisOrSuperExp()
Determines if the expression refers to this or super.
 o translate(ClassGen, MethodGen)
 o translateSynthesized(ClassGen, MethodGen)
First translate the expression and then synthesize it.
 o type()
 o typeCheck(SymbolTable)
 o typeExp()
Determines if the expression refers to a type.
 o variableExp()
Determines if the expression is an access to a local or a formal param.

Variables

 o type_d
 public Type type_d
 o trueList_d
 public InstructionList trueList_d
 o falseList_d
 public InstructionList falseList_d
 o leftValue_d
 public boolean leftValue_d
 o statementExp_d
 public boolean statementExp_d

Constructors

 o ExpressionNode
 public ExpressionNode()

Methods

 o typeCheck
 public abstract Type typeCheck(SymbolTable stable) throws TypeCheckError
Overrides:
typeCheck in class SyntaxTreeNode
 o type
 public Type type()
 o evaluateExp
 public BigDecimal evaluateExp()
 o evaluate
 public BigDecimal evaluate(SymbolTable stable) throws NotConstant
 o translate
 public void translate(ClassGen classGen,
                       MethodGen methodGen)
 o 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.

 o 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.

 o desynthesize
 public void desynthesize(ClassGen classGen,
                          MethodGen methodGen)
 o lookupPrimop
 public MethodType lookupPrimop(SymbolTable stable,
                                int op,
                                MethodType ctype)
 o variableExp
 public boolean variableExp()
Determines if the expression is an access to a local or a formal param. Redefined in the VariableExpNode class.

 o leftValue
 public boolean leftValue()
Determines if the expression is an lvalue. TODO -> check if it is final.

 o typeExp
 public boolean typeExp()
Determines if the expression refers to a type.

 o thisExp
 public boolean thisExp()
Determines if the expression is 'this'.

 o superExp
 public boolean superExp()
Determines if the expression is 'super'.

 o thisOrSuperExp
 public boolean thisOrSuperExp()
Determines if the expression refers to this or super.

 o backPatch
 public static void backPatch(InstructionList list,
                              InstructionHandle target)
Backpatch a true or a false list.

 o addTrueList
 public InstructionList addTrueList(InstructionHandle ih)
Add an instruction to the true list for backpatching.

 o addFalseList
 public InstructionList addFalseList(InstructionHandle ih)
Add an instruction to the false list for backpatching.

 o appendToTrueList
 public InstructionList appendToTrueList(InstructionList right)
Append a list to the true list.

 o appendToFalseList
 public InstructionList appendToFalseList(InstructionList right)
Append a list to the false list.


All Packages  Class Hierarchy  This Package  Previous  Next  Index