|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.ext.jl.ast.Node_c
polyglot.ext.jl.ast.SourceFile_c
public class SourceFile_c
A SourceFile is an immutable representations of a Java
langauge source file. It consists of a package name, a list of
Imports, and a list of GlobalDecls.
| Field Summary | |
|---|---|
protected java.util.List |
decls
|
protected java.util.List |
imports
|
protected ImportTable |
importTable
|
protected PackageNode |
package_
|
protected Source |
source
|
| Fields inherited from class polyglot.ext.jl.ast.Node_c |
|---|
del, ext, position |
| Constructor Summary | |
|---|---|
SourceFile_c(Position pos,
PackageNode package_,
java.util.List imports,
java.util.List decls)
|
|
| Method Summary | |
|---|---|
Node |
buildTypes(TypeBuilder tb)
Build type objects for the source file. |
NodeVisitor |
buildTypesEnter(TypeBuilder tb)
Build type objects for the source file. |
java.util.List |
decls()
Get the declarations of the source file. |
SourceFile |
decls(java.util.List decls)
Set the declarations of the source file. |
Context |
enterScope(Context c)
Push a new scope upon entering this node, and add any declarations to the context that should be in scope when visiting children of this node. |
java.util.List |
imports()
Get the imports of the source file. |
SourceFile |
imports(java.util.List imports)
Set the imports of the source file. |
ImportTable |
importTable()
Get the declarations of the source file. |
SourceFile |
importTable(ImportTable importTable)
Set the declarations of the source file. |
PackageNode |
package_()
Get the package of the source file. |
SourceFile |
package_(PackageNode package_)
Set the package of the source file. |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Write the source file to an output file. |
protected SourceFile_c |
reconstruct(PackageNode package_,
java.util.List imports,
java.util.List decls)
Reconstruct the source file. |
Source |
source()
Get the source of the source file. |
SourceFile |
source(Source source)
Set the source of the source file. |
java.lang.String |
toString()
|
Node |
typeCheck(TypeChecker tc)
Type check the source file. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the source file. |
| Methods inherited from class polyglot.ext.jl.ast.Node_c |
|---|
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypesOverride, childExpectedType, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, enterScope, exceptionCheck, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface polyglot.ast.Node |
|---|
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList |
| Methods inherited from interface polyglot.ast.JL |
|---|
init, node |
| Methods inherited from interface polyglot.ast.NodeOps |
|---|
addDecls, addMembers, addMembersEnter, disambiguate, disambiguateEnter, enterScope, exceptionCheck, exceptionCheckEnter, throwTypes, translate, typeCheckEnter |
| Methods inherited from interface polyglot.util.Copy |
|---|
copy |
| Field Detail |
|---|
protected PackageNode package_
protected java.util.List imports
protected java.util.List decls
protected ImportTable importTable
protected Source source
| Constructor Detail |
|---|
public SourceFile_c(Position pos,
PackageNode package_,
java.util.List imports,
java.util.List decls)
| Method Detail |
|---|
public Source source()
source in interface SourceFilepublic SourceFile source(Source source)
source in interface SourceFilepublic PackageNode package_()
package_ in interface SourceFilepublic SourceFile package_(PackageNode package_)
package_ in interface SourceFilepublic java.util.List imports()
imports in interface SourceFileImport.public SourceFile imports(java.util.List imports)
imports in interface SourceFileimports - A list of Import.public java.util.List decls()
decls in interface SourceFileTopLevelDecl.public SourceFile decls(java.util.List decls)
decls in interface SourceFiledecls - A list of TopLevelDecl.public ImportTable importTable()
importTable in interface SourceFilepublic SourceFile importTable(ImportTable importTable)
importTable in interface SourceFile
protected SourceFile_c reconstruct(PackageNode package_,
java.util.List imports,
java.util.List decls)
public Node visitChildren(NodeVisitor v)
visitChildren in interface NodeOpsvisitChildren in class Node_cv - The visitor that will traverse/rewrite the AST.
this.
public NodeVisitor buildTypesEnter(TypeBuilder tb)
throws SemanticException
buildTypesEnter in interface NodeOpsbuildTypesEnter in class Node_ctb - The visitor which adds new type objects to the
TypeSystem.
SemanticException
public Node buildTypes(TypeBuilder tb)
throws SemanticException
buildTypes in interface NodeOpsbuildTypes in class Node_ctb - The visitor which adds new type objects to the
TypeSystem.
SemanticExceptionpublic Context enterScope(Context c)
Node_c
enterScope in interface NodeOpsenterScope in class Node_cc - the current Context
Context to be used for visiting this node.
public Node typeCheck(TypeChecker tc)
throws SemanticException
typeCheck in interface NodeOpstypeCheck in class Node_ctc - The type checking visitor.
SemanticExceptionpublic java.lang.String toString()
toString in class Node_c
public void prettyPrint(CodeWriter w,
PrettyPrinter tr)
prettyPrint in interface NodeOpsprettyPrint in class Node_cw - The code writer to which to write.tr - The pretty printer. This is not a visitor.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||