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
public abstract class ParseNode extends java.lang.ObjectClass used by the JavaCUP parser to construct a parse tree.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classParseNode.BinaryNodea parse node with two childrenprivate static classParseNode.NullaryNodea parse node with no childrenprivate static classParseNode.QuaternaryNodea parse node with four childrenprivate static classParseNode.TernaryNodea parse node with three childrenprivate static classParseNode.UnaryNodea parse node with one child
-
Field Summary
Fields Modifier and Type Field Description static intANDstatic intARRAYstatic intARRAY_INITstatic intASSIGNstatic intBANDstatic intBINDstatic intBINOPstatic intBOOLEAN_LITERALstatic intBORstatic intBXORstatic intCLASSstatic intCOLONprivate intcolumnthe column position for this nodestatic intCOMMAstatic intDIVstatic intDOLLARstatic intEQstatic intFIELDprivate java.lang.Stringfilethe script file containing the text form which this node was parsedstatic intFLOAT_LITERALstatic intGEstatic intGTstatic intIDENTIFIERstatic intINSTANCEOFstatic intINTEGER_LITERALstatic intLEprivate intlinethe line position fo rthis nodestatic intLSHstatic intLTstatic intMETHstatic intMINUSstatic intMODstatic intMULstatic intNEstatic intNEWstatic intNOTstatic intNOTHINGstatic intNULL_LITERALstatic intORstatic intPATHstatic intPLUSstatic intRETURNstatic intRSHstatic intSEMIstatic intSTRING_LITERALprivate inttagthe type tag for this nodestatic intTERNOPstatic intTHROWstatic intTWIDDLEstatic intUMINUSstatic intUNOPstatic intURSH
-
Constructor Summary
Constructors Modifier Constructor Description protectedParseNode(int tag, java.lang.String file, int line, int column)generic constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.ObjectgetChild(int idx)get the nth child for this node or null if the index exceeds the child countabstract intgetChildCount()get the child count for this nodeintgetColumn()get the column position for this nodeintgetLine()get the line position for this nodejava.lang.StringgetPos()get a string representing the position for this nodeintgetTag()get the tag for this nodeabstract java.lang.StringgetText()get the display representation of this nodestatic ParseNodenode(int tag, java.lang.String file, int line, int column)create a simple node for a builtin tokenstatic ParseNodenode(int tag, java.lang.String file, int line, int column, java.lang.Object child0)create a simple node for a builtin tokenstatic ParseNodenode(int tag, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1)create a simple node for a builtin tokenstatic ParseNodenode(int tag, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1, java.lang.Object child2)create a simple node for a builtin tokenstatic ParseNodenode(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)create a simple node for a builtin token
-
-
-
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
-
CLASS
public static final int CLASS
- See Also:
- Constant Field Values
-
ARRAY_INIT
public static final int ARRAY_INIT
- 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
-
LSH
public static final int LSH
- See Also:
- Constant Field Values
-
RSH
public static final int RSH
- See Also:
- Constant Field Values
-
URSH
public static final int URSH
- See Also:
- Constant Field Values
-
INSTANCEOF
public static final int INSTANCEOF
- 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 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 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- Parameters:
idx- the child index- 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 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
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 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, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.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, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1, java.lang.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, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1, java.lang.Object child2, java.lang.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
-
-