|
||||||||||
| 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.Term_c
polyglot.ext.jl.ast.ClassDecl_c
A ClassDecl is the definition of a class, abstract class,
or interface. It may be a public or other top-level class, or an inner
named class, or an anonymous class.
| Field Summary | |
protected ClassBody |
body
|
protected Flags |
flags
|
protected java.util.List |
interfaces
|
protected java.lang.String |
name
|
protected TypeNode |
superClass
|
protected ParsedClassType |
type
|
| Fields inherited from class polyglot.ext.jl.ast.Term_c |
exceptions, reachable |
| Fields inherited from class polyglot.ext.jl.ast.Node_c |
del, ext, position |
| Constructor Summary | |
ClassDecl_c(Position pos,
Flags flags,
java.lang.String name,
TypeNode superClass,
java.util.List interfaces,
ClassBody body)
|
|
| Method Summary | |
java.util.List |
acceptCFG(CFGBuilder v,
java.util.List succs)
Visit this term in evaluation order. |
protected Node |
addDefaultConstructor(TypeSystem ts,
NodeFactory nf)
|
protected Node |
addDefaultConstructorIfNeeded(TypeSystem ts,
NodeFactory nf)
|
Node |
addMembers(AddMemberVisitor tc)
Adds disambiguated methods and fields to the types. |
ClassBody |
body()
The class's body. |
ClassDecl |
body(ClassBody body)
Set the class's body. |
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
NodeVisitor |
buildTypesEnter(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
Named |
declaration()
The type object being declared. |
protected boolean |
defaultConstructorNeeded()
|
Node |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
NodeVisitor |
disambiguateEnter(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
protected void |
disambiguateSuperType(AmbiguityRemover ar)
|
void |
dump(CodeWriter w)
Dump the AST node for debugging purposes. |
Context |
enterScope(Node child,
Context c)
Push a new scope for visiting the child node child. |
Term |
entry()
Return the first (sub)term performed when evaluating this term. |
Flags |
flags()
The class declaration's flags. |
ClassDecl |
flags(Flags flags)
Set the class declaration's flags. |
java.util.List |
interfaces()
The class's interface list. |
ClassDecl |
interfaces(java.util.List interfaces)
Set the class's interface list. |
java.lang.String |
name()
The class declaration's name. |
ClassDecl |
name(java.lang.String name)
Set the class declaration's name. |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given code writer. |
void |
prettyPrintFooter(CodeWriter w,
PrettyPrinter tr)
|
void |
prettyPrintHeader(CodeWriter w,
PrettyPrinter tr)
|
protected ClassDecl_c |
reconstruct(TypeNode superClass,
java.util.List interfaces,
ClassBody body)
|
TypeNode |
superClass()
The class's super class. |
ClassDecl |
superClass(TypeNode superClass)
Set the class's super class. |
java.lang.String |
toString()
|
ParsedClassType |
type()
The type of the class declaration. |
ClassDecl |
type(ParsedClassType type)
Set the type of the class declaration. |
Node |
typeCheck(TypeChecker tc)
Type check the AST. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the node. |
| Methods inherited from class polyglot.ext.jl.ast.Term_c |
exceptionCheck, exceptions, exceptions, listEntry, reachable, reachable |
| Methods inherited from class polyglot.ext.jl.ast.Node_c |
addDecls, addMembersEnter, addMembersOverride, buildTypesOverride, childExpectedType, copy, del, del, disambiguateOverride, enterScope, 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.Term |
exceptions, exceptions, reachable, reachable |
| Methods inherited from interface polyglot.ast.Node |
childExpectedType, del, del, 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, addMembersEnter, enterScope, exceptionCheck, exceptionCheckEnter, throwTypes, translate, typeCheckEnter |
| Methods inherited from interface polyglot.util.Copy |
copy |
| Field Detail |
protected Flags flags
protected java.lang.String name
protected TypeNode superClass
protected java.util.List interfaces
protected ClassBody body
protected ParsedClassType type
| Constructor Detail |
public ClassDecl_c(Position pos,
Flags flags,
java.lang.String name,
TypeNode superClass,
java.util.List interfaces,
ClassBody body)
| Method Detail |
public Named declaration()
TopLevelDecl
declaration in interface TopLevelDeclpublic ParsedClassType type()
ClassDecl
type in interface ClassDeclpublic ClassDecl type(ParsedClassType type)
ClassDecl
type in interface ClassDeclpublic Flags flags()
ClassDecl
flags in interface ClassDeclpublic ClassDecl flags(Flags flags)
ClassDecl
flags in interface ClassDeclpublic java.lang.String name()
ClassDecl
name in interface ClassDeclpublic ClassDecl name(java.lang.String name)
ClassDecl
name in interface ClassDeclpublic TypeNode superClass()
ClassDecl
superClass in interface ClassDeclpublic ClassDecl superClass(TypeNode superClass)
ClassDecl
superClass in interface ClassDeclpublic java.util.List interfaces()
ClassDecl
interfaces in interface ClassDeclTypeNode.public ClassDecl interfaces(java.util.List interfaces)
ClassDecl
interfaces in interface ClassDeclinterfaces - A list of TypeNode.public ClassBody body()
ClassDecl
body in interface ClassDeclpublic ClassDecl body(ClassBody body)
ClassDecl
body in interface ClassDecl
protected ClassDecl_c reconstruct(TypeNode superClass,
java.util.List interfaces,
ClassBody body)
public Term entry()
entry in interface Termentry in class Term_c
public java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
acceptCFG in interface TermacceptCFG in class Term_cpublic Node visitChildren(NodeVisitor v)
NodeOps
visitChildren in interface NodeOpsvisitChildren in class Node_c
public NodeVisitor buildTypesEnter(TypeBuilder tb)
throws SemanticException
NodeOpsTypeSystem.
This method is called by the enter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
buildTypesEnter in interface NodeOpsbuildTypesEnter in class Node_cSemanticException
public Node buildTypes(TypeBuilder tb)
throws SemanticException
NodeOpsTypeSystem.
This method is called by the leave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
buildTypes in interface NodeOpsbuildTypes in class Node_cSemanticException
public Context enterScope(Node child,
Context c)
NodeOpschild.
The default behavior is to delegate the call to the child node, and let
it add appropriate declarations that should be in scope. However,
this method gives parent nodes have the ability to modify this behavior.
enterScope in interface NodeOpsenterScope in class Node_cchild - the child node about to be entered.c - the current Context
Context to be used for visiting node
child
public NodeVisitor disambiguateEnter(AmbiguityRemover ar)
throws SemanticException
NodeOpsenter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
disambiguateEnter in interface NodeOpsdisambiguateEnter in class Node_cSemanticException
protected void disambiguateSuperType(AmbiguityRemover ar)
throws SemanticException
SemanticException
public Node disambiguate(AmbiguityRemover ar)
throws SemanticException
NodeOpsleave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
disambiguate in interface NodeOpsdisambiguate in class Node_cSemanticException
public Node addMembers(AddMemberVisitor tc)
throws SemanticException
NodeOpsleave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
addMembers in interface NodeOpsaddMembers in class Node_cSemanticException
protected Node addDefaultConstructorIfNeeded(TypeSystem ts,
NodeFactory nf)
protected boolean defaultConstructorNeeded()
protected Node addDefaultConstructor(TypeSystem ts,
NodeFactory nf)
public Node typeCheck(TypeChecker tc)
throws SemanticException
NodeOpsleave() method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this or a new copy of the node which will be
installed as a child of the node's parent.
typeCheck in interface NodeOpstypeCheck in class Node_cSemanticExceptionpublic java.lang.String toString()
toString in class Node_c
public void prettyPrintHeader(CodeWriter w,
PrettyPrinter tr)
public void prettyPrintFooter(CodeWriter w,
PrettyPrinter tr)
public void prettyPrint(CodeWriter w,
PrettyPrinter tr)
NodeOps
prettyPrint in interface NodeOpsprettyPrint in class Node_cpublic void dump(CodeWriter w)
Node
dump in interface Nodedump in class Node_c
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||