public final class DetailAST
extends antlr.CommonASTWithHiddenTokens
Modifier and Type | Field and Description |
---|---|
private java.util.BitSet |
branchTokenTypes
All token types in this branch.
|
private int |
childCount
Number of children.
|
private int |
columnNo
The column number.
|
private int |
lineNo
The line number.
|
private static int |
NOT_INITIALIZED
Constant to indicate if not calculated the child count.
|
private DetailAST |
parent
The parent token.
|
private DetailAST |
previousSibling
Previous sibling.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
DetailAST() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(antlr.collections.AST ast) |
void |
addNextSibling(DetailAST ast)
Add next sibling.
|
void |
addPreviousSibling(DetailAST ast)
Add previous sibling.
|
boolean |
branchContains(int type)
Checks if this branch of the parse tree contains a token
of the provided type.
|
private void |
clearBranchTokenTypes()
Clears branchTokenTypes cache for all parents of the current DetailAST instance, and the
child count for the current DetailAST instance.
|
private static void |
clearChildCountCache(DetailAST ast)
Clears the child count for the ast instance.
|
private static int |
findColumnNo(DetailAST ast)
Finds column number in the first non-comment node.
|
DetailAST |
findFirstToken(int type)
Returns the first child token that makes a specified type.
|
private static int |
findLineNo(DetailAST ast)
Finds line number in the first non-comment node.
|
private java.util.BitSet |
getBranchTokenTypes()
Returns token type with branch.
|
int |
getChildCount()
Returns the number of child nodes one level below this node.
|
int |
getChildCount(int type)
Returns the number of direct child tokens that have the specified type.
|
int |
getColumnNo()
Gets column number.
|
DetailAST |
getFirstChild() |
DetailAST |
getLastChild()
Gets the last child node.
|
int |
getLineNo()
Gets line number.
|
DetailAST |
getNextSibling() |
DetailAST |
getParent()
Returns the parent token.
|
DetailAST |
getPreviousSibling()
Returns the previous sibling or null if no such sibling exists.
|
void |
initialize(antlr.collections.AST ast) |
void |
initialize(antlr.Token tok) |
void |
setColumnNo(int columnNo)
Set column number.
|
void |
setFirstChild(antlr.collections.AST ast) |
void |
setLineNo(int lineNo)
Set line number.
|
void |
setNextSibling(antlr.collections.AST ast) |
private void |
setParent(DetailAST parent)
Set the parent token.
|
java.lang.String |
toString() |
decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getLine, getNumberOfChildren, getTokenNames, removeChildren, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
private static final long serialVersionUID
private static final int NOT_INITIALIZED
private int lineNo
private int columnNo
private int childCount
private DetailAST parent
private DetailAST previousSibling
private java.util.BitSet branchTokenTypes
public void initialize(antlr.Token tok)
initialize
in interface antlr.collections.AST
initialize
in class antlr.CommonASTWithHiddenTokens
public void initialize(antlr.collections.AST ast)
initialize
in interface antlr.collections.AST
initialize
in class antlr.CommonASTWithHiddenTokens
public void setFirstChild(antlr.collections.AST ast)
setFirstChild
in interface antlr.collections.AST
setFirstChild
in class antlr.BaseAST
public void setNextSibling(antlr.collections.AST ast)
setNextSibling
in interface antlr.collections.AST
setNextSibling
in class antlr.BaseAST
public void addPreviousSibling(DetailAST ast)
ast
- DetailAST object.public void addNextSibling(DetailAST ast)
ast
- DetailAST object.public void addChild(antlr.collections.AST ast)
addChild
in interface antlr.collections.AST
addChild
in class antlr.BaseAST
public int getChildCount()
public int getChildCount(int type)
type
- the token type to matchprivate void setParent(DetailAST parent)
parent
- the parent tokenpublic DetailAST getParent()
public int getLineNo()
public void setLineNo(int lineNo)
lineNo
- line number.public int getColumnNo()
public void setColumnNo(int columnNo)
columnNo
- column number.public DetailAST getLastChild()
private static int findColumnNo(DetailAST ast)
ast
- DetailAST node.private static int findLineNo(DetailAST ast)
ast
- DetailAST node.private java.util.BitSet getBranchTokenTypes()
public boolean branchContains(int type)
type
- a TokenTypetype
.public DetailAST getPreviousSibling()
public DetailAST findFirstToken(int type)
type
- the token type to matchpublic java.lang.String toString()
toString
in interface antlr.collections.AST
toString
in class antlr.BaseAST
public DetailAST getNextSibling()
getNextSibling
in interface antlr.collections.AST
getNextSibling
in class antlr.BaseAST
public DetailAST getFirstChild()
getFirstChild
in interface antlr.collections.AST
getFirstChild
in class antlr.BaseAST
private static void clearChildCountCache(DetailAST ast)
ast
- The ast to clear.private void clearBranchTokenTypes()