Coverage Report - org.webslinger.json.Token
 
Classes in this File Line Coverage Branch Coverage Complexity
Token
80%
4/5
100%
1/1
1
 
 1  
 /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
 2  
 package org.webslinger.json;
 3  
 
 4  
 import org.webslinger.javacc.GenericToken;
 5  
 
 6  
 /**
 7  
  * Describes the input token stream.
 8  
  */
 9  
 
 10  1245
 public class Token extends GenericToken {
 11  
 
 12  
   /**
 13  
    * A reference to the next regular (non-special) token from the input
 14  
    * stream.  If this is the last token from the input stream, or if the
 15  
    * token manager has not read tokens beyond this one, this field is
 16  
    * set to null.  This is true only if this token is also a regular
 17  
    * token.  Otherwise, see below for a description of the contents of
 18  
    * this field.
 19  
    */
 20  
   public Token next;
 21  
 
 22  
   /**
 23  
    * This field is used to access special tokens that occur prior to this
 24  
    * token, but after the immediately preceding regular (non-special) token.
 25  
    * If there are no such special tokens, this field is set to null.
 26  
    * When there are more than one such special token, this field refers
 27  
    * to the last of these special tokens, which in turn refers to the next
 28  
    * previous special token through its specialToken field, and so on
 29  
    * until the first special token (whose specialToken field is null).
 30  
    * The next fields of special tokens refer to other special tokens that
 31  
    * immediately follow it (without an intervening regular token).  If there
 32  
    * is no such token, this field is null.
 33  
    */
 34  
   public Token specialToken;
 35  
 
 36  
   public GenericToken getNextToken() {
 37  53
       return next;
 38  
   }
 39  
 
 40  
   public GenericToken getSpecialToken() {
 41  0
       return specialToken;
 42  
   }
 43  
 
 44  
   /**
 45  
    * Returns a new Token object, by default. However, if you want, you
 46  
    * can create and return subclass objects based on the value of ofKind.
 47  
    * Simply add the cases to the switch for all those special cases.
 48  
    * For example, if you have a subclass of Token called IDToken that
 49  
    * you want to create if ofKind is ID, simlpy add something like :
 50  
    *
 51  
    *    case MyParserConstants.ID : return new IDToken();
 52  
    *
 53  
    * to the following switch statement. Then you can cast matchedToken
 54  
    * variable to the appropriate type and use it in your lexical actions.
 55  
    */
 56  
   public static final Token newToken(int ofKind)
 57  
   {
 58  216
      switch(ofKind)
 59  
      {
 60  216
        default : return new Token();
 61  
      }
 62  
   }
 63  
 }