00001 package edu.ksu.cis.bandera.abstraction.predicate.parser; 00002 00003 /* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */ 00004 /** 00005 * Describes the input token stream. 00006 */ 00007 public class Token { 00008 00009 /** 00010 * An integer that describes the kind of this token. This numbering 00011 * system is determined by JavaCCParser, and a table of these numbers is 00012 * stored in the file ...Constants.java. 00013 */ 00014 public int kind; 00015 00016 /** 00017 * beginLine and beginColumn describe the position of the first character 00018 * of this token; endLine and endColumn describe the position of the 00019 * last character of this token. 00020 */ 00021 public int beginLine, beginColumn, endLine, endColumn; 00022 00023 /** 00024 * The string image of the token. 00025 */ 00026 public String image; 00027 00028 /** 00029 * A reference to the next regular (non-special) token from the input 00030 * stream. If this is the last token from the input stream, or if the 00031 * token manager has not read tokens beyond this one, this field is 00032 * set to null. This is true only if this token is also a regular 00033 * token. Otherwise, see below for a description of the contents of 00034 * this field. 00035 */ 00036 public Token next; 00037 00038 /** 00039 * This field is used to access special tokens that occur prior to this 00040 * token, but after the immediately preceding regular (non-special) token. 00041 * If there are no such special tokens, this field is set to null. 00042 * When there are more than one such special token, this field refers 00043 * to the last of these special tokens, which in turn refers to the next 00044 * previous special token through its specialToken field, and so on 00045 * until the first special token (whose specialToken field is null). 00046 * The next fields of special tokens refer to other special tokens that 00047 * immediately follow it (without an intervening regular token). If there 00048 * is no such token, this field is null. 00049 */ 00050 public Token specialToken; 00051 00052 /** 00053 * Returns a new Token object, by default. However, if you want, you 00054 * can create and return subclass objects based on the value of ofKind. 00055 * Simply add the cases to the switch for all those special cases. 00056 * For example, if you have a subclass of Token called IDToken that 00057 * you want to create if ofKind is ID, simlpy add something like : 00058 * 00059 * case MyParserConstants.ID : return new IDToken(); 00060 * 00061 * to the following switch statement. Then you can cast matchedToken 00062 * variable to the appropriate type and use it in your lexical actions. 00063 */ 00064 public static final Token newToken(int ofKind) 00065 { 00066 switch(ofKind) 00067 { 00068 default : return new Token(); 00069 } 00070 } 00071 /** 00072 * Returns the image. 00073 */ 00074 public final String toString() 00075 { 00076 return image; 00077 } 00078 }