org.jboss.byteman.rule.grammar
Class ParseNode

java.lang.Object
  extended by org.jboss.byteman.rule.grammar.ParseNode
Direct Known Subclasses:
ParseNode.BinaryNode, ParseNode.NullaryNode, ParseNode.QuaternaryNode, ParseNode.TernaryNode, ParseNode.UnaryNode

public abstract class ParseNode
extends java.lang.Object

Class used by the JavaCUP parser to construct a parse tree.


Nested Class Summary
private static class ParseNode.BinaryNode
          a parse node with two children
private static class ParseNode.NullaryNode
          a parse node with no children
private static class ParseNode.QuaternaryNode
          a parse node with four children
private static class ParseNode.TernaryNode
          a parse node with three children
private static class ParseNode.UnaryNode
          a parse node with one child
 
Field Summary
static int AND
           
static int ARRAY
           
static int ASSIGN
           
static int BAND
           
static int BIND
           
static int BINOP
           
static int BOOLEAN_LITERAL
           
static int BOR
           
static int BXOR
           
static int COLON
           
private  int column
          the column position for this node
static int COMMA
           
static int DIV
           
static int DOLLAR
           
static int EQ
           
static int FIELD
           
private  java.lang.String file
          the script file containing the text form which this node was parsed
static int FLOAT_LITERAL
           
static int GE
           
static int GT
           
static int IDENTIFIER
           
static int INTEGER_LITERAL
           
static int LE
           
private  int line
          the line position fo rthis node
static int LT
           
static int METH
           
static int MINUS
           
static int MOD
           
static int MUL
           
static int NE
           
static int NEW
           
static int NOT
           
static int NOTHING
           
static int NULL_LITERAL
           
static int OR
           
static int PATH
           
static int PLUS
           
static int RETURN
           
static int SEMI
           
static int STRING_LITERAL
           
private  int tag
          the type tag for this node
static int TERNOP
           
static int THROW
           
static int TWIDDLE
           
static int UMINUS
           
static int UNOP
           
 
Constructor Summary
protected ParseNode(int tag, java.lang.String file, int line, int column)
          generic constructor
 
Method Summary
abstract  java.lang.Object getChild(int idx)
          get the nth child for this node or null if the index exceeds the child count
abstract  int getChildCount()
          get the child count for this node
 int getColumn()
          get the column position for this node
 int getLine()
          get the line position for this node
 java.lang.String getPos()
          get a string representing the position for this node
 int getTag()
          get the tag for this node
abstract  java.lang.String getText()
          get the display representation of this node
static ParseNode node(int tag, java.lang.String file, int line, int column)
          create a simple node for a builtin token
static ParseNode node(int tag, java.lang.String file, int line, int column, java.lang.Object child0)
          create a simple node for a builtin token
static ParseNode node(int tag, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1)
           
static ParseNode node(int tag, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1, java.lang.Object child2)
           
static ParseNode node(int tag, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1, java.lang.Object child2, java.lang.Object child3)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARRAY

public static final int ARRAY
See Also:
Constant Field Values

ASSIGN

public static final int ASSIGN
See Also:
Constant Field Values

BIND

public static final int BIND
See Also:
Constant Field Values

BINOP

public static final int BINOP
See Also:
Constant Field Values

BOOLEAN_LITERAL

public static final int BOOLEAN_LITERAL
See Also:
Constant Field Values

COMMA

public static final int COMMA
See Also:
Constant Field Values

COLON

public static final int COLON
See Also:
Constant Field Values

FIELD

public static final int FIELD
See Also:
Constant Field Values

FLOAT_LITERAL

public static final int FLOAT_LITERAL
See Also:
Constant Field Values

IDENTIFIER

public static final int IDENTIFIER
See Also:
Constant Field Values

INTEGER_LITERAL

public static final int INTEGER_LITERAL
See Also:
Constant Field Values

METH

public static final int METH
See Also:
Constant Field Values

NOTHING

public static final int NOTHING
See Also:
Constant Field Values

PATH

public static final int PATH
See Also:
Constant Field Values

RETURN

public static final int RETURN
See Also:
Constant Field Values

SEMI

public static final int SEMI
See Also:
Constant Field Values

STRING_LITERAL

public static final int STRING_LITERAL
See Also:
Constant Field Values

TERNOP

public static final int TERNOP
See Also:
Constant Field Values

THROW

public static final int THROW
See Also:
Constant Field Values

UNOP

public static final int UNOP
See Also:
Constant Field Values

NEW

public static final int NEW
See Also:
Constant Field Values

NULL_LITERAL

public static final int NULL_LITERAL
See Also:
Constant Field Values

AND

public static final int AND
See Also:
Constant Field Values

BAND

public static final int BAND
See Also:
Constant Field Values

BOR

public static final int BOR
See Also:
Constant Field Values

BXOR

public static final int BXOR
See Also:
Constant Field Values

DIV

public static final int DIV
See Also:
Constant Field Values

DOLLAR

public static final int DOLLAR
See Also:
Constant Field Values

EQ

public static final int EQ
See Also:
Constant Field Values

GE

public static final int GE
See Also:
Constant Field Values

GT

public static final int GT
See Also:
Constant Field Values

LE

public static final int LE
See Also:
Constant Field Values

LT

public static final int LT
See Also:
Constant Field Values

MINUS

public static final int MINUS
See Also:
Constant Field Values

MOD

public static final int MOD
See Also:
Constant Field Values

MUL

public static final int MUL
See Also:
Constant Field Values

NE

public static final int NE
See Also:
Constant Field Values

NOT

public static final int NOT
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values

PLUS

public static final int PLUS
See Also:
Constant Field Values

TWIDDLE

public static final int TWIDDLE
See Also:
Constant Field Values

UMINUS

public static final int UMINUS
See Also:
Constant Field Values

tag

private int tag
the type tag for this node


file

private java.lang.String file
the script file containing the text form which this node was parsed


line

private int line
the line position fo rthis node


column

private int column
the column position for this node

Constructor Detail

ParseNode

protected ParseNode(int tag,
                    java.lang.String file,
                    int line,
                    int column)
generic constructor

Parameters:
tag - identifies the type of this node
line - identifies the start line for this node's text
column - identifies the start columen for this node's text
Method Detail

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

public abstract java.lang.Object getChild(int idx)
get the nth child for this node or null if the index exceeds the child count

Returns:
the nth child for this node

getText

public abstract java.lang.String getText()
get the display representation of this node

Returns:
the display representation of this node

getPos

public java.lang.String getPos()
get a string representing the position for this node

Returns:
a string representing the position for this node

node

public static ParseNode node(int tag,
                             java.lang.String file,
                             int line,
                             int column)
create a simple node for a builtin token

Parameters:
tag - identifies the type of this node
line - identifies the start line for this node's text
column - identifies the start columen for this node's text
Returns:
a simple node for a builtin token

node

public static ParseNode node(int tag,
                             java.lang.String file,
                             int line,
                             int column,
                             java.lang.Object child0)
create a simple node for a builtin token

Parameters:
tag - identifies the type of this node
line - identifies the start line for this node's text
column - identifies the start columen for this node's text
Returns:
a simple node for a builtin token

node

public static ParseNode node(int tag,
                             java.lang.String file,
                             int line,
                             int column,
                             java.lang.Object child0,
                             java.lang.Object child1)

node

public static ParseNode node(int tag,
                             java.lang.String file,
                             int line,
                             int column,
                             java.lang.Object child0,
                             java.lang.Object child1,
                             java.lang.Object child2)

node

public static ParseNode node(int tag,
                             java.lang.String file,
                             int line,
                             int column,
                             java.lang.Object child0,
                             java.lang.Object child1,
                             java.lang.Object child2,
                             java.lang.Object child3)