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