View Javadoc
1   /* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
2   
3   /**
4    * Redistribution and use of this software and associated documentation ("Software"), with or
5    * without modification, are permitted provided that the following conditions are met:
6    *
7    * 1. Redistributions of source code must retain copyright statements and notices. Redistributions
8    * must also contain a copy of this document.
9    *
10   * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
11   * conditions and the following disclaimer in the documentation and/or other materials provided with
12   * the distribution.
13   *
14   * 3. The name "Exolab" must not be used to endorse or promote products derived from this Software
15   * without prior written permission of Intalio, Inc. For written permission, please contact
16   * info@exolab.org.
17   *
18   * 4. Products derived from this Software may not be called "Exolab" nor may "Exolab" appear in
19   * their names without prior written permission of Intalio, Inc. Exolab is a registered trademark of
20   * Intalio, Inc.
21   *
22   * 5. Due credit should be given to the Exolab Project (http://www.exolab.org/).
23   *
24   * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR
25   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTALIO, INC. OR ITS
27   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
31   * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32   *
33   * Copyright 2000 (C) Intalio Inc. All Rights Reserved.
34   *
35   * $Id$
36   */
37  
38  package org.exolab.castor.xml.dtd.parser;
39  
40  /**
41   * Describes the input token stream.
42   * 
43   * @author Generated automatically by <b>JavaCC</b>
44   * @version Version 0.7pre3
45   */
46  public class Token {
47  
48    /**
49     * An integer that describes the kind of this token. This numbering system is determined by
50     * JavaCCParser, and a table of these numbers is stored in the file ...Constants.java.
51     */
52    public int kind;
53  
54    /**
55     * beginLine and beginColumn describe the position of the first character of this token; endLine
56     * and endColumn describe the position of the last character of this token.
57     */
58    public int beginLine, beginColumn, endLine, endColumn;
59  
60    /**
61     * The string image of the token.
62     */
63    public String image;
64  
65    /**
66     * A reference to the next regular (non-special) token from the input stream. If this is the last
67     * token from the input stream, or if the token manager has not read tokens beyond this one, this
68     * field is set to null. This is true only if this token is also a regular token. Otherwise, see
69     * below for a description of the contents of this field.
70     */
71    public Token next;
72  
73    /**
74     * This field is used to access special tokens that occur prior to this token, but after the
75     * immediately preceding regular (non-special) token. If there are no such special tokens, this
76     * field is set to null. When there are more than one such special token, this field refers to the
77     * last of these special tokens, which in turn refers to the next previous special token through
78     * its specialToken field, and so on until the first special token (whose specialToken field is
79     * null). The next fields of special tokens refer to other special tokens that immediately follow
80     * it (without an intervening regular token). If there is no such token, this field is null.
81     */
82    public Token specialToken;
83  
84    /**
85     * Returns the image.
86     */
87    public final String toString() {
88      return image;
89    }
90  
91    /**
92     * Returns a new Token object, by default. However, if you want, you can create and return
93     * subclass objects based on the value of ofKind. Simply add the cases to the switch for all those
94     * special cases. For example, if you have a subclass of Token called IDToken that you want to
95     * create if ofKind is ID, simlpy add something like :
96     *
97     * case MyParserConstants.ID : return new IDToken();
98     *
99     * to the following switch statement. Then you can cast matchedToken variable to the appropriate
100    * type and use it in your lexical actions.
101    */
102   public static final Token newToken(int ofKind) {
103     switch (ofKind) {
104       default:
105         return new Token();
106     }
107   }
108 
109 }