/* Generated By: CSCC: 4.0 (07/17/2009)  Do not edit this line. TheParserTokenManager.cs */
namespace edu.neu.ccs.demeterf.http.classes{

using edu.neu.ccs.demeterf.lib;
using System.Net.Sockets;
using System.Text;
using System.IO;
using System;
using Fields = edu.neu.ccs.demeterf.Fields;
using ident = edu.neu.ccs.demeterf.lib.ident;
using verbatim = edu.neu.ccs.demeterf.lib.verbatim;

public class TheParserTokenManager : TheParserConstants
{
private int jjStopStringLiteralDfa_0(int pos, long active0)
{
   switch (pos)
   {
      case 0:
         if ((active0 & 0x1805feL) != 0L)
         {
            jjmatchedKind = 27;
            return 42;
         }
         if ((active0 & 0x200L) != 0L)
            return 44;
         return -1;
      case 1:
         if ((active0 & 0x1805feL) != 0L)
         {
            jjmatchedKind = 27;
            jjmatchedPos = 1;
            return 42;
         }
         return -1;
      case 2:
         if ((active0 & 0x12L) != 0L)
            return 42;
         if ((active0 & 0x1805ecL) != 0L)
         {
            jjmatchedKind = 27;
            jjmatchedPos = 2;
            return 42;
         }
         return -1;
      case 3:
         if ((active0 & 0x1005e0L) != 0L)
         {
            jjmatchedKind = 27;
            jjmatchedPos = 3;
            return 42;
         }
         if ((active0 & 0x8000cL) != 0L)
            return 42;
         return -1;
      case 4:
         if ((active0 & 0x1a0L) != 0L)
         {
            jjmatchedKind = 27;
            jjmatchedPos = 4;
            return 42;
         }
         if ((active0 & 0x100040L) != 0L)
            return 42;
         return -1;
      case 5:
         if ((active0 & 0x180L) != 0L)
         {
            jjmatchedKind = 27;
            jjmatchedPos = 5;
            return 42;
         }
         if ((active0 & 0x20L) != 0L)
            return 42;
         return -1;
      default :
         return -1;
   }
}
private int jjStartNfa_0(int pos, long active0)
{
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
}
private int jjStopAtPos(int pos, int kind)
{
   jjmatchedKind = kind;
   jjmatchedPos = pos;
   return pos + 1;
}
private int jjStartNfaWithStates_0(int pos, int kind, int state)
{
   jjmatchedKind = kind;
   jjmatchedPos = pos;
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) { return pos + 1; }
   return jjMoveNfa_0(state, pos + 1);
}
private int jjMoveStringLiteralDfa0_0()
{
   switch((int)curChar)
   {
      case 13:
         jjmatchedKind = 15;
         return jjMoveStringLiteralDfa1_0(0x10000L);
      case 47:
         return jjStartNfaWithStates_0(0, 9, 44);
      case 58:
         return jjStopAtPos(0, 11);
      case 67:
         return jjMoveStringLiteralDfa1_0(0x80L);
      case 68:
         return jjMoveStringLiteralDfa1_0(0x20L);
      case 71:
         return jjMoveStringLiteralDfa1_0(0x2L);
      case 72:
         return jjMoveStringLiteralDfa1_0(0x404L);
      case 79:
         return jjMoveStringLiteralDfa1_0(0x100L);
      case 80:
         return jjMoveStringLiteralDfa1_0(0x18L);
      case 84:
         return jjMoveStringLiteralDfa1_0(0x40L);
      case 102:
         return jjMoveStringLiteralDfa1_0(0x100000L);
      case 116:
         return jjMoveStringLiteralDfa1_0(0x80000L);
      default :
         return jjMoveNfa_0(0, 0);
   }
}
private int jjMoveStringLiteralDfa1_0(long active0)
{
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) {
      jjStopStringLiteralDfa_0(0, active0);
      return 1;
   }
   switch((int)curChar)
   {
      case 10:
         if ((active0 & 0x10000L) != 0L)
            return jjStopAtPos(1, 16);
         break;
      case 69:
         return jjMoveStringLiteralDfa2_0(active0, 0x26L);
      case 79:
         return jjMoveStringLiteralDfa2_0(active0, 0x88L);
      case 80:
         return jjMoveStringLiteralDfa2_0(active0, 0x100L);
      case 82:
         return jjMoveStringLiteralDfa2_0(active0, 0x40L);
      case 84:
         return jjMoveStringLiteralDfa2_0(active0, 0x400L);
      case 85:
         return jjMoveStringLiteralDfa2_0(active0, 0x10L);
      case 97:
         return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
      case 114:
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
      default :
         break;
   }
   return jjStartNfa_0(0, active0);
}
private int jjMoveStringLiteralDfa2_0(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return jjStartNfa_0(0, old0); 
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) {
      jjStopStringLiteralDfa_0(1, active0);
      return 2;
   }
   switch((int)curChar)
   {
      case 65:
         return jjMoveStringLiteralDfa3_0(active0, 0x44L);
      case 76:
         return jjMoveStringLiteralDfa3_0(active0, 0x20L);
      case 78:
         return jjMoveStringLiteralDfa3_0(active0, 0x80L);
      case 83:
         return jjMoveStringLiteralDfa3_0(active0, 0x8L);
      case 84:
         if ((active0 & 0x2L) != 0L)
            return jjStartNfaWithStates_0(2, 1, 42);
         else if ((active0 & 0x10L) != 0L)
            return jjStartNfaWithStates_0(2, 4, 42);
         return jjMoveStringLiteralDfa3_0(active0, 0x500L);
      case 108:
         return jjMoveStringLiteralDfa3_0(active0, 0x100000L);
      case 117:
         return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
      default :
         break;
   }
   return jjStartNfa_0(1, active0);
}
private int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return jjStartNfa_0(1, old0); 
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) {
      jjStopStringLiteralDfa_0(2, active0);
      return 3;
   }
   switch((int)curChar)
   {
      case 67:
         return jjMoveStringLiteralDfa4_0(active0, 0x40L);
      case 68:
         if ((active0 & 0x4L) != 0L)
            return jjStartNfaWithStates_0(3, 2, 42);
         break;
      case 69:
         return jjMoveStringLiteralDfa4_0(active0, 0x20L);
      case 73:
         return jjMoveStringLiteralDfa4_0(active0, 0x100L);
      case 78:
         return jjMoveStringLiteralDfa4_0(active0, 0x80L);
      case 80:
         return jjMoveStringLiteralDfa4_0(active0, 0x400L);
      case 84:
         if ((active0 & 0x8L) != 0L)
            return jjStartNfaWithStates_0(3, 3, 42);
         break;
      case 101:
         if ((active0 & 0x80000L) != 0L)
            return jjStartNfaWithStates_0(3, 19, 42);
         break;
      case 115:
         return jjMoveStringLiteralDfa4_0(active0, 0x100000L);
      default :
         break;
   }
   return jjStartNfa_0(2, active0);
}
private int jjMoveStringLiteralDfa4_0(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return jjStartNfa_0(2, old0); 
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) {
      jjStopStringLiteralDfa_0(3, active0);
      return 4;
   }
   switch((int)curChar)
   {
      case 47:
         if ((active0 & 0x400L) != 0L)
            return jjStopAtPos(4, 10);
         break;
      case 69:
         if ((active0 & 0x40L) != 0L)
            return jjStartNfaWithStates_0(4, 6, 42);
         return jjMoveStringLiteralDfa5_0(active0, 0x80L);
      case 79:
         return jjMoveStringLiteralDfa5_0(active0, 0x100L);
      case 84:
         return jjMoveStringLiteralDfa5_0(active0, 0x20L);
      case 101:
         if ((active0 & 0x100000L) != 0L)
            return jjStartNfaWithStates_0(4, 20, 42);
         break;
      default :
         break;
   }
   return jjStartNfa_0(3, active0);
}
private int jjMoveStringLiteralDfa5_0(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return jjStartNfa_0(3, old0); 
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) {
      jjStopStringLiteralDfa_0(4, active0);
      return 5;
   }
   switch((int)curChar)
   {
      case 67:
         return jjMoveStringLiteralDfa6_0(active0, 0x80L);
      case 69:
         if ((active0 & 0x20L) != 0L)
            return jjStartNfaWithStates_0(5, 5, 42);
         break;
      case 78:
         return jjMoveStringLiteralDfa6_0(active0, 0x100L);
      default :
         break;
   }
   return jjStartNfa_0(4, active0);
}
private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return jjStartNfa_0(4, old0); 
   try { curChar = input_stream.readChar(); }
   catch(System.IO.IOException e) {
      jjStopStringLiteralDfa_0(5, active0);
      return 6;
   }
   switch((int)curChar)
   {
      case 83:
         if ((active0 & 0x100L) != 0L)
            return jjStartNfaWithStates_0(6, 8, 42);
         break;
      case 84:
         if ((active0 & 0x80L) != 0L)
            return jjStartNfaWithStates_0(6, 7, 42);
         break;
      default :
         break;
   }
   return jjStartNfa_0(5, active0);
}
private void jjCheckNAdd(int state)
{
   if (jjrounds[state] != jjround)
   {
      jjstateSet[jjnewStateCnt++] = state;
      jjrounds[state] = jjround;
   }
}
private void jjAddStates(int start, int end)
{
   do {
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
   } while (start++ != end);
}
private void jjCheckNAddTwoStates(int state1, int state2)
{
   jjCheckNAdd(state1);
   jjCheckNAdd(state2);
}
private void jjCheckNAddStates(int start, int end)
{
   do {
      jjCheckNAdd(jjnextStates[start]);
   } while (start++ != end);
}
private void jjCheckNAddStates(int start)
{
   jjCheckNAdd(jjnextStates[start]);
   jjCheckNAdd(jjnextStates[start + 1]);
}
static ulong[] jjbitVec0 = {
   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
};
private int jjMoveNfa_0(int startState, int curPos)
{
   int[] nextStates;
   int startsAt = 0;
   jjnewStateCnt = 56;
   int i = 1;
   jjstateSet[0] = startState;
   int j, kind = 0x7fffffff;
   for (;;)
   {
      if (++jjround == 0x7fffffff)
         ReInitRounds();
      if (curChar < 64)
      {
         ulong l = 1UL << curChar;
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               case 44:
                  if (curChar == 42)
                     jjCheckNAddTwoStates(50, 51);
                  else if (curChar == 47)
                     jjCheckNAddStates(0, 2);
                  break;
               case 0:
                  if ((0xa3ff707000000000L & l) != 0L)
                  {
                     if (kind > 27)
                        kind = 27;
                     jjCheckNAdd(42);
                  }
                  else if (curChar == 47)
                     jjAddStates(3, 4);
                  else if (curChar == 34)
                     jjCheckNAddStates(5, 7);
                  else if (curChar == 39)
                     jjAddStates(8, 9);
                  if ((0x3ff000000000000L & l) != 0L)
                  {
                     if (kind > 21)
                        kind = 21;
                     jjCheckNAddStates(10, 12);
                  }
                  else if ((0x280000000000L & l) != 0L)
                     jjCheckNAddTwoStates(1, 2);
                  else if (curChar == 46)
                     jjCheckNAdd(13);
                  if (curChar == 45)
                     jjCheckNAdd(6);
                  else if (curChar == 48)
                     jjstateSet[jjnewStateCnt++] = 3;
                  break;
               case 1:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAdd(1);
                  break;
               case 2:
                  if (curChar == 48)
                     jjstateSet[jjnewStateCnt++] = 3;
                  break;
               case 4:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjstateSet[jjnewStateCnt++] = 4;
                  break;
               case 5:
                  if (curChar == 45)
                     jjCheckNAdd(6);
                  break;
               case 6:
                  if ((0x3ff000000000000L & l) != 0L)
                     jjCheckNAddTwoStates(6, 7);
                  break;
               case 7:
                  if (curChar == 46)
                     jjCheckNAdd(8);
                  break;
               case 8:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 22)
                     kind = 22;
                  jjCheckNAddTwoStates(8, 9);
                  break;
               case 10:
                  if ((0x280000000000L & l) != 0L)
                     jjCheckNAdd(11);
                  break;
               case 11:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 22)
                     kind = 22;
                  jjCheckNAdd(11);
                  break;
               case 12:
                  if (curChar == 46)
                     jjCheckNAdd(13);
                  break;
               case 13:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 22)
                     kind = 22;
                  jjCheckNAddTwoStates(13, 14);
                  break;
               case 15:
                  if ((0x280000000000L & l) != 0L)
                     jjCheckNAdd(16);
                  break;
               case 16:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 22)
                     kind = 22;
                  jjCheckNAdd(16);
                  break;
               case 17:
                  if (curChar == 39)
                     jjAddStates(8, 9);
                  break;
               case 18:
                  if ((0xffffff7fffffdbffL & l) != 0L)
                     jjCheckNAdd(19);
                  break;
               case 19:
                  if (curChar == 39 && kind > 24)
                     kind = 24;
                  break;
               case 21:
                  if ((0x8400000000L & l) != 0L)
                     jjCheckNAdd(19);
                  break;
               case 22:
                  if ((0xff000000000000L & l) != 0L)
                     jjCheckNAddTwoStates(23, 19);
                  break;
               case 23:
                  if ((0xff000000000000L & l) != 0L)
                     jjCheckNAdd(19);
                  break;
               case 24:
                  if ((0xf000000000000L & l) != 0L)
                     jjstateSet[jjnewStateCnt++] = 25;
                  break;
               case 25:
                  if ((0xff000000000000L & l) != 0L)
                     jjCheckNAdd(23);
                  break;
               case 26:
                  if (curChar == 34)
                     jjCheckNAddStates(5, 7);
                  break;
               case 27:
                  if ((0xfffffffbffffdbffL & l) != 0L)
                     jjCheckNAddStates(5, 7);
                  break;
               case 29:
                  if ((0x8400000000L & l) != 0L)
                     jjCheckNAddStates(5, 7);
                  break;
               case 30:
                  if (curChar == 34 && kind > 25)
                     kind = 25;
                  break;
               case 31:
                  if ((0xff000000000000L & l) != 0L)
                     jjCheckNAddStates(13, 16);
                  break;
               case 32:
                  if ((0xff000000000000L & l) != 0L)
                     jjCheckNAddStates(5, 7);
                  break;
               case 33:
                  if ((0xf000000000000L & l) != 0L)
                     jjstateSet[jjnewStateCnt++] = 34;
                  break;
               case 34:
                  if ((0xff000000000000L & l) != 0L)
                     jjCheckNAdd(32);
                  break;
               case 36:
                  jjCheckNAddStates(17, 19);
                  break;
               case 38:
                  jjCheckNAddStates(20, 22);
                  break;
               case 42:
                  if ((0xa3ff707000000000L & l) == 0L)
                     break;
                  if (kind > 27)
                     kind = 27;
                  jjCheckNAdd(42);
                  break;
               case 43:
                  if (curChar == 47)
                     jjAddStates(3, 4);
                  break;
               case 45:
                  if ((0xffffffffffffdbffL & l) != 0L)
                     jjCheckNAddStates(0, 2);
                  break;
               case 46:
               case 47:
                  if (curChar == 10 && kind > 17)
                     kind = 17;
                  break;
               case 48:
                  if (curChar == 13)
                     jjstateSet[jjnewStateCnt++] = 47;
                  break;
               case 49:
                  if (curChar == 42)
                     jjCheckNAddTwoStates(50, 51);
                  break;
               case 50:
                  if ((0xfffffbffffffffffL & l) != 0L)
                     jjCheckNAddTwoStates(50, 51);
                  break;
               case 51:
                  if (curChar == 42)
                     jjAddStates(23, 24);
                  break;
               case 52:
                  if ((0xffff7fffffffffffL & l) != 0L)
                     jjCheckNAddTwoStates(53, 51);
                  break;
               case 53:
                  if ((0xfffffbffffffffffL & l) != 0L)
                     jjCheckNAddTwoStates(53, 51);
                  break;
               case 54:
                  if (curChar == 47 && kind > 18)
                     kind = 18;
                  break;
               case 55:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAddStates(10, 12);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else if (curChar < 128)
      {
         ulong l = 1UL << (curChar & 0x3F);
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               case 0:
                  if ((0x7fffffe87fffffeL & l) != 0L)
                  {
                     if (kind > 27)
                        kind = 27;
                     jjCheckNAdd(42);
                  }
                  else if (curChar == 123)
                     jjstateSet[jjnewStateCnt++] = 35;
                  break;
               case 3:
                  if ((0x100000001000000L & l) != 0L)
                     jjCheckNAdd(4);
                  break;
               case 4:
                  if ((0x7e0000007eL & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAdd(4);
                  break;
               case 9:
                  if ((0x2000000020L & l) != 0L)
                     jjAddStates(25, 26);
                  break;
               case 14:
                  if ((0x2000000020L & l) != 0L)
                     jjAddStates(27, 28);
                  break;
               case 18:
                  if ((0xffffffffefffffffL & l) != 0L)
                     jjCheckNAdd(19);
                  break;
               case 20:
                  if (curChar == 92)
                     jjAddStates(29, 31);
                  break;
               case 21:
                  if ((0x14404410000000L & l) != 0L)
                     jjCheckNAdd(19);
                  break;
               case 27:
                  if ((0xffffffffefffffffL & l) != 0L)
                     jjCheckNAddStates(5, 7);
                  break;
               case 28:
                  if (curChar == 92)
                     jjAddStates(32, 34);
                  break;
               case 29:
                  if ((0x14404410000000L & l) != 0L)
                     jjCheckNAddStates(5, 7);
                  break;
               case 35:
                  if (curChar == 123)
                     jjCheckNAddStates(17, 19);
                  break;
               case 36:
                  if ((0xdfffffffffffffffL & l) != 0L)
                     jjCheckNAddStates(17, 19);
                  break;
               case 37:
                  if (curChar == 125)
                     jjCheckNAdd(38);
                  break;
               case 38:
                  if ((0xdfffffffffffffffL & l) != 0L)
                     jjCheckNAddStates(20, 22);
                  break;
               case 39:
                  if (curChar == 125 && kind > 26)
                     kind = 26;
                  break;
               case 40:
                  if (curChar == 125)
                     jjstateSet[jjnewStateCnt++] = 39;
                  break;
               case 41:
                  if (curChar == 123)
                     jjstateSet[jjnewStateCnt++] = 35;
                  break;
               case 42:
                  if ((0x7fffffe87fffffeL & l) == 0L)
                     break;
                  if (kind > 27)
                     kind = 27;
                  jjCheckNAdd(42);
                  break;
               case 45:
                  jjAddStates(0, 2);
                  break;
               case 50:
                  jjCheckNAddTwoStates(50, 51);
                  break;
               case 52:
               case 53:
                  jjCheckNAddTwoStates(53, 51);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else
      {
         int i2 = (curChar & 0xff) >> 6;
         ulong l2 = 1UL << (curChar & 0x3F);
         MatchLoop: do
         {
            switch(jjstateSet[--i])
            {
               case 18:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjstateSet[jjnewStateCnt++] = 19;
                  break;
               case 27:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjAddStates(5, 7);
                  break;
               case 36:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjCheckNAddStates(17, 19);
                  break;
               case 38:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjCheckNAddStates(20, 22);
                  break;
               case 45:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjAddStates(0, 2);
                  break;
               case 50:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjCheckNAddTwoStates(50, 51);
                  break;
               case 52:
               case 53:
                  if ((jjbitVec0[i2] & l2) != 0L)
                     jjCheckNAddTwoStates(53, 51);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      if (kind != 0x7fffffff)
      {
         jjmatchedKind = kind;
         jjmatchedPos = curPos;
         kind = 0x7fffffff;
      }
      ++curPos;
      if ((i = jjnewStateCnt) == (startsAt = 56 - (jjnewStateCnt = startsAt)))
         return curPos;
      try { curChar = input_stream.readChar(); }
      catch(System.IO.IOException e) { return curPos; }
   }
}
static int[] jjnextStates = {
   45, 46, 48, 44, 49, 27, 28, 30, 18, 20, 1, 6, 7, 27, 28, 32, 
   30, 36, 37, 40, 37, 38, 40, 52, 54, 10, 11, 15, 16, 21, 22, 24, 
   29, 31, 33, 
};
public static String[] jjstrLiteralImages = {
"", "\0107\0105\0124", "\0110\0105\0101\0104", "\0120\0117\0123\0124", 
"\0120\0125\0124", "\0104\0105\0114\0105\0124\0105", "\0124\0122\0101\0103\0105", 
"\0103\0117\0116\0116\0105\0103\0124", "\0117\0120\0124\0111\0117\0116\0123", "\057", "\0110\0124\0124\0120\057", 
"\072", null, null, null, null, null, null, null, "\0164\0162\0165\0145", 
"\0146\0141\0154\0163\0145", null, null, null, null, null, null, null, };
public static String[] lexStateNames = {
   "DEFAULT", 
};
static long[] jjtoToken = {
   0xf780fffL, 
};
static long[] jjtoSkip = {
   0x7f000L, 
};
protected SimpleCharStream input_stream;
private long[] jjrounds = new long[56];
private int[] jjstateSet = new int[112];
protected char curChar;
public TheParserTokenManager(SimpleCharStream stream){
   if (SimpleCharStream.staticFlag)
      throw new Exception("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
   input_stream = stream;
}
public TheParserTokenManager(SimpleCharStream stream, int lexState) : this(stream){
   SwitchTo(lexState);
}
public void ReInit(SimpleCharStream stream)
{
   jjmatchedPos = jjnewStateCnt = 0;
   curLexState = defaultLexState;
   input_stream = stream;
   ReInitRounds();
}
private void ReInitRounds()
{
   int i;
   jjround = 0x80000001;
   for (i = 56; 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;
long 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(System.IO.IOException e){
      jjmatchedKind = 0;
      matchedToken = jjFillToken();
      return matchedToken;
   }

   try { input_stream.backup(0);
      while (curChar <= 32 && (0x100000600L & (1L << curChar)) != 0L)
         curChar = input_stream.BeginToken();
   }
   catch (System.IO.IOException e1) { goto EOFLoop; }
   jjmatchedKind = 0x7fffffff;
   jjmatchedPos = 0;
   curPos = jjMoveStringLiteralDfa0_0();
   if (jjmatchedKind != 0x7fffffff){
      if (jjmatchedPos + 1 < curPos)
         input_stream.backup(curPos - jjmatchedPos - 1);
      if (((ulong)jjtoToken[jjmatchedKind >> 6] & (1UL << (jjmatchedKind & 0x3F))) != 0){
         matchedToken = jjFillToken();
         return matchedToken;
      }
      else
      {
         goto EOFLoop;
      }
   }
   int error_line = input_stream.getEndLine();
   int error_column = input_stream.getEndColumn();
   String error_after = null;
   bool EOFSeen = false;
   try { input_stream.readChar(); input_stream.backup(1); }
   catch (System.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);
  }
}

}
}