KickJava   Java API By Example, From Geeks To Geeks.

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


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 the various regular expression productions.
27  */

28
29 public class TokenProduction {
30
31   /**
32    * Definitions of constants that identify the kind of regular
33    * expression production this is.
34    */

35   public static final int TOKEN = 0,
36                           SKIP = 1,
37                           MORE = 2,
38                           SPECIAL = 3;
39
40   /**
41    * The image of the above constants.
42    */

43   public static final String JavaDoc[] kindImage = {
44     "TOKEN", "SKIP", "MORE", "SPECIAL"
45   };
46
47   /**
48    * The starting line and column of this token production.
49    */

50   public int line, column;
51
52   /**
53    * The states in which this regular expression production exists. If
54    * this array is null, then "<*>" has been specified and this regular
55    * expression exists in all states. However, this null value is
56    * replaced by a String array that includes all lexical state names
57    * during the semanticization phase.
58    */

59   public String JavaDoc[] lexStates;
60
61   /**
62    * The kind of this token production - TOKEN, SKIP, MORE, or SPECIAL.
63    */

64   public int kind;
65
66   /**
67    * The list of regular expression specifications that comprise this
68    * production. Each entry is a "RegExprSpec".
69    */

70   public java.util.Vector JavaDoc respecs = new java.util.Vector JavaDoc();
71
72   /**
73    * This is true if this corresponds to a production that actually
74    * appears in the input grammar. Otherwise (if this is created to
75    * describe a regular expression that is part of the BNF) this is set
76    * to false.
77    */

78   public boolean isExplicit = true;
79
80   /**
81    * This is true if case is to be ignored within the regular expressions
82    * of this token production.
83    */

84   public boolean ignoreCase = false;
85
86   /**
87    * The first and last tokens from the input stream that represent this
88    * production.
89    */

90   public Token firstToken, lastToken;
91
92 }
93
Popular Tags