public abstract class ParseNode extends Object
Modifier and Type | Field | Description |
---|---|---|
static int |
AND |
|
static int |
ARRAY |
|
static int |
ARRAY_INIT |
|
static int |
ASSIGN |
|
static int |
BAND |
|
static int |
BIND |
|
static int |
BINOP |
|
static int |
BOOLEAN_LITERAL |
|
static int |
BOR |
|
static int |
BXOR |
|
static int |
CLASS |
|
static int |
COLON |
|
static int |
COMMA |
|
static int |
DIV |
|
static int |
DOLLAR |
|
static int |
EQ |
|
static int |
FIELD |
|
static int |
FLOAT_LITERAL |
|
static int |
GE |
|
static int |
GT |
|
static int |
IDENTIFIER |
|
static int |
INTEGER_LITERAL |
|
static int |
LE |
|
static int |
LSH |
|
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 |
RSH |
|
static int |
SEMI |
|
static int |
STRING_LITERAL |
|
static int |
TERNOP |
|
static int |
THROW |
|
static int |
TWIDDLE |
|
static int |
UMINUS |
|
static int |
UNOP |
|
static int |
URSH |
Modifier | Constructor | Description |
---|---|---|
protected |
ParseNode(int tag,
String file,
int line,
int column) |
generic constructor
|
Modifier and Type | Method | Description |
---|---|---|
abstract 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
|
String |
getPos() |
get a string representing the position for this node
|
int |
getTag() |
get the tag for this node
|
abstract String |
getText() |
get the display representation of this node
|
static ParseNode |
node(int tag,
String file,
int line,
int column) |
create a simple node for a builtin token
|
static ParseNode |
node(int tag,
String file,
int line,
int column,
Object child0) |
create a simple node for a builtin token
|
static ParseNode |
node(int tag,
String file,
int line,
int column,
Object child0,
Object child1) |
create a simple node for a builtin token
|
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
|
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
|
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 CLASS
public static final int ARRAY_INIT
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
public static final int LSH
public static final int RSH
public static final int URSH
protected ParseNode(int tag, String file, int line, int column)
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 textpublic int getTag()
public int getLine()
public int getColumn()
public abstract int getChildCount()
public abstract Object getChild(int idx)
idx
- the child indexpublic abstract String getText()
public String getPos()
public static ParseNode node(int tag, String file, int line, int column)
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 textpublic static ParseNode node(int tag, String file, int line, int column, Object child0)
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 nodepublic static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1)
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 nodepublic static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1, Object child2)
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 nodepublic static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1, Object child2, Object child3)
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 nodeCopyright © 2018. All rights reserved.