PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/serde/src/java/org/apache/hadoop/hive/serde2/dynamic_type/Token.java

#
Java | 78 lines | 18 code | 10 blank | 50 comment | 1 complexity | 4e0a57bf9b24c8b8ad3ae50bc3cca732 MD5 | raw file
 1/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
 2package org.apache.hadoop.hive.serde2.dynamic_type;
 3
 4/**
 5 * Describes the input token stream.
 6 */
 7
 8public class Token {
 9
10  /**
11   * An integer that describes the kind of this token. This numbering system is
12   * determined by JavaCCParser, and a table of these numbers is stored in the
13   * file ...Constants.java.
14   */
15  public int kind;
16
17  /**
18   * beginLine and beginColumn describe the position of the first character of
19   * this token; endLine and endColumn describe the position of the last
20   * character of this token.
21   */
22  public int beginLine, beginColumn, endLine, endColumn;
23
24  /**
25   * The string image of the token.
26   */
27  public String image;
28
29  /**
30   * A reference to the next regular (non-special) token from the input stream.
31   * If this is the last token from the input stream, or if the token manager
32   * has not read tokens beyond this one, this field is set to null. This is
33   * true only if this token is also a regular token. Otherwise, see below for a
34   * description of the contents of this field.
35   */
36  public Token next;
37
38  /**
39   * This field is used to access special tokens that occur prior to this token,
40   * but after the immediately preceding regular (non-special) token. If there
41   * are no such special tokens, this field is set to null. When there are more
42   * than one such special token, this field refers to the last of these special
43   * tokens, which in turn refers to the next previous special token through its
44   * specialToken field, and so on until the first special token (whose
45   * specialToken field is null). The next fields of special tokens refer to
46   * other special tokens that immediately follow it (without an intervening
47   * regular token). If there is no such token, this field is null.
48   */
49  public Token specialToken;
50
51  /**
52   * Returns the image.
53   */
54  @Override
55  public String toString() {
56    return image;
57  }
58
59  /**
60   * Returns a new Token object, by default. However, if you want, you can
61   * create and return subclass objects based on the value of ofKind. Simply add
62   * the cases to the switch for all those special cases. For example, if you
63   * have a subclass of Token called IDToken that you want to create if ofKind
64   * is ID, simlpy add something like :
65   * 
66   * case MyParserConstants.ID : return new IDToken();
67   * 
68   * to the following switch statement. Then you can cast matchedToken variable
69   * to the appropriate type and use it in your lexical actions.
70   */
71  public static final Token newToken(int ofKind) {
72    switch (ofKind) {
73    default:
74      return new Token();
75    }
76  }
77
78}