org.aspectj.compiler.base.ast
Class ASTObject

java.lang.Object
  extended byorg.aspectj.compiler.base.CompilerObject
      extended byorg.aspectj.compiler.base.ast.ASTObject
Direct Known Subclasses:
CatchClause, CatchClauses, CompilationUnit, DecPattern, Expr, Formals, FormalsPattern, GenTypeNames, IdentifierStar, Import, Imports, Modifiers, NamePattern, NamePatterns, NameTypeDPattern, NameTypeDsPattern, PerClause, Stmt, Stmts, SwitchClause, SwitchClauses, TypeD, TypeDs

public abstract class ASTObject
extends org.aspectj.compiler.base.CompilerObject


Field Summary
protected static DummySourceLocation dummySource
           
protected  ASTObject parent
           
protected  SourceLocation sourceLocation
           
 
Constructor Summary
ASTObject()
           
ASTObject(SourceLocation loc)
           
 
Method Summary
 void addComment(Comment _comment)
           
 MethodDec buildAccessMethod(org.aspectj.compiler.base.InnerAccessFixer w)
          Builds a method that would perform the actions of this expression.
 void checkNoSharing(ASTObject other)
           
 void checkSpec()
           
 void cleanup()
           
 void clearComment()
           
 void clearParent()
           
 boolean contains(ASTObject node)
           
 boolean containsTypes()
           
 ASTObject copy()
           
 ASTObject copyWalk(CopyWalker walker)
           
 void display(int indent)
           
 ASTObject fixAccessPost(org.aspectj.compiler.crosscuts.AccessFixer fixer)
           
 void fixAST(org.aspectj.compiler.base.ASTFixerPass fixer)
           
 boolean fromSource()
           
 AST getAST()
           
 int getBeginColumn()
           
 int getBeginLine()
           
 Type getBytecodeType()
           
 TypeDec getBytecodeTypeDec()
          not part of the language's semantic model, but part of the compiler's generated code model.
 ASTObject getChildAt(int childIndex)
           
 int getChildCount()
           
 java.lang.String getChildNameAt(int childIndex)
           
 Comment getComment()
           
 CompilationUnit getCompilationUnit()
           
 Type getDeclaringType()
          returns the declaring type of a method.
 java.lang.String getDefaultDisplayName()
           
 CodeDec getEnclosingCodeDec()
           
 Dec getEnclosingDec()
           
 int getEndColumn()
           
 int getEndLine()
           
 int getEndPosition()
           
 java.lang.String getFormalComment()
           
 Type getLexicalType()
          returns the lexically enclosing Type for this object.
 Type getOutermostBytecodeType()
           
 Type getOutermostLexicalType()
           
 ASTObject getParent()
           
 java.lang.String getSourceDirectoryName()
           
 java.io.File getSourceFile()
           
 java.lang.String getSourceFileName()
           
 SourceLocation getSourceLocation()
           
 int getStartPosition()
           
 boolean hasLegalProtectedAccess(Type fromType)
           
 boolean hasSource()
           
 boolean hasSourceLocation()
           
 void implementMixin(org.aspectj.compiler.crosscuts.MixinImplementationPass walker)
           
 int indexOf(ASTObject node)
           
 boolean inStaticContext()
           
 boolean isLanguageVisible()
           
 boolean isLeaf()
           
 boolean isSynthetic()
           
protected  void makeChild(ASTObject object)
           
protected  void makeChild(ASTObject[] array)
           
 ASTObject postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 ASTObject postCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass walker)
           
 ASTObject postCopy(CopyWalker walker, ASTObject oldObject)
           
 ASTObject postFixAST(org.aspectj.compiler.base.ASTFixerPass fixer)
           
 ASTObject postImplementMixin(org.aspectj.compiler.crosscuts.MixinImplementationPass walker)
           
 ASTObject postInnerAccess(org.aspectj.compiler.base.InnerAccessFixer w)
          Converts an expression accessing inaccessable context to one that is legal.
 void postInnerInfo(org.aspectj.compiler.base.InnerInfoPass walker)
           
 ASTObject postLift(org.aspectj.compiler.base.LocalClassPass.LiftWalker walker)
           
 ASTObject postMove(MovingWalker walker)
           
 ASTObject postScope(ScopeWalker walker)
           
 ASTObject postThreading(org.aspectj.compiler.base.LocalClassPass.ThreadingWalker walker)
           
 void preAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 void preCopy(CopyWalker walker, ASTObject oldObject)
           
 void preIntroduction(org.aspectj.compiler.crosscuts.IntroductionPlannerPass pass)
           
 void preLift(org.aspectj.compiler.base.LocalClassPass.LiftWalker walker)
           
 void preMove(MovingWalker walker)
           
 void preScope(ScopeWalker walker)
           
 void preThreading(org.aspectj.compiler.base.LocalClassPass.ThreadingWalker walker)
           
 void remove(ASTObject child)
           
 void remove(int index)
           
 void removeChildAt(int childIndex)
           
 void replaceWith(ASTObject other)
           
 void setChildAt(int childIndex, ASTObject child)
           
 void setFormalComment(java.lang.String comment)
           
 void setParent(ASTObject x)
           
protected  void setParents()
           
 ASTObject setSource(ASTObject sourceObject)
           
 void setSourceLocation(SourceLocation newLocation)
           
 ASTObject setSyntheticSource(ASTObject sourceObject)
          Sets the ASTObject that this one came from, not the source file, but from a synthetic location.
 void showError(java.lang.String message)
           
 void showMessage(java.lang.String message)
           
 void showTypeError(Type foundType, Type requiredType)
           
 void showWarning(java.lang.String message)
           
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 java.lang.String unparse()
           
 void unparse(org.aspectj.compiler.base.CodeWriter writer)
           
 void walk(Walker walker)
           
 void walkAnalysis(org.aspectj.compiler.base.LocalClassPass.AnalysisWalker walker)
           
 void walkAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)
           
 void walkCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass walker)
           
 void walkFlow(org.aspectj.compiler.base.FlowCheckerPass w)
           
 void walkForwardReference(org.aspectj.compiler.base.ForwardReferenceChecker w)
           
 void walkFrameLoc(org.aspectj.compiler.base.FrameLocPass walker)
           
 void walkInnerInfo(org.aspectj.compiler.base.InnerInfoPass walker)
           
 ASTObject walkMemberMunger(org.aspectj.compiler.base.MemberClassMunger w)
           
 void walkScope(ScopeWalker walker)
           
 
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

sourceLocation

protected SourceLocation sourceLocation

parent

protected ASTObject parent

dummySource

protected static DummySourceLocation dummySource
Constructor Detail

ASTObject

public ASTObject(SourceLocation loc)

ASTObject

public ASTObject()
Method Detail

hasSourceLocation

public boolean hasSourceLocation()

getSourceLocation

public SourceLocation getSourceLocation()

setSourceLocation

public void setSourceLocation(SourceLocation newLocation)

getStartPosition

public int getStartPosition()

getEndPosition

public int getEndPosition()

getBeginLine

public int getBeginLine()

getEndLine

public int getEndLine()

getBeginColumn

public int getBeginColumn()

getEndColumn

public int getEndColumn()

getComment

public Comment getComment()

addComment

public void addComment(Comment _comment)

isSynthetic

public boolean isSynthetic()

isLanguageVisible

public boolean isLanguageVisible()

setFormalComment

public void setFormalComment(java.lang.String comment)

getFormalComment

public java.lang.String getFormalComment()

clearComment

public void clearComment()

getCompilationUnit

public CompilationUnit getCompilationUnit()

getSourceFile

public java.io.File getSourceFile()

getSourceFileName

public final java.lang.String getSourceFileName()

getSourceDirectoryName

public final java.lang.String getSourceDirectoryName()

hasSource

public boolean hasSource()

fromSource

public boolean fromSource()

setParent

public void setParent(ASTObject x)

getParent

public ASTObject getParent()

getChildCount

public int getChildCount()

getChildAt

public ASTObject getChildAt(int childIndex)

getChildNameAt

public java.lang.String getChildNameAt(int childIndex)

setChildAt

public void setChildAt(int childIndex,
                       ASTObject child)

removeChildAt

public void removeChildAt(int childIndex)

remove

public void remove(int index)

remove

public void remove(ASTObject child)

isLeaf

public boolean isLeaf()

indexOf

public int indexOf(ASTObject node)

contains

public boolean contains(ASTObject node)

hasLegalProtectedAccess

public boolean hasLegalProtectedAccess(Type fromType)

containsTypes

public final boolean containsTypes()

walkForwardReference

public void walkForwardReference(org.aspectj.compiler.base.ForwardReferenceChecker w)

walkFlow

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

walkFrameLoc

public void walkFrameLoc(org.aspectj.compiler.base.FrameLocPass walker)

preMove

public void preMove(MovingWalker walker)

postMove

public ASTObject postMove(MovingWalker walker)

fixAccessPost

public ASTObject fixAccessPost(org.aspectj.compiler.crosscuts.AccessFixer fixer)

copyWalk

public ASTObject copyWalk(CopyWalker walker)

postCopy

public ASTObject postCopy(CopyWalker walker,
                          ASTObject oldObject)

preCopy

public void preCopy(CopyWalker walker,
                    ASTObject oldObject)

preIntroduction

public void preIntroduction(org.aspectj.compiler.crosscuts.IntroductionPlannerPass pass)

preScope

public void preScope(ScopeWalker walker)

postScope

public ASTObject postScope(ScopeWalker walker)

walkScope

public void walkScope(ScopeWalker walker)

walk

public void walk(Walker walker)

getOutermostLexicalType

public Type getOutermostLexicalType()

getOutermostBytecodeType

public Type getOutermostBytecodeType()

getLexicalType

public Type getLexicalType()
returns the lexically enclosing Type for this object. For pure Java code this is always identical to getDeclaringType() and getBytecodeTypeDec().getType(). For introduced methods, this can be different, i.e. interface I { } class C implements I { } aspect A { void C.m() { ... } } For the method I.m() implemented in C and for any ASTObjects inside of it, getLexicalType() == A getDeclaringType() == I getBytecodeTypeDec().getType() == C


getDeclaringType

public Type getDeclaringType()
returns the declaring type of a method. For non-static methods, this type will always be the type of 'this' within the method. For static methods, this type will always be the type used to name the method for outside of its scope, i.e. DeclaringType.m() For a comparision with getLexicalType() and getBytecodeTypeDec() see getLexicalType().


getBytecodeTypeDec

public TypeDec getBytecodeTypeDec()
not part of the language's semantic model, but part of the compiler's generated code model. This will return the type declaration that will actually be enclosing this point in the bytecodes produced by the compiler.


getBytecodeType

public Type getBytecodeType()

getEnclosingDec

public Dec getEnclosingDec()

getEnclosingCodeDec

public CodeDec getEnclosingCodeDec()

inStaticContext

public boolean inStaticContext()

showTypeError

public void showTypeError(Type foundType,
                          Type requiredType)

showError

public void showError(java.lang.String message)

showWarning

public void showWarning(java.lang.String message)

showMessage

public void showMessage(java.lang.String message)

toShortString

public java.lang.String toShortString()

copy

public ASTObject copy()

checkNoSharing

public void checkNoSharing(ASTObject other)

setSource

public ASTObject setSource(ASTObject sourceObject)

setSyntheticSource

public ASTObject setSyntheticSource(ASTObject sourceObject)
Sets the ASTObject that this one came from, not the source file, but from a synthetic location.


makeChild

protected void makeChild(ASTObject object)

makeChild

protected void makeChild(ASTObject[] array)

getDefaultDisplayName

public java.lang.String getDefaultDisplayName()

clearParent

public void clearParent()

setParents

protected void setParents()

replaceWith

public void replaceWith(ASTObject other)

toString

public java.lang.String toString()

display

public void display(int indent)

getAST

public AST getAST()

unparse

public java.lang.String unparse()

unparse

public void unparse(org.aspectj.compiler.base.CodeWriter writer)
             throws java.io.IOException
Throws:
java.io.IOException

cleanup

public void cleanup()

fixAST

public void fixAST(org.aspectj.compiler.base.ASTFixerPass fixer)

postFixAST

public ASTObject postFixAST(org.aspectj.compiler.base.ASTFixerPass fixer)

implementMixin

public void implementMixin(org.aspectj.compiler.crosscuts.MixinImplementationPass walker)

postImplementMixin

public ASTObject postImplementMixin(org.aspectj.compiler.crosscuts.MixinImplementationPass walker)

walkInnerInfo

public void walkInnerInfo(org.aspectj.compiler.base.InnerInfoPass walker)

postInnerInfo

public void postInnerInfo(org.aspectj.compiler.base.InnerInfoPass walker)

checkSpec

public void checkSpec()

preAssignmentCheck

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

walkAssignmentCheck

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

postAssignmentCheck

public ASTObject postAssignmentCheck(org.aspectj.compiler.base.AssignmentCheckerPass walker)

walkAnalysis

public void walkAnalysis(org.aspectj.compiler.base.LocalClassPass.AnalysisWalker walker)

preLift

public void preLift(org.aspectj.compiler.base.LocalClassPass.LiftWalker walker)

postLift

public ASTObject postLift(org.aspectj.compiler.base.LocalClassPass.LiftWalker walker)

preThreading

public void preThreading(org.aspectj.compiler.base.LocalClassPass.ThreadingWalker walker)

postThreading

public ASTObject postThreading(org.aspectj.compiler.base.LocalClassPass.ThreadingWalker walker)

walkMemberMunger

public ASTObject walkMemberMunger(org.aspectj.compiler.base.MemberClassMunger w)

postInnerAccess

public ASTObject postInnerAccess(org.aspectj.compiler.base.InnerAccessFixer w)
Converts an expression accessing inaccessable context to one that is legal.


buildAccessMethod

public MethodDec buildAccessMethod(org.aspectj.compiler.base.InnerAccessFixer w)
Builds a method that would perform the actions of this expression. The InnerAccessFixer object keeps a cache of such methods to provide to the InnerAccessFixer walk, but if no appropriate method has yet been built, the original expression is the one that knows how to build it. This should only be overridden in PrefixExpr, PostfixExpr, FieldAccessExpr, AssignExpr, and CallExpr. If and when we do cookie methods for constructor, we may also need to override this in NewInstanceExpr and ConstructorCallExpr.


walkCleanup

public void walkCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass walker)

postCleanup

public ASTObject postCleanup(org.aspectj.compiler.base.ByteCodeCleanupPass walker)