public class JL5ClassDeclExt extends JL5AnnotatedElementExt implements ClassDeclOps
Modifier and Type | Field and Description |
---|---|
protected java.util.List<ParamTypeNode> |
paramTypes |
annotations
Constructor and Description |
---|
JL5ClassDeclExt() |
JL5ClassDeclExt(java.util.List<ParamTypeNode> paramTypes,
java.util.List<AnnotationElem> annotations) |
Modifier and Type | Method and Description |
---|---|
Node |
addDefaultConstructor(TypeSystem ts,
NodeFactory nf,
ConstructorInstance defaultConstructorInstance) |
Node |
annotationCheck(AnnotationChecker annoCheck) |
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these.
|
protected Declaration |
declaration()
Return the Declaration associated with this AST node.
|
Context |
enterChildScope(Node child,
Context c)
Push a new scope for visiting the child node
child . |
ClassDecl |
node()
The node we ultimately extend.
|
java.util.List<ParamTypeNode> |
paramTypes() |
Node |
paramTypes(java.util.List<ParamTypeNode> types) |
protected <N extends Node> |
paramTypes(N n,
java.util.List<ParamTypeNode> types) |
void |
prettyPrint(CodeWriter w,
PrettyPrinter pp)
Pretty-print the AST using the given
CodeWriter . |
void |
prettyPrintFooter(CodeWriter w,
PrettyPrinter tr) |
void |
prettyPrintHeader(CodeWriter w,
PrettyPrinter tr) |
void |
prettyPrintHeaderRest(CodeWriter w,
PrettyPrinter tr) |
void |
prettyPrintModifiers(CodeWriter w,
PrettyPrinter tr) |
void |
prettyPrintName(CodeWriter w,
PrettyPrinter tr) |
void |
setAnnotations(Annotations annotations)
Set the annotations on the appropriate type object associated with
this AnnotatedElement.
|
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
annotationElems, annotationElems, annotationElems
acceptCFG, firstChild
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterScope, exceptionCheck, exceptionCheckEnter, ext, ext, extRewrite, extRewriteEnter, init, initPred, pred, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, superLang, throwTypes, toString, typeCheckEnter, typeCheckOverride, visitChild, visitList
protected java.util.List<ParamTypeNode> paramTypes
public JL5ClassDeclExt()
public JL5ClassDeclExt(java.util.List<ParamTypeNode> paramTypes, java.util.List<AnnotationElem> annotations)
public ClassDecl node()
Ext
node
in interface Ext
node
in class JL5TermExt
public java.util.List<ParamTypeNode> paramTypes()
public Node paramTypes(java.util.List<ParamTypeNode> types)
protected <N extends Node> N paramTypes(N n, java.util.List<ParamTypeNode> types)
public Node annotationCheck(AnnotationChecker annoCheck) throws SemanticException
annotationCheck
in interface AnnotatedElement
annotationCheck
in class JL5AnnotatedElementExt
SemanticException
public void setAnnotations(Annotations annotations)
AnnotatedElement
setAnnotations
in interface AnnotatedElement
setAnnotations
in class JL5AnnotatedElementExt
protected Declaration declaration()
JL5AnnotatedElementExt
declaration
in class JL5AnnotatedElementExt
public Node visitChildren(NodeVisitor v)
NodeOps
visitChildren
in interface NodeOps
visitChildren
in class JL5AnnotatedElementExt
v
- The visitor that will traverse/rewrite the AST.this
.public Node buildTypes(TypeBuilder tb) throws SemanticException
NodeOps
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.buildTypes
in interface NodeOps
buildTypes
in class Ext_c
tb
- The visitor which adds new type objects to the
TypeSystem
.SemanticException
public Context enterChildScope(Node child, Context c)
NodeOps
child
.
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.enterChildScope
in interface NodeOps
enterChildScope
in class Ext_c
child
- the child node about to be entered.c
- the current Context
Context
to be used for visiting node
child
public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
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.typeCheck
in interface NodeOps
typeCheck
in class JL5AnnotatedElementExt
tc
- The type checking visitor.SemanticException
public void prettyPrintModifiers(CodeWriter w, PrettyPrinter tr)
public void prettyPrintName(CodeWriter w, PrettyPrinter tr)
public void prettyPrintHeaderRest(CodeWriter w, PrettyPrinter tr)
public void prettyPrint(CodeWriter w, PrettyPrinter pp)
NodeOps
CodeWriter
.prettyPrint
in interface NodeOps
prettyPrint
in class JL5AnnotatedElementExt
w
- The code writer to which to write.pp
- The pretty printer. This is not a visitor.public void prettyPrintHeader(CodeWriter w, PrettyPrinter tr)
prettyPrintHeader
in interface ClassDeclOps
public void prettyPrintFooter(CodeWriter w, PrettyPrinter tr)
prettyPrintFooter
in interface ClassDeclOps
public Node addDefaultConstructor(TypeSystem ts, NodeFactory nf, ConstructorInstance defaultConstructorInstance) throws SemanticException
addDefaultConstructor
in interface ClassDeclOps
SemanticException