public abstract class JL5ProcedureDeclExt extends JL5AnnotatedElementExt implements ProcedureDeclOps
Modifier and Type | Field and Description |
---|---|
protected java.util.List<ParamTypeNode> |
typeParams |
annotations
Constructor and Description |
---|
JL5ProcedureDeclExt(java.util.List<ParamTypeNode> typeParams,
java.util.List<AnnotationElem> annotations) |
Modifier and Type | Method and Description |
---|---|
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these.
|
protected abstract Node |
buildTypesFinish(JL5TypeSystem ts,
ParsedClassType ct,
Flags flags,
java.util.List<? extends Type> formalTypes,
java.util.List<? extends Type> throwTypes,
java.util.List<TypeVariable> typeParams) |
Node |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST.
|
Context |
enterScope(Context 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.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter pp)
Pretty-print the AST using the given
CodeWriter . |
void |
prettyPrintHeader(Flags flags,
CodeWriter w,
PrettyPrinter tr)
Pretty-print the procedure's header using the given code writer.
|
protected abstract void |
prettyPrintName(CodeWriter w,
PrettyPrinter pp) |
protected Node |
reconstruct(Node n,
java.util.List<ParamTypeNode> typeParams) |
void |
setAnnotations(Annotations annotations)
Set the annotations on the appropriate type object associated with
this AnnotatedElement.
|
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
java.util.List<ParamTypeNode> |
typeParams() |
Node |
typeParams(java.util.List<ParamTypeNode> typeParams) |
protected <N extends Node> |
typeParams(N n,
java.util.List<ParamTypeNode> typeParams) |
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
annotationCheck, annotationElems, annotationElems, annotationElems, declaration
acceptCFG, firstChild, node
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, copy, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, dump, enterChildScope, 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> typeParams
public JL5ProcedureDeclExt(java.util.List<ParamTypeNode> typeParams, java.util.List<AnnotationElem> annotations)
public java.util.List<ParamTypeNode> typeParams()
public Node typeParams(java.util.List<ParamTypeNode> typeParams)
protected <N extends Node> N typeParams(N n, java.util.List<ParamTypeNode> typeParams)
public void setAnnotations(Annotations annotations)
AnnotatedElement
setAnnotations
in interface AnnotatedElement
setAnnotations
in class JL5AnnotatedElementExt
protected Node reconstruct(Node n, java.util.List<ParamTypeNode> typeParams)
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 Context enterScope(Context c)
NodeOps
addDecls
when leaving the node
for that.enterScope
in interface NodeOps
enterScope
in class Ext_c
c
- the current Context
Context
to be used for visiting this node.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
protected abstract Node buildTypesFinish(JL5TypeSystem ts, ParsedClassType ct, Flags flags, java.util.List<? extends Type> formalTypes, java.util.List<? extends Type> throwTypes, java.util.List<TypeVariable> typeParams)
public Node disambiguate(AmbiguityRemover ar) 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.
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 NodeOps
disambiguate
in class Ext_c
ar
- The visitor which disambiguates.SemanticException
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 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(Flags flags, CodeWriter w, PrettyPrinter tr)
ProcedureDeclOps
prettyPrintHeader
in interface ProcedureDeclOps
protected abstract void prettyPrintName(CodeWriter w, PrettyPrinter pp)