GrammarAtompublic abstract class GrammarAtom extends AlternativeElement A GrammarAtom is either a token ref, a character ref, or string.
The analysis doesn't care. |
Fields Summary |
---|
protected String | label | protected String | atomText | protected int | tokenType | protected boolean | not | protected String | ASTNodeTypeSet to type of AST node to create during parse. Defaults to what is
set in the TokenSymbol. |
Constructors Summary |
---|
public GrammarAtom(Grammar g, Token t, int autoGenType)
super(g, t, autoGenType);
atomText = t.getText();
|
Methods Summary |
---|
public java.lang.String | getASTNodeType()
return ASTNodeType;
| public java.lang.String | getLabel()
return label;
| public java.lang.String | getText()
return atomText;
| public int | getType()
return tokenType;
| public void | setASTNodeType(java.lang.String type)
ASTNodeType = type;
| public void | setLabel(java.lang.String label_)
label = label_;
| public void | setOption(persistence.antlr.Token option, persistence.antlr.Token value)
if (option.getText().equals("AST")) {
setASTNodeType(value.getText());
}
else {
grammar.antlrTool.error("Invalid element option:" + option.getText(),
grammar.getFilename(), option.getLine(), option.getColumn());
}
| public java.lang.String | toString()
String s = " ";
if (label != null) s += label + ":";
if (not) s += "~";
return s + atomText;
|
|