/* Generated By:JavaCC: Do not edit this line. TeXMathParserTokenManager.java */
package org.jplot2d.javacc;
import java.util.ArrayList;
import java.util.List;
import org.jplot2d.tex.MathElement;

/** Token Manager. */
public class TeXMathParserTokenManager implements TeXMathParserConstants
{

  /** Debug output. */
  public  java.io.PrintStream debugStream = System.out;
  /** Set debug output. */
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private int jjStopAtPos(int pos, int kind)
{
   jjmatchedKind = kind;
   jjmatchedPos = pos;
   return pos + 1;
}
private int jjMoveStringLiteralDfa0_1()
{
   switch(curChar)
   {
      case 10:
         return jjStopAtPos(0, 13);
      case 32:
         return jjStopAtPos(0, 12);
      case 36:
         return jjStopAtPos(0, 11);
      case 92:
         jjmatchedKind = 3;
         return jjMoveStringLiteralDfa1_1(0x47f0L);
      case 123:
         return jjStopAtPos(0, 1);
      case 125:
         return jjStopAtPos(0, 2);
      default :
         return 1;
   }
}
private int jjMoveStringLiteralDfa1_1(long active0)
{
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      return 1;
   }
   switch(curChar)
   {
      case 36:
         if ((active0 & 0x10L) != 0L)
            return jjStopAtPos(1, 4);
         break;
      case 92:
         if ((active0 & 0x80L) != 0L)
            return jjStopAtPos(1, 7);
         break;
      case 110:
         if ((active0 & 0x4000L) != 0L)
            return jjStopAtPos(1, 14);
         break;
      case 116:
         return jjMoveStringLiteralDfa2_1(active0, 0x700L);
      case 123:
         if ((active0 & 0x20L) != 0L)
            return jjStopAtPos(1, 5);
         break;
      case 125:
         if ((active0 & 0x40L) != 0L)
            return jjStopAtPos(1, 6);
         break;
      default :
         return 2;
   }
   return 2;
}
private int jjMoveStringLiteralDfa2_1(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return 2;
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      return 2;
   }
   switch(curChar)
   {
      case 101:
         return jjMoveStringLiteralDfa3_1(active0, 0x700L);
      default :
         return 3;
   }
}
private int jjMoveStringLiteralDfa3_1(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return 3;
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      return 3;
   }
   switch(curChar)
   {
      case 120:
         return jjMoveStringLiteralDfa4_1(active0, 0x700L);
      default :
         return 4;
   }
}
private int jjMoveStringLiteralDfa4_1(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return 4;
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      return 4;
   }
   switch(curChar)
   {
      case 116:
         return jjMoveStringLiteralDfa5_1(active0, 0x700L);
      default :
         return 5;
   }
}
private int jjMoveStringLiteralDfa5_1(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return 5;
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      return 5;
   }
   switch(curChar)
   {
      case 98:
         return jjMoveStringLiteralDfa6_1(active0, 0x400L);
      case 105:
         return jjMoveStringLiteralDfa6_1(active0, 0x200L);
      case 114:
         return jjMoveStringLiteralDfa6_1(active0, 0x100L);
      default :
         return 6;
   }
}
private int jjMoveStringLiteralDfa6_1(long old0, long active0)
{
   if (((active0 &= old0)) == 0L)
      return 6;
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      return 6;
   }
   switch(curChar)
   {
      case 102:
         if ((active0 & 0x400L) != 0L)
            return jjStopAtPos(6, 10);
         break;
      case 109:
         if ((active0 & 0x100L) != 0L)
            return jjStopAtPos(6, 8);
         break;
      case 116:
         if ((active0 & 0x200L) != 0L)
            return jjStopAtPos(6, 9);
         break;
      default :
         return 7;
   }
   return 7;
}
private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
{
   switch (pos)
   {
      default :
         return -1;
   }
}
private final int jjStartNfa_0(int pos, long active0, long active1)
{
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
}
private int jjMoveStringLiteralDfa0_0()
{
   switch(curChar)
   {
      case 36:
         return jjStopAtPos(0, 20);
      case 40:
         return jjStopAtPos(0, 24);
      case 41:
         return jjStopAtPos(0, 25);
      case 45:
         return jjStopAtPos(0, 22);
      case 92:
         jjmatchedKind = 3;
         return jjMoveStringLiteralDfa1_0(0xfffffffff00007f0L, 0x7L);
      case 94:
         return jjStopAtPos(0, 27);
      case 95:
         return jjStopAtPos(0, 26);
      case 123:
         return jjStopAtPos(0, 1);
      case 125:
         return jjStopAtPos(0, 2);
      default :
         return jjMoveNfa_0(3, 0);
   }
}
private int jjMoveStringLiteralDfa1_0(long active0, long active1)
{
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(0, active0, active1);
      return 1;
   }
   switch(curChar)
   {
      case 36:
         if ((active0 & 0x10L) != 0L)
            return jjStopAtPos(1, 4);
         break;
      case 68:
         return jjMoveStringLiteralDfa2_0(active0, 0x80000000000000L, active1, 0L);
      case 71:
         return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L);
      case 76:
         return jjMoveStringLiteralDfa2_0(active0, 0x200000000000000L, active1, 0L);
      case 79:
         return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1L);
      case 80:
         return jjMoveStringLiteralDfa2_0(active0, 0xc800000000000000L, active1, 0L);
      case 83:
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000000L, active1, 0L);
      case 84:
         return jjMoveStringLiteralDfa2_0(active0, 0x100000000000000L, active1, 0L);
      case 85:
         return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000000L, active1, 0L);
      case 88:
         return jjMoveStringLiteralDfa2_0(active0, 0x400000000000000L, active1, 0L);
      case 92:
         if ((active0 & 0x80L) != 0L)
            return jjStopAtPos(1, 7);
         break;
      case 97:
         return jjMoveStringLiteralDfa2_0(active0, 0x80000000L, active1, 0x2L);
      case 98:
         return jjMoveStringLiteralDfa2_0(active0, 0x100000000L, active1, 0L);
      case 99:
         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000000L, active1, 0L);
      case 100:
         return jjMoveStringLiteralDfa2_0(active0, 0x400000000L, active1, 0L);
      case 101:
         return jjMoveStringLiteralDfa2_0(active0, 0x2800000000L, active1, 0L);
      case 103:
         return jjMoveStringLiteralDfa2_0(active0, 0x200000000L, active1, 0L);
      case 105:
         return jjMoveStringLiteralDfa2_0(active0, 0x8000000000L, active1, 0L);
      case 107:
         return jjMoveStringLiteralDfa2_0(active0, 0x10000000000L, active1, 0L);
      case 108:
         return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L, active1, 0L);
      case 109:
         return jjMoveStringLiteralDfa2_0(active0, 0x40070000000L, active1, 0x4L);
      case 110:
         return jjMoveStringLiteralDfa2_0(active0, 0x80000000000L, active1, 0L);
      case 111:
         return jjMoveStringLiteralDfa2_0(active0, 0x20000000000000L, active1, 0L);
      case 112:
         return jjMoveStringLiteralDfa2_0(active0, 0x14200000000000L, active1, 0L);
      case 114:
         return jjMoveStringLiteralDfa2_0(active0, 0x400000000000L, active1, 0L);
      case 115:
         return jjMoveStringLiteralDfa2_0(active0, 0x800000000000L, active1, 0L);
      case 116:
         return jjMoveStringLiteralDfa2_0(active0, 0x1004000000700L, active1, 0L);
      case 117:
         return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0L);
      case 120:
         return jjMoveStringLiteralDfa2_0(active0, 0x100000000000L, active1, 0L);
      case 122:
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L);
      case 123:
         if ((active0 & 0x20L) != 0L)
            return jjStopAtPos(1, 5);
         break;
      case 125:
         if ((active0 & 0x40L) != 0L)
            return jjStopAtPos(1, 6);
         break;
      default :
         break;
   }
   return jjStartNfa_0(0, active0, active1);
}
private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(0, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(1, active0, active1);
      return 2;
   }
   switch(curChar)
   {
      case 97:
         return jjMoveStringLiteralDfa3_0(active0, 0x241030270000000L, active1, 0L);
      case 101:
         return jjMoveStringLiteralDfa3_0(active0, 0x80001500000700L, active1, 0L);
      case 104:
         return jjMoveStringLiteralDfa3_0(active0, 0x410c404000000000L, active1, 0L);
      case 105:
         if ((active0 & 0x100000000000L) != 0L)
            return jjStopAtPos(2, 44);
         else if ((active0 & 0x200000000000L) != 0L)
            return jjStopAtPos(2, 45);
         else if ((active0 & 0x400000000000000L) != 0L)
            return jjStopAtPos(2, 58);
         else if ((active0 & 0x800000000000000L) != 0L)
            return jjStopAtPos(2, 59);
         return jjMoveStringLiteralDfa3_0(active0, 0x1000800000000000L, active1, 0x4L);
      case 108:
         return jjMoveStringLiteralDfa3_0(active0, 0x80000000L, active1, 0L);
      case 109:
         return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0x1L);
      case 110:
         return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x2L);
      case 111:
         return jjMoveStringLiteralDfa3_0(active0, 0x8000000000L, active1, 0L);
      case 112:
         return jjMoveStringLiteralDfa3_0(active0, 0x2002000800000000L, active1, 0L);
      case 115:
         return jjMoveStringLiteralDfa3_0(active0, 0x8010000000000000L, active1, 0L);
      case 116:
         return jjMoveStringLiteralDfa3_0(active0, 0x2000000000L, active1, 0L);
      case 117:
         if ((active0 & 0x40000000000L) != 0L)
            return jjStopAtPos(2, 42);
         else if ((active0 & 0x80000000000L) != 0L)
            return jjStopAtPos(2, 43);
         break;
      default :
         break;
   }
   return jjStartNfa_0(1, active0, active1);
}
private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(1, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(2, active0, active1);
      return 3;
   }
   switch(curChar)
   {
      case 97:
         if ((active0 & 0x2000000000L) != 0L)
            return jjStopAtPos(3, 37);
         break;
      case 99:
         return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x4L);
      case 101:
         return jjMoveStringLiteralDfa4_0(active0, 0x120004000000000L, active1, 0x1L);
      case 103:
         return jjMoveStringLiteralDfa4_0(active0, 0x1000800000000000L, active1, 0x2L);
      case 105:
         if ((active0 & 0x4000000000000L) != 0L)
            return jjStopAtPos(3, 50);
         else if ((active0 & 0x8000000000000L) != 0L)
            return jjStopAtPos(3, 51);
         else if ((active0 & 0x10000000000000L) != 0L)
            return jjStopAtPos(3, 52);
         else if ((active0 & 0x4000000000000000L) != 0L)
            return jjStopAtPos(3, 62);
         else if ((active0 & 0x8000000000000000L) != 0L)
            return jjStopAtPos(3, 63);
         break;
      case 108:
         return jjMoveStringLiteralDfa4_0(active0, 0x80000400000000L, active1, 0L);
      case 109:
         return jjMoveStringLiteralDfa4_0(active0, 0x240020200000000L, active1, 0L);
      case 111:
         if ((active0 & 0x400000000000L) != 0L)
            return jjStopAtPos(3, 46);
         break;
      case 112:
         return jjMoveStringLiteralDfa4_0(active0, 0x10080000000L, active1, 0L);
      case 115:
         return jjMoveStringLiteralDfa4_0(active0, 0x2002000800000000L, active1, 0L);
      case 116:
         return jjMoveStringLiteralDfa4_0(active0, 0x9170000000L, active1, 0L);
      case 117:
         if ((active0 & 0x1000000000000L) != 0L)
            return jjStopAtPos(3, 48);
         break;
      case 120:
         return jjMoveStringLiteralDfa4_0(active0, 0x700L, active1, 0L);
      default :
         break;
   }
   return jjStartNfa_0(2, active0, active1);
}
private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(2, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(3, active0, active1);
      return 4;
   }
   switch(curChar)
   {
      case 97:
         if ((active0 & 0x100000000L) != 0L)
            return jjStopAtPos(4, 32);
         else if ((active0 & 0x1000000000L) != 0L)
            return jjStopAtPos(4, 36);
         else if ((active0 & 0x8000000000L) != 0L)
            return jjStopAtPos(4, 39);
         break;
      case 98:
         return jjMoveStringLiteralDfa5_0(active0, 0x200020000000000L, active1, 0L);
      case 103:
         return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L, active1, 0x1L);
      case 104:
         return jjMoveStringLiteralDfa5_0(active0, 0xf0000000L, active1, 0L);
      case 105:
         return jjMoveStringLiteralDfa5_0(active0, 0x2002000800000000L, active1, 0L);
      case 109:
         return jjMoveStringLiteralDfa5_0(active0, 0x1040800200000000L, active1, 0L);
      case 112:
         return jjMoveStringLiteralDfa5_0(active0, 0x10000000000L, active1, 0L);
      case 114:
         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4L);
      case 115:
         return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x2L);
      case 116:
         return jjMoveStringLiteralDfa5_0(active0, 0x180004400000700L, active1, 0L);
      default :
         break;
   }
   return jjStartNfa_0(3, active0, active1);
}
private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(3, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(4, active0, active1);
      return 5;
   }
   switch(curChar)
   {
      case 97:
         if ((active0 & 0x80000000L) != 0L)
            return jjStopAtPos(5, 31);
         else if ((active0 & 0x200000000L) != 0L)
            return jjStopAtPos(5, 33);
         else if ((active0 & 0x400000000L) != 0L)
            return jjStopAtPos(5, 34);
         else if ((active0 & 0x4000000000L) != 0L)
            return jjStopAtPos(5, 38);
         else if ((active0 & 0x10000000000L) != 0L)
            return jjStopAtPos(5, 40);
         else if ((active0 & 0x800000000000L) != 0L)
            return jjStopAtPos(5, 47);
         else if ((active0 & 0x20000000000000L) != 0L)
            return jjStopAtPos(5, 53);
         else if ((active0 & 0x40000000000000L) != 0L)
            return jjStopAtPos(5, 54);
         else if ((active0 & 0x80000000000000L) != 0L)
            return jjStopAtPos(5, 55);
         else if ((active0 & 0x100000000000000L) != 0L)
            return jjStopAtPos(5, 56);
         else if ((active0 & 0x1000000000000000L) != 0L)
            return jjStopAtPos(5, 60);
         else if ((active1 & 0x1L) != 0L)
            return jjStopAtPos(5, 64);
         break;
      case 98:
         return jjMoveStringLiteralDfa6_0(active0, 0x40000400L, active1, 0L);
      case 100:
         return jjMoveStringLiteralDfa6_0(active0, 0x200020000000000L, active1, 0L);
      case 105:
         return jjMoveStringLiteralDfa6_0(active0, 0x20000200L, active1, 0L);
      case 108:
         return jjMoveStringLiteralDfa6_0(active0, 0x2002000800000000L, active1, 0L);
      case 111:
         if ((active1 & 0x4L) != 0L)
            return jjStopAtPos(5, 66);
         break;
      case 114:
         return jjMoveStringLiteralDfa6_0(active0, 0x10000100L, active1, 0L);
      case 116:
         return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x2L);
      default :
         break;
   }
   return jjStartNfa_0(4, active0, active1);
}
private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(4, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(5, active0, active1);
      return 6;
   }
   switch(curChar)
   {
      case 97:
         if ((active0 & 0x20000000000L) != 0L)
            return jjStopAtPos(6, 41);
         else if ((active0 & 0x200000000000000L) != 0L)
            return jjStopAtPos(6, 57);
         break;
      case 102:
         if ((active0 & 0x400L) != 0L)
            return jjStopAtPos(6, 10);
         else if ((active0 & 0x40000000L) != 0L)
            return jjStopAtPos(6, 30);
         break;
      case 109:
         if ((active0 & 0x100L) != 0L)
            return jjStopAtPos(6, 8);
         else if ((active0 & 0x10000000L) != 0L)
            return jjStopAtPos(6, 28);
         break;
      case 111:
         return jjMoveStringLiteralDfa7_0(active0, 0x2002000800000000L, active1, 0L);
      case 114:
         return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x2L);
      case 116:
         if ((active0 & 0x200L) != 0L)
            return jjStopAtPos(6, 9);
         else if ((active0 & 0x20000000L) != 0L)
            return jjStopAtPos(6, 29);
         break;
      default :
         break;
   }
   return jjStartNfa_0(5, active0, active1);
}
private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(5, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(6, active0, active1);
      return 7;
   }
   switch(curChar)
   {
      case 110:
         if ((active0 & 0x800000000L) != 0L)
            return jjStopAtPos(7, 35);
         else if ((active0 & 0x2000000000000L) != 0L)
            return jjStopAtPos(7, 49);
         else if ((active0 & 0x2000000000000000L) != 0L)
            return jjStopAtPos(7, 61);
         break;
      case 111:
         return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x2L);
      default :
         break;
   }
   return jjStartNfa_0(6, active0, active1);
}
private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1)
{
   if (((active0 &= old0) | (active1 &= old1)) == 0L)
      return jjStartNfa_0(6, old0, old1);
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_0(7, 0L, active1);
      return 8;
   }
   switch(curChar)
   {
      case 109:
         if ((active1 & 0x2L) != 0L)
            return jjStopAtPos(8, 65);
         break;
      default :
         break;
   }
   return jjStartNfa_0(7, 0L, active1);
}
private int jjMoveNfa_0(int startState, int curPos)
{
   int startsAt = 0;
   jjnewStateCnt = 10;
   int i = 1;
   jjstateSet[0] = startState;
   int kind = 0x7fffffff;
   for (;;)
   {
      if (++jjround == 0x7fffffff)
         ReInitRounds();
      if (curChar < 64)
      {
         long l = 1L << curChar;
         do
         {
            switch(jjstateSet[--i])
            {
               case 3:
                  if ((0x3ff000000000000L & l) != 0L)
                  {
                     if (kind > 21)
                        kind = 21;
                     jjCheckNAddTwoStates(0, 1);
                  }
                  else if ((0x70009c0000000000L & l) != 0L)
                  {
                     if (kind > 23)
                        kind = 23;
                  }
                  else if (curChar == 46)
                  {
                     if (kind > 21)
                        kind = 21;
                     jjCheckNAdd(4);
                  }
                  if (curChar == 61)
                     jjCheckNAdd(6);
                  else if (curChar == 60)
                     jjCheckNAdd(6);
                  else if (curChar == 62)
                     jjCheckNAdd(6);
                  break;
               case 0:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAddTwoStates(0, 1);
                  break;
               case 1:
                  if (curChar != 46)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAdd(2);
                  break;
               case 2:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAdd(2);
                  break;
               case 4:
                  if ((0x3ff000000000000L & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  jjCheckNAdd(4);
                  break;
               case 5:
                  if ((0x70009c0000000000L & l) != 0L && kind > 23)
                     kind = 23;
                  break;
               case 6:
                  if (curChar == 61 && kind > 23)
                     kind = 23;
                  break;
               case 7:
                  if (curChar == 62)
                     jjCheckNAdd(6);
                  break;
               case 8:
                  if (curChar == 60)
                     jjCheckNAdd(6);
                  break;
               case 9:
                  if (curChar == 61)
                     jjCheckNAdd(6);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else if (curChar < 128)
      {
         long l = 1L << (curChar & 077);
         do
         {
            switch(jjstateSet[--i])
            {
               default : break;
            }
         } while(i != startsAt);
      }
      else
      {
         int i2 = (curChar & 0xff) >> 6;
         long l2 = 1L << (curChar & 077);
         do
         {
            switch(jjstateSet[--i])
            {
               default : break;
            }
         } while(i != startsAt);
      }
      if (kind != 0x7fffffff)
      {
         jjmatchedKind = kind;
         jjmatchedPos = curPos;
         kind = 0x7fffffff;
      }
      ++curPos;
      if ((i = jjnewStateCnt) == (startsAt = 10 - (jjnewStateCnt = startsAt)))
         return curPos;
      try { curChar = input_stream.readChar(); }
      catch(java.io.IOException e) { return curPos; }
   }
}
static final int[] jjnextStates = {
};

/** Token literal values. */
public static final String[] jjstrLiteralImages = {
"", "\173", "\175", "\134", "\134\44", "\134\173", "\134\175", "\134\134", 
"\134\164\145\170\164\162\155", "\134\164\145\170\164\151\164", "\134\164\145\170\164\142\146", "\44", "\40", 
"\12", "\134\156", null, null, null, null, null, "\44", null, "\55", null, "\50", 
"\51", "\137", "\136", "\134\155\141\164\150\162\155", 
"\134\155\141\164\150\151\164", "\134\155\141\164\150\142\146", "\134\141\154\160\150\141", 
"\134\142\145\164\141", "\134\147\141\155\155\141", "\134\144\145\154\164\141", 
"\134\145\160\163\151\154\157\156", "\134\172\145\164\141", "\134\145\164\141", "\134\164\150\145\164\141", 
"\134\151\157\164\141", "\134\153\141\160\160\141", "\134\154\141\155\142\144\141", "\134\155\165", 
"\134\156\165", "\134\170\151", "\134\160\151", "\134\162\150\157", 
"\134\163\151\147\155\141", "\134\164\141\165", "\134\165\160\163\151\154\157\156", "\134\160\150\151", 
"\134\143\150\151", "\134\160\163\151", "\134\157\155\145\147\141", "\134\107\141\155\155\141", 
"\134\104\145\154\164\141", "\134\124\150\145\164\141", "\134\114\141\155\142\144\141", "\134\130\151", 
"\134\120\151", "\134\123\151\147\155\141", "\134\125\160\163\151\154\157\156", 
"\134\120\150\151", "\134\120\163\151", "\134\117\155\145\147\141", 
"\134\141\156\147\163\164\162\157\155", "\134\155\151\143\162\157", null, };

/** Lexer state names. */
public static final String[] lexStateNames = {
   "MATH",
   "DEFAULT",
};

/** Lex State array. */
public static final int[] jjnewLexState = {
   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 
   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
};
static final long[] jjtoToken = {
   0xfffffffffff0ffffL, 0xfL, 
};
static final long[] jjtoSkip = {
   0xf0000L, 0x0L, 
};
protected SimpleCharStream input_stream;
private final int[] jjrounds = new int[10];
private final int[] jjstateSet = new int[20];
protected char curChar;
/** Constructor. */
public TeXMathParserTokenManager(SimpleCharStream stream){
   if (SimpleCharStream.staticFlag)
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
   input_stream = stream;
}

/** Constructor. */
public TeXMathParserTokenManager(SimpleCharStream stream, int lexState){
   this(stream);
   SwitchTo(lexState);
}

/** Reinitialise parser. */
public void ReInit(SimpleCharStream stream)
{
   jjmatchedPos = jjnewStateCnt = 0;
   curLexState = defaultLexState;
   input_stream = stream;
   ReInitRounds();
}
private void ReInitRounds()
{
   int i;
   jjround = 0x80000001;
   for (i = 10; i-- > 0;)
      jjrounds[i] = 0x80000000;
}

/** Reinitialise parser. */
public void ReInit(SimpleCharStream stream, int lexState)
{
   ReInit(stream);
   SwitchTo(lexState);
}

/** Switch to specified lex state. */
public void SwitchTo(int lexState)
{
   if (lexState >= 2 || lexState < 0)
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
   else
      curLexState = lexState;
}

protected Token jjFillToken()
{
   final Token t;
   final String curTokenImage;
   final int beginLine;
   final int endLine;
   final int beginColumn;
   final int endColumn;
   String im = jjstrLiteralImages[jjmatchedKind];
   curTokenImage = (im == null) ? input_stream.GetImage() : im;
   beginLine = input_stream.getBeginLine();
   beginColumn = input_stream.getBeginColumn();
   endLine = input_stream.getEndLine();
   endColumn = input_stream.getEndColumn();
   t = Token.newToken(jjmatchedKind, curTokenImage);

   t.beginLine = beginLine;
   t.endLine = endLine;
   t.beginColumn = beginColumn;
   t.endColumn = endColumn;

   return t;
}

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

/** Get the next Token. */
public Token getNextToken() 
{
  Token matchedToken;
  int curPos = 0;

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

   switch(curLexState)
   {
     case 0:
       try { input_stream.backup(0);
          while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
             curChar = input_stream.BeginToken();
       }
       catch (java.io.IOException e1) { continue EOFLoop; }
       jjmatchedKind = 0x7fffffff;
       jjmatchedPos = 0;
       curPos = jjMoveStringLiteralDfa0_0();
       if (jjmatchedPos == 0 && jjmatchedKind > 67)
       {
          jjmatchedKind = 67;
       }
       break;
     case 1:
       jjmatchedKind = 0x7fffffff;
       jjmatchedPos = 0;
       curPos = jjMoveStringLiteralDfa0_1();
       if (jjmatchedPos == 0 && jjmatchedKind > 15)
       {
          jjmatchedKind = 15;
       }
       break;
   }
     if (jjmatchedKind != 0x7fffffff)
     {
        if (jjmatchedPos + 1 < curPos)
           input_stream.backup(curPos - jjmatchedPos - 1);
        if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
        {
           matchedToken = jjFillToken();
       if (jjnewLexState[jjmatchedKind] != -1)
         curLexState = jjnewLexState[jjmatchedKind];
           return matchedToken;
        }
        else
        {
         if (jjnewLexState[jjmatchedKind] != -1)
           curLexState = jjnewLexState[jjmatchedKind];
           continue EOFLoop;
        }
     }
     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);
  }
}

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);
}

}

 

Ads help maintain this website.