org.aspectj.compiler.base.ast
Class VarExpr

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.AssignableExpr
                      extended byorg.aspectj.compiler.base.ast.VarExpr

public class VarExpr
extends AssignableExpr


Field Summary
protected  VarDec varDec
           
 
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
  VarExpr(Identifier ident)
           
protected VarExpr(SourceLocation source)
           
  VarExpr(SourceLocation location, VarDec _varDec)
           
  VarExpr(java.lang.String ident)
           
  VarExpr(VarDec dec)
           
 
Method Summary
 boolean canBeCopied()
          Can this expression be copied without changing the semantics of the program.
protected  void cgAssignment(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Generate code to actually assign into this assignable.
protected  void cgDupLvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Generates code to duplicate the top lvalue on the stack.
protected  void cgDupRvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Generates code to duplicate the top rvalue on the stack and places it BELOW the lvalue that may be just below it.
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 cgLtoRvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Generate code to remove the lvalue at the top of the stack (if any) and place the appropriate rvalue on the stack.
protected  void cgLvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
          Generate code to place the lvalue of this expression on the top of the stack.
 ASTObject copyWalk(CopyWalker walker)
           
protected  Type discoverType()
           
 java.lang.String getDefaultDisplayName()
           
 java.lang.String getId()
           
 VarDec getVarDec()
           
protected  boolean isIncable()
          Is this an expression that we can generate an IINC code for? That is, a VarExpr to a variable of type int with an index that will fit in one byte?
 Expr makeReference()
          When called for the first time will return an expression that may involve computation and state changes.
 ASTObject postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 ASTObject postMove(MovingWalker walker)
           
 ASTObject postThreading(org.aspectj.compiler.base.LocalClassPass.ThreadingWalker walker)
           
 void setVarDec(VarDec _varDec)
           
 Expr toExpr()
           
 void unparse(org.aspectj.compiler.base.CodeWriter writer)
           
 void walkAnalysis(org.aspectj.compiler.base.LocalClassPass.AnalysisWalker walker)
           
 void walkFlow(org.aspectj.compiler.base.FlowCheckerPass w)
           
 
Methods inherited from class org.aspectj.compiler.base.ast.AssignableExpr
cgValue, isLhs
 
Methods inherited from class org.aspectj.compiler.base.ast.Expr
assertType, cgBuffer, cgTest, cgValue, checkSpec, cleanup, getType, isAssignableTo, isConstantFalse, isConstantTrue, isConstantZero, isInConstructorCallExpr, isInExprStmt, isLegalStmt, isMethodConvertableTo, isUltimatelyLiteral, makeQualifiedThis, 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, getChildAt, getChildCount, getChildNameAt, 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, postScope, preAssignmentCheck, preCopy, preIntroduction, preLift, preMove, preScope, preThreading, remove, remove, removeChildAt, replaceWith, setChildAt, setFormalComment, setParent, setParents, setSource, setSourceLocation, setSyntheticSource, showError, showMessage, showTypeError, showWarning, toShortString, toString, unparse, walk, 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

varDec

protected VarDec varDec
Constructor Detail

VarExpr

public VarExpr(SourceLocation location,
               VarDec _varDec)

VarExpr

public VarExpr(java.lang.String ident)

VarExpr

public VarExpr(VarDec dec)

VarExpr

public VarExpr(Identifier ident)

VarExpr

protected VarExpr(SourceLocation source)
Method Detail

toExpr

public Expr toExpr()

discoverType

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

makeReference

public Expr makeReference()
Description copied from class: Expr
When called for the first time will return an expression that may involve computation and state changes. When called on an Expr returned from this method, it is guaranteed that no further computation will occur. For Exprs that are already references, this is copied identity. For others, this will return a ReferenceExpr.

Overrides:
makeReference in class Expr

canBeCopied

public final boolean canBeCopied()
Description copied from class: Expr
Can this expression be copied without changing the semantics of the program.

Overrides:
canBeCopied in class Expr

getId

public java.lang.String getId()

postMove

public ASTObject postMove(MovingWalker walker)
Overrides:
postMove 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

postAssignmentCheck

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

walkAnalysis

public void walkAnalysis(org.aspectj.compiler.base.LocalClassPass.AnalysisWalker walker)
Overrides:
walkAnalysis in class ASTObject

postThreading

public ASTObject postThreading(org.aspectj.compiler.base.LocalClassPass.ThreadingWalker walker)
Overrides:
postThreading in class ASTObject

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

cgLvalue

protected void cgLvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: AssignableExpr
Generate code to place the lvalue of this expression on the top of the stack. Only assignable expressions have lvalues. Some assignable expressions (such as static field access expressions) do not have lvalues, and for them this method is a noop.

Specified by:
cgLvalue in class AssignableExpr

cgLtoRvalue

protected void cgLtoRvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: AssignableExpr
Generate code to remove the lvalue at the top of the stack (if any) and place the appropriate rvalue on the stack. Assumes that said lvalue was generated by this expression.

Specified by:
cgLtoRvalue in class AssignableExpr

cgAssignment

protected void cgAssignment(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: AssignableExpr
Generate code to actually assign into this assignable. Assumes that the new rvalue is at the top of the stack, and that this expression's lvalue (if any) is just below it.

Specified by:
cgAssignment in class AssignableExpr

cgDupLvalue

protected void cgDupLvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: AssignableExpr
Generates code to duplicate the top lvalue on the stack. Assumes that said lvalue on the stack was generated by this expression.

Specified by:
cgDupLvalue in class AssignableExpr

cgDupRvalue

protected void cgDupRvalue(org.aspectj.compiler.base.bcg.CodeBuilder cb)
Description copied from class: AssignableExpr
Generates code to duplicate the top rvalue on the stack and places it BELOW the lvalue that may be just below it. Assumes that said lvalue and rvalue on the stack were generated by this expression.

Specified by:
cgDupRvalue in class AssignableExpr

isIncable

protected boolean isIncable()
Description copied from class: AssignableExpr
Is this an expression that we can generate an IINC code for? That is, a VarExpr to a variable of type int with an index that will fit in one byte?

Overrides:
isIncable in class AssignableExpr

getVarDec

public VarDec getVarDec()

setVarDec

public void setVarDec(VarDec _varDec)

copyWalk

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

getDefaultDisplayName

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