org.aspectj.compiler.base.ast
Class BinopExpr
java.lang.Object
org.aspectj.compiler.base.CompilerObject
org.aspectj.compiler.base.ast.ASTObject
org.aspectj.compiler.base.ast.Expr
org.aspectj.compiler.base.ast.JavaExpr
org.aspectj.compiler.base.ast.BinopExpr
- Direct Known Subclasses:
- AddOpExpr, BitwiseOpExpr, ConditionalOpExpr, EqualityTestOpExpr, NumericOpExpr, NumericTestOpExpr, ShiftOpExpr
- public abstract class BinopExpr
- extends JavaExpr
Fields inherited from class org.aspectj.compiler.base.ast.Expr |
type |
Method Summary |
static BinopExpr |
build(SourceLocation source,
java.lang.String op,
Expr rand1,
Expr rand2)
|
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 abstract void |
cgOp(org.aspectj.compiler.base.bcg.CodeBuilder cb,
Type ty)
Generate code that takes the top two values on the stack and
replaces it with the one value that is appropriate. |
ASTObject |
getChildAt(int childIndex)
|
int |
getChildCount()
|
java.lang.String |
getChildNameAt(int childIndex)
|
java.lang.String |
getDefaultDisplayName()
|
protected abstract Type |
getLiftType()
|
java.lang.String |
getOp()
|
Expr |
getRand1()
|
Expr |
getRand2()
|
protected abstract LiteralExpr |
halfFold(Type type,
LiteralExpr lit1,
LiteralExpr lit2)
returns a new unfinished ASTObject, that still needs to have
ASTObject.setSource(org.aspectj.compiler.base.ast.ASTObject) called on it. |
ASTObject |
postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
|
void |
setChildAt(int childIndex,
ASTObject child)
|
void |
setOp(java.lang.String _op)
|
void |
setRand1(Expr _rand1)
|
void |
setRand2(Expr _rand2)
|
void |
unparse(org.aspectj.compiler.base.CodeWriter writer)
|
Methods inherited from class org.aspectj.compiler.base.ast.Expr |
assertType, canBeCopied, cgBuffer, cgTest, cgValue, cgValue, checkSpec, cleanup, discoverType, 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, copyWalk, 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, postCleanup, postFixAST, postImplementMixin, postInnerAccess, postInnerInfo, postLift, postMove, postScope, postThreading, preAssignmentCheck, 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, walkFlow, 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 |
rand1
protected Expr rand1
op
protected java.lang.String op
rand2
protected Expr rand2
BinopExpr
public BinopExpr(SourceLocation location,
Expr _rand1,
java.lang.String _op,
Expr _rand2)
BinopExpr
protected BinopExpr(SourceLocation source)
postAssignmentCheck
public ASTObject postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
- Overrides:
postAssignmentCheck
in class ASTObject
getLiftType
protected abstract Type getLiftType()
halfFold
protected abstract LiteralExpr halfFold(Type type,
LiteralExpr lit1,
LiteralExpr lit2)
- returns a new unfinished ASTObject, that still needs to have
ASTObject.setSource(org.aspectj.compiler.base.ast.ASTObject)
called on it.
build
public static BinopExpr build(SourceLocation source,
java.lang.String op,
Expr rand1,
Expr rand2)
unparse
public void unparse(org.aspectj.compiler.base.CodeWriter writer)
- Overrides:
unparse
in class ASTObject
cgOp
protected abstract void cgOp(org.aspectj.compiler.base.bcg.CodeBuilder cb,
Type ty)
- Generate code that takes the top two values on the stack and
replaces it with the one value that is appropriate. This is
only used by non-effect operators, and is sometimes called
from
AssignExpr
.
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
getRand1
public Expr getRand1()
setRand1
public void setRand1(Expr _rand1)
getOp
public java.lang.String getOp()
setOp
public void setOp(java.lang.String _op)
getRand2
public Expr getRand2()
setRand2
public void setRand2(Expr _rand2)
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