public class ExtraAst
extends antlr.CommonAST
| Modifier and Type | Field and Description |
|---|---|
private int |
column
Source file column number associated with this AST
|
private java.lang.Object |
extra
Extra, user-defined object reference associated with this node.
|
private int |
id
Identifier which is unique to this node within an expression AST
|
private int |
line
Source file line number associated with this AST
|
private java.lang.Class |
operandType
Common operand type associated with this node (certain operators
only).
|
| Constructor and Description |
|---|
ExtraAst()
Default constructor.
|
ExtraAst(antlr.Token token)
Constructor which accepts and wrappers token.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
dumpTree()
Dumps the tree represented by this node.
|
private void |
dumpTreeImpl(java.lang.StringBuilder sb,
java.lang.String indent)
The implementation of the dump-tree method.
|
private void |
extractTokenData(antlr.Token token)
Extract token type, line number, and column information from a token
and store this information as member data.
|
int |
getColumn()
Get the source code column number which designates where in the source
code file the token wrappered by this node was found.
|
java.lang.Object |
getExtra()
Retrieve this AST's associated object reference.
|
int |
getId()
Get this AST node's identifier.
|
int |
getLine()
Get the source code line number which designates where in the source
code file the token wrappered by this node was found.
|
java.lang.Class |
getOperandType()
Retrieve this AST's associated operand type.
|
void |
initialize(antlr.collections.AST ast)
Initialize this node with the specified AST.
|
void |
initialize(antlr.Token token)
Initialize this node with the specified token.
|
void |
setExtra(java.lang.Object extra)
Set this AST's associated object reference.
|
void |
setId(int id)
Set this AST node's identifier.
|
void |
setOperandType(java.lang.Class type)
Set this AST's associated operand type.
|
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpenprivate java.lang.Object extra
private java.lang.Class operandType
private int line
private int column
private int id
public ExtraAst()
public ExtraAst(antlr.Token token)
token - Token upon which this node is based.public int getId()
public void setId(int id)
id - Unique identifier for this node.public java.lang.Object getExtra()
null if no
reference has been assigned.public void setExtra(java.lang.Object extra)
extra - The associated object reference or null if the
reference should be removed.public java.lang.Class getOperandType()
null if the
reference should be removed.public void setOperandType(java.lang.Class type)
type - The associated operand type or null if the
reference should be removed.public void initialize(antlr.collections.AST ast)
ast.initialize in interface antlr.collections.ASTinitialize in class antlr.CommonASTast - AST upon which this node is based. Expected to be an instance
of ExtraAst.public void initialize(antlr.Token token)
token for later use in
line number and column queries.initialize in interface antlr.collections.ASTinitialize in class antlr.CommonASTtoken - Token upon which this node is based.public int getLine()
0 for an artificially manufactured AST (i.e., one
not generated by a parser).getLine in interface antlr.collections.ASTgetLine in class antlr.BaseAST0 for an artifical AST.getColumn()public int getColumn()
0 for an artificially manufactured AST (i.e., one
not generated by a parser).getColumn in interface antlr.collections.ASTgetColumn in class antlr.BaseAST0 for an artificial AST.getLine()private void extractTokenData(antlr.Token token)
token - Token from which information is to be extracted.public java.lang.String dumpTree()
@.id and extra fields can also be added.private void dumpTreeImpl(java.lang.StringBuilder sb,
java.lang.String indent)
sb - The StringBuilder used to compose the result.indent - The indentation for current node.