|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectagg.attribute.parser.javaExpr.SimpleNode
public class SimpleNode
Field Summary | |
---|---|
protected java.util.Vector<Node> |
children
|
protected static ClassResolver |
classResolver
|
protected java.lang.String |
identifier
|
protected java.lang.Object |
info
|
protected static boolean |
neverCalled
Initialization flag |
protected static java.util.Hashtable<java.lang.Class<?>,java.lang.Integer> |
numberTypes
Widening order for numeric types |
protected static java.lang.Class<?> |
objectClass
Object class handle for frequent comparison |
protected Node |
parent
|
protected static java.lang.Object[] |
stack
Stack for calculations. |
protected static java.lang.Class<?> |
stringClass
String class handle for frequent comparison |
protected static SymbolTable |
symtab
Symbol table |
protected static int |
top
|
Constructor Summary | |
---|---|
SimpleNode(java.lang.String id)
|
Method Summary | |
---|---|
void |
checkContext()
Obtaining the node type and checking for consistency. |
protected java.lang.Class<?> |
commonNumberType(SimpleNode n1,
SimpleNode n2)
Widening a number type as necessary. |
Node |
copy()
Copys the abstract syntax tree. |
void |
dump(java.lang.String prefix)
|
void |
getAllVariablesinExpression(java.util.Vector<java.lang.String> v)
fills the vector with the names of all variables which occur in this abstract syntax tree |
java.lang.String |
getError()
This method returns an error string, if interpretting is failed |
java.lang.String |
getIdentifier()
|
java.lang.Object |
getInfo()
|
java.lang.Class<?> |
getNodeClass()
Getting the node class. |
java.lang.Object |
getRootResult()
|
java.lang.String |
getString()
returns this node as a string with all children. |
static SymbolTable |
getSymbolTable()
|
boolean |
hasNumberType()
Checking if node's type is a number type. |
boolean |
hasStringType()
Checking if node's type is a number type. |
void |
interpret()
Interpret method |
boolean |
isAction()
Checking if the node represents a member (method or field). |
boolean |
isArrayIndex()
Checking if the node represents an array index). |
protected boolean |
isConstantExpr()
|
boolean |
isMember()
Checking if the node represents a member (method or field). |
void |
jjtAddChild(Node n)
This method tells the node to add its argument to the node's list of children. |
void |
jjtClose()
This method is called after all the child nodes have been added. |
static Node |
jjtCreate(java.lang.String id)
|
Node |
jjtGetChild(int i)
This method returns a child node. |
int |
jjtGetNumChildren()
Return the number of children the node has. |
Node |
jjtGetParent()
|
void |
jjtOpen()
This method is called after the node has been made the current node. |
void |
jjtSetParent(Node n)
This pair of methods are used to inform the node of its parent. |
void |
replaceChildWith(Node old,
Node newNode)
Replaces a child |
void |
rewrite()
Rewrites all children. |
static void |
setClassResolver(ClassResolver cr)
|
void |
setInfo(java.lang.Object i)
|
protected void |
setNodeClass(java.lang.Class<?> nodeClass)
Setting the node class. |
static void |
setSymbolTable(SymbolTable st)
|
protected void |
takeNodeClassFrom(SimpleNode node)
Setting the node class to that of the parameter node. |
java.lang.String |
toString()
|
java.lang.String |
toString(java.lang.String prefix)
|
protected int |
typeCode()
Getting the number type code of this node object |
protected static int |
typeCode(java.lang.Class<?> cls)
Getting the number type code of a primitive number type |
protected static void |
typeInit()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Node parent
protected java.util.Vector<Node> children
protected java.lang.String identifier
protected java.lang.Object info
protected static java.lang.Object[] stack
protected static int top
protected static boolean neverCalled
protected static SymbolTable symtab
protected static java.util.Hashtable<java.lang.Class<?>,java.lang.Integer> numberTypes
protected static java.lang.Class<?> stringClass
protected static java.lang.Class<?> objectClass
protected static ClassResolver classResolver
Constructor Detail |
---|
public SimpleNode(java.lang.String id)
Method Detail |
---|
public static Node jjtCreate(java.lang.String id)
public void jjtOpen()
Node
jjtOpen
in interface Node
public void jjtClose()
Node
jjtClose
in interface Node
public void jjtSetParent(Node n)
Node
jjtSetParent
in interface Node
public Node jjtGetParent()
jjtGetParent
in interface Node
public void jjtAddChild(Node n)
Node
jjtAddChild
in interface Node
public Node jjtGetChild(int i)
Node
jjtGetChild
in interface Node
public int jjtGetNumChildren()
Node
jjtGetNumChildren
in interface Node
public void setInfo(java.lang.Object i)
public java.lang.Object getInfo()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String prefix)
public void dump(java.lang.String prefix)
dump
in interface Node
public void interpret()
Node
interpret
in interface Node
public java.lang.String getError()
Node
getError
in interface Node
protected static void typeInit()
public java.lang.Class<?> getNodeClass()
protected void setNodeClass(java.lang.Class<?> nodeClass)
protected void takeNodeClassFrom(SimpleNode node)
public boolean isAction()
public boolean isMember()
public boolean isArrayIndex()
public boolean hasStringType()
public boolean hasNumberType()
protected int typeCode()
protected static int typeCode(java.lang.Class<?> cls)
protected java.lang.Class<?> commonNumberType(SimpleNode n1, SimpleNode n2)
protected boolean isConstantExpr()
public void checkContext()
checkContext
in interface Node
public static void setSymbolTable(SymbolTable st)
public static SymbolTable getSymbolTable()
public static void setClassResolver(ClassResolver cr)
public java.lang.Object getRootResult()
getRootResult
in interface Node
public java.lang.String getString()
getString
in interface Node
public void rewrite()
rewrite
in interface Node
special rewriting at class ASTId
public void replaceChildWith(Node old, Node newNode)
replaceChildWith
in interface Node
public void getAllVariablesinExpression(java.util.Vector<java.lang.String> v)
getAllVariablesinExpression
in interface Node
public java.lang.String getIdentifier()
public Node copy()
copy
in interface Node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |