|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.ast.Node_c
polyglot.ast.Term_c
polyglot.ast.ConstructorDecl_c
public class ConstructorDecl_c
A ConstructorDecl is an immutable representation of a
constructor declaration as part of a class body.
| Field Summary | |
|---|---|
protected Block |
body
|
protected ConstructorInstance |
ci
|
protected Flags |
flags
|
protected java.util.List |
formals
|
protected Id |
name
|
protected java.util.List |
throwTypes
|
| Fields inherited from class polyglot.ast.Term_c |
|---|
exceptions, reachable |
| Fields inherited from class polyglot.ast.Node_c |
|---|
del, error, ext, position |
| Fields inherited from interface polyglot.ast.Term |
|---|
ENTRY, EXIT |
| Constructor Summary | |
|---|---|
ConstructorDecl_c(Position pos,
Flags flags,
Id name,
java.util.List formals,
java.util.List throwTypes,
Block body)
|
|
| Method Summary | |
|---|---|
java.util.List |
acceptCFG(CFGBuilder v,
java.util.List succs)
Visit this term in evaluation order. |
Block |
body()
Get the body of the constructor. |
CodeBlock |
body(Block body)
Set the body of the constructor. |
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
NodeVisitor |
buildTypesEnter(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. |
Term |
codeBody()
The body of the method, constructor, initializer, or field initializer. |
CodeInstance |
codeInstance()
The CodeInstance of the method, constructor, or initializer. |
ConstructorInstance |
constructorInstance()
Get the constructorInstance of the constructor. |
ConstructorDecl |
constructorInstance(ConstructorInstance ci)
Set the constructorInstance of the constructor. |
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory. |
Node |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
void |
dump(CodeWriter w)
Dump the AST node for debugging purposes. |
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. |
NodeVisitor |
exceptionCheckEnter(ExceptionChecker ec)
Check that exceptions are properly propagated throughout the AST. |
Term |
firstChild()
Return the first direct subterm performed when evaluating this term. |
Flags |
flags()
Get the flags of the constructor. |
ConstructorDecl |
flags(Flags flags)
Set the flags of the constructor. |
java.util.List |
formals()
Get the formals of the constructor. |
ConstructorDecl |
formals(java.util.List formals)
Set the formals of the constructor. |
Id |
id()
Get the name of the constructor. |
ConstructorDecl |
id(Id name)
Set the name of the constructor. |
boolean |
isDisambiguated()
|
MemberInstance |
memberInstance()
|
java.lang.String |
name()
Get the name of the constructor. |
ConstructorDecl |
name(java.lang.String name)
Set the name of the constructor. |
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given CodeWriter. |
void |
prettyPrintHeader(CodeWriter w,
PrettyPrinter tr)
Write the constructor to an output file. |
ProcedureInstance |
procedureInstance()
Get the procedureInstance of the constructor. |
protected ConstructorDecl_c |
reconstruct(Id name,
java.util.List formals,
java.util.List throwTypes,
Block body)
Reconstruct the constructor. |
java.util.List |
throwTypes()
Get the throwTypes of the constructor. |
ConstructorDecl |
throwTypes(java.util.List throwTypes)
Set the throwTypes of the constructor. |
java.lang.String |
toString()
|
Node |
typeCheck(TypeChecker tc)
Type check the constructor. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the constructor. |
| Methods inherited from class polyglot.ast.Term_c |
|---|
exceptionCheck, exceptions, exceptions, listChild, reachable, reachable |
| Methods inherited from class polyglot.ast.Node_c |
|---|
addDecls, checkConstants, childExpectedType, copy, copy, del, del, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, error, error, ext, ext, ext, ext, init, isTypeChecked, node, position, position, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, 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.Term |
|---|
exceptions, exceptions, reachable, reachable |
| Methods inherited from interface polyglot.ast.Node |
|---|
childExpectedType, del, del, error, error, ext, ext, ext, ext, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
| Methods inherited from interface polyglot.ast.JL |
|---|
init, node |
| Methods inherited from interface polyglot.ast.NodeOps |
|---|
addDecls, checkConstants, copy, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, exceptionCheck, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride |
| Methods inherited from interface polyglot.util.Copy |
|---|
copy |
| Field Detail |
|---|
protected Flags flags
protected Id name
protected java.util.List formals
protected java.util.List throwTypes
protected Block body
protected ConstructorInstance ci
| Constructor Detail |
|---|
public ConstructorDecl_c(Position pos,
Flags flags,
Id name,
java.util.List formals,
java.util.List throwTypes,
Block body)
| Method Detail |
|---|
public boolean isDisambiguated()
isDisambiguated in interface NodeisDisambiguated in class Node_cpublic MemberInstance memberInstance()
memberInstance in interface ClassMemberpublic Flags flags()
flags in interface ConstructorDeclflags in interface ProcedureDeclpublic ConstructorDecl flags(Flags flags)
flags in interface ConstructorDeclpublic Id id()
id in interface ConstructorDeclpublic ConstructorDecl id(Id name)
id in interface ConstructorDeclpublic java.lang.String name()
name in interface ConstructorDeclname in interface ProcedureDeclpublic ConstructorDecl name(java.lang.String name)
name in interface ConstructorDeclpublic java.util.List formals()
formals in interface ConstructorDeclformals in interface ProcedureDeclFormal.public ConstructorDecl formals(java.util.List formals)
formals in interface ConstructorDeclformals - A list of Formal.public java.util.List throwTypes()
throwTypes in interface ConstructorDeclthrowTypes in interface ProcedureDeclTypeNode.public ConstructorDecl throwTypes(java.util.List throwTypes)
throwTypes in interface ConstructorDeclthrowTypes - A list of TypeNode.public Term codeBody()
CodeNode
codeBody in interface CodeNodepublic Block body()
body in interface CodeBlockpublic CodeBlock body(Block body)
body in interface CodeBlockpublic ConstructorInstance constructorInstance()
constructorInstance in interface ConstructorDeclpublic ProcedureInstance procedureInstance()
procedureInstance in interface ProcedureDeclpublic CodeInstance codeInstance()
CodeNode
codeInstance in interface CodeNodepublic ConstructorDecl constructorInstance(ConstructorInstance ci)
constructorInstance in interface ConstructorDecl
protected ConstructorDecl_c reconstruct(Id name,
java.util.List formals,
java.util.List throwTypes,
Block body)
public Node visitChildren(NodeVisitor v)
visitChildren in interface NodeOpsvisitChildren in class Node_cv - The visitor that will traverse/rewrite the AST.
this.
public NodeVisitor buildTypesEnter(TypeBuilder tb)
throws SemanticException
NodeOpsTypeSystem.
This method is called by the enter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
buildTypesEnter in interface NodeOpsbuildTypesEnter in class Node_ctb - The visitor which adds new type objects to the
TypeSystem.
SemanticException
public Node buildTypes(TypeBuilder tb)
throws SemanticException
NodeOpsTypeSystem.
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 NodeOpsbuildTypes in class Node_ctb - The visitor which adds new type objects to the
TypeSystem.
SemanticException
public Node disambiguate(AmbiguityRemover ar)
throws SemanticException
NodeOpsleave() 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 NodeOpsdisambiguate in class Node_car - The visitor which disambiguates.
SemanticExceptionpublic Context enterScope(Context c)
Node_c
enterScope in interface NodeOpsenterScope in class Node_cc - the current Context
Context to be used for visiting this node.
public Node typeCheck(TypeChecker tc)
throws SemanticException
typeCheck in interface NodeOpstypeCheck in class Node_ctc - The type checking visitor.
SemanticException
public NodeVisitor exceptionCheckEnter(ExceptionChecker ec)
throws SemanticException
NodeOpsenter() method of the
visitor. The * method should perform work that should be done
before visiting the children of the node. The method may return
this or a new copy of the node on which
visitChildren() and leave() will be
invoked.
exceptionCheckEnter in interface NodeOpsexceptionCheckEnter in class Node_cec - The visitor.
SemanticExceptionpublic java.lang.String toString()
toString in class Node_c
public void prettyPrintHeader(CodeWriter w,
PrettyPrinter tr)
public void prettyPrint(CodeWriter w,
PrettyPrinter tr)
Node_cCodeWriter.
prettyPrint in interface NodeOpsprettyPrint in class Node_cw - The code writer to which to write.tr - The pretty printer. This is not a visitor.public void dump(CodeWriter w)
Node
dump in interface Nodedump in class Node_cpublic Term firstChild()
Term
firstChild in interface Term
public java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
Term_c
acceptCFG in interface TermacceptCFG in class Term_cpublic Node copy(NodeFactory nf)
NodeOps
copy in interface NodeOpscopy in class Node_c
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||