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 |
---|---|
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, xmlSerializeRootOpen
private 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.AST
initialize
in class antlr.CommonAST
ast
- 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.AST
initialize
in class antlr.CommonAST
token
- 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.AST
getLine
in class antlr.BaseAST
0
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.AST
getColumn
in class antlr.BaseAST
0
for an artificial AST.getLine()
private void extractTokenData(antlr.Token token)
token
- Token from which information is to be extracted.