14ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
24fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy/*
34fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  Copyright 2004 the mime4j project
44fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *
54fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  Licensed under the Apache License, Version 2.0 (the "License");
64fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  you may not use this file except in compliance with the License.
74fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  You may obtain a copy of the License at
84fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *
94fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *      http://www.apache.org/licenses/LICENSE-2.0
104fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *
114fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  Unless required by applicable law or agreed to in writing, software
124fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  distributed under the License is distributed on an "AS IS" BASIS,
134fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
144fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  See the License for the specific language governing permissions and
154fa0a3295bcacbdcd6a9e7709cf17aa5adb90356Scott Kennedy *  limitations under the License.
164ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira */
174ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereirapackage org.apache.james.mime4j.field.contenttype.parser;
184ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
194ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira/**
204ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira * Describes the input token stream.
214ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira */
224ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
234ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereirapublic class Token {
244ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
254ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
264ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * An integer that describes the kind of this token.  This numbering
274ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * system is determined by JavaCCParser, and a table of these numbers is
284ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * stored in the file ...Constants.java.
294ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
304ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public int kind;
314ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
324ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
334ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * beginLine and beginColumn describe the position of the first character
344ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * of this token; endLine and endColumn describe the position of the
354ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * last character of this token.
364ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
374ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public int beginLine, beginColumn, endLine, endColumn;
384ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
394ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
404ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * The string image of the token.
414ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
424ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public String image;
434ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
444ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
454ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * A reference to the next regular (non-special) token from the input
464ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * stream.  If this is the last token from the input stream, or if the
474ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * token manager has not read tokens beyond this one, this field is
484ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * set to null.  This is true only if this token is also a regular
494ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * token.  Otherwise, see below for a description of the contents of
504ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * this field.
514ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
524ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public Token next;
534ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
544ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
554ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * This field is used to access special tokens that occur prior to this
564ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * token, but after the immediately preceding regular (non-special) token.
574ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * If there are no such special tokens, this field is set to null.
584ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * When there are more than one such special token, this field refers
594ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * to the last of these special tokens, which in turn refers to the next
604ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * previous special token through its specialToken field, and so on
614ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * until the first special token (whose specialToken field is null).
624ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * The next fields of special tokens refer to other special tokens that
634ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * immediately follow it (without an intervening regular token).  If there
644ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * is no such token, this field is null.
654ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
664ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public Token specialToken;
674ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
684ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
694ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * Returns the image.
704ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
714ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public String toString()
724ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  {
734ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira     return image;
744ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  }
754ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
764ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  /**
774ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * Returns a new Token object, by default. However, if you want, you
784ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * can create and return subclass objects based on the value of ofKind.
794ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * Simply add the cases to the switch for all those special cases.
804ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * For example, if you have a subclass of Token called IDToken that
814ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * you want to create if ofKind is ID, simlpy add something like :
824ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   *
834ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   *    case MyParserConstants.ID : return new IDToken();
844ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   *
854ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * to the following switch statement. Then you can cast matchedToken
864ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   * variable to the appropriate type and use it in your lexical actions.
874ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira   */
884ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  public static final Token newToken(int ofKind)
894ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  {
904ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira     switch(ofKind)
914ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira     {
924ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira       default : return new Token();
934ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira     }
944ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira  }
954ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira
964ebb916ddca5f59d4f854f104fca0de6e0dda706Mindy Pereira}
97