Clover coverage report - Code Coverage for hivemind release 1.0-beta-1
Coverage timestamp: Sat Jul 3 2004 09:41:37 EDT
file stats: LOC: 97   Methods: 0
NCLOC: 19   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
Token.java - - - -
coverage
 1   
 /* Generated By:JavaCC: Do not edit this line. Token.java Version 2.1 */
 2   
 //  Copyright 2004 The Apache Software Foundation
 3   
 //
 4   
 // Licensed under the Apache License, Version 2.0 (the "License");
 5   
 // you may not use this file except in compliance with the License.
 6   
 // You may obtain a copy of the License at
 7   
 //
 8   
 //     http://www.apache.org/licenses/LICENSE-2.0
 9   
 //
 10   
 // Unless required by applicable law or agreed to in writing, software
 11   
 // distributed under the License is distributed on an "AS IS" BASIS,
 12   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13   
 // See the License for the specific language governing permissions and
 14   
 // limitations under the License.
 15   
 
 16   
 ///CLOVER:OFF
 17   
 package org.apache.hivemind.sdl.parser;
 18   
 
 19   
 /**
 20   
  * Describes the input token stream.
 21   
  */
 22   
 
 23   
 public class Token {
 24   
 
 25   
   /**
 26   
    * An integer that describes the kind of this token.  This numbering
 27   
    * system is determined by JavaCCParser, and a table of these numbers is
 28   
    * stored in the file ...Constants.java.
 29   
    */
 30   
   public int kind;
 31   
 
 32   
   /**
 33   
    * beginLine and beginColumn describe the position of the first character
 34   
    * of this token; endLine and endColumn describe the position of the
 35   
    * last character of this token.
 36   
    */
 37   
   public int beginLine, beginColumn, endLine, endColumn;
 38   
 
 39   
   /**
 40   
    * The string image of the token.
 41   
    */
 42   
   public String image;
 43   
 
 44   
   /**
 45   
    * A reference to the next regular (non-special) token from the input
 46   
    * stream.  If this is the last token from the input stream, or if the
 47   
    * token manager has not read tokens beyond this one, this field is
 48   
    * set to null.  This is true only if this token is also a regular
 49   
    * token.  Otherwise, see below for a description of the contents of
 50   
    * this field.
 51   
    */
 52   
   public Token next;
 53   
 
 54   
   /**
 55   
    * This field is used to access special tokens that occur prior to this
 56   
    * token, but after the immediately preceding regular (non-special) token.
 57   
    * If there are no such special tokens, this field is set to null.
 58   
    * When there are more than one such special token, this field refers
 59   
    * to the last of these special tokens, which in turn refers to the next
 60   
    * previous special token through its specialToken field, and so on
 61   
    * until the first special token (whose specialToken field is null).
 62   
    * The next fields of special tokens refer to other special tokens that
 63   
    * immediately follow it (without an intervening regular token).  If there
 64   
    * is no such token, this field is null.
 65   
    */
 66   
   public Token specialToken;
 67   
 
 68   
   /**
 69   
    * Returns the image.
 70   
    */
 71   
   public final String toString()
 72   
   {
 73   
      return image;
 74   
   }
 75   
 
 76   
   /**
 77   
    * Returns a new Token object, by default. However, if you want, you
 78   
    * can create and return subclass objects based on the value of ofKind.
 79   
    * Simply add the cases to the switch for all those special cases.
 80   
    * For example, if you have a subclass of Token called IDToken that
 81   
    * you want to create if ofKind is ID, simlpy add something like :
 82   
    *
 83   
    *    case MyParserConstants.ID : return new IDToken();
 84   
    *
 85   
    * to the following switch statement. Then you can cast matchedToken
 86   
    * variable to the appropriate type and use it in your lexical actions.
 87   
    */
 88   
   public static final Token newToken(int ofKind)
 89   
   {
 90   
      switch(ofKind)
 91   
      {
 92   
        default : return new Token();
 93   
      }
 94   
   }
 95   
 
 96   
 }
 97