polyglot.ext.coffer.ast
Class CofferMethodDecl_c
java.lang.Object
polyglot.ext.jl.ast.Node_c
polyglot.ext.jl.ast.Term_c
polyglot.ext.jl.ast.MethodDecl_c
polyglot.ext.coffer.ast.CofferMethodDecl_c
- All Implemented Interfaces:
- ClassMember, java.lang.Cloneable, CodeDecl, CofferMethodDecl, Copy, JL, MethodDecl, Node, NodeOps, ProcedureDecl, Term
- public class CofferMethodDecl_c
- extends MethodDecl_c
- implements CofferMethodDecl
An implementation of the CofferMethodDecl
interface.
ConstructorDecl
is extended with pre- and post-conditions.
Method Summary |
Node |
buildTypes(TypeBuilder tb)
Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these. |
KeySetNode |
entryKeys()
|
CofferMethodDecl |
entryKeys(KeySetNode entryKeys)
|
protected MethodInstance |
makeMethodInstance(ClassType ct,
TypeSystem ts)
|
void |
prettyPrintHeader(Flags flags,
CodeWriter w,
PrettyPrinter tr)
Write the method to an output file. |
protected CofferMethodDecl_c |
reconstruct(TypeNode returnType,
java.util.List formals,
KeySetNode entryKeys,
KeySetNode returnKeys,
java.util.List throwConstraints,
Block body)
|
KeySetNode |
returnKeys()
|
CofferMethodDecl |
returnKeys(KeySetNode returnKeys)
|
java.util.List |
throwConstraints()
|
CofferMethodDecl |
throwConstraints(java.util.List throwConstraints)
|
java.util.List |
throwTypes()
The method's exception throw types. |
MethodDecl |
throwTypes(java.util.List l)
Set the method's exception throw types. |
Node |
typeCheck(TypeChecker tc)
Type check the AST. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the node. |
Methods inherited from class polyglot.ext.jl.ast.MethodDecl_c |
acceptCFG, addMembersEnter, body, body, buildTypesEnter, codeInstance, disambiguate, disambiguateEnter, dump, enterScope, entry, exceptionCheck, flags, flags, formals, formals, methodInstance, methodInstance, name, name, overrideMethodCheck, prettyPrint, procedureInstance, reconstruct, returnType, returnType, toString, translate |
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.Node |
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge |
Methods inherited from interface polyglot.ast.JL |
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
addDecls, addMembers, addMembersEnter, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheckEnter |
Methods inherited from interface polyglot.util.Copy |
copy |
entryKeys
protected KeySetNode entryKeys
returnKeys
protected KeySetNode returnKeys
throwConstraints
protected java.util.List throwConstraints
CofferMethodDecl_c
public CofferMethodDecl_c(Position pos,
Flags flags,
TypeNode returnType,
java.lang.String name,
java.util.List formals,
KeySetNode entryKeys,
KeySetNode returnKeys,
java.util.List throwConstraints,
Block body)
entryKeys
public KeySetNode entryKeys()
- Specified by:
entryKeys
in interface CofferMethodDecl
entryKeys
public CofferMethodDecl entryKeys(KeySetNode entryKeys)
- Specified by:
entryKeys
in interface CofferMethodDecl
returnKeys
public KeySetNode returnKeys()
- Specified by:
returnKeys
in interface CofferMethodDecl
returnKeys
public CofferMethodDecl returnKeys(KeySetNode returnKeys)
- Specified by:
returnKeys
in interface CofferMethodDecl
throwTypes
public java.util.List throwTypes()
- Description copied from interface:
MethodDecl
- The method's exception throw types.
- Specified by:
throwTypes
in interface MethodDecl
- Overrides:
throwTypes
in class MethodDecl_c
throwTypes
public MethodDecl throwTypes(java.util.List l)
- Description copied from interface:
MethodDecl
- Set the method's exception throw types.
- Specified by:
throwTypes
in interface MethodDecl
- Overrides:
throwTypes
in class MethodDecl_c
throwConstraints
public java.util.List throwConstraints()
- Specified by:
throwConstraints
in interface CofferMethodDecl
throwConstraints
public CofferMethodDecl throwConstraints(java.util.List throwConstraints)
- Specified by:
throwConstraints
in interface CofferMethodDecl
reconstruct
protected CofferMethodDecl_c reconstruct(TypeNode returnType,
java.util.List formals,
KeySetNode entryKeys,
KeySetNode returnKeys,
java.util.List throwConstraints,
Block body)
visitChildren
public Node visitChildren(NodeVisitor v)
- Description copied from interface:
NodeOps
- Visit the children of the node.
- Specified by:
visitChildren
in interface NodeOps
- Overrides:
visitChildren
in class MethodDecl_c
buildTypes
public Node buildTypes(TypeBuilder tb)
throws SemanticException
- Description copied from interface:
NodeOps
- Collects classes, methods, and fields from the AST rooted at this node
and constructs type objects for these. These type objects may be
ambiguous. Inserts classes into the
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.
- Specified by:
buildTypes
in interface NodeOps
- Overrides:
buildTypes
in class MethodDecl_c
- Throws:
SemanticException
typeCheck
public Node typeCheck(TypeChecker tc)
throws SemanticException
- Description copied from interface:
NodeOps
- Type check the AST.
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.
- Specified by:
typeCheck
in interface NodeOps
- Overrides:
typeCheck
in class MethodDecl_c
- Throws:
SemanticException
makeMethodInstance
protected MethodInstance makeMethodInstance(ClassType ct,
TypeSystem ts)
throws SemanticException
- Overrides:
makeMethodInstance
in class MethodDecl_c
- Throws:
SemanticException
prettyPrintHeader
public void prettyPrintHeader(Flags flags,
CodeWriter w,
PrettyPrinter tr)
- Write the method to an output file.
- Overrides:
prettyPrintHeader
in class MethodDecl_c