01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10: /* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
11: package de.uka.ilkd.key.casetool.together.patterns.HelperClasses.MyParser;
12:
13: /**
14: * Describes the input token stream.
15: */
16:
17: public class Token {
18:
19: /**
20: * An integer that describes the kind of this token. This numbering
21: * system is determined by JavaCCParser, and a table of these numbers is
22: * stored in the file ...Constants.java.
23: */
24: public int kind;
25:
26: /**
27: * beginLine and beginColumn describe the position of the first character
28: * of this token; endLine and endColumn describe the position of the
29: * last character of this token.
30: */
31: public int beginLine, beginColumn, endLine, endColumn;
32:
33: /**
34: * The string image of the token.
35: */
36: public String image;
37:
38: /**
39: * A reference to the next regular (non-special) token from the input
40: * stream. If this is the last token from the input stream, or if the
41: * token manager has not read tokens beyond this one, this field is
42: * set to null. This is true only if this token is also a regular
43: * token. Otherwise, see below for a description of the contents of
44: * this field.
45: */
46: public Token next;
47:
48: /**
49: * This field is used to access special tokens that occur prior to this
50: * token, but after the immediately preceding regular (non-special) token.
51: * If there are no such special tokens, this field is set to null.
52: * When there are more than one such special token, this field refers
53: * to the last of these special tokens, which in turn refers to the next
54: * previous special token through its specialToken field, and so on
55: * until the first special token (whose specialToken field is null).
56: * The next fields of special tokens refer to other special tokens that
57: * immediately follow it (without an intervening regular token). If there
58: * is no such token, this field is null.
59: */
60: public Token specialToken;
61:
62: /**
63: * Returns the image.
64: */
65: public final String toString() {
66: return image;
67: }
68:
69: /**
70: * Returns a new Token object, by default. However, if you want, you
71: * can create and return subclass objects based on the value of ofKind.
72: * Simply add the cases to the switch for all those special cases.
73: * For example, if you have a subclass of Token called IDToken that
74: * you want to create if ofKind is ID, simlpy add something like :
75: *
76: * case MyParserConstants.ID : return new IDToken();
77: *
78: * to the following switch statement. Then you can cast matchedToken
79: * variable to the appropriate type and use it in your lexical actions.
80: */
81: public static final Token newToken(int ofKind) {
82: switch (ofKind) {
83: default:
84: return new Token();
85: }
86: }
87:
88: }
|