KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javacc > parser > Lookahead


1 /*
2  * Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3  * California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has
4  * intellectual property rights relating to technology embodied in the product
5  * that is described in this document. In particular, and without limitation,
6  * these intellectual property rights may include one or more of the U.S.
7  * patents listed at http://www.sun.com/patents and one or more additional
8  * patents or pending patent applications in the U.S. and in other countries.
9  * U.S. Government Rights - Commercial software. Government users are subject
10  * to the Sun Microsystems, Inc. standard license agreement and applicable
11  * provisions of the FAR and its supplements. Use is subject to license terms.
12  * Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
13  * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. This
14  * product is covered and controlled by U.S. Export Control laws and may be
15  * subject to the export or import laws in other countries. Nuclear, missile,
16  * chemical biological weapons or nuclear maritime end uses or end users,
17  * whether direct or indirect, are strictly prohibited. Export or reexport
18  * to countries subject to U.S. embargo or to entities identified on U.S.
19  * export exclusion lists, including, but not limited to, the denied persons
20  * and specially designated nationals lists is strictly prohibited.
21  */

22
23 package org.javacc.parser;
24
25 /**
26  * Describes lookahead rule for a particular expansion or expansion
27  * sequence (See Sequence.java). In case this describes the lookahead
28  * rule for a single expansion unit, then a sequence is created with
29  * this node as the first element, and the expansion unit as the second
30  * and last element.
31  */

32
33 public class Lookahead extends Expansion {
34
35   /**
36    * Contains the list of tokens that make up the semantic lookahead
37    * if any. If this node represents a different kind of lookahead (other
38    * than semantic lookahead), then this vector contains nothing. If
39    * this vector contains something, then it is the boolean expression
40    * that forms the semantic lookahead. In this case, the following
41    * fields "amount" and "la_expansion" are ignored.
42    */

43   public java.util.Vector JavaDoc action_tokens = new java.util.Vector JavaDoc();
44
45   /**
46    * The lookahead amount. Its default value essentially gives us
47    * infinite lookahead.
48    */

49   public int amount = Integer.MAX_VALUE;
50
51   /**
52    * The expansion used to determine whether or not to choose the
53    * corresponding parse option. This expansion is parsed upto
54    * "amount" tokens of lookahead or until a complete match for it
55    * is found. Usually, this is the same as the expansion to be
56    * parsed.
57    */

58   public Expansion la_expansion;
59
60   /**
61    * Is set to true if this is an explicit lookahead specification.
62    */

63   public boolean isExplicit;
64
65 }
66
Popular Tags