public class ConstructorDecl_c extends ProcedureDecl_c implements ConstructorDecl
ConstructorDecl
is an immutable representation of a
constructor declaration as part of a class body.Term.Instance
Modifier and Type | Field and Description |
---|---|
protected ConstructorInstance |
ci |
body, flags, formals, name, throwTypes
exceptions, reachable
Constructor and Description |
---|
ConstructorDecl_c(Position pos,
Flags flags,
Id name,
java.util.List<Formal> formals,
java.util.List<TypeNode> throwTypes,
Block body) |
ConstructorDecl_c(Position pos,
Flags flags,
Id name,
java.util.List<Formal> formals,
java.util.List<TypeNode> throwTypes,
Block body,
Ext ext) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.List<T> |
acceptCFG(CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these.
|
ConstructorInstance |
constructorInstance()
The constructor's type object.
|
ConstructorDecl |
constructorInstance(ConstructorInstance ci)
Set the constructor's type object.
|
protected <N extends ConstructorDecl_c> |
constructorInstance(N n,
ConstructorInstance ci) |
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
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.
|
Node |
extRewrite(ExtensionRewriter rw)
Rewrite the AST for the compilation in this language.
|
Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
boolean |
isDisambiguated() |
MemberInstance |
memberInstance() |
void |
prettyPrintHeader(Flags flags,
CodeWriter w,
PrettyPrinter tr)
Pretty-print the procedure's header using the given code writer.
|
ProcedureInstance |
procedureInstance()
The procedure's type object.
|
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
body, body, body, buildTypesEnter, codeBody, codeInstance, disambiguate, dump, exceptionCheckEnter, flags, flags, flags, formals, formals, formals, id, id, id, name, name, prettyPrint, reconstruct, throwTypes, throwTypes, throwTypes
exceptionCheck, exceptions, exceptions, exceptions, listChild, reachable, reachable, reachable
addDecls, checkConstants, childExpectedType, copy, copy, copyIfNeeded, del, del, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, error, error, error, ext, ext, ext, ext, extRewriteEnter, isTypeChecked, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
id
flags, flags, formals, formals, id, name, name, throwTypes, throwTypes
codeBody, codeInstance
exceptions, exceptions, reachable, reachable
del, del, dump, error, error, ext, ext, ext, ext, isTypeChecked, position, position, visit, visitEdge
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, exceptionCheck, exceptionCheckEnter, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride, visitChild, visitList
protected ConstructorInstance ci
public ConstructorDecl_c(Position pos, Flags flags, Id name, java.util.List<Formal> formals, java.util.List<TypeNode> throwTypes, Block body)
public boolean isDisambiguated()
isDisambiguated
in interface Node
isDisambiguated
in class Node_c
public MemberInstance memberInstance()
memberInstance
in interface ClassMember
public ProcedureInstance procedureInstance()
ProcedureDecl
procedureInstance
in interface ProcedureDecl
procedureInstance
in class ProcedureDecl_c
public ConstructorInstance constructorInstance()
ConstructorDecl
constructorInstance
in interface ConstructorDecl
public ConstructorDecl constructorInstance(ConstructorInstance ci)
ConstructorDecl
constructorInstance
in interface ConstructorDecl
protected <N extends ConstructorDecl_c> N constructorInstance(N n, ConstructorInstance ci)
public Node visitChildren(NodeVisitor v)
NodeOps
visitChildren
in interface NodeOps
visitChildren
in class Node_c
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 Node_c
tb
- The visitor which adds new type objects to the
TypeSystem
.SemanticException
public Context enterScope(Context c)
Node_c
enterScope
in interface NodeOps
enterScope
in class Node_c
c
- the current Context
Context
to be used for visiting this node.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 Node_c
tc
- The type checking visitor.SemanticException
public Node extRewrite(ExtensionRewriter rw) 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.extRewrite
in interface NodeOps
extRewrite
in class Term_c
rw
- The visitor.SemanticException
public void prettyPrintHeader(Flags flags, CodeWriter w, PrettyPrinter tr)
ProcedureDeclOps
prettyPrintHeader
in interface ProcedureDeclOps
public Term firstChild()
TermOps
firstChild
in interface TermOps
firstChild
in class Term_c
public <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOps