|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectantlr.BaseAST
antlr.CommonAST
com.puppycrawl.tools.checkstyle.api.DetailAST
public final class DetailAST
An extension of the CommonAST that records the line and column number. The idea was taken from Java Guru FAQ: How can I include line numbers in automatically generated ASTs?.
| Field Summary |
|---|
| Fields inherited from class antlr.BaseAST |
|---|
down, right |
| Constructor Summary | |
|---|---|
DetailAST()
|
|
| Method Summary | |
|---|---|
void |
addChild(AST aAST)
|
boolean |
branchContains(int aType)
Checks if this branch of the parse tree contains a token of the provided type. |
DetailAST |
findFirstToken(int aType)
Returns the first child token that makes a specified type. |
int |
getChildCount()
Returns the number of child nodes one level below this node. |
int |
getChildCount(int aType)
Returns the number of direct child tokens that have the specified type. |
int |
getColumnNo()
|
DetailAST |
getFirstChild()
|
DetailAST |
getLastChild()
|
int |
getLineNo()
|
DetailAST |
getNextSibling()
|
DetailAST |
getParent()
Returns the parent token. |
DetailAST |
getPreviousSibling()
Returns the previous sibling or null if no such sibling exists. |
void |
initialize(AST aAST)
|
void |
initialize(Token aTok)
|
void |
setFirstChild(AST aAST)
|
void |
setNextSibling(AST aAST)
|
String |
toString()
|
| Methods inherited from class antlr.CommonAST |
|---|
getText, getType, initialize, setText, setType |
| Methods inherited from class antlr.BaseAST |
|---|
decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getLine, getNumberOfChildren, getTokenNames, removeChildren, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DetailAST()
| Method Detail |
|---|
public void initialize(Token aTok)
initialize in interface ASTinitialize in class CommonASTpublic void initialize(AST aAST)
initialize in interface ASTinitialize in class CommonASTpublic void setFirstChild(AST aAST)
setFirstChild in interface ASTsetFirstChild in class BaseASTpublic void setNextSibling(AST aAST)
setNextSibling in interface ASTsetNextSibling in class BaseASTpublic void addChild(AST aAST)
addChild in interface ASTaddChild in class BaseASTpublic int getChildCount()
public DetailAST getParent()
public int getLineNo()
public int getColumnNo()
public DetailAST getLastChild()
public boolean branchContains(int aType)
aType - a TokenType
aType.public int getChildCount(int aType)
aType - the token type to match
public DetailAST getPreviousSibling()
public DetailAST findFirstToken(int aType)
aType - the token type to match
public String toString()
toString in interface ASTtoString in class BaseASTpublic DetailAST getNextSibling()
getNextSibling in interface ASTgetNextSibling in class BaseASTpublic DetailAST getFirstChild()
getFirstChild in interface ASTgetFirstChild in class BaseAST
|
Back to the Checkstyle Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||