Package org.jboss.byteman.rule.grammar
Class ParseNode
java.lang.Object
org.jboss.byteman.rule.grammar.ParseNode
- Direct Known Subclasses:
ParseNode.BinaryNode
,ParseNode.NullaryNode
,ParseNode.QuaternaryNode
,ParseNode.TernaryNode
,ParseNode.UnaryNode
Class used by the JavaCUP parser to construct a parse tree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
a parse node with two childrenprivate static class
a parse node with no childrenprivate static class
a parse node with four childrenprivate static class
a parse node with three childrenprivate static class
a parse node with one child -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
private int
the column position for this nodestatic final int
static final int
static final int
static final int
static final int
private String
the script file containing the text form which this node was parsedstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
private int
the line position fo rthis nodestatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
private int
the type tag for this nodestatic final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
getChild
(int idx) get the nth child for this node or null if the index exceeds the child countabstract int
get the child count for this nodeint
get the column position for this nodeint
getLine()
get the line position for this nodegetPos()
get a string representing the position for this nodeint
getTag()
get the tag for this nodeabstract String
getText()
get the display representation of this nodestatic ParseNode
create a simple node for a builtin tokenstatic ParseNode
create a simple node for a builtin tokenstatic ParseNode
create a simple node for a builtin tokenstatic ParseNode
create a simple node for a builtin tokenstatic ParseNode
node
(int tag, String file, int line, int column, Object child0, Object child1, Object child2, Object child3) create a simple node for a builtin token
-
Field Details
-
ARRAY
public static final int ARRAY- See Also:
-
ASSIGN
public static final int ASSIGN- See Also:
-
BIND
public static final int BIND- See Also:
-
BINOP
public static final int BINOP- See Also:
-
BOOLEAN_LITERAL
public static final int BOOLEAN_LITERAL- See Also:
-
COMMA
public static final int COMMA- See Also:
-
COLON
public static final int COLON- See Also:
-
FIELD
public static final int FIELD- See Also:
-
FLOAT_LITERAL
public static final int FLOAT_LITERAL- See Also:
-
IDENTIFIER
public static final int IDENTIFIER- See Also:
-
INTEGER_LITERAL
public static final int INTEGER_LITERAL- See Also:
-
METH
public static final int METH- See Also:
-
NOTHING
public static final int NOTHING- See Also:
-
PATH
public static final int PATH- See Also:
-
RETURN
public static final int RETURN- See Also:
-
SEMI
public static final int SEMI- See Also:
-
STRING_LITERAL
public static final int STRING_LITERAL- See Also:
-
TERNOP
public static final int TERNOP- See Also:
-
THROW
public static final int THROW- See Also:
-
UNOP
public static final int UNOP- See Also:
-
NEW
public static final int NEW- See Also:
-
NULL_LITERAL
public static final int NULL_LITERAL- See Also:
-
CLASS
public static final int CLASS- See Also:
-
ARRAY_INIT
public static final int ARRAY_INIT- See Also:
-
AND
public static final int AND- See Also:
-
BAND
public static final int BAND- See Also:
-
BOR
public static final int BOR- See Also:
-
BXOR
public static final int BXOR- See Also:
-
DIV
public static final int DIV- See Also:
-
DOLLAR
public static final int DOLLAR- See Also:
-
EQ
public static final int EQ- See Also:
-
GE
public static final int GE- See Also:
-
GT
public static final int GT- See Also:
-
LE
public static final int LE- See Also:
-
LT
public static final int LT- See Also:
-
MINUS
public static final int MINUS- See Also:
-
MOD
public static final int MOD- See Also:
-
MUL
public static final int MUL- See Also:
-
NE
public static final int NE- See Also:
-
NOT
public static final int NOT- See Also:
-
OR
public static final int OR- See Also:
-
PLUS
public static final int PLUS- See Also:
-
TWIDDLE
public static final int TWIDDLE- See Also:
-
UMINUS
public static final int UMINUS- See Also:
-
LSH
public static final int LSH- See Also:
-
RSH
public static final int RSH- See Also:
-
URSH
public static final int URSH- See Also:
-
INSTANCEOF
public static final int INSTANCEOF- See Also:
-
tag
private int tagthe type tag for this node -
file
the script file containing the text form which this node was parsed -
line
private int linethe line position fo rthis node -
column
private int columnthe column position for this node
-
-
Constructor Details
-
ParseNode
generic constructor- Parameters:
tag
- identifies the type of this nodefile
- identifies the file containing the node's textline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's text
-
-
Method Details
-
getTag
public int getTag()get the tag for this node- Returns:
- the tag for this node
-
getLine
public int getLine()get the line position for this node- Returns:
- the line position for this node
-
getColumn
public int getColumn()get the column position for this node- Returns:
- the column position for this node
-
getChildCount
public abstract int getChildCount()get the child count for this node- Returns:
- the child count for this node
-
getChild
get the nth child for this node or null if the index exceeds the child count- Parameters:
idx
- the child index- Returns:
- the nth child for this node
-
getText
get the display representation of this node- Returns:
- the display representation of this node
-
getPos
get a string representing the position for this node- Returns:
- a string representing the position for this node
-
node
create a simple node for a builtin token- Parameters:
tag
- identifies the type of this nodefile
- identifies the file containing the node's textline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's text- Returns:
- a simple node for a builtin token
-
node
create a simple node for a builtin token- Parameters:
tag
- identifies the type of this nodefile
- identifies the file containing the node's textline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textchild0
- the first child for this node- Returns:
- a simple node for a builtin token
-
node
public static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1) create a simple node for a builtin token- Parameters:
tag
- identifies the type of this nodefile
- identifies the file containing the node's textline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textchild0
- the first child for this nodechild1
- the second child for this node- Returns:
- a simple node for a builtin token
-
node
public static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1, Object child2) create a simple node for a builtin token- Parameters:
tag
- identifies the type of this nodefile
- identifies the file containing the node's textline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textchild0
- the first child for this nodechild1
- the second child for this nodechild2
- the third child for this node- Returns:
- a simple node for a builtin token
-
node
public static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1, Object child2, Object child3) create a simple node for a builtin token- Parameters:
tag
- identifies the type of this nodefile
- identifies the file containing the node's textline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textchild0
- the first child for this nodechild1
- the second child for this nodechild2
- the third child for this nodechild3
- the fourth child for this node- Returns:
- a simple node for a builtin token
-