jltools.ext.jl.ast
Class Formal_c

java.lang.Object
  |
  +--jltools.ext.jl.ast.Node_c
        |
        +--jltools.ext.jl.ast.Formal_c
All Implemented Interfaces:
java.lang.Cloneable, Copy, Formal, Node, java.io.Serializable

public class Formal_c
extends Node_c
implements Formal

A Formal represents a formal parameter to a method or constructor or to a catch block. It consists of a type and a variable identifier.

See Also:
Serialized Form

Inner classes inherited from class jltools.ext.jl.ast.Node_c
Node_c.StringCodeWriter
 
Fields inherited from class jltools.ext.jl.ast.Node_c
ext, position
 
Constructor Summary
Formal_c(Ext ext, Position pos, Flags flags, TypeNode type, java.lang.String name)
           
 
Method Summary
 Node buildTypes_(TypeBuilder tb)
          Build type objects for the formal.
 Type declType()
          Get the type of the formal.
 void dump(CodeWriter w)
          Dump the AST node for debugging purposes.
 Flags flags()
          Get the flags of the formal.
 Formal flags(Flags flags)
          Set the flags of the formal.
 void leaveScope(Context c)
          Adjust the environment on leaving the scope of the method.
 LocalInstance localInstance()
          Get the local instance of the formal.
 Formal localInstance(LocalInstance li)
          Set the local instance of the formal.
 java.lang.String name()
          Get the name of the formal.
 Formal name(java.lang.String name)
          Set the name of the formal.
protected  Formal_c reconstruct(TypeNode type)
          Reconstruct the formal.
 Node reconstructTypes_(NodeFactory nf, TypeSystem ts, Context c)
          This method can be called after a node is visited to ensure its type information is reconstructed.
 java.lang.String toString()
           
 void translate_(CodeWriter w, Translator tr)
          Write the formal to an output file.
 TypeNode type()
          Get the type node of the formal.
 Formal type(TypeNode type)
          Set the type node of the formal.
 Node typeCheck_(TypeChecker tc)
          Type check the formal.
 Node visitChildren(NodeVisitor v)
          Visit the children of the formal.
 
Methods inherited from class jltools.ext.jl.ast.Node_c
buildTypes, buildTypesOverride_, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride_, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride_, disambiguateTypesOverride, enterScope, exceptionCheck_, 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.Node
buildTypesOverride_, copy, disambiguate_, disambiguateOverride_, disambiguateTypes_, disambiguateTypesOverride_, enterScope, exceptionCheck_, exceptionCheckOverride_, ext, ext, foldConstants_, foldConstantsOverride_, position, position, typeCheckOverride_, visit
 

Constructor Detail

Formal_c

public Formal_c(Ext ext,
                Position pos,
                Flags flags,
                TypeNode type,
                java.lang.String name)
Method Detail

declType

public Type declType()
Get the type of the formal.
Specified by:
declType in interface Formal

flags

public Flags flags()
Get the flags of the formal.
Specified by:
flags in interface Formal

flags

public Formal flags(Flags flags)
Set the flags of the formal.
Specified by:
flags in interface Formal

type

public TypeNode type()
Get the type node of the formal.
Specified by:
type in interface Formal

type

public Formal type(TypeNode type)
Set the type node of the formal.
Specified by:
type in interface Formal

name

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

name

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

localInstance

public LocalInstance localInstance()
Get the local instance of the formal.
Specified by:
localInstance in interface Formal

localInstance

public Formal localInstance(LocalInstance li)
Set the local instance of the formal.
Specified by:
localInstance in interface Formal

reconstruct

protected Formal_c reconstruct(TypeNode type)
Reconstruct the formal.

visitChildren

public Node visitChildren(NodeVisitor v)
Visit the children of the formal.
Specified by:
visitChildren in interface Node
Overrides:
visitChildren 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

translate_

public void translate_(CodeWriter w,
                       Translator tr)
Write the formal 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.

buildTypes_

public Node buildTypes_(TypeBuilder tb)
                 throws SemanticException
Build type objects for the formal.
Specified by:
buildTypes_ in interface Node
Overrides:
buildTypes_ in class Node_c

typeCheck_

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

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

toString

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

reconstructTypes_

public Node reconstructTypes_(NodeFactory nf,
                              TypeSystem ts,
                              Context c)
                       throws SemanticException
Description copied from interface: Node
This method can be called after a node is visited to ensure its type information is reconstructed.
Specified by:
reconstructTypes_ in interface Node
Overrides:
reconstructTypes_ in class Node_c