polyglot.ext.coffer.ast
Class CofferClassDecl_c
java.lang.Object
polyglot.ext.jl.ast.Node_c
polyglot.ext.jl.ast.Term_c
polyglot.ext.jl.ast.ClassDecl_c
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.
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.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 |
key
protected KeyNode key
CofferClassDecl_c
public CofferClassDecl_c(Position pos,
Flags flags,
java.lang.String name,
KeyNode key,
TypeNode superClass,
java.util.List interfaces,
ClassBody body)
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)