jltools.ext.jl.ast
Class ConstructorDecl_c

java.lang.Object
  |
  +--jltools.ext.jl.ast.Node_c
        |
        +--jltools.ext.jl.ast.ConstructorDecl_c
All Implemented Interfaces:
ClassMember, java.lang.Cloneable, ConstructorDecl, Copy, Node, ProcedureDecl, java.io.Serializable
Direct Known Subclasses:
JifConstructorDecl_c

public class ConstructorDecl_c
extends Node_c
implements ConstructorDecl

A ConstructorDecl is an immutable representation of a constructor declaration as part of a class body.

See Also:
Serialized Form

Inner classes inherited from class jltools.ext.jl.ast.Node_c
Node_c.StringCodeWriter
 
Field Summary
protected  <>Block body
           
protected  ConstructorInstance ci
           
protected  java.util.List exceptionTypes
           
protected  Flags flags
           
protected  java.util.List formals
           
protected  java.lang.String name
           
 
Fields inherited from class jltools.ext.jl.ast.Node_c
ext, position
 
Constructor Summary
ConstructorDecl_c(Ext ext, Position pos, Flags flags, java.lang.String name, java.util.List formals, java.util.List exceptionTypes, <>Block body)
           
 
Method Summary
 <>Block body()
          Get the body of the constructor.
 ConstructorDecl body(<>Block body)
          Set the body of the constructor.
 Node buildTypesOverride_(TypeBuilder tb)
          Build type objects for the constructor.
 ConstructorInstance constructorInstance()
          Get the constructorInstance of the constructor.
 ConstructorDecl constructorInstance(ConstructorInstance ci)
          Set the constructorInstance of the constructor.
 void dump(CodeWriter w)
          Dump the AST node for debugging purposes.
 void enterScope(Context c)
          Adjust the environment on entering the scope of the method.
 Node exceptionCheck_(ExceptionChecker ec)
          Check exceptions thrown by the constructor.
 java.util.List exceptionTypes()
          Get the exceptionTypes of the constructor.
 ConstructorDecl exceptionTypes(java.util.List exceptionTypes)
          Set the exceptionTypes of the constructor.
 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.
 void leaveScope(Context c)
          Adjust the environment on leaving the scope of the method.
protected  ConstructorInstance makeConstructorInstance(ClassType ct, TypeSystem ts)
           
 java.lang.String name()
          Get the name of the constructor.
 ConstructorDecl name(java.lang.String name)
          Set the name of the constructor.
 ProcedureInstance procedureInstance()
          Get the procedureInstance of the constructor.
protected  ConstructorDecl_c reconstruct(java.util.List formals, java.util.List exceptionTypes, <>Block body)
          Reconstruct the constructor.
 Node reconstructTypes_(NodeFactory nf, TypeSystem ts, Context c)
          Reconstruct the type objects for the constructor.
 java.lang.String toString()
           
 void translate_(CodeWriter w, Translator tr)
          Write the constructor to an output file.
 Node typeCheck_(TypeChecker tc)
          Type check the constructor.
 Node visitChildren(NodeVisitor v)
          Visit the children of the constructor.
 
Methods inherited from class jltools.ext.jl.ast.Node_c
buildTypes_, buildTypes, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride_, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride_, disambiguateTypesOverride, exceptionCheck, exceptionCheckOverride_, exceptionCheckOverride, ext, ext, foldConstants_, foldConstants, foldConstantsOverride_, foldConstantsOverride, position, position, reconstructTypes, translate, translateBlock, translateSubstmt, typeCheck, typeCheckOverride_, typeCheckOverride, visit, visitList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jltools.ast.ConstructorDecl
body
 
Methods inherited from interface jltools.ast.Node
buildTypes_, copy, disambiguate_, disambiguateOverride_, disambiguateTypes_, disambiguateTypesOverride_, exceptionCheckOverride_, ext, ext, foldConstants_, foldConstantsOverride_, position, position, typeCheckOverride_, visit
 

Field Detail

flags

protected Flags flags

name

protected java.lang.String name

formals

protected java.util.List formals

exceptionTypes

protected java.util.List exceptionTypes

body

protected <>Block body

ci

protected ConstructorInstance ci
Constructor Detail

ConstructorDecl_c

public ConstructorDecl_c(Ext ext,
                         Position pos,
                         Flags flags,
                         java.lang.String name,
                         java.util.List formals,
                         java.util.List exceptionTypes,
                         <>Block body)
Method Detail

flags

public Flags flags()
Get the flags of the constructor.
Specified by:
flags in interface ConstructorDecl

flags

public ConstructorDecl flags(Flags flags)
Set the flags of the constructor.
Specified by:
flags in interface ConstructorDecl

name

public java.lang.String name()
Get the name of the constructor.
Specified by:
name in interface ConstructorDecl

name

public ConstructorDecl name(java.lang.String name)
Set the name of the constructor.
Specified by:
name in interface ConstructorDecl

formals

public java.util.List formals()
Get the formals of the constructor.
Specified by:
formals in interface ConstructorDecl

formals

public ConstructorDecl formals(java.util.List formals)
Set the formals of the constructor.
Specified by:
formals in interface ConstructorDecl

exceptionTypes

public java.util.List exceptionTypes()
Get the exceptionTypes of the constructor.
Specified by:
exceptionTypes in interface ConstructorDecl

exceptionTypes

public ConstructorDecl exceptionTypes(java.util.List exceptionTypes)
Set the exceptionTypes of the constructor.
Specified by:
exceptionTypes in interface ConstructorDecl

body

public <>Block body()
Get the body of the constructor.
Specified by:
body in interface ConstructorDecl

body

public ConstructorDecl body(<>Block body)
Set the body of the constructor.

constructorInstance

public ConstructorInstance constructorInstance()
Get the constructorInstance of the constructor.
Specified by:
constructorInstance in interface ConstructorDecl

procedureInstance

public ProcedureInstance procedureInstance()
Get the procedureInstance of the constructor.
Specified by:
procedureInstance in interface ProcedureDecl

constructorInstance

public ConstructorDecl constructorInstance(ConstructorInstance ci)
Set the constructorInstance of the constructor.
Specified by:
constructorInstance in interface ConstructorDecl

reconstruct

protected ConstructorDecl_c reconstruct(java.util.List formals,
                                        java.util.List exceptionTypes,
                                        <>Block body)
Reconstruct the constructor.

visitChildren

public Node visitChildren(NodeVisitor v)
Visit the children of the constructor.
Specified by:
visitChildren in interface Node
Overrides:
visitChildren in class Node_c

buildTypesOverride_

public Node buildTypesOverride_(TypeBuilder tb)
                         throws SemanticException
Build type objects for the constructor.
Specified by:
buildTypesOverride_ in interface Node
Overrides:
buildTypesOverride_ in class Node_c
Following copied from interface: jltools.ast.Node
Parameters:
cb - The visitor which adds new type objects to the TypeSystem.

enterScope

public void enterScope(Context c)
Description copied from interface: Node
Adjust the environment on entering the scope of the method.
Specified by:
enterScope in interface Node
Overrides:
enterScope in class Node_c

leaveScope

public void leaveScope(Context c)
Description copied from interface: Node
Adjust the environment on leaving the scope of the method.
Specified by:
leaveScope in interface Node
Overrides:
leaveScope in class Node_c

typeCheck_

public Node typeCheck_(TypeChecker tc)
                throws SemanticException
Type check the constructor.
Specified by:
typeCheck_ in interface Node
Overrides:
typeCheck_ in class Node_c

exceptionCheck_

public Node exceptionCheck_(ExceptionChecker ec)
                     throws SemanticException
Check exceptions thrown by the constructor.
Specified by:
exceptionCheck_ in interface Node
Overrides:
exceptionCheck_ in class Node_c

toString

public java.lang.String toString()
Overrides:
toString in class Node_c

translate_

public void translate_(CodeWriter w,
                       Translator tr)
Write the constructor to an output file.
Specified by:
translate_ in interface Node
Overrides:
translate_ in class Node_c
Following copied from interface: jltools.ast.Node
Parameters:
w - The code writer to which to write.
tr - The translation pass. This is not a visitor.

dump

public void dump(CodeWriter w)
Description copied from interface: Node
Dump the AST node for debugging purposes.
Specified by:
dump in interface Node
Overrides:
dump in class Node_c

reconstructTypes_

public Node reconstructTypes_(NodeFactory nf,
                              TypeSystem ts,
                              Context c)
                       throws SemanticException
Reconstruct the type objects for the constructor.
Specified by:
reconstructTypes_ in interface Node
Overrides:
reconstructTypes_ in class Node_c

makeConstructorInstance

protected ConstructorInstance makeConstructorInstance(ClassType ct,
                                                      TypeSystem ts)
                                               throws SemanticException