jellyj.syntaxtree
Class ExpressionNode

jellyj.syntaxtree.SyntaxTreeNode
  |
  +--jellyj.syntaxtree.ExpressionNode
Direct Known Subclasses:
AdditiveExpNode, AllocationExpNode, AndExpNode, ArrayExpNode, ArrayInitializerNode, AssignmentNode, CastExpNode, ConditionalAndExpNode, ConditionalExpNode, ConditionalOrExpNode, ConstructorInvocationNode, EqualityExpNode, ExclusiveOrExpNode, FieldExpNode, InclusiveOrExpNode, InstanceOfExpNode, Literal, MethodExpNode, MultiplicativeExpNode, PostDecrementExpNode, PostIncrementExpNode, PreDecrementExpNode, PreIncrementExpNode, RelationalExpNode, ShiftExpNode, SymbolExpNode, UnaryMinusExpNode, UnaryNegExpNode, UnaryNotExpNode, UnaryPlusExpNode, VariableExpNode

public abstract class ExpressionNode
extends SyntaxTreeNode


Field Summary
 InstructionListfalseList_d
           
 booleanleftValue_d
           
 booleanstatementExp_d
           
 InstructionListtrueList_d
           
 Typetype_d
           

Fields inherited from class jellyj.syntaxtree.SyntaxTreeNode
column_d, line_d

Method Summary
 InstructionListaddFalseList(InstructionHandle ih)
          Add an instruction to the false list for backpatching.
 InstructionListaddTrueList(InstructionHandle ih)
          Add an instruction to the true list for backpatching.
 InstructionListappendToFalseList(InstructionList right)
          Append a list to the false list.
 InstructionListappendToTrueList(InstructionList right)
          Append a list to the true list.
 static voidbackPatch(InstructionList list, InstructionHandle target)
          Backpatch a true or a false list.
 voiddesynthesize(ClassGen classGen, MethodGen methodGen)
           
 BigDecimalevaluate(SymbolTable stable)
           
 BigDecimalevaluateExp()
           
 booleanleftValue()
          Determines if the expression is an lvalue.
 MethodTypelookupPrimop(SymbolTable stable, int op, MethodType ctype)
           
 booleansuperExp()
          Determines if the expression is 'super'.
 BranchHandlesynthesize(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.
 booleanthisExp()
          Determines if the expression is 'this'.
 booleanthisOrSuperExp()
          Determines if the expression refers to this or super.
 voidtranslate(ClassGen classGen, MethodGen methodGen)
           
 BranchHandletranslateSynthesized(ClassGen classGen, MethodGen methodGen)
          First translate the expression and then synthesize it.
 Typetype()
           
 abstract TypetypeCheck(SymbolTable stable)
           
 booleantypeExp()
          Determines if the expression refers to a type.
 booleanvariableExp()
          Determines if the expression is an access to a local or a formal param.

Field Detail

falseList_d

public InstructionList falseList_d

leftValue_d

public boolean leftValue_d

statementExp_d

public boolean statementExp_d

trueList_d

public InstructionList trueList_d

type_d

public Type type_d
Method Detail

addFalseList

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

addTrueList

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

appendToFalseList

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

appendToTrueList

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

backPatch

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

desynthesize

public void desynthesize(ClassGen classGen, MethodGen methodGen)

evaluate

public BigDecimal evaluate(SymbolTable stable)
throws jellyj.util.NotConstant

evaluateExp

public BigDecimal evaluateExp()

leftValue

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

lookupPrimop

public MethodType lookupPrimop(SymbolTable stable, int op, MethodType ctype)

superExp

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

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.

thisExp

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

thisOrSuperExp

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

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.

type

public Type type()

typeCheck

public abstract Type typeCheck(SymbolTable stable)
throws jellyj.util.TypeCheckError

typeExp

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

variableExp

public boolean variableExp()
Determines if the expression is an access to a local or a formal param. Redefined in the VariableExpNode class.

Association Links

to Class jellyj.util.Type

to Class jellyj.classfile.classgen.InstructionList

to Class jellyj.classfile.classgen.InstructionList