KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > RuleEndElement


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/RuleEndElement.java#4 $
8  */

9
10 /**Contains a list of all places that reference
11  * this enclosing rule. Useful for FOLLOW computations.
12  */

13 class RuleEndElement extends BlockEndElement {
14     protected Lookahead[] cache; // Each rule can cache it's lookahead computation.
15
// The FOLLOW(rule) is stored in this cache.
16
// 1..k
17
protected boolean noFOLLOW;
18
19
20     public RuleEndElement(Grammar g) {
21         super(g);
22         cache = new Lookahead[g.maxk + 1];
23     }
24
25     public Lookahead look(int k) {
26         return grammar.theLLkAnalyzer.look(k, this);
27     }
28
29     public String JavaDoc toString() {
30         //return " [RuleEnd]";
31
return "";
32     }
33 }
34
Popular Tags