KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > IPAcl > Token


1 /*
2  * @(#)file Token.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 4.7
5  * @(#)date 08/02/09
6  *
7  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9  *
10  */

11
12
13 /* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
14 package com.sun.jmx.snmp.IPAcl;
15
16 /**
17  * Describes the input token stream.
18  */

19
20 class Token {
21
22   /**
23    * An integer that describes the kind of this token. This numbering
24    * system is determined by JavaCCParser, and a table of these numbers is
25    * stored in the file ...Constants.java.
26    */

27   public int kind;
28
29   /**
30    * beginLine and beginColumn describe the position of the first character
31    * of this token; endLine and endColumn describe the position of the
32    * last character of this token.
33    */

34   public int beginLine, beginColumn, endLine, endColumn;
35
36   /**
37    * The string image of the token.
38    */

39   public String JavaDoc image;
40
41   /**
42    * A reference to the next regular (non-special) token from the input
43    * stream. If this is the last token from the input stream, or if the
44    * token manager has not read tokens beyond this one, this field is
45    * set to null. This is true only if this token is also a regular
46    * token. Otherwise, see below for a description of the contents of
47    * this field.
48    */

49   public Token next;
50
51   /**
52    * This field is used to access special tokens that occur prior to this
53    * token, but after the immediately preceding regular (non-special) token.
54    * If there are no such special tokens, this field is set to null.
55    * When there are more than one such special token, this field refers
56    * to the last of these special tokens, which in turn refers to the next
57    * previous special token through its specialToken field, and so on
58    * until the first special token (whose specialToken field is null).
59    * The next fields of special tokens refer to other special tokens that
60    * immediately follow it (without an intervening regular token). If there
61    * is no such token, this field is null.
62    */

63   public Token specialToken;
64
65   /**
66    * Returns the image.
67    */

68   public final String JavaDoc toString()
69   {
70      return image;
71   }
72
73   /**
74    * Returns a new Token object, by default. However, if you want, you
75    * can create and return subclass objects based on the value of ofKind.
76    * Simply add the cases to the switch for all those special cases.
77    * For example, if you have a subclass of Token called IDToken that
78    * you want to create if ofKind is ID, simlpy add something like :
79    *
80    * case MyParserConstants.ID : return new IDToken();
81    *
82    * to the following switch statement. Then you can cast matchedToken
83    * variable to the appropriate type and use it in your lexical actions.
84    */

85   public static final Token newToken(int ofKind)
86   {
87      switch(ofKind)
88      {
89        default : return new Token();
90      }
91   }
92
93 }
94
Popular Tags