jltools.ext.jl.ast
Class ClassDecl_c

java.lang.Object
  |
  +--jltools.ext.jl.ast.Node_c
        |
        +--jltools.ext.jl.ast.ClassDecl_c
All Implemented Interfaces:
ClassDecl, ClassMember, java.lang.Cloneable, Copy, Node, java.io.Serializable, TopLevelDecl
Direct Known Subclasses:
JifClassDecl_c

public class ClassDecl_c
extends Node_c
implements ClassDecl

A ClassDecl is the definition of a class, abstract class, or interface. It may be a public or other top-level class, or an inner named class, or an anonymous class.

See Also:
Serialized Form

Inner classes inherited from class jltools.ext.jl.ast.Node_c
Node_c.StringCodeWriter
 
Field Summary
protected  ClassBody body
           
protected  Flags flags
           
protected  java.util.List interfaces
           
protected  java.lang.String name
           
protected  TypeNode superClass
           
protected  ParsedClassType type
           
 
Fields inherited from class jltools.ext.jl.ast.Node_c
ext, position
 
Constructor Summary
ClassDecl_c(Ext ext, Position pos, Flags flags, java.lang.String name, TypeNode superClass, java.util.List interfaces, ClassBody body)
           
 
Method Summary
 ClassBody body()
           
 ClassDecl body(ClassBody body)
           
 Node buildTypesOverride_(TypeBuilder tb)
          Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these.
 Node disambiguateTypesOverride_(TypeAmbiguityRemover sc)
          Constructs a context for each type declared in the AST.
 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.
 Flags flags()
           
 ClassDecl flags(Flags flags)
           
 java.util.List interfaces()
           
 ClassDecl interfaces(java.util.List interfaces)
           
 void leaveScope(Context c)
          Adjust the environment on leaving the scope of the method.
 java.lang.String name()
           
 ClassDecl name(java.lang.String name)
           
protected  ClassDecl_c reconstruct(TypeNode superClass, java.util.List interfaces, ClassBody body)
           
 TypeNode superClass()
           
 ClassDecl superClass(TypeNode superClass)
           
 java.lang.String toString()
           
 void translate_(CodeWriter w, Translator tr)
          Translate the AST using the given code writer.
 ParsedClassType type()
           
 Node visitChildren(NodeVisitor v)
          Visit the children of the node.
 
Methods inherited from class jltools.ext.jl.ast.Node_c
buildTypes_, buildTypes, buildTypesOverride, copy, disambiguate_, disambiguate, disambiguateOverride_, disambiguateOverride, disambiguateTypes_, disambiguateTypes, disambiguateTypesOverride, exceptionCheck_, exceptionCheck, exceptionCheckOverride_, exceptionCheckOverride, ext, ext, foldConstants_, foldConstants, foldConstantsOverride_, foldConstantsOverride, position, position, reconstructTypes_, reconstructTypes, translate, translateBlock, translateSubstmt, typeCheck_, 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
buildTypes_, copy, disambiguate_, disambiguateOverride_, disambiguateTypes_, exceptionCheck_, exceptionCheckOverride_, ext, ext, foldConstants_, foldConstantsOverride_, position, position, reconstructTypes_, typeCheck_, typeCheckOverride_, visit
 

Field Detail

flags

protected Flags flags

name

protected java.lang.String name

superClass

protected TypeNode superClass

interfaces

protected java.util.List interfaces

body

protected ClassBody body

type

protected ParsedClassType type
Constructor Detail

ClassDecl_c

public ClassDecl_c(Ext ext,
                   Position pos,
                   Flags flags,
                   java.lang.String name,
                   TypeNode superClass,
                   java.util.List interfaces,
                   ClassBody body)
Method Detail

type

public ParsedClassType type()
Specified by:
type in interface ClassDecl

flags

public Flags flags()
Specified by:
flags in interface ClassDecl

flags

public ClassDecl flags(Flags flags)
Specified by:
flags in interface ClassDecl

name

public java.lang.String name()
Specified by:
name in interface ClassDecl

name

public ClassDecl name(java.lang.String name)
Specified by:
name in interface ClassDecl

superClass

public TypeNode superClass()
Specified by:
superClass in interface ClassDecl

superClass

public ClassDecl superClass(TypeNode superClass)
Specified by:
superClass in interface ClassDecl

interfaces

public java.util.List interfaces()
Specified by:
interfaces in interface ClassDecl

interfaces

public ClassDecl interfaces(java.util.List interfaces)
Specified by:
interfaces in interface ClassDecl

body

public ClassBody body()
Specified by:
body in interface ClassDecl

body

public ClassDecl body(ClassBody body)
Specified by:
body in interface ClassDecl

reconstruct

protected ClassDecl_c reconstruct(TypeNode superClass,
                                  java.util.List interfaces,
                                  ClassBody body)

visitChildren

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

buildTypesOverride_

public Node buildTypesOverride_(TypeBuilder tb)
                         throws SemanticException
Description copied from interface: Node
Collects classes, methods, and fields from the AST rooted at this node and constructs type objects for these. These type objects may be ambiguous.
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

disambiguateTypesOverride_

public Node disambiguateTypesOverride_(TypeAmbiguityRemover sc)
                                throws SemanticException
Description copied from interface: Node
Constructs a context for each type declared in the AST. A context is used to look up names when cleaning class signatures.
Specified by:
disambiguateTypesOverride_ in interface Node
Overrides:
disambiguateTypesOverride_ in class Node_c
Following copied from interface: jltools.ast.Node
Parameters:
cb - The visitor which builds contexts.

toString

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

translate_

public void translate_(CodeWriter w,
                       Translator tr)
Description copied from interface: Node
Translate the AST using the given code writer.
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