polyglot.ext.coffer.ast
Class CofferClassDecl_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.ClassDecl_c
              extended by polyglot.ext.coffer.ast.CofferClassDecl_c
All Implemented Interfaces:
java.lang.Cloneable, ClassDecl, ClassMember, JL, Node, NodeOps, Term, TopLevelDecl, CofferClassDecl, Copy

public class CofferClassDecl_c
extends ClassDecl_c
implements CofferClassDecl

An implementation of the CofferClassDecl interface. ClassDecl is extended with a possibly-null key name.


Field Summary
protected  KeyNode key
           
 
Fields inherited from class polyglot.ext.jl.ast.ClassDecl_c
body, flags, interfaces, name, superClass, 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
CofferClassDecl_c(Position pos, Flags flags, java.lang.String name, KeyNode key, TypeNode superClass, java.util.List interfaces, ClassBody body)
           
 
Method Summary
 Node buildTypes(TypeBuilder tb)
          Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these.
 Context enterScope(Context context)
          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.
 KeyNode key()
           
 CofferClassDecl key(KeyNode key)
           
 void prettyPrintHeader(CodeWriter w, PrettyPrinter tr)
           
protected  CofferClassDecl_c reconstruct(KeyNode key, TypeNode superClass, java.util.List interfaces, ClassBody body)
           
 void superTranslate(CodeWriter w, Translator tr)
           
 void translate(CodeWriter w, Translator tr)
          Translate the AST using the given CodeWriter.
 Node visitChildren(NodeVisitor v)
          Visit the children of the node.
 
Methods inherited from class polyglot.ext.jl.ast.ClassDecl_c
acceptCFG, addDefaultConstructor, addDefaultConstructorIfNeeded, addMembers, body, body, buildTypesEnter, declaration, defaultConstructorNeeded, disambiguate, disambiguateEnter, disambiguateSuperType, dump, enterScope, entry, flags, flags, interfaces, interfaces, name, name, prettyPrint, prettyPrintFooter, reconstruct, superClass, superClass, toString, type, type, typeCheck
 
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, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, print, printBlock, printSubStmt, throwTypes, 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.ClassDecl
body, body, flags, flags, interfaces, interfaces, name, name, superClass, superClass, type, type
 
Methods inherited from interface polyglot.ast.TopLevelDecl
declaration
 

Field Detail

key

protected KeyNode key
Constructor Detail

CofferClassDecl_c

public CofferClassDecl_c(Position pos,
                         Flags flags,
                         java.lang.String name,
                         KeyNode key,
                         TypeNode superClass,
                         java.util.List interfaces,
                         ClassBody body)
Method Detail

key

public KeyNode key()
Specified by:
key in interface CofferClassDecl

key

public CofferClassDecl key(KeyNode key)
Specified by:
key in interface CofferClassDecl

reconstruct

protected CofferClassDecl_c reconstruct(KeyNode key,
                                        TypeNode superClass,
                                        java.util.List interfaces,
                                        ClassBody body)

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 ClassDecl_c
Parameters:
v - The visitor that will traverse/rewrite the AST.
Returns:
A new AST if a change was made, or this.

enterScope

public Context enterScope(Context context)
Description copied from class: Node_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.

Specified by:
enterScope in interface NodeOps
Overrides:
enterScope in class Node_c
Parameters:
context - the current Context
Returns:
the Context to be used for visiting this node.

buildTypes

public Node buildTypes(TypeBuilder tb)
                throws SemanticException
Description copied from interface: NodeOps
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. These type objects may be ambiguous. Inserts classes into the TypeSystem. 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:
buildTypes in interface NodeOps
Overrides:
buildTypes in class ClassDecl_c
Parameters:
tb - The visitor which adds new type objects to the TypeSystem.
Throws:
SemanticException

prettyPrintHeader

public void prettyPrintHeader(CodeWriter w,
                              PrettyPrinter tr)
Overrides:
prettyPrintHeader in class ClassDecl_c

translate

public void translate(CodeWriter w,
                      Translator tr)
Description copied from class: Node_c
Translate the AST using the given CodeWriter.

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

superTranslate

public void superTranslate(CodeWriter w,
                           Translator tr)