antlr

Class GrammarAtom

Known Direct Subclasses:
CharLiteralElement, StringLiteralElement, TokenRefElement, WildcardElement

(package private) abstract class GrammarAtom
extends AlternativeElement

A GrammarAtom is either a token ref, a character ref, or string. The analysis doesn't care.

Field Summary

protected String
ASTNodeType
Set to type of AST node to create during parse.
protected String
atomText
protected String
label
protected boolean
not
protected int
tokenType

Fields inherited from class antlr.AlternativeElement

autoGenType, enclosingRuleName, next

Fields inherited from class antlr.GrammarElement

AUTO_GEN_BANG, AUTO_GEN_CARET, AUTO_GEN_NONE, column, grammar, line

Constructor Summary

GrammarAtom(Grammar g, Token t, int autoGenType)

Method Summary

String
getASTNodeType()
String
getLabel()
String
getText()
int
getType()
void
setASTNodeType(String type)
void
setLabel(String label_)
void
setOption(Token option, Token value)
String
toString()

Methods inherited from class antlr.AlternativeElement

getAutoGenType, getLabel, setAutoGenType, setLabel

Methods inherited from class antlr.GrammarElement

generate, getColumn, getLine, look, toString

Field Details

ASTNodeType

protected String ASTNodeType
Set to type of AST node to create during parse. Defaults to what is set in the TokenSymbol.

atomText

protected String atomText

label

protected String label

not

protected boolean not

tokenType

protected int tokenType

Constructor Details

GrammarAtom

public GrammarAtom(Grammar g,
                   Token t,
                   int autoGenType)

Method Details

getASTNodeType

public String getASTNodeType()

getLabel

public String getLabel()
Overrides:
getLabel in interface AlternativeElement

getText

public String getText()

getType

public int getType()

setASTNodeType

public void setASTNodeType(String type)

setLabel

public void setLabel(String label_)
Overrides:
setLabel in interface AlternativeElement

setOption

public void setOption(Token option,
                      Token value)

toString

public String toString()
Overrides:
toString in interface GrammarElement