|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.ext.jl.ast.Node_c
polyglot.ext.jl.ast.Term_c
polyglot.ext.jl.ast.MethodDecl_c
public class MethodDecl_c
A method declaration.
| Field Summary | |
|---|---|
protected Block |
body
|
protected Flags |
flags
|
protected java.util.List |
formals
|
protected MethodInstance |
mi
|
protected java.lang.String |
name
|
protected TypeNode |
returnType
|
protected java.util.List |
throwTypes
|
protected static java.util.Collection |
TOPICS
|
| Fields inherited from class polyglot.ext.jl.ast.Term_c |
|---|
exceptions, reachable |
| Fields inherited from class polyglot.ext.jl.ast.Node_c |
|---|
del, ext, position |
| Constructor Summary | |
|---|---|
MethodDecl_c(Position pos,
Flags flags,
TypeNode returnType,
java.lang.String 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. |
NodeVisitor |
addMembersEnter(AddMemberVisitor am)
Adds disambiguated methods and fields to the types. |
Block |
body()
Get the body of the method. |
CodeDecl |
body(Block body)
Set the body of the method. |
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. |
CodeInstance |
codeInstance()
The CodeInstance of the method, constructor, or initializer. |
Node |
disambiguate(AmbiguityRemover ar)
Remove any remaining ambiguities from the AST. |
NodeVisitor |
disambiguateEnter(AmbiguityRemover ar)
Build type objects for the method. |
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. |
Term |
entry()
Return the first (sub)term performed when evaluating this term. |
Node |
exceptionCheck(ExceptionChecker ec)
Check exceptions thrown by the method. |
Flags |
flags()
Get the flags of the method. |
MethodDecl |
flags(Flags flags)
Set the flags of the method. |
java.util.List |
formals()
Get the formals of the method. |
MethodDecl |
formals(java.util.List formals)
Set the formals of the method. |
protected MethodInstance |
makeMethodInstance(ClassType ct,
TypeSystem ts)
|
MethodInstance |
methodInstance()
Get the method instance of the method. |
MethodDecl |
methodInstance(MethodInstance mi)
Set the method instance of the method. |
java.lang.String |
name()
Get the name of the method. |
MethodDecl |
name(java.lang.String name)
Set the name of the method. |
protected void |
overrideMethodCheck(TypeChecker tc)
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given CodeWriter. |
void |
prettyPrintHeader(Flags flags,
CodeWriter w,
PrettyPrinter tr)
Write the method to an output file. |
ProcedureInstance |
procedureInstance()
Get the procedure instance of the method. |
protected MethodDecl_c |
reconstruct(TypeNode returnType,
java.util.List formals,
java.util.List throwTypes,
Block body)
Reconstruct the method. |
TypeNode |
returnType()
Get the return type of the method. |
MethodDecl |
returnType(TypeNode returnType)
Set the return type of the method. |
java.util.List |
throwTypes()
Get the exception types of the method. |
MethodDecl |
throwTypes(java.util.List throwTypes)
Set the exception types of the method. |
java.lang.String |
toString()
|
void |
translate(CodeWriter w,
Translator tr)
Translate the AST using the given CodeWriter. |
Node |
typeCheck(TypeChecker tc)
Type check the method. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the method. |
| Methods inherited from class polyglot.ext.jl.ast.Term_c |
|---|
exceptions, exceptions, listEntry, reachable, reachable |
| Methods inherited from class polyglot.ext.jl.ast.Node_c |
|---|
addDecls, addMembers, addMembersOverride, buildTypesOverride, childExpectedType, copy, del, del, disambiguateOverride, enterScope, 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.Term |
|---|
exceptions, exceptions, reachable, reachable |
| Methods inherited from interface polyglot.ast.Node |
|---|
childExpectedType, del, del, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList |
| Methods inherited from interface polyglot.ast.JL |
|---|
init, node |
| Methods inherited from interface polyglot.ast.NodeOps |
|---|
addDecls, addMembers, enterScope, exceptionCheckEnter, throwTypes, typeCheckEnter |
| Methods inherited from interface polyglot.util.Copy |
|---|
copy |
| Field Detail |
|---|
protected Flags flags
protected TypeNode returnType
protected java.lang.String name
protected java.util.List formals
protected java.util.List throwTypes
protected Block body
protected MethodInstance mi
protected static final java.util.Collection TOPICS
| Constructor Detail |
|---|
public MethodDecl_c(Position pos,
Flags flags,
TypeNode returnType,
java.lang.String name,
java.util.List formals,
java.util.List throwTypes,
Block body)
| Method Detail |
|---|
public Flags flags()
flags in interface MethodDeclflags in interface ProcedureDeclpublic MethodDecl flags(Flags flags)
flags in interface MethodDeclpublic TypeNode returnType()
returnType in interface MethodDeclpublic MethodDecl returnType(TypeNode returnType)
returnType in interface MethodDeclpublic java.lang.String name()
name in interface MethodDeclname in interface ProcedureDeclpublic MethodDecl name(java.lang.String name)
name in interface MethodDeclpublic java.util.List formals()
formals in interface MethodDeclformals in interface ProcedureDeclFormal.public MethodDecl formals(java.util.List formals)
formals in interface MethodDeclformals - A list of Formal.public java.util.List throwTypes()
throwTypes in interface MethodDeclthrowTypes in interface ProcedureDeclTypeNode.public MethodDecl throwTypes(java.util.List throwTypes)
throwTypes in interface MethodDeclthrowTypes - A list of TypeNode.public Block body()
body in interface CodeDeclpublic CodeDecl body(Block body)
body in interface CodeDeclpublic MethodInstance methodInstance()
methodInstance in interface MethodDeclpublic MethodDecl methodInstance(MethodInstance mi)
methodInstance in interface MethodDeclpublic CodeInstance codeInstance()
CodeDecl
codeInstance in interface CodeDeclpublic ProcedureInstance procedureInstance()
procedureInstance in interface ProcedureDecl
protected MethodDecl_c reconstruct(TypeNode returnType,
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 NodeVisitor disambiguateEnter(AmbiguityRemover ar)
throws SemanticException
disambiguateEnter in interface NodeOpsdisambiguateEnter in class Node_car - The visitor which disambiguates.
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.
disambiguate in interface NodeOpsdisambiguate in class Node_car - The visitor which disambiguates.
SemanticExceptionpublic NodeVisitor addMembersEnter(AddMemberVisitor am)
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.
addMembersEnter in interface NodeOpsaddMembersEnter in class Node_cam - The visitor which builds types.public 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
protected void overrideMethodCheck(TypeChecker tc)
throws SemanticException
SemanticException
public Node exceptionCheck(ExceptionChecker ec)
throws SemanticException
exceptionCheck in interface NodeOpsexceptionCheck in class Term_cec - The visitor.
SemanticExceptionpublic java.lang.String toString()
toString in class Node_c
public void prettyPrintHeader(Flags flags,
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 translate(CodeWriter w,
Translator tr)
Node_cCodeWriter.
translate in interface NodeOpstranslate in class Node_cw - The code writer to which to write.tr - The translation pass. This is not a visitor.public void dump(CodeWriter w)
Node
dump in interface Nodedump in class Node_c
protected MethodInstance makeMethodInstance(ClassType ct,
TypeSystem ts)
throws SemanticException
SemanticExceptionpublic Term entry()
entry in interface Termentry in class Term_c
public java.util.List acceptCFG(CFGBuilder v,
java.util.List succs)
acceptCFG in interface TermacceptCFG in class Term_c
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||