/* Generated By:JJTree&JavaCC: Do not edit this line. SMARTSParserTokenManager.java */
/* $RCSfile$
 * $Author: $
 * $Date: $
 * $Revision: $
 *
 * Copyright (C) 2004-2007  The Chemistry Development Kit (CDK) project
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 * (or see http://www.gnu.org/copyleft/lesser.html)
 */

package org.openscience.cdk.smiles.smarts.parser;

/** 
*
* @cdk.module smarts 
*/
import java.io.StringReader;
import java.util.Stack;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.isomorphism.matchers.QueryAtomContainer;
import org.openscience.cdk.tools.LoggingTool;

public class SMARTSParserTokenManager implements SMARTSParserConstants
{
  public  java.io.PrintStream debugStream = System.out;
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2)
{
   switch (pos)
   {
      default :
         return -1;
   }
}
private final int jjStartNfa_0(int pos, long active0, long active1, long active2)
{
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1);
}
private final int jjStopAtPos(int pos, int kind)
{
   jjmatchedKind = kind;
   jjmatchedPos = pos;
   return pos + 1;
}
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
{
   jjmatchedKind = kind;
   jjmatchedPos = pos;
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) { return pos + 1; }
   return jjMoveNfa_0(state, pos + 1);
}
private final int jjMoveStringLiteralDfa0_0()
{
   switch(curChar)
   {
      case 33:
         return jjStopAtPos(0, 5);
      case 35:
         jjmatchedKind = 12;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x200L);
      case 36:
         return jjStopAtPos(0, 139);
      case 38:
         return jjStopAtPos(0, 3);
      case 40:
         return jjStopAtPos(0, 140);
      case 41:
         return jjStopAtPos(0, 141);
      case 42:
         return jjStopAtPos(0, 126);
      case 43:
         jjmatchedKind = 149;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0xfe0000000L);
      case 44:
         return jjStopAtPos(0, 4);
      case 45:
         jjmatchedKind = 6;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x1fc00000L);
      case 46:
         return jjStopAtPos(0, 148);
      case 47:
         jjmatchedKind = 7;
         return jjMoveStringLiteralDfa1_0(0x200L, 0x0L, 0x0L);
      case 58:
         return jjStopAtPos(0, 13);
      case 59:
         return jjStopAtPos(0, 2);
      case 61:
         return jjStopAtPos(0, 11);
      case 62:
         jjmatchedKind = 147;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x40000L);
      case 63:
         return jjStopAtPos(0, 144);
      case 64:
         jjmatchedKind = 15;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x0L, 0x1000000000L);
      case 65:
         jjmatchedKind = 129;
         return jjMoveStringLiteralDfa1_0(0x80010800000000L, 0x4220800020L, 0x0L);
      case 66:
         jjmatchedKind = 27;
         return jjMoveStringLiteralDfa1_0(0x200000004000000L, 0x10008004000L, 0x0L);
      case 67:
         jjmatchedKind = 28;
         return jjMoveStringLiteralDfa1_0(0xa448000000000L, 0x1028000002040L, 0x0L);
      case 68:
         jjmatchedKind = 130;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x80000000000000L, 0x0L);
      case 69:
         return jjMoveStringLiteralDfa1_0(0x0L, 0x210040000000000L, 0x0L);
      case 70:
         jjmatchedKind = 31;
         return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x80080000000L, 0x0L);
      case 71:
         jjmatchedKind = 136;
         return jjMoveStringLiteralDfa1_0(0x60000000000000L, 0x20000000000000L, 0x0L);
      case 72:
         jjmatchedKind = 23;
         return jjMoveStringLiteralDfa1_0(0x1000000L, 0x100000001010000L, 0x0L);
      case 73:
         jjmatchedKind = 75;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x200080L, 0x0L);
      case 75:
         jjmatchedKind = 41;
         return jjMoveStringLiteralDfa1_0(0x400000000000000L, 0x0L, 0x0L);
      case 76:
         return jjMoveStringLiteralDfa1_0(0x2000000L, 0x1000400000008000L, 0x0L);
      case 77:
         return jjMoveStringLiteralDfa1_0(0x800400000000L, 0x100000000001L, 0x0L);
      case 78:
         jjmatchedKind = 29;
         return jjMoveStringLiteralDfa1_0(0x8004000300000000L, 0x2a00000000000L, 0x0L);
      case 79:
         jjmatchedKind = 30;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x100000L, 0x0L);
      case 80:
         jjmatchedKind = 37;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x2004002814400010L, 0x0L);
      case 82:
         jjmatchedKind = 131;
         return jjMoveStringLiteralDfa1_0(0x800000000000000L, 0x14008000cL, 0x0L);
      case 83:
         jjmatchedKind = 38;
         return jjMoveStringLiteralDfa1_0(0x1100081000000000L, 0x8000000000300L, 0x0L);
      case 84:
         return jjMoveStringLiteralDfa1_0(0x100000000000L, 0x440000402020402L, 0x0L);
      case 85:
         return jjStopAtPos(0, 100);
      case 86:
         return jjStopAtPos(0, 45);
      case 87:
         return jjStopAtPos(0, 82);
      case 88:
         jjmatchedKind = 134;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x1000L, 0x0L);
      case 89:
         jjmatchedKind = 61;
         return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000000000L, 0x0L);
      case 90:
         return jjMoveStringLiteralDfa1_0(0x4010000000000000L, 0x0L, 0x0L);
      case 91:
         return jjStopAtPos(0, 142);
      case 92:
         jjmatchedKind = 8;
         return jjMoveStringLiteralDfa1_0(0x400L, 0x0L, 0x0L);
      case 93:
         return jjStopAtPos(0, 143);
      case 94:
         return jjStopAtPos(0, 138);
      case 97:
         jjmatchedKind = 128;
         return jjMoveStringLiteralDfa1_0(0x200000L, 0x0L, 0x0L);
      case 99:
         return jjStopAtPos(0, 16);
      case 104:
         return jjStopAtPos(0, 127);
      case 110:
         return jjStopAtPos(0, 17);
      case 111:
         return jjStopAtPos(0, 18);
      case 112:
         return jjStopAtPos(0, 20);
      case 114:
         return jjStopAtPos(0, 132);
      case 115:
         jjmatchedKind = 19;
         return jjMoveStringLiteralDfa1_0(0x400000L, 0x0L, 0x0L);
      case 118:
         return jjStopAtPos(0, 133);
      case 120:
         return jjStopAtPos(0, 135);
      case 126:
         return jjStopAtPos(0, 14);
      default :
         return jjMoveNfa_0(0, 0);
   }
}
private final int jjMoveStringLiteralDfa1_0(long active0, long active1, long active2)
{
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(0, active0, active1, active2);
      return 1;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x20000000L) != 0L)
         {
            jjmatchedKind = 157;
            jjmatchedPos = 1;
         }
         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0xfc0000000L);
      case 45:
         if ((active2 & 0x400000L) != 0L)
         {
            jjmatchedKind = 150;
            jjmatchedPos = 1;
         }
         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0L, active2, 0x1f800000L);
      case 62:
         if ((active2 & 0x40000L) != 0L)
            return jjStopAtPos(1, 146);
         break;
      case 63:
         if ((active0 & 0x200L) != 0L)
            return jjStopAtPos(1, 9);
         else if ((active0 & 0x400L) != 0L)
            return jjStopAtPos(1, 10);
         break;
      case 64:
         if ((active2 & 0x1000000000L) != 0L)
            return jjStopAtPos(1, 164);
         break;
      case 88:
         if ((active2 & 0x200L) != 0L)
            return jjStopAtPos(1, 137);
         break;
      case 97:
         if ((active0 & 0x200000000L) != 0L)
            return jjStopAtPos(1, 33);
         else if ((active0 & 0x40000000000L) != 0L)
            return jjStopAtPos(1, 42);
         else if ((active0 & 0x20000000000000L) != 0L)
            return jjStopAtPos(1, 53);
         else if ((active1 & 0x4000L) != 0L)
            return jjStopAtPos(1, 78);
         else if ((active1 & 0x8000L) != 0L)
            return jjStopAtPos(1, 79);
         else if ((active1 & 0x20000L) != 0L)
            return jjStopAtPos(1, 81);
         else if ((active1 & 0x100000000L) != 0L)
            return jjStopAtPos(1, 96);
         else if ((active1 & 0x800000000L) != 0L)
            return jjStopAtPos(1, 99);
         break;
      case 98:
         if ((active0 & 0x800000000000000L) != 0L)
            return jjStopAtPos(1, 59);
         else if ((active0 & 0x8000000000000000L) != 0L)
            return jjStopAtPos(1, 63);
         else if ((active1 & 0x200L) != 0L)
            return jjStopAtPos(1, 73);
         else if ((active1 & 0x4000000L) != 0L)
            return jjStopAtPos(1, 90);
         else if ((active1 & 0x40000000000000L) != 0L)
            return jjStopAtPos(1, 118);
         else if ((active1 & 0x800000000000000L) != 0L)
            return jjStopAtPos(1, 123);
         break;
      case 99:
         if ((active0 & 0x80000000000L) != 0L)
            return jjStopAtPos(1, 43);
         else if ((active1 & 0x2L) != 0L)
            return jjStopAtPos(1, 65);
         else if ((active1 & 0x200000000L) != 0L)
            return jjStopAtPos(1, 97);
         break;
      case 100:
         if ((active1 & 0x10L) != 0L)
            return jjStopAtPos(1, 68);
         else if ((active1 & 0x40L) != 0L)
            return jjStopAtPos(1, 70);
         else if ((active1 & 0x100000000000L) != 0L)
            return jjStopAtPos(1, 108);
         else if ((active1 & 0x2000000000000L) != 0L)
            return jjStopAtPos(1, 113);
         else if ((active1 & 0x20000000000000L) != 0L)
            return jjStopAtPos(1, 117);
         break;
      case 101:
         if ((active0 & 0x400000L) != 0L)
            return jjStopAtPos(1, 22);
         else if ((active0 & 0x1000000L) != 0L)
            return jjStopAtPos(1, 24);
         else if ((active0 & 0x4000000L) != 0L)
            return jjStopAtPos(1, 26);
         else if ((active0 & 0x100000000L) != 0L)
            return jjStopAtPos(1, 32);
         else if ((active0 & 0x1000000000000L) != 0L)
            return jjStopAtPos(1, 48);
         else if ((active0 & 0x40000000000000L) != 0L)
            return jjStopAtPos(1, 54);
         else if ((active0 & 0x100000000000000L) != 0L)
            return jjStopAtPos(1, 56);
         else if ((active1 & 0x400L) != 0L)
            return jjStopAtPos(1, 74);
         else if ((active1 & 0x1000L) != 0L)
            return jjStopAtPos(1, 76);
         else if ((active1 & 0x80000L) != 0L)
            return jjStopAtPos(1, 83);
         else if ((active1 & 0x1000000000000L) != 0L)
            return jjStopAtPos(1, 112);
         break;
      case 102:
         if ((active1 & 0x10000L) != 0L)
            return jjStopAtPos(1, 80);
         else if ((active1 & 0x20000000000L) != 0L)
            return jjStopAtPos(1, 105);
         break;
      case 103:
         if ((active0 & 0x400000000L) != 0L)
            return jjStopAtPos(1, 34);
         else if ((active1 & 0x20L) != 0L)
            return jjStopAtPos(1, 69);
         else if ((active1 & 0x1000000L) != 0L)
            return jjStopAtPos(1, 88);
         break;
      case 104:
         if ((active1 & 0x8L) != 0L)
            return jjStopAtPos(1, 67);
         else if ((active1 & 0x400000000L) != 0L)
            return jjStopAtPos(1, 98);
         break;
      case 105:
         if ((active0 & 0x2000000L) != 0L)
            return jjStopAtPos(1, 25);
         else if ((active0 & 0x1000000000L) != 0L)
            return jjStopAtPos(1, 36);
         else if ((active0 & 0x100000000000L) != 0L)
            return jjStopAtPos(1, 44);
         else if ((active0 & 0x4000000000000L) != 0L)
            return jjStopAtPos(1, 50);
         else if ((active1 & 0x8000000L) != 0L)
            return jjStopAtPos(1, 91);
         break;
      case 107:
         if ((active1 & 0x10000000000L) != 0L)
            return jjStopAtPos(1, 104);
         break;
      case 108:
         if ((active0 & 0x800000000L) != 0L)
            return jjStopAtPos(1, 35);
         else if ((active0 & 0x8000000000L) != 0L)
            return jjStopAtPos(1, 39);
         else if ((active1 & 0x2000000L) != 0L)
            return jjStopAtPos(1, 89);
         break;
      case 109:
         if ((active1 & 0x4000000000L) != 0L)
            return jjStopAtPos(1, 102);
         else if ((active1 & 0x8000000000L) != 0L)
            return jjStopAtPos(1, 103);
         else if ((active1 & 0x80000000000L) != 0L)
            return jjStopAtPos(1, 107);
         else if ((active1 & 0x4000000000000L) != 0L)
            return jjStopAtPos(1, 114);
         else if ((active1 & 0x8000000000000L) != 0L)
            return jjStopAtPos(1, 115);
         else if ((active1 & 0x400000000000000L) != 0L)
            return jjStopAtPos(1, 122);
         break;
      case 110:
         if ((active0 & 0x800000000000L) != 0L)
            return jjStopAtPos(1, 47);
         else if ((active0 & 0x10000000000000L) != 0L)
            return jjStopAtPos(1, 52);
         else if ((active1 & 0x80L) != 0L)
            return jjStopAtPos(1, 71);
         else if ((active1 & 0x100L) != 0L)
            return jjStopAtPos(1, 72);
         else if ((active1 & 0x40000000L) != 0L)
            return jjStopAtPos(1, 94);
         break;
      case 111:
         if ((active0 & 0x2000000000000L) != 0L)
            return jjStopAtPos(1, 49);
         else if ((active1 & 0x1L) != 0L)
            return jjStopAtPos(1, 64);
         else if ((active1 & 0x10000000L) != 0L)
            return jjStopAtPos(1, 92);
         else if ((active1 & 0x200000000000L) != 0L)
            return jjStopAtPos(1, 109);
         else if ((active1 & 0x100000000000000L) != 0L)
            return jjStopAtPos(1, 120);
         break;
      case 112:
         if ((active1 & 0x800000000000L) != 0L)
            return jjStopAtPos(1, 111);
         break;
      case 114:
         if ((active0 & 0x10000000000L) != 0L)
            return jjStopAtPos(1, 40);
         else if ((active0 & 0x400000000000L) != 0L)
            return jjStopAtPos(1, 46);
         else if ((active0 & 0x200000000000000L) != 0L)
            return jjStopAtPos(1, 57);
         else if ((active0 & 0x400000000000000L) != 0L)
            return jjStopAtPos(1, 58);
         else if ((active0 & 0x1000000000000000L) != 0L)
            return jjStopAtPos(1, 60);
         else if ((active0 & 0x4000000000000000L) != 0L)
            return jjStopAtPos(1, 62);
         else if ((active1 & 0x200000L) != 0L)
            return jjStopAtPos(1, 85);
         else if ((active1 & 0x80000000L) != 0L)
            return jjStopAtPos(1, 95);
         else if ((active1 & 0x400000000000L) != 0L)
            return jjStopAtPos(1, 110);
         else if ((active1 & 0x200000000000000L) != 0L)
            return jjStopAtPos(1, 121);
         else if ((active1 & 0x2000000000000000L) != 0L)
            return jjStopAtPos(1, 125);
         break;
      case 115:
         if ((active0 & 0x200000L) != 0L)
            return jjStopAtPos(1, 21);
         else if ((active0 & 0x80000000000000L) != 0L)
            return jjStopAtPos(1, 55);
         else if ((active1 & 0x2000L) != 0L)
            return jjStopAtPos(1, 77);
         else if ((active1 & 0x100000L) != 0L)
            return jjStopAtPos(1, 84);
         else if ((active1 & 0x40000000000L) != 0L)
            return jjStopAtPos(1, 106);
         break;
      case 116:
         if ((active1 & 0x400000L) != 0L)
            return jjStopAtPos(1, 86);
         else if ((active1 & 0x20000000L) != 0L)
            return jjStopAtPos(1, 93);
         break;
      case 117:
         if ((active0 & 0x8000000000000L) != 0L)
            return jjStopAtPos(1, 51);
         else if ((active1 & 0x4L) != 0L)
            return jjStopAtPos(1, 66);
         else if ((active1 & 0x800000L) != 0L)
            return jjStopAtPos(1, 87);
         else if ((active1 & 0x2000000000L) != 0L)
            return jjStopAtPos(1, 101);
         else if ((active1 & 0x10000000000000L) != 0L)
            return jjStopAtPos(1, 116);
         else if ((active1 & 0x1000000000000000L) != 0L)
            return jjStopAtPos(1, 124);
         break;
      case 121:
         if ((active1 & 0x80000000000000L) != 0L)
            return jjStopAtPos(1, 119);
         break;
      default :
         break;
   }
   return jjStartNfa_0(0, active0, active1, active2);
}
private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1, long old2, long active2)
{
   if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L)
      return jjStartNfa_0(0, old0, old1, old2); 
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(1, 0L, 0L, active2);
      return 2;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x40000000L) != 0L)
         {
            jjmatchedKind = 158;
            jjmatchedPos = 2;
         }
         return jjMoveStringLiteralDfa3_0(active2, 0xf80000000L);
      case 45:
         if ((active2 & 0x800000L) != 0L)
         {
            jjmatchedKind = 151;
            jjmatchedPos = 2;
         }
         return jjMoveStringLiteralDfa3_0(active2, 0x1f000000L);
      default :
         break;
   }
   return jjStartNfa_0(1, 0L, 0L, active2);
}
private final int jjMoveStringLiteralDfa3_0(long old2, long active2)
{
   if (((active2 &= old2)) == 0L)
      return jjStartNfa_0(1, 0L, 0L, old2); 
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(2, 0L, 0L, active2);
      return 3;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x80000000L) != 0L)
         {
            jjmatchedKind = 159;
            jjmatchedPos = 3;
         }
         return jjMoveStringLiteralDfa4_0(active2, 0xf00000000L);
      case 45:
         if ((active2 & 0x1000000L) != 0L)
         {
            jjmatchedKind = 152;
            jjmatchedPos = 3;
         }
         return jjMoveStringLiteralDfa4_0(active2, 0x1e000000L);
      default :
         break;
   }
   return jjStartNfa_0(2, 0L, 0L, active2);
}
private final int jjMoveStringLiteralDfa4_0(long old2, long active2)
{
   if (((active2 &= old2)) == 0L)
      return jjStartNfa_0(2, 0L, 0L, old2); 
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(3, 0L, 0L, active2);
      return 4;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x100000000L) != 0L)
         {
            jjmatchedKind = 160;
            jjmatchedPos = 4;
         }
         return jjMoveStringLiteralDfa5_0(active2, 0xe00000000L);
      case 45:
         if ((active2 & 0x2000000L) != 0L)
         {
            jjmatchedKind = 153;
            jjmatchedPos = 4;
         }
         return jjMoveStringLiteralDfa5_0(active2, 0x1c000000L);
      default :
         break;
   }
   return jjStartNfa_0(3, 0L, 0L, active2);
}
private final int jjMoveStringLiteralDfa5_0(long old2, long active2)
{
   if (((active2 &= old2)) == 0L)
      return jjStartNfa_0(3, 0L, 0L, old2); 
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(4, 0L, 0L, active2);
      return 5;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x200000000L) != 0L)
         {
            jjmatchedKind = 161;
            jjmatchedPos = 5;
         }
         return jjMoveStringLiteralDfa6_0(active2, 0xc00000000L);
      case 45:
         if ((active2 & 0x4000000L) != 0L)
         {
            jjmatchedKind = 154;
            jjmatchedPos = 5;
         }
         return jjMoveStringLiteralDfa6_0(active2, 0x18000000L);
      default :
         break;
   }
   return jjStartNfa_0(4, 0L, 0L, active2);
}
private final int jjMoveStringLiteralDfa6_0(long old2, long active2)
{
   if (((active2 &= old2)) == 0L)
      return jjStartNfa_0(4, 0L, 0L, old2); 
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(5, 0L, 0L, active2);
      return 6;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x400000000L) != 0L)
         {
            jjmatchedKind = 162;
            jjmatchedPos = 6;
         }
         return jjMoveStringLiteralDfa7_0(active2, 0x800000000L);
      case 45:
         if ((active2 & 0x8000000L) != 0L)
         {
            jjmatchedKind = 155;
            jjmatchedPos = 6;
         }
         return jjMoveStringLiteralDfa7_0(active2, 0x10000000L);
      default :
         break;
   }
   return jjStartNfa_0(5, 0L, 0L, active2);
}
private final int jjMoveStringLiteralDfa7_0(long old2, long active2)
{
   if (((active2 &= old2)) == 0L)
      return jjStartNfa_0(5, 0L, 0L, old2); 
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(6, 0L, 0L, active2);
      return 7;
   }
   switch(curChar)
   {
      case 43:
         if ((active2 & 0x800000000L) != 0L)
            return jjStopAtPos(7, 163);
         break;
      case 45:
         if ((active2 & 0x10000000L) != 0L)
            return jjStopAtPos(7, 156);
         break;
      default :
         break;
   }
   return jjStartNfa_0(6, 0L, 0L, active2);
}
private final void jjCheckNAdd(int state)
{
   if (jjrounds[state] != jjround)
   {
      jjstateSet[jjnewStateCnt++] = state;
      jjrounds[state] = jjround;
   }
}
private final void jjAddStates(int start, int end)
{
   do {
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
   } while (start++ != end);
}
private final void jjCheckNAddTwoStates(int state1, int state2)
{
   jjCheckNAdd(state1);
   jjCheckNAdd(state2);
}
private final void jjCheckNAddStates(int start, int end)
{
   do {
      jjCheckNAdd(jjnextStates[start]);
   } while (start++ != end);
}
private final void jjCheckNAddStates(int start)
{
   jjCheckNAdd(jjnextStates[start]);
   jjCheckNAdd(jjnextStates[start + 1]);
}
private final int jjMoveNfa_0(int startState, int curPos)
{
   int[] nextStates;
   int startsAt = 0;
   jjnewStateCnt = 1;
   int i = 1;
   jjstateSet[0] = startState;
   int j, kind = 0x7fffffff;
   for (;;)
   {
      if (++jjround == 0x7fffffff)
         ReInitRounds();
      if (curChar < 64)
      {
         long l = 1L << curChar;
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               case 0:
                  if ((0x3ff000000000000L & l) != 0L)
                     kind = 145;
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else if (curChar < 128)
      {
         long l = 1L << (curChar & 077);
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               default : break;
            }
         } while(i != startsAt);
      }
      else
      {
         int i2 = (curChar & 0xff) >> 6;
         long l2 = 1L << (curChar & 077);
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               default : break;
            }
         } while(i != startsAt);
      }
      if (kind != 0x7fffffff)
      {
         jjmatchedKind = kind;
         jjmatchedPos = curPos;
         kind = 0x7fffffff;
      }
      ++curPos;
      if ((i = jjnewStateCnt) == (startsAt = 1 - (jjnewStateCnt = startsAt)))
         return curPos;
      try { curChar = input_stream.readChar(); }
      catch(java.io.IOException e) { return curPos; }
   }
}
static final int[] jjnextStates = {
};
public static final String[] jjstrLiteralImages = {
"", null, "\73", "\46", "\54", "\41", "\55", "\57", "\134", "\57\77", 
"\134\77", "\75", "\43", "\72", "\176", "\100", "\143", "\156", "\157", "\163", "\160", 
"\141\163", "\163\145", "\110", "\110\145", "\114\151", "\102\145", "\102", "\103", 
"\116", "\117", "\106", "\116\145", "\116\141", "\115\147", "\101\154", "\123\151", 
"\120", "\123", "\103\154", "\101\162", "\113", "\103\141", "\123\143", "\124\151", 
"\126", "\103\162", "\115\156", "\106\145", "\103\157", "\116\151", "\103\165", 
"\132\156", "\107\141", "\107\145", "\101\163", "\123\145", "\102\162", "\113\162", 
"\122\142", "\123\162", "\131", "\132\162", "\116\142", "\115\157", "\124\143", 
"\122\165", "\122\150", "\120\144", "\101\147", "\103\144", "\111\156", "\123\156", 
"\123\142", "\124\145", "\111", "\130\145", "\103\163", "\102\141", "\114\141", 
"\110\146", "\124\141", "\127", "\122\145", "\117\163", "\111\162", "\120\164", 
"\101\165", "\110\147", "\124\154", "\120\142", "\102\151", "\120\157", "\101\164", 
"\122\156", "\106\162", "\122\141", "\101\143", "\124\150", "\120\141", "\125", 
"\120\165", "\101\155", "\103\155", "\102\153", "\103\146", "\105\163", "\106\155", 
"\115\144", "\116\157", "\114\162", "\116\160", "\103\145", "\116\144", "\120\155", 
"\123\155", "\105\165", "\107\144", "\124\142", "\104\171", "\110\157", "\105\162", 
"\124\155", "\131\142", "\114\165", "\120\162", "\52", "\150", "\141", "\101", "\104", 
"\122", "\162", "\166", "\130", "\170", "\107", "\43\130", "\136", "\44", "\50", 
"\51", "\133", "\135", "\77", null, "\76\76", "\76", "\56", "\53", "\55\55", 
"\55\55\55", "\55\55\55\55", "\55\55\55\55\55", "\55\55\55\55\55\55", 
"\55\55\55\55\55\55\55", "\55\55\55\55\55\55\55\55", "\53\53", "\53\53\53", "\53\53\53\53", 
"\53\53\53\53\53", "\53\53\53\53\53\53", "\53\53\53\53\53\53\53", "\53\53\53\53\53\53\53\53", 
"\100\100", };
public static final String[] lexStateNames = {
   "DEFAULT", 
};
protected SimpleCharStream input_stream;
private final int[] jjrounds = new int[1];
private final int[] jjstateSet = new int[2];
protected char curChar;
public SMARTSParserTokenManager(SimpleCharStream stream)
{
   if (SimpleCharStream.staticFlag)
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
   input_stream = stream;
}
public SMARTSParserTokenManager(SimpleCharStream stream, int lexState)
{
   this(stream);
   SwitchTo(lexState);
}
public void ReInit(SimpleCharStream stream)
{
   jjmatchedPos = jjnewStateCnt = 0;
   curLexState = defaultLexState;
   input_stream = stream;
   ReInitRounds();
}
private final void ReInitRounds()
{
   int i;
   jjround = 0x80000001;
   for (i = 1; i-- > 0;)
      jjrounds[i] = 0x80000000;
}
public void ReInit(SimpleCharStream stream, int lexState)
{
   ReInit(stream);
   SwitchTo(lexState);
}
public void SwitchTo(int lexState)
{
   if (lexState >= 1 || lexState < 0)
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
   else
      curLexState = lexState;
}

protected Token jjFillToken()
{
   Token t = Token.newToken(jjmatchedKind);
   t.kind = jjmatchedKind;
   String im = jjstrLiteralImages[jjmatchedKind];
   t.image = (im == null) ? input_stream.GetImage() : im;
   t.beginLine = input_stream.getBeginLine();
   t.beginColumn = input_stream.getBeginColumn();
   t.endLine = input_stream.getEndLine();
   t.endColumn = input_stream.getEndColumn();
   return t;
}

int curLexState = 0;
int defaultLexState = 0;
int jjnewStateCnt;
int jjround;
int jjmatchedPos;
int jjmatchedKind;

public Token getNextToken() 
{
  int kind;
  Token specialToken = null;
  Token matchedToken;
  int curPos = 0;

  EOFLoop :
  for (;;)
  {   
   try   
   {     
      curChar = input_stream.BeginToken();
   }     
   catch(java.io.IOException e)
   {        
      jjmatchedKind = 0;
      matchedToken = jjFillToken();
      return matchedToken;
   }

   jjmatchedKind = 0x7fffffff;
   jjmatchedPos = 0;
   curPos = jjMoveStringLiteralDfa0_0();
   if (jjmatchedKind != 0x7fffffff)
   {
      if (jjmatchedPos + 1 < curPos)
         input_stream.backup(curPos - jjmatchedPos - 1);
         matchedToken = jjFillToken();
         return matchedToken;
   }
   int error_line = input_stream.getEndLine();
   int error_column = input_stream.getEndColumn();
   String error_after = null;
   boolean EOFSeen = false;
   try { input_stream.readChar(); input_stream.backup(1); }
   catch (java.io.IOException e1) {
      EOFSeen = true;
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
      if (curChar == '\n' || curChar == '\r') {
         error_line++;
         error_column = 0;
      }
      else
         error_column++;
   }
   if (!EOFSeen) {
      input_stream.backup(1);
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
   }
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
  }
}

}
