KickJava   Java API By Example, From Geeks To Geeks.

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


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 regular expressions.
27  */

28
29 abstract public class RegularExpression extends Expansion {
30
31   /**
32    * The label of the regular expression (if any). If no label is
33    * present, this is set to "".
34    */

35   public String JavaDoc label = "";
36
37   /**
38    * The ordinal value assigned to the regular expression. It is
39    * used for internal processing and passing information between
40    * the parser and the lexical analyzer.
41    */

42   int ordinal;
43
44   /**
45    * The LHS to which the token value of the regular expression
46    * is assigned. In case there is no LHS, then the vector
47    * remains empty.
48    */

49   public java.util.Vector JavaDoc lhsTokens = new java.util.Vector JavaDoc();
50
51   /**
52     * We now allow qualified access to token members. Store it here.
53    */

54   public Token rhsToken;
55
56   /**
57    * This flag is set if the regular expression has a label prefixed
58    * with the # symbol - this indicates that the purpose of the regular
59    * expression is solely for defining other regular expressions.
60    */

61   public boolean private_rexp = false;
62
63   /**
64    * If this is a top-level regular expression (nested directly
65    * within a TokenProduction), then this field point to that
66    * TokenProduction object.
67    */

68   public TokenProduction tpContext = null;
69
70   abstract public Nfa GenerateNfa(boolean ignoreCase);
71
72   public boolean CanMatchAnyChar()
73   {
74      return false;
75   }
76
77   /**
78    * The following variable is used to maintain state information for the
79    * loop determination algorithm: It is initialized to 0, and
80    * set to -1 if this node has been visited in a pre-order walk, and then
81    * it is set to 1 if the pre-order walk of the whole graph from this
82    * node has been traversed. i.e., -1 indicates partially processed,
83    * and 1 indicates fully processed.
84    */

85   int walkStatus = 0;
86
87 }
88
Popular Tags