polyglot.ext.jl.ast
Class ClassBody_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.ast.Term_c
          extended by polyglot.ext.jl.ast.ClassBody_c
All Implemented Interfaces:
java.lang.Cloneable, ClassBody, JL, Node, NodeOps, Term, Copy

public class ClassBody_c
extends Term_c
implements ClassBody

A ClassBody represents the body of a class or interface declaration or the body of an anonymous class.


Field Summary
protected  java.util.List members
           
 
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
ClassBody_c(Position pos, java.util.List members)
           
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
 ClassBody addMember(ClassMember member)
          Add a member to the class, returning a new node.
 Node disambiguate(AmbiguityRemover ar)
          Remove any remaining ambiguities from the AST.
 NodeVisitor disambiguateEnter(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)
           
 Term entry()
          Return the first (sub)term performed when evaluating this term.
 NodeVisitor exceptionCheckEnter(ExceptionChecker ec)
          Check that exceptions are properly propagated throughout the AST.
protected  boolean isSameMethod(TypeSystem ts, MethodInstance mi, MethodInstance mj)
           
 java.util.List members()
          List of the class's members.
 ClassBody members(java.util.List members)
          Set the class's members.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
          Pretty-print the AST using the given CodeWriter.
protected  ClassBody_c reconstruct(java.util.List members)
           
 java.lang.String toString()
           
 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, addMembers, addMembersEnter, addMembersOverride, buildTypes, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguateOverride, dump, enterScope, enterScope, 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, 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, buildTypes, buildTypesEnter, enterScope, enterScope, exceptionCheck, throwTypes, translate, typeCheckEnter
 
Methods inherited from interface polyglot.util.Copy
copy
 

Field Detail

members

protected java.util.List members
Constructor Detail

ClassBody_c

public ClassBody_c(Position pos,
                   java.util.List members)
Method Detail

members

public java.util.List members()
Description copied from interface: ClassBody
List of the class's members.

Specified by:
members in interface ClassBody
Returns:
A list of ClassMember.

members

public ClassBody members(java.util.List members)
Description copied from interface: ClassBody
Set the class's members.

Specified by:
members in interface ClassBody
Parameters:
members - A list of ClassMember.

addMember

public ClassBody addMember(ClassMember member)
Description copied from interface: ClassBody
Add a member to the class, returning a new node.

Specified by:
addMember in interface ClassBody

reconstruct

protected ClassBody_c reconstruct(java.util.List members)

visitChildren

public Node visitChildren(NodeVisitor v)
Description copied from interface: NodeOps
Visit the children of the node.

Specified by:
visitChildren in interface NodeOps
Overrides:
visitChildren in class Node_c
Parameters:
v - The visitor that will traverse/rewrite the AST.
Returns:
A new AST if a change was made, or this.

disambiguateEnter

public NodeVisitor disambiguateEnter(AmbiguityRemover ar)
                              throws SemanticException
Description copied from interface: NodeOps
Remove any remaining ambiguities from the AST. 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.

Specified by:
disambiguateEnter in interface NodeOps
Overrides:
disambiguateEnter in class Node_c
Parameters:
ar - The visitor which disambiguates.
Throws:
SemanticException

disambiguate

public Node disambiguate(AmbiguityRemover ar)
                  throws SemanticException
Description copied from interface: NodeOps
Remove any remaining ambiguities from the AST. 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.

Specified by:
disambiguate in interface NodeOps
Overrides:
disambiguate in class Node_c
Parameters:
ar - The visitor which disambiguates.
Throws:
SemanticException

toString

public java.lang.String toString()
Overrides:
toString in class Node_c

duplicateFieldCheck

protected void duplicateFieldCheck(TypeChecker tc)
                            throws SemanticException
Throws:
SemanticException

duplicateConstructorCheck

protected void duplicateConstructorCheck(TypeChecker tc)
                                  throws SemanticException
Throws:
SemanticException

duplicateMethodCheck

protected void duplicateMethodCheck(TypeChecker tc)
                             throws SemanticException
Throws:
SemanticException

duplicateMemberClassCheck

protected void duplicateMemberClassCheck(TypeChecker tc)
                                  throws SemanticException
Throws:
SemanticException

isSameMethod

protected boolean isSameMethod(TypeSystem ts,
                               MethodInstance mi,
                               MethodInstance mj)

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Description copied from interface: NodeOps
Type check the AST. 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.

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class Node_c
Parameters:
tc - The type checking visitor.
Throws:
SemanticException

exceptionCheckEnter

public NodeVisitor exceptionCheckEnter(ExceptionChecker ec)
                                throws SemanticException
Description copied from interface: NodeOps
Check that exceptions are properly propagated throughout the AST. 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.

Specified by:
exceptionCheckEnter in interface NodeOps
Overrides:
exceptionCheckEnter in class Node_c
Parameters:
ec - The visitor.
Throws:
SemanticException

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Description copied from class: Node_c
Pretty-print the AST using the given CodeWriter.

Specified by:
prettyPrint in interface NodeOps
Overrides:
prettyPrint in class Node_c
Parameters:
w - The code writer to which to write.
tr - The pretty printer. This is not a visitor.

entry

public Term entry()
Return the first (sub)term performed when evaluating this term.

Specified by:
entry in interface Term
Specified by:
entry in class Term_c

acceptCFG

public java.util.List acceptCFG(CFGBuilder v,
                                java.util.List succs)
Visit this term in evaluation order.

Specified by:
acceptCFG in interface Term
Specified by:
acceptCFG in class Term_c