org.aspectj.compiler.base.ast
Class FieldDec

java.lang.Object
  extended byorg.aspectj.compiler.base.CompilerObject
      extended byorg.aspectj.compiler.base.ast.ASTObject
          extended byorg.aspectj.compiler.base.ast.Stmt
              extended byorg.aspectj.compiler.base.ast.Dec
                  extended byorg.aspectj.compiler.base.ast.VarDec
                      extended byorg.aspectj.compiler.base.ast.FieldDec
All Implemented Interfaces:
AspectMember, ClassMember

public class FieldDec
extends VarDec


Field Summary
 
Fields inherited from class org.aspectj.compiler.base.ast.VarDec
decs, id, initializer, modifiers, typeD
 
Fields inherited from class org.aspectj.compiler.base.ast.Dec
forcePublic, owner, semanticObject
 
Fields inherited from class org.aspectj.compiler.base.ast.ASTObject
dummySource, parent, sourceLocation
 
Constructor Summary
  FieldDec(Modifiers _modifiers, TypeD _typeD, Identifier _id, Expr _initializer)
           
protected FieldDec(SourceLocation source)
           
  FieldDec(SourceLocation location, Modifiers _modifiers, TypeD _typeD, java.lang.String _id, Expr _initializer)
           
 
Method Summary
protected  void cgMember(org.aspectj.compiler.base.bcg.ClassfileBuilder cb)
          This method takes care of generating code for Member decs.
 ASTObject copyWalk(CopyWalker walker)
           
 void ensureFolded(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 AssignExpr getAssignExpr()
           
 MethodDec getBackdoorGetterMethod()
           
 MethodDec getBackdoorSetterMethod()
           
 java.lang.String getDefaultDisplayName()
           
 Dec getEnclosingDec()
           
 Field getField()
           
 java.lang.String getKind()
           
 boolean isConstant()
           
 boolean isField()
           
 boolean isFolded()
           
 SemanticObject makeCorrespondingSemanticObject()
           
 ASTObject postFixAST(org.aspectj.compiler.base.ASTFixerPass fixer)
           
 ASTObject postImplementMixin(org.aspectj.compiler.crosscuts.MixinImplementationPass fixer)
           
 java.lang.String toShortString()
           
 void unparse(org.aspectj.compiler.base.CodeWriter writer)
           
 void walkAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
          We need to do this because we can't properly do name binding of a reference to a field until we've done constant folding.
 void walkForwardReference(org.aspectj.compiler.base.ForwardReferenceChecker w)
           
 void walkFrameLoc(org.aspectj.compiler.base.FrameLocPass walker)
           
 void walkInnerInfo(org.aspectj.compiler.base.InnerInfoPass w)
           
 void walkScope(ScopeWalker walker)
           
 
Methods inherited from class org.aspectj.compiler.base.ast.VarDec
cgStmt, checkAssignmentType, checkSpec, getChildAt, getChildCount, getChildNameAt, getDescriptor, getExpr, getFrameLoc, getId, getInitializer, getModifiers, getType, getTypeD, inStaticContext, isBlank, isIntroduced, postAssignmentCheck, preAssignmentCheck, preScope, setChildAt, setId, setInitializer, setModifiers, setTypeD, unparse, walkFlow
 
Methods inherited from class org.aspectj.compiler.base.ast.Dec
addIntroducedFromType, checkOverride, cleanup, conflictsWith, dominates, forcePublic, getBytecodeId, getCorrespondingSemanticObject, getDeclaringType, getLexicalType, getName, getOutermostLexicalType, getSignatureString, getStackDelta, isAbstract, isAccessible, isAccessible, isAlmostApplicable, isApplicable, isDeprecated, isFinal, isInherited, isLanguageVisible, isMoreAccessibleThan, isMoreSpecificThan, isPrivate, isProtected, isPublic, isStatic, isSynthetic, lookupDeclaringType, lookupLexicalType, makeBlockScope, postCopy, preCopy, preMove, requireStmt, samePackage, setAllEnclosingTypes, setBytecodeId, setDeclaringType, setDeprecated, setExplicitlyNonSynthetic, setFromLexicalScope, setLanguageVisible, setLexicalType, writeModifiers, writeNames
 
Methods inherited from class org.aspectj.compiler.base.ast.Stmt
cgTop, completesNormally, isBreakable, isContinuable, isEmpty, mustBeLive, registerLocation, requireBlockStmt, setCompletesNormally
 
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, getEnclosingCodeDec, getEndColumn, getEndLine, getEndPosition, getFormalComment, getOutermostBytecodeType, getParent, getSourceDirectoryName, getSourceFile, getSourceFileName, getSourceLocation, getStartPosition, hasLegalProtectedAccess, hasSource, hasSourceLocation, implementMixin, indexOf, isLeaf, makeChild, makeChild, postCleanup, postInnerAccess, postInnerInfo, postLift, postMove, postScope, postThreading, preIntroduction, preLift, preThreading, remove, remove, removeChildAt, replaceWith, setFormalComment, setParent, setParents, setSource, setSourceLocation, setSyntheticSource, showError, showMessage, showTypeError, showWarning, toString, unparse, walk, walkAnalysis, walkCleanup, walkMemberMunger
 
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
 
Methods inherited from interface org.aspectj.compiler.crosscuts.ast.AspectMember
cgTop, cleanup, setParent, unparse
 
Methods inherited from interface org.aspectj.compiler.base.ast.ClassMember
cgTop, cleanup, setParent, unparse
 

Constructor Detail

FieldDec

public FieldDec(SourceLocation location,
                Modifiers _modifiers,
                TypeD _typeD,
                java.lang.String _id,
                Expr _initializer)

FieldDec

public FieldDec(Modifiers _modifiers,
                TypeD _typeD,
                Identifier _id,
                Expr _initializer)

FieldDec

protected FieldDec(SourceLocation source)
Method Detail

getEnclosingDec

public Dec getEnclosingDec()
Overrides:
getEnclosingDec in class ASTObject

walkAssignmentCheck

public void walkAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
We need to do this because we can't properly do name binding of a reference to a field until we've done constant folding. Actually what we can't do is type checking of assignment statements until we've done folding. This isn't true for method look-up...
 static final int x = 2;
       byte b = x + 1; // this can't be type checked until we know whether or not x
                       // is a constant
 
We can fix this by splitting into: name-binding constant-folding: this unfortunately can't be just a walker assignment type checking

Overrides:
walkAssignmentCheck in class ASTObject

isFolded

public boolean isFolded()

ensureFolded

public void ensureFolded(org.aspectj.compiler.base.AssignmentCheckerPass walker)

isField

public boolean isField()
Overrides:
isField in class VarDec

toShortString

public java.lang.String toShortString()
Overrides:
toShortString in class VarDec

makeCorrespondingSemanticObject

public SemanticObject makeCorrespondingSemanticObject()
Overrides:
makeCorrespondingSemanticObject in class Dec

getField

public Field getField()

getKind

public java.lang.String getKind()
Overrides:
getKind in class VarDec

postFixAST

public ASTObject postFixAST(org.aspectj.compiler.base.ASTFixerPass fixer)
Overrides:
postFixAST in class ASTObject

postImplementMixin

public ASTObject postImplementMixin(org.aspectj.compiler.crosscuts.MixinImplementationPass fixer)
Overrides:
postImplementMixin in class ASTObject

walkScope

public void walkScope(ScopeWalker walker)
Overrides:
walkScope in class ASTObject

getBackdoorGetterMethod

public MethodDec getBackdoorGetterMethod()

getBackdoorSetterMethod

public MethodDec getBackdoorSetterMethod()

unparse

public void unparse(org.aspectj.compiler.base.CodeWriter writer)
Specified by:
unparse in interface AspectMember
Overrides:
unparse in class VarDec

isConstant

public boolean isConstant()

getAssignExpr

public AssignExpr getAssignExpr()

walkForwardReference

public void walkForwardReference(org.aspectj.compiler.base.ForwardReferenceChecker w)
Overrides:
walkForwardReference in class Dec

walkInnerInfo

public void walkInnerInfo(org.aspectj.compiler.base.InnerInfoPass w)
Overrides:
walkInnerInfo in class ASTObject

walkFrameLoc

public void walkFrameLoc(org.aspectj.compiler.base.FrameLocPass walker)
Overrides:
walkFrameLoc in class VarDec

cgMember

protected void cgMember(org.aspectj.compiler.base.bcg.ClassfileBuilder cb)
This method takes care of generating code for Member decs. At this point, we should not have initializers unless they're constants.

Overrides:
cgMember in class Dec

copyWalk

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

getDefaultDisplayName

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