org.aspectj.compiler.base.ast
Class TriTestExpr

java.lang.Object
  extended byorg.aspectj.compiler.base.CompilerObject
      extended byorg.aspectj.compiler.base.ast.ASTObject
          extended byorg.aspectj.compiler.base.ast.Expr
              extended byorg.aspectj.compiler.base.ast.JavaExpr
                  extended byorg.aspectj.compiler.base.ast.TriTestExpr

public class TriTestExpr
extends JavaExpr


Field Summary
protected  Expr _false
           
protected  Expr _true
           
protected  Expr test
           
 
Fields inherited from class org.aspectj.compiler.base.ast.Expr
type
 
Fields inherited from class org.aspectj.compiler.base.ast.ASTObject
dummySource, parent, sourceLocation
 
Constructor Summary
  TriTestExpr(Expr _test, Expr __true, Expr __false)
           
protected TriTestExpr(SourceLocation source)
           
  TriTestExpr(SourceLocation location, Expr _test, Expr __true, Expr __false)
           
 
Method Summary
protected  void cgEffect(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Evaluates the expression in a context where its value is unnecessary (i.e., from ExprStmt, or in a FieldAccessExpr when the field is static but there is an expression there nonetheless).
protected  void cgTest(org.aspectj.compiler.base.bcg.CodeBuilder cb, org.aspectj.compiler.base.bcg.Label tdest, org.aspectj.compiler.base.bcg.Label fdest)
          Evaluates the expression in a context where its value will only be used to branch (from IfStmt, TriTestExpr, WhileStmt, DoStmt, and ForStmt).
protected  void cgValue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Leaves the value of this expression on the stack.
 void checkSpec()
           
 ASTObject copyWalk(CopyWalker walker)
           
 Type discoverType()
           
 ASTObject getChildAt(int childIndex)
           
 int getChildCount()
           
 java.lang.String getChildNameAt(int childIndex)
           
 java.lang.String getDefaultDisplayName()
           
 Expr getFalse()
           
 Expr getTest()
           
 Expr getTrue()
           
 void normalizeFlow(org.aspectj.compiler.base.FlowCheckerPass w)
           
 ASTObject postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 ASTObject postCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass w)
           
 void preAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 void setChildAt(int childIndex, ASTObject child)
           
 void setFalse(Expr __false)
           
 void setTest(Expr _test)
           
 void setTrue(Expr __true)
           
 Expr toExpr()
           
 void unparse(org.aspectj.compiler.base.CodeWriter writer)
           
 void walkFlow(org.aspectj.compiler.base.FlowCheckerPass w)
           
 
Methods inherited from class org.aspectj.compiler.base.ast.Expr
assertType, canBeCopied, cgBuffer, cgValue, cleanup, getType, isAssignableTo, isConstantFalse, isConstantTrue, isConstantZero, isInConstructorCallExpr, isInExprStmt, isLegalStmt, isMethodConvertableTo, isUltimatelyLiteral, makeQualifiedThis, makeReference, postCopy, setType, showOperatorTypeError, showOperatorTypeError, walkCleanup, walkFrameLoc
 
Methods inherited from class org.aspectj.compiler.base.ast.ASTObject
addComment, buildAccessMethod, checkNoSharing, clearComment, clearParent, contains, containsTypes, copy, display, fixAccessPost, fixAST, fromSource, getAST, getBeginColumn, getBeginLine, getBytecodeType, getBytecodeTypeDec, getComment, getCompilationUnit, getDeclaringType, getEnclosingCodeDec, getEnclosingDec, getEndColumn, getEndLine, getEndPosition, getFormalComment, getLexicalType, getOutermostBytecodeType, getOutermostLexicalType, getParent, getSourceDirectoryName, getSourceFile, getSourceFileName, getSourceLocation, getStartPosition, hasLegalProtectedAccess, hasSource, hasSourceLocation, implementMixin, indexOf, inStaticContext, isLanguageVisible, isLeaf, isSynthetic, makeChild, makeChild, postFixAST, postImplementMixin, postInnerAccess, postInnerInfo, postLift, postMove, postScope, postThreading, preCopy, preIntroduction, preLift, preMove, preScope, preThreading, remove, remove, removeChildAt, replaceWith, setFormalComment, setParent, setParents, setSource, setSourceLocation, setSyntheticSource, showError, showMessage, showTypeError, showWarning, toShortString, toString, unparse, walk, walkAnalysis, walkAssignmentCheck, walkForwardReference, walkInnerInfo, walkMemberMunger, walkScope
 
Methods inherited from class org.aspectj.compiler.base.CompilerObject
getCompiler, getOptions, getTypeManager, getWorld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

test

protected Expr test

_true

protected Expr _true

_false

protected Expr _false
Constructor Detail

TriTestExpr

public TriTestExpr(SourceLocation location,
                   Expr _test,
                   Expr __true,
                   Expr __false)

TriTestExpr

public TriTestExpr(Expr _test,
                   Expr __true,
                   Expr __false)

TriTestExpr

protected TriTestExpr(SourceLocation source)
Method Detail

toExpr

public Expr toExpr()

discoverType

public Type discoverType()
Specified by:
discoverType in class Expr

checkSpec

public void checkSpec()
Overrides:
checkSpec in class Expr

preAssignmentCheck

public void preAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
Overrides:
preAssignmentCheck in class ASTObject

postAssignmentCheck

public ASTObject postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
Overrides:
postAssignmentCheck in class ASTObject

unparse

public void unparse(org.aspectj.compiler.base.CodeWriter writer)
Overrides:
unparse in class ASTObject

walkFlow

public void walkFlow(org.aspectj.compiler.base.FlowCheckerPass w)
Overrides:
walkFlow in class ASTObject

normalizeFlow

public void normalizeFlow(org.aspectj.compiler.base.FlowCheckerPass w)

postCleanup

public ASTObject postCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass w)
Overrides:
postCleanup in class ASTObject

cgValue

protected void cgValue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: Expr
Leaves the value of this expression on the stack. May self-call Expr.cgTest(CodeBuilder, Label, Label).

Overrides:
cgValue in class Expr

cgEffect

protected void cgEffect(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: Expr
Evaluates the expression in a context where its value is unnecessary (i.e., from ExprStmt, or in a FieldAccessExpr when the field is static but there is an expression there nonetheless). May self-call Expr.cgValue(CodeBuilder).

Overrides:
cgEffect in class Expr

cgTest

protected void cgTest(org.aspectj.compiler.base.bcg.CodeBuilder cb,
                      org.aspectj.compiler.base.bcg.Label tdest,
                      org.aspectj.compiler.base.bcg.Label fdest)
Description copied from class: Expr
Evaluates the expression in a context where its value will only be used to branch (from IfStmt, TriTestExpr, WhileStmt, DoStmt, and ForStmt). The expression, of course, will have boolean type. By default, this evaluates the expression to the stack and then emits an EQ/NE branch bytecode, but many expressions such as tests in BinopExpr will be able to do much better. May self-call Expr.cgValue(CodeBuilder).

Overrides:
cgTest in class Expr

getTest

public Expr getTest()

setTest

public void setTest(Expr _test)

getTrue

public Expr getTrue()

setTrue

public void setTrue(Expr __true)

getFalse

public Expr getFalse()

setFalse

public void setFalse(Expr __false)

copyWalk

public ASTObject copyWalk(CopyWalker walker)
Overrides:
copyWalk in class ASTObject

getChildAt

public ASTObject getChildAt(int childIndex)
Overrides:
getChildAt in class ASTObject

getChildNameAt

public java.lang.String getChildNameAt(int childIndex)
Overrides:
getChildNameAt in class ASTObject

setChildAt

public void setChildAt(int childIndex,
                       ASTObject child)
Overrides:
setChildAt in class ASTObject

getChildCount

public int getChildCount()
Overrides:
getChildCount in class ASTObject

getDefaultDisplayName

public java.lang.String getDefaultDisplayName()
Overrides:
getDefaultDisplayName in class Expr