org.omegahat.Environment.Parser.Parse
Class ClassDefinition

java.lang.Object
  |
  +--antlr.BaseAST
        |
        +--antlr.CommonAST
              |
              +--org.omegahat.Environment.Parser.Parse.BasicExpression
                    |
                    +--org.omegahat.Environment.Parser.Parse.ClassDefinition
All Implemented Interfaces:
antlr.collections.AST, Evaluable, ExpressionInt, OmegaTokenTypes, java.lang.Runnable, java.io.Serializable, Subsettable, TreeNodeInt

public class ClassDefinition
extends BasicExpression

Representation of the parsed input defining an interpreted class with its field and method declarations.

See Also:
Serialized Form

Field Summary
protected  List body
          A collection of elements within this class: constructors, fields and methods.
protected  Method constructors
          Table of the constructor functions for the class created during the evaluation of this expression and used in the Java class created to implement this one.
protected  List fields
          List of the field definitions declared in the input source which are converted into Java fields in the compiled class or the table of fields in the interpreted version.
protected  List interfaces
          List of the interface classes this class implements.
protected  MethodsCollection methods
          Collection of the different Method objects indexed by method name and storing the different interpreted functions with this name.
protected  Name name
          The name of the class, including package information
protected  Name superClass
          The name of the class that this one extends.
 
Fields inherited from class org.omegahat.Environment.Parser.Parse.BasicExpression
children, comments, isActive, parent, POST, PRE
 
Fields inherited from class antlr.BaseAST
down, right
 
Fields inherited from interface org.omegahat.Environment.Parser.AntlrParser.OmegaTokenTypes
ABSTRACT, ARG_LIST, ARRAY_DECLARATOR, ARRAY_INIT, ASSIGN, BAND, BAND_ASSIGN, BLOCK, BNOT, BOR, BOR_ASSIGN, BREAK, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, CHAR_LITERAL, CLASS_DEF, COLON, COMMA, CONTINUE, CTOR_DEF, DEC, DIV, DIV_ASSIGN, DOT, DOTS, EAGER, ELEMENT_OP, EOF, EQUAL, ESC, EXPONENT, EXPONENT_OP, EXPR, EXTENDS_CLAUSE, FINAL, FLOAT_SUFFIX, FUNCTION, GE, GT, HEX_DIGIT, IDENT, IMPLEMENTS_CLAUSE, IMPORT, INC, INDEX_OP, INSTANCE_INIT, INSTANCEOF, INTERFACE_DEF, LABELED_STAT, LAND, LAZY, LBRACK, LCURLY, LE, LITERAL_abstract, LITERAL_boolean, LITERAL_break, LITERAL_byte, LITERAL_case, LITERAL_catch, LITERAL_char, LITERAL_class, LITERAL_const, LITERAL_continue, LITERAL_default, LITERAL_do, LITERAL_double, LITERAL_eager, LITERAL_else, LITERAL_extends, LITERAL_false, LITERAL_final, LITERAL_finally, LITERAL_float, LITERAL_for, LITERAL_function, LITERAL_global, LITERAL_if, LITERAL_implements, LITERAL_import, LITERAL_in, LITERAL_instanceof, LITERAL_int, LITERAL_interface, LITERAL_lazy, LITERAL_long, LITERAL_method, LITERAL_native, LITERAL_new, LITERAL_null, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_return, LITERAL_short, LITERAL_static, LITERAL_super, LITERAL_switch, LITERAL_synchronized, LITERAL_this, LITERAL_threadsafe, LITERAL_throw, LITERAL_throws, LITERAL_transient, LITERAL_true, LITERAL_try, LITERAL_void, LITERAL_while, LNOT, LOR, LPAREN, LT, METHOD, METHOD_CALL, METHOD_DEF, MINUS, MINUS_ASSIGN, MISSING_ARG, ML_COMMENT, MOD, MOD_ASSIGN, MODIFIERS, NOT_EQUAL, NULL_TREE_LOOKAHEAD, NUM_FLOAT, NUM_INT, NUM_LONG, OBJBLOCK, PACKAGE_DEF, PARAMETER_DEF, PARAMETERS, PLUS, PLUS_ASSIGN, POST_DEC, POST_INC, QUESTION, RBRACK, RCURLY, RETURN, RPAREN, SEMI, SEQUENCE_OP, SL, SL_ASSIGN, SL_COMMENT, SLIST, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STATIC_INIT, STRING_LITERAL, SYNCHRONIZED, THROW, TRANSIENT, TYPE, TYPECAST, UNARY_MINUS, UNARY_PLUS, VARIABLE_DEF, VOCAB, WS
 
Constructor Summary
ClassDefinition(Name name, Name superClass, List Interfaces, List body)
           
 
Method Summary
 Method addMethod(java.lang.String nm, FunctionExpression expr, Evaluator evaluator)
           
 List body()
           
 List body(List l)
           
 Method constructors()
           
 Method constructors(Method l)
           
 java.lang.Object eval(Evaluator evaluator)
           
 List fields()
           
 List fields(List l)
           
 List interfaces()
           
 List interfaces(List l)
           
 MethodsCollection methods()
           
 MethodsCollection methods(MethodsCollection t)
           
 Name name()
           
 Name name(Name n)
           
 Name superClass()
           
 Name superClass(Name n)
           
 
Methods inherited from class org.omegahat.Environment.Parser.Parse.BasicExpression
addChild, addComment, apply, apply, apply, children, children, comment, comment, depth, error, eval, evalInit, evaluationFrame, evaluator, getReferencedVariables, getReferencedVariables, getReferencedVariables, isActive, isActive, parent, parent, postComment, postComment, preComment, preComment, render, replaceChild, resolve, run, setParent, setParent, setParent, setParent, showComments, showComments, subset, substitute, substitute, toString
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, initialize, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected Name name
The name of the class, including package information

superClass

protected Name superClass
The name of the class that this one extends.

interfaces

protected List interfaces
List of the interface classes this class implements.

body

protected List body
A collection of elements within this class: constructors, fields and methods.

constructors

protected Method constructors
Table of the constructor functions for the class created during the evaluation of this expression and used in the Java class created to implement this one.

fields

protected List fields
List of the field definitions declared in the input source which are converted into Java fields in the compiled class or the table of fields in the interpreted version.

methods

protected MethodsCollection methods
Collection of the different Method objects indexed by method name and storing the different interpreted functions with this name.
Constructor Detail

ClassDefinition

public ClassDefinition(Name name,
                       Name superClass,
                       List Interfaces,
                       List body)
Method Detail

eval

public java.lang.Object eval(Evaluator evaluator)
                      throws java.lang.Throwable
Overrides:
eval in class BasicExpression

addMethod

public Method addMethod(java.lang.String nm,
                        FunctionExpression expr,
                        Evaluator evaluator)
                 throws java.lang.Throwable

body

public List body(List l)

body

public List body()

name

public Name name()

name

public Name name(Name n)

superClass

public Name superClass()

superClass

public Name superClass(Name n)

interfaces

public List interfaces()

interfaces

public List interfaces(List l)

constructors

public Method constructors()

constructors

public Method constructors(Method l)

fields

public List fields()

fields

public List fields(List l)

methods

public MethodsCollection methods()

methods

public MethodsCollection methods(MethodsCollection t)