KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > CharLiteralElement


1 package antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/RIGHTS.html
6  *
7  * $Id: //depot/code/org.antlr/main/main/antlr/CharLiteralElement.java#4 $
8  */

9
10 class CharLiteralElement extends GrammarAtom {
11
12
13     public CharLiteralElement(LexerGrammar g, Token t, boolean inverted, int autoGenType) {
14         super(g, t, AUTO_GEN_NONE);
15         tokenType = ANTLRLexer.tokenTypeForCharLiteral(t.getText());
16         g.charVocabulary.add(tokenType);
17         line = t.getLine();
18         not = inverted;
19         this.autoGenType = autoGenType;
20     }
21
22     public void generate() {
23         grammar.generator.gen(this);
24     }
25
26     public Lookahead look(int k) {
27         return grammar.theLLkAnalyzer.look(k, this);
28     }
29 }
30
Popular Tags