public abstract class ParseNode
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
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
|
Modifier and Type | Field and Description |
---|---|
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 |
Modifier | Constructor and Description |
---|---|
protected |
ParseNode(int tag,
java.lang.String file,
int line,
int column)
generic constructor
|
Modifier and Type | Method and Description |
---|---|
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) |
public static final int ARRAY
public static final int ASSIGN
public static final int BIND
public static final int BINOP
public static final int BOOLEAN_LITERAL
public static final int COMMA
public static final int COLON
public static final int FIELD
public static final int FLOAT_LITERAL
public static final int IDENTIFIER
public static final int INTEGER_LITERAL
public static final int METH
public static final int NOTHING
public static final int PATH
public static final int RETURN
public static final int SEMI
public static final int STRING_LITERAL
public static final int TERNOP
public static final int THROW
public static final int UNOP
public static final int NEW
public static final int NULL_LITERAL
public static final int AND
public static final int BAND
public static final int BOR
public static final int BXOR
public static final int DIV
public static final int DOLLAR
public static final int EQ
public static final int GE
public static final int GT
public static final int LE
public static final int LT
public static final int MINUS
public static final int MOD
public static final int MUL
public static final int NE
public static final int NOT
public static final int OR
public static final int PLUS
public static final int TWIDDLE
public static final int UMINUS
private int tag
private java.lang.String file
private int line
private int column
protected ParseNode(int tag, java.lang.String file, int line, int column)
tag
- identifies the type of this nodeline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textpublic int getTag()
public int getLine()
public int getColumn()
public abstract int getChildCount()
public abstract java.lang.Object getChild(int idx)
public abstract java.lang.String getText()
public java.lang.String getPos()
public static ParseNode node(int tag, java.lang.String file, int line, int column)
tag
- identifies the type of this nodeline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textpublic static ParseNode node(int tag, java.lang.String file, int line, int column, java.lang.Object child0)
tag
- identifies the type of this nodeline
- identifies the start line for this node's textcolumn
- identifies the start columen for this node's textpublic static ParseNode node(int tag, java.lang.String file, int line, int column, java.lang.Object child0, java.lang.Object child1)
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)
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)