public class ClassBody_c extends Term_c implements ClassBody
ClassBody represents the body of a class or interface
declaration or the body of an anonymous class.Term.Instance| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<ClassMember> |
members |
exceptions, reachable| Constructor and Description |
|---|
ClassBody_c(Position pos,
java.util.List<ClassMember> members) |
ClassBody_c(Position pos,
java.util.List<ClassMember> members,
Ext ext) |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.List<T> |
acceptCFG(CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
ClassBody |
addMember(ClassMember member)
Add a member to the class, returning a new node.
|
NodeVisitor |
buildTypesEnter(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these.
|
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
Node |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST.
|
protected void |
duplicateConstructorCheck(TypeChecker tc) |
protected void |
duplicateFieldCheck(TypeChecker tc) |
protected void |
duplicateMemberClassCheck(TypeChecker tc) |
protected void |
duplicateMethodCheck(TypeChecker tc) |
NodeVisitor |
exceptionCheckEnter(ExceptionChecker ec)
Check that exceptions are properly propagated throughout the AST.
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
protected boolean |
isSameMethod(TypeSystem ts,
MethodInstance mi,
MethodInstance mj) |
java.util.List<ClassMember> |
members()
List of the class's members.
|
ClassBody |
members(java.util.List<ClassMember> members)
Set the class's members.
|
protected <N extends ClassBody_c> |
members(N n,
java.util.List<ClassMember> members) |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter. |
protected <N extends ClassBody_c> |
reconstruct(N n,
java.util.List<ClassMember> members) |
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
exceptionCheck, exceptions, exceptions, exceptions, extRewrite, listChild, reachable, reachable, reachableaddDecls, buildTypes, checkConstants, childExpectedType, copy, copy, copyIfNeeded, del, del, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitListclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexceptions, exceptions, reachable, reachabledel, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdgeaddDecls, buildTypes, checkConstants, childExpectedType, copy, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitListprotected java.util.List<ClassMember> members
public ClassBody_c(Position pos, java.util.List<ClassMember> members)
public ClassBody_c(Position pos, java.util.List<ClassMember> members, Ext ext)
public java.util.List<ClassMember> members()
ClassBodymembers in interface ClassBodyClassMember.public ClassBody members(java.util.List<ClassMember> members)
ClassBodymembers in interface ClassBodymembers - A list of ClassMember.protected <N extends ClassBody_c> N members(N n, java.util.List<ClassMember> members)
public ClassBody addMember(ClassMember member)
ClassBodyprotected <N extends ClassBody_c> N reconstruct(N n, java.util.List<ClassMember> members)
public Node visitChildren(NodeVisitor v)
NodeOpsvisitChildren in interface NodeOpsvisitChildren in class Node_cv - The visitor that will traverse/rewrite the AST.this.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_ctb - The visitor which adds new type objects to the
TypeSystem.SemanticExceptionpublic 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.
The node should not assume that its children have been disambiguated.
If it depends on a child being disambiguated,
it may just return this without doing any work.disambiguate in interface NodeOpsdisambiguate in class Node_car - The visitor which disambiguates.SemanticExceptionprotected void duplicateFieldCheck(TypeChecker tc) throws SemanticException
SemanticExceptionprotected void duplicateConstructorCheck(TypeChecker tc) throws SemanticException
SemanticExceptionprotected void duplicateMethodCheck(TypeChecker tc) throws SemanticException
SemanticExceptionprotected void duplicateMemberClassCheck(TypeChecker tc) throws SemanticException
SemanticExceptionprotected boolean isSameMethod(TypeSystem ts, MethodInstance mi, MethodInstance mj)
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_ctc - The type checking visitor.SemanticExceptionpublic NodeVisitor exceptionCheckEnter(ExceptionChecker ec) 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.exceptionCheckEnter in interface NodeOpsexceptionCheckEnter in class Node_cec - The visitor.SemanticExceptionpublic void prettyPrint(CodeWriter w, PrettyPrinter tr)
Node_cCodeWriter.prettyPrint in interface NodeOpsprettyPrint in class Node_cw - The code writer to which to write.tr - The pretty printer. This is not a visitor.public Term firstChild()
TermOpsfirstChild in interface TermOpsfirstChild in class Term_cpublic <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps