KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > parsec > LookaheadParser


1 /**
2  *
3  */

4 package jfun.parsec;
5
6 final class LookaheadParser<R> extends Parser<R> {
7   private final Parser<R> p;
8
9   private final int toknum;
10
11   LookaheadParser(String JavaDoc n, Parser<R> p, int toknum) {
12     super(n);
13     this.p = p;
14     this.toknum = toknum;
15   }
16
17   boolean apply(final ParseContext ctxt) {
18     return p.parse(ctxt, toknum);
19   }
20
21   boolean apply(final ParseContext ctxt, final int la) {
22     return p.parse(ctxt, la);
23   }
24 }
Popular Tags