|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectantlr.BaseAST
antlr.CommonAST
antlr.CommonASTWithHiddenTokens
jparse.JavaAST
jparse.ConstrAST
An AST node that represents a constructor definition
Field Summary | |
private CompoundAST |
body
The body of the constructor |
private Type[] |
exceptions
The checked exceptions this constructor might throw |
private IdentifierAST[] |
exceptNames
The names of the exception types thrown by this constructor |
private ModifierAST |
modifiers
The modifiers for this constructor |
private ParameterAST[] |
paramNames
The names of the parameter for this constructor |
private Type[] |
paramTypes
The parameter types for this constructor |
Fields inherited from class jparse.JavaAST |
context, currSymTable, noTypes, symTable, topLevel, typeAST |
Fields inherited from class antlr.CommonASTWithHiddenTokens |
hiddenAfter, hiddenBefore |
Fields inherited from class antlr.CommonAST |
|
Fields inherited from class antlr.BaseAST |
down, right |
Constructor Summary | |
(package private) |
ConstrAST()
Create a default constructor |
(package private) |
ConstrAST(ModifierAST mods,
JavaAST parameters,
JavaAST exceptions,
CompoundAST block)
Create a new constructor AST |
Method Summary | |
Constructor |
bestMatch(Constructor cons)
Find the best match, given two matching constructors |
protected Type[] |
computeExceptions()
Returns an array of Type objects that represent the types
of the exceptions declared to be thrown by this constructor. |
CompoundAST |
getBody()
Get the code for the body of this constructor |
Type |
getDeclaringClass()
Returns the Type object representing the class or
interface that declares the constructor represented by this object. |
Type[] |
getExceptionTypes()
Get the checked exception types that might be thrown by this constructor |
int |
getModifiers()
Returns the Java language modifiers for the constructor represented by this object, as an integer. |
ParameterAST[] |
getParameters()
Get the formal parameters of this constructor |
Type[] |
getParameterTypes()
Returns an array of Type objects that represent the formal
parameter types, in declaration order, of this constructor. |
boolean |
match(Type[] params,
Type caller)
Determines whether this constructor matches the parameters given by a caller |
void |
parseComplete()
Compute any derived attributes that must be evaluated after the initial parse. |
String |
toString()
Return a string describing this ConstrAST |
Methods inherited from class jparse.JavaAST |
print, printHiddenAfter, printHiddenBefore |
Methods inherited from class antlr.CommonASTWithHiddenTokens |
getHiddenAfter, getHiddenBefore, initialize |
Methods inherited from class antlr.CommonAST |
getText, getType, initialize, initialize, setText, setType |
Methods inherited from class antlr.BaseAST |
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getFirstChild, getLine, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private final ModifierAST modifiers
private final ParameterAST[] paramNames
private Type[] paramTypes
private final IdentifierAST[] exceptNames
private Type[] exceptions
private final CompoundAST body
Constructor Detail |
ConstrAST()
ConstrAST(ModifierAST mods, JavaAST parameters, JavaAST exceptions, CompoundAST block)
mods
- the modifiers for this constructorparameters
- the parameters for this constructorexceptions
- the exceptions thrown by this constructorblock
- the body of the constructorMethod Detail |
public void parseComplete()
JavaAST
parseComplete
in class JavaAST
public Type getDeclaringClass()
Type
object representing the class or
interface that declares the constructor represented by this object.
getDeclaringClass
in interface Constructor
Type
of the declaring classpublic int getModifiers()
Modifier
class should be used to decode the modifiers.
getModifiers
in interface Constructor
public ParameterAST[] getParameters()
public Type[] getParameterTypes()
Type
objects that represent the formal
parameter types, in declaration order, of this constructor. Returns an
array of length 0 if the underlying constructor takes no parameters.
getParameterTypes
in interface Constructor
public final Type[] getExceptionTypes()
getExceptionTypes
in interface HasExceptions
protected Type[] computeExceptions()
Type
objects that represent the types
of the exceptions declared to be thrown by this constructor. Returns
an array of length 0 if the constructor declares no exceptions in its
throws
clause.
public CompoundAST getBody()
public boolean match(Type[] params, Type caller)
match
in interface Constructor
params
- the types of the parameters to the constructorcaller
- the type of the caller
true
if this constructor matches,
false
otherwisepublic Constructor bestMatch(Constructor cons)
bestMatch
in interface Constructor
cons
- the other constructor to compare
null
if neither matches bestpublic String toString()
ConstrAST
toString
in interface antlr.collections.AST
ConstrAST
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |