KickJava   Java API By Example, From Geeks To Geeks.

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


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 JavaCC productions.
27  */

28
29 public class NormalProduction {
30
31   /**
32    * The line and column number of the construct that corresponds
33    * most closely to this node.
34    */

35   public int line, column;
36
37   /**
38    * The NonTerminal nodes which refer to this production.
39    */

40   java.util.Vector JavaDoc parents = new java.util.Vector JavaDoc();
41
42   /**
43    * The access modifier of this production.
44    */

45   public String JavaDoc accessMod;
46
47   /**
48    * The name of the non-terminal of this production.
49    */

50   public String JavaDoc lhs;
51
52   /**
53    * The tokens that make up the return type of this production.
54    */

55   public java.util.Vector JavaDoc return_type_tokens = new java.util.Vector JavaDoc();
56
57   /**
58    * The tokens that make up the parameters of this production.
59    */

60   public java.util.Vector JavaDoc parameter_list_tokens = new java.util.Vector JavaDoc();
61
62   /**
63    * Each entry in this vector is a vector of tokens that represents an
64    * exception in the throws list of this production. This list does not
65    * include ParseException which is always thrown.
66    */

67   public java.util.Vector JavaDoc throws_list = new java.util.Vector JavaDoc();
68
69   /**
70    * The RHS of this production. Not used for JavaCodeProduction.
71    */

72   public Expansion expansion;
73
74   /**
75    * This boolean flag is true if this production can expand to empty.
76    */

77   boolean emptyPossible = false;
78
79   /**
80    * A list of all non-terminals that this one can expand to without
81    * having to consume any tokens. Also an index that shows how many
82    * pointers exist.
83    */

84   NormalProduction[] leftExpansions = new NormalProduction[10];
85   int leIndex = 0;
86
87   /**
88    * The following variable is used to maintain state information for the
89    * left-recursion determination algorithm: It is initialized to 0, and
90    * set to -1 if this node has been visited in a pre-order walk, and then
91    * it is set to 1 if the pre-order walk of the whole graph from this
92    * node has been traversed. i.e., -1 indicates partially processed,
93    * and 1 indicates fully processed.
94    */

95   int walkStatus = 0;
96
97   /**
98    * The first and last tokens from the input stream that represent this
99    * production.
100    */

101   public Token firstToken, lastToken;
102
103 }
104
Popular Tags