polyglot.ext.coffer.ast
Class CofferConstructorDecl_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.ast.Term_c
          extended by polyglot.ext.jl.ast.ConstructorDecl_c
              extended by polyglot.ext.coffer.ast.CofferConstructorDecl_c
All Implemented Interfaces:
java.lang.Cloneable, ClassMember, CodeDecl, ConstructorDecl, JL, Node, NodeOps, ProcedureDecl, Term, CofferConstructorDecl, Copy

public class CofferConstructorDecl_c
extends ConstructorDecl_c
implements CofferConstructorDecl

An implementation of the CofferConstructorDecl interface. ConstructorDecl is extended with pre- and post-conditions.


Nested Class Summary
 class CofferConstructorDecl_c.GetType
           
 
Field Summary
protected  KeySetNode entryKeys
           
protected  KeySetNode returnKeys
           
protected  java.util.List throwConstraints
           
 
Fields inherited from class polyglot.ext.jl.ast.ConstructorDecl_c
body, ci, flags, formals, name, throwTypes
 
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
CofferConstructorDecl_c(Position pos, Flags flags, java.lang.String name, java.util.List formals, KeySetNode entryKeys, KeySetNode returnKeys, java.util.List throwConstraints, Block body)
           
 
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()
           
 CofferConstructorDecl entryKeys(KeySetNode entryKeys)
           
protected  ConstructorInstance makeConstructorInstance(ClassType ct, TypeSystem ts)
           
 void prettyPrintHeader(CodeWriter w, PrettyPrinter tr)
          Write the constructor to an output file.
protected  CofferConstructorDecl_c reconstruct(java.util.List formals, KeySetNode entryKeys, KeySetNode returnKeys, java.util.List throwConstraints, Block body)
           
 KeySetNode returnKeys()
           
 CofferConstructorDecl returnKeys(KeySetNode returnKeys)
           
 java.util.List throwConstraints()
           
 CofferConstructorDecl throwConstraints(java.util.List throwConstraints)
           
 java.util.List throwTypes()
          Get the throwTypes of the constructor.
 ConstructorDecl throwTypes(java.util.List l)
          Set the throwTypes of the constructor.
 Node typeCheck(TypeChecker tc)
          Type check the constructor.
 Node visitChildren(NodeVisitor v)
          Visit the children of the constructor.
 
Methods inherited from class polyglot.ext.jl.ast.ConstructorDecl_c
acceptCFG, addMembersEnter, body, body, buildTypesEnter, codeInstance, constructorInstance, constructorInstance, disambiguate, disambiguateEnter, dump, enterScope, entry, exceptionCheck, flags, flags, formals, formals, name, name, prettyPrint, procedureInstance, reconstruct, toString
 
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, 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.ConstructorDecl
constructorInstance, constructorInstance, flags, flags, formals, formals, name, name
 
Methods inherited from interface polyglot.ast.ProcedureDecl
procedureInstance
 
Methods inherited from interface polyglot.ast.CodeDecl
body, body, codeInstance
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, 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, addMembersEnter, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheckEnter
 
Methods inherited from interface polyglot.util.Copy
copy
 

Field Detail

entryKeys

protected KeySetNode entryKeys

returnKeys

protected KeySetNode returnKeys

throwConstraints

protected java.util.List throwConstraints
Constructor Detail

CofferConstructorDecl_c

public CofferConstructorDecl_c(Position pos,
                               Flags flags,
                               java.lang.String name,
                               java.util.List formals,
                               KeySetNode entryKeys,
                               KeySetNode returnKeys,
                               java.util.List throwConstraints,
                               Block body)
Method Detail

entryKeys

public KeySetNode entryKeys()
Specified by:
entryKeys in interface CofferConstructorDecl

entryKeys

public CofferConstructorDecl entryKeys(KeySetNode entryKeys)
Specified by:
entryKeys in interface CofferConstructorDecl

returnKeys

public KeySetNode returnKeys()
Specified by:
returnKeys in interface CofferConstructorDecl

returnKeys

public CofferConstructorDecl returnKeys(KeySetNode returnKeys)
Specified by:
returnKeys in interface CofferConstructorDecl

throwConstraints

public java.util.List throwConstraints()
Specified by:
throwConstraints in interface CofferConstructorDecl

throwTypes

public java.util.List throwTypes()
Description copied from class: ConstructorDecl_c
Get the throwTypes of the constructor.

Specified by:
throwTypes in interface ConstructorDecl
Specified by:
throwTypes in interface ProcedureDecl
Overrides:
throwTypes in class ConstructorDecl_c
Returns:
A list of TypeNode.

throwTypes

public ConstructorDecl throwTypes(java.util.List l)
Description copied from class: ConstructorDecl_c
Set the throwTypes of the constructor.

Specified by:
throwTypes in interface ConstructorDecl
Overrides:
throwTypes in class ConstructorDecl_c
Parameters:
l - A list of TypeNode.

throwConstraints

public CofferConstructorDecl throwConstraints(java.util.List throwConstraints)
Specified by:
throwConstraints in interface CofferConstructorDecl

reconstruct

protected CofferConstructorDecl_c reconstruct(java.util.List formals,
                                              KeySetNode entryKeys,
                                              KeySetNode returnKeys,
                                              java.util.List throwConstraints,
                                              Block body)

visitChildren

public Node visitChildren(NodeVisitor v)
Description copied from class: ConstructorDecl_c
Visit the children of the constructor.

Specified by:
visitChildren in interface NodeOps
Overrides:
visitChildren in class ConstructorDecl_c
Parameters:
v - The visitor that will traverse/rewrite the AST.
Returns:
A new AST if a change was made, or this.

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 ConstructorDecl_c
Parameters:
tb - The visitor which adds new type objects to the TypeSystem.
Throws:
SemanticException

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Description copied from class: ConstructorDecl_c
Type check the constructor.

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class ConstructorDecl_c
Parameters:
tc - The type checking visitor.
Throws:
SemanticException

makeConstructorInstance

protected ConstructorInstance makeConstructorInstance(ClassType ct,
                                                      TypeSystem ts)
                                               throws SemanticException
Overrides:
makeConstructorInstance in class ConstructorDecl_c
Throws:
SemanticException

prettyPrintHeader

public void prettyPrintHeader(CodeWriter w,
                              PrettyPrinter tr)
Write the constructor to an output file.

Overrides:
prettyPrintHeader in class ConstructorDecl_c