01: package antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.cs.usfca.edu
05: * Software rights: http://www.antlr.org/license.html
06: */
07:
08: class CharLiteralElement extends GrammarAtom {
09:
10: public CharLiteralElement(LexerGrammar g, Token t,
11: boolean inverted, int autoGenType) {
12: super (g, t, AUTO_GEN_NONE);
13: tokenType = ANTLRLexer.tokenTypeForCharLiteral(t.getText());
14: g.charVocabulary.add(tokenType);
15: line = t.getLine();
16: not = inverted;
17: this .autoGenType = autoGenType;
18: }
19:
20: public void generate(Context context) {
21: grammar.generator.gen(this , context);
22: }
23:
24: public Lookahead look(int k) {
25: return grammar.theLLkAnalyzer.look(k, this);
26: }
27: }
|