AST
node type CompilationUnit

General Info

Production
CompilationUnit : ASTNode ::= <PackageDecl:java.lang.String> ImportDecl* TypeDecl*;
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by AST.ASTNode<ASTNode>
          extended by AST.CompilationUnit
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>
Direct Known Subclasses:
AnnotatedCompilationUnit, PrimitiveCompilationUnit, WildcardsCompilationUnit

Description

Source
Declared in Java1.4Frontend/java.ast at line 4

Member Filters

API level:

Aspect:

Constructors

 
public CompilationUnit(java.lang.String p0,
                       List<ImportDecl> p1,
                       List<TypeDecl> p2)
 
public CompilationUnit(beaver.Symbol p0,
                       List<ImportDecl> p1,
                       List<TypeDecl> p2)
 

Attributes

syn java.lang.String relativeName()
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 27
Aspect
ClassPath
syn java.lang.String pathName()
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 28
Aspect
ClassPath
syn boolean fromSource()
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 29
Aspect
ClassPath
syn SimpleSet localLookupType(java.lang.String name)
Source
Declared in Java1.4Frontend/LookupType.jrag at line 299
Aspect
TypeScopePropagation
syn SimpleSet importedTypes(java.lang.String name)
Source
Declared in Java1.4Frontend/LookupType.jrag at line 306
Aspect
TypeScopePropagation
syn SimpleSet importedTypesOnDemand(java.lang.String name)
Source
Declared in Java1.4Frontend/LookupType.jrag at line 314
Aspect
TypeScopePropagation
syn java.lang.String dumpString()
Overrides:dumpString in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/PrettyPrint.jadd at line 800
Aspect
PrettyPrint
syn java.lang.String packageName()
Source
Declared in Java1.4Frontend/QualifiedNames.jrag at line 92
Aspect
TypeName
syn java.lang.String destinationPath()
Source
Declared in Java1.4Backend/ConstantPoolNames.jrag at line 68
Aspect
ConstantPoolNames
syn SimpleSet importedFields(java.lang.String name)
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 112
Aspect
StaticImports
syn SimpleSet importedFieldsOnDemand(java.lang.String name)
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 120
Aspect
StaticImports
syn java.util.Collection importedMethods(java.lang.String name)
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 141
Aspect
StaticImports
syn java.util.Collection importedMethodsOnDemand(java.lang.String name)
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 148
Aspect
StaticImports
inh TypeDecl lookupType(java.lang.String packageName,
                    java.lang.String typeName)
Source
Declared in Java1.4Frontend/LookupType.jrag at line 99
Aspect
LookupFullyQualifiedTypes
inh SimpleSet lookupType(java.lang.String name)
Source
Declared in Java1.4Frontend/LookupType.jrag at line 259
Aspect
TypeScopePropagation
inh SimpleSet lookupVariable(java.lang.String name)
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 111
Aspect
StaticImports
inh java.util.Collection lookupMethod(java.lang.String name)
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 140
Aspect
StaticImports

Methods

public void flushCache()
Overrides:flushCache in class ASTNode<ASTNode>
public void flushCollectionCache()
Overrides:flushCollectionCache in class ASTNode<ASTNode>
public CompilationUnit clone()
                      throws java.lang.CloneNotSupportedException
Overrides:clone in class ASTNode<ASTNode>
Throws:
java.lang.CloneNotSupportedException
Overrides:copy in class ASTNode<ASTNode>
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Overrides:fullCopy in class ASTNode<ASTNode>
Returns:
dangling copy of the subtree at this node
public void setRelativeName(java.lang.String name)
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 163
Aspect
ClassPath
public void setPathName(java.lang.String name)
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 166
Aspect
ClassPath
public void setFromSource(boolean value)
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 169
Aspect
ClassPath
public java.util.Collection parseErrors()
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 68
Aspect
ErrorCheck
public void addParseError(Problem msg)
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 69
Aspect
ErrorCheck
public void errorCheck(java.util.Collection collection)
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 228
Aspect
ErrorCheck
public void errorCheck(java.util.Collection err,
                       java.util.Collection warn)
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 232
Aspect
ErrorCheck
Source
Declared in Java1.4Frontend/NameCheck.jrag at line 35
Aspect
NameCheck
public void toString(java.lang.StringBuffer s)
Overrides:toString in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/PrettyPrint.jadd at line 32
Aspect
PrettyPrint
public void generateClassfile()
Source
Declared in Java1.4Backend/GenerateClassfile.jrag at line 18
Aspect
GenerateClassfile
public void transformation()
Overrides:transformation in class ASTNode<ASTNode>
Source
Declared in Java1.4Backend/Transformations.jrag at line 18
Aspect
Transformations
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class ASTNode<ASTNode>
protected int numChildren()
Overrides:numChildren in class ASTNode<ASTNode>
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class ASTNode<ASTNode>
public void setPackageDecl(java.lang.String value)
Replaces the lexeme PackageDecl.
Parameters:
value - The new value for the lexeme PackageDecl.
public void setPackageDecl(beaver.Symbol symbol)
JastAdd-internal setter for lexeme PackageDecl using the Beaver parser.
public java.lang.String getPackageDecl()
Retrieves the value for the lexeme PackageDecl.
Returns:
The value for the lexeme PackageDecl.
public void setImportDeclList(List<ImportDecl> list)
Replaces the ImportDecl list.
Parameters:
list - The new list node to be used as the ImportDecl list.
public int getNumImportDecl()
Retrieves the number of children in the ImportDecl list.
Returns:
Number of children in the ImportDecl list.
Retrieves the number of children in the ImportDecl list. Calling this method will not trigger rewrites..
Returns:
Number of children in the ImportDecl list.
public ImportDecl getImportDecl(int i)
Retrieves the element at index i in the ImportDecl list..
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the ImportDecl list.
public void addImportDecl(ImportDecl node)
Append an element to the ImportDecl list.
Parameters:
node - The element to append to the ImportDecl list.
public void setImportDecl(ImportDecl node,
                          int i)
Replaces the ImportDecl list element at index i with the new node node.
Parameters:
node - The new node to replace the old list element.
i - The list index of the node to be replaced.
Retrieves the ImportDecl list.
Returns:
The node representing the ImportDecl list.
Retrieves the ImportDecl list.

This method does not invoke AST transformations.

Returns:
The node representing the ImportDecl list.
Retrieves the ImportDecl list.
Returns:
The node representing the ImportDecl list.
Retrieves the ImportDecl list.

This method does not invoke AST transformations.

Returns:
The node representing the ImportDecl list.
public void setTypeDeclList(List<TypeDecl> list)
Replaces the TypeDecl list.
Parameters:
list - The new list node to be used as the TypeDecl list.
public int getNumTypeDecl()
Retrieves the number of children in the TypeDecl list.
Returns:
Number of children in the TypeDecl list.
Retrieves the number of children in the TypeDecl list. Calling this method will not trigger rewrites..
Returns:
Number of children in the TypeDecl list.
public TypeDecl getTypeDecl(int i)
Retrieves the element at index i in the TypeDecl list..
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the TypeDecl list.
public void addTypeDecl(TypeDecl node)
Append an element to the TypeDecl list.
Parameters:
node - The element to append to the TypeDecl list.
public void addTypeDeclNoTransform(TypeDecl node)
public void setTypeDecl(TypeDecl node,
                        int i)
Replaces the TypeDecl list element at index i with the new node node.
Parameters:
node - The new node to replace the old list element.
i - The list index of the node to be replaced.
Retrieves the TypeDecl list.
Returns:
The node representing the TypeDecl list.
Retrieves the TypeDecl list.

This method does not invoke AST transformations.

Returns:
The node representing the TypeDecl list.
Retrieves the TypeDecl list.
Returns:
The node representing the TypeDecl list.
Retrieves the TypeDecl list.

This method does not invoke AST transformations.

Returns:
The node representing the TypeDecl list.
public void nameCheck()
Overrides:nameCheck in class ASTNode<ASTNode>
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 181
Aspect
StaticImports
Overrides:Define_CompilationUnit_compilationUnit in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/ClassPath.jrag at line 32
public boolean Define_boolean_isIncOrDec(ASTNode caller,
                                         ASTNode child)
Overrides:Define_boolean_isIncOrDec in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 51
public boolean Define_boolean_handlesException(ASTNode caller,
                                               ASTNode child,
                                               TypeDecl exceptionType)
Overrides:Define_boolean_handlesException in class ASTNode<ASTNode>
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 198
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller,
                                             ASTNode child,
                                             java.lang.String name)
Overrides:Define_SimpleSet_lookupType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/LookupType.jrag at line 355
public SimpleSet Define_SimpleSet_allImportedTypes(ASTNode caller,
                                                   ASTNode child,
                                                   java.lang.String name)
Overrides:Define_SimpleSet_allImportedTypes in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/NameCheck.jrag at line 27
public java.lang.String Define_String_packageName(ASTNode caller,
                                                  ASTNode child)
Overrides:Define_String_packageName in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/QualifiedNames.jrag at line 90
Overrides:Define_NameType_nameType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/SyntacticClassification.jrag at line 69
Overrides:Define_TypeDecl_enclosingType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeAnalysis.jrag at line 493
public boolean Define_boolean_isNestedType(ASTNode caller,
                                           ASTNode child)
Overrides:Define_boolean_isNestedType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeAnalysis.jrag at line 519
public boolean Define_boolean_isMemberType(ASTNode caller,
                                           ASTNode child)
Overrides:Define_boolean_isMemberType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeAnalysis.jrag at line 529
public boolean Define_boolean_isLocalClass(ASTNode caller,
                                           ASTNode child)
Overrides:Define_boolean_isLocalClass in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeAnalysis.jrag at line 541
public java.lang.String Define_String_hostPackage(ASTNode caller,
                                                  ASTNode child)
Overrides:Define_String_hostPackage in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeAnalysis.jrag at line 563
Overrides:Define_TypeDecl_hostType in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/TypeAnalysis.jrag at line 583
public java.lang.String Define_String_destinationPath(ASTNode caller,
                                                      ASTNode child)
Overrides:Define_String_destinationPath in class ASTNode<ASTNode>
Source
Declared in Java1.4Backend/ConstantPoolNames.jrag at line 66
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller,
                                                 ASTNode child,
                                                 java.lang.String name)
Overrides:Define_SimpleSet_lookupVariable in class ASTNode<ASTNode>
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 104
public java.util.Collection Define_Collection_lookupMethod(ASTNode caller,
                                                           ASTNode child,
                                                           java.lang.String name)
Overrides:Define_Collection_lookupMethod in class ASTNode<ASTNode>
Source
Declared in Java1.5Frontend/StaticImports.jrag at line 133
Overrides:rewriteTo in class ASTNode<ASTNode>

Fields

protected java.util.ArrayList errors
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 65
Aspect
ErrorCheck
protected java.util.ArrayList warnings
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 66
Aspect
ErrorCheck
protected java.util.Collection parseErrors
Source
Declared in Java1.4Frontend/ErrorCheck.jrag at line 70
Aspect
ErrorCheck
protected java.lang.String tokenjava_lang_String_PackageDecl
public int PackageDeclstart
public int PackageDeclend
protected boolean packageName_computed
protected java.lang.String packageName_value
protected boolean destinationPath_computed
protected java.lang.String destinationPath_value
protected java.util.Map lookupType_String_values

Inherited Members

Attributes inherited from AST.ASTNode

Methods inherited from class AST.ASTNode

Methods inherited from class beaver.Symbol

getColumn
getEnd
getId
getLine
getStart
makePosition

Methods inherited from class java.lang.Object

equals
finalize
getClass
hashCode
notify
notifyAll
wait
wait
wait

Fields inherited from AST.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value