src/java.management.rest/share/classes/com/oracle/jmx/remote/rest/json/parser/JSONParserTokenManager.java
author hb
Mon, 01 Jan 2018 23:59:14 +0530
branchjmx-rest-api
changeset 56002 60ab3b595a8e
parent 55985 0c5a02edfdef
permissions -rw-r--r--
Lot of bug fixes Added test cases
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     1
/* Generated By:JavaCC: Do not edit this line. JSONParserTokenManager.java */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     2
package com.oracle.jmx.remote.rest.json.parser;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     3
import java.io.StringReader;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     4
import com.oracle.jmx.remote.rest.json.*;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     5
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     6
/** Token Manager. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     7
public class JSONParserTokenManager implements JSONParserConstants
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     8
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
     9
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    10
  /** Debug output. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    11
  public  java.io.PrintStream debugStream = System.out;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    12
  /** Set debug output. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    13
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    14
private final int jjStopStringLiteralDfa_0(int pos, long active0)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    15
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    16
   switch (pos)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    17
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    18
      default :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    19
         return -1;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    20
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    21
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    22
private final int jjStartNfa_0(int pos, long active0)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    23
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    24
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    25
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    26
private int jjStopAtPos(int pos, int kind)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    27
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    28
   jjmatchedKind = kind;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    29
   jjmatchedPos = pos;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    30
   return pos + 1;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    31
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    32
private int jjMoveStringLiteralDfa0_0()
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    33
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    34
   switch(curChar)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    35
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    36
      case 44:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    37
         return jjStopAtPos(0, 18);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    38
      case 58:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    39
         return jjStopAtPos(0, 17);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    40
      case 91:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    41
         return jjStopAtPos(0, 20);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    42
      case 93:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    43
         return jjStopAtPos(0, 21);
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    44
      case 78:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    45
      case 110:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    46
         return jjMoveStringLiteralDfa1_0(0x8000L);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    47
      case 123:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    48
         return jjStopAtPos(0, 16);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    49
      case 125:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    50
         return jjStopAtPos(0, 19);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    51
      default :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    52
         return jjMoveNfa_0(0, 0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    53
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    54
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    55
private int jjMoveStringLiteralDfa1_0(long active0)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    56
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    57
   try { curChar = input_stream.readChar(); }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    58
   catch(java.io.IOException e) {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    59
      jjStopStringLiteralDfa_0(0, active0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    60
      return 1;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    61
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    62
   switch(curChar)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    63
   {
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    64
      case 85:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    65
      case 117:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    66
         return jjMoveStringLiteralDfa2_0(active0, 0x8000L);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    67
      default :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    68
         break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    69
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    70
   return jjStartNfa_0(0, active0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    71
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    72
private int jjMoveStringLiteralDfa2_0(long old0, long active0)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    73
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    74
   if (((active0 &= old0)) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    75
      return jjStartNfa_0(0, old0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    76
   try { curChar = input_stream.readChar(); }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    77
   catch(java.io.IOException e) {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    78
      jjStopStringLiteralDfa_0(1, active0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    79
      return 2;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    80
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    81
   switch(curChar)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    82
   {
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
    83
      case 76:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    84
      case 108:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    85
         return jjMoveStringLiteralDfa3_0(active0, 0x8000L);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    86
      default :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    87
         break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    88
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    89
   return jjStartNfa_0(1, active0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    90
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    91
private int jjMoveStringLiteralDfa3_0(long old0, long active0)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    92
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    93
   if (((active0 &= old0)) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    94
      return jjStartNfa_0(1, old0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    95
   try { curChar = input_stream.readChar(); }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    96
   catch(java.io.IOException e) {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    97
      jjStopStringLiteralDfa_0(2, active0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    98
      return 3;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
    99
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   100
   switch(curChar)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   101
   {
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   102
      case 76:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   103
      case 108:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   104
         if ((active0 & 0x8000L) != 0L)
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   105
            return jjStopAtPos(3, 15);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   106
         break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   107
      default :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   108
         break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   109
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   110
   return jjStartNfa_0(2, active0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   111
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   112
static final long[] jjbitVec0 = {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   113
   0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   114
};
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   115
static final long[] jjbitVec2 = {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   116
   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   117
};
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   118
private int jjMoveNfa_0(int startState, int curPos)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   119
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   120
   int startsAt = 0;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   121
   jjnewStateCnt = 29;
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   122
   int i = 1;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   123
   jjstateSet[0] = startState;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   124
   int kind = 0x7fffffff;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   125
   for (;;)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   126
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   127
      if (++jjround == 0x7fffffff)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   128
         ReInitRounds();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   129
      if (curChar < 64)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   130
      {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   131
         long l = 1L << curChar;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   132
         do
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   133
         {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   134
            switch(jjstateSet[--i])
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   135
            {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   136
               case 0:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   137
                  if ((0x3ff000000000000L & l) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   138
                  {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   139
                     if (kind > 7)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   140
                        kind = 7;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   141
                     jjCheckNAddStates(0, 6);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   142
                  }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   143
                  else if (curChar == 45)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   144
                     jjCheckNAddStates(7, 10);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   145
                  else if (curChar == 34)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   146
                     jjCheckNAddStates(11, 13);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   147
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   148
               case 1:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   149
                  if ((0xfffffffbffffffffL & l) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   150
                     jjCheckNAddStates(11, 13);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   151
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   152
               case 3:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   153
                  if (curChar == 34)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   154
                     jjCheckNAddStates(11, 13);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   155
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   156
               case 4:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   157
                  if (curChar == 34 && kind > 13)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   158
                     kind = 13;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   159
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   160
               case 13:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   161
                  if (curChar == 45)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   162
                     jjCheckNAddStates(7, 10);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   163
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   164
               case 14:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   165
                  if ((0x3ff000000000000L & l) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   166
                     break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   167
                  if (kind > 7)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   168
                     kind = 7;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   169
                  jjCheckNAdd(14);
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   170
                  break;
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   171
               case 15:
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   172
                  if ((0x3ff000000000000L & l) != 0L)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   173
                     jjCheckNAddTwoStates(15, 16);
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   174
                  break;
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   175
               case 16:
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   176
                  if (curChar == 46)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   177
                     jjCheckNAdd(17);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   178
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   179
               case 17:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   180
                  if ((0x3ff000000000000L & l) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   181
                     break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   182
                  if (kind > 8)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   183
                     kind = 8;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   184
                  jjCheckNAdd(17);
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   185
                  break;
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   186
               case 18:
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   187
                  if ((0x3ff000000000000L & l) != 0L)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   188
                     jjCheckNAddTwoStates(18, 19);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   189
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   190
               case 20:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   191
                  if ((0x280000000000L & l) != 0L)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   192
                     jjCheckNAdd(21);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   193
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   194
               case 21:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   195
                  if ((0x3ff000000000000L & l) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   196
                     break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   197
                  if (kind > 8)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   198
                     kind = 8;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   199
                  jjCheckNAdd(21);
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   200
                  break;
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   201
               case 22:
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   202
                  if ((0x3ff000000000000L & l) != 0L)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   203
                     jjCheckNAddTwoStates(22, 23);
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   204
                  break;
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   205
               case 23:
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   206
                  if (curChar == 46)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   207
                     jjCheckNAdd(24);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   208
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   209
               case 24:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   210
                  if ((0x3ff000000000000L & l) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   211
                     jjCheckNAddTwoStates(24, 25);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   212
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   213
               case 26:
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   214
                  if ((0x280000000000L & l) != 0L)
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   215
                     jjCheckNAdd(27);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   216
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   217
               case 27:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   218
                  if ((0x3ff000000000000L & l) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   219
                     break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   220
                  if (kind > 8)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   221
                     kind = 8;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   222
                  jjCheckNAdd(27);
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   223
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   224
               case 28:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   225
                  if ((0x3ff000000000000L & l) == 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   226
                     break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   227
                  if (kind > 7)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   228
                     kind = 7;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   229
                  jjCheckNAddStates(0, 6);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   230
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   231
               default : break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   232
            }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   233
         } while(i != startsAt);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   234
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   235
      else if (curChar < 128)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   236
      {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   237
         long l = 1L << (curChar & 077);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   238
         do
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   239
         {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   240
            switch(jjstateSet[--i])
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   241
            {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   242
               case 0:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   243
                  if ((0x4000000040L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   244
                     jjstateSet[jjnewStateCnt++] = 11;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   245
                  else if ((0x10000000100000L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   246
                     jjstateSet[jjnewStateCnt++] = 7;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   247
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   248
               case 1:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   249
                  if ((0xffffffffefffffffL & l) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   250
                     jjCheckNAddStates(11, 13);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   251
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   252
               case 2:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   253
                  if (curChar == 92)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   254
                     jjstateSet[jjnewStateCnt++] = 3;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   255
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   256
               case 3:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   257
                  if ((0x14404410144044L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   258
                     jjCheckNAddStates(11, 13);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   259
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   260
               case 5:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   261
                  if ((0x2000000020L & l) != 0L && kind > 14)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   262
                     kind = 14;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   263
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   264
               case 6:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   265
                  if ((0x20000000200000L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   266
                     jjCheckNAdd(5);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   267
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   268
               case 7:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   269
                  if ((0x4000000040000L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   270
                     jjstateSet[jjnewStateCnt++] = 6;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   271
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   272
               case 8:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   273
                  if ((0x10000000100000L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   274
                     jjstateSet[jjnewStateCnt++] = 7;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   275
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   276
               case 9:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   277
                  if ((0x8000000080000L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   278
                     jjCheckNAdd(5);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   279
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   280
               case 10:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   281
                  if ((0x100000001000L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   282
                     jjstateSet[jjnewStateCnt++] = 9;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   283
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   284
               case 11:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   285
                  if ((0x200000002L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   286
                     jjstateSet[jjnewStateCnt++] = 10;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   287
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   288
               case 12:
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   289
                  if ((0x4000000040L & l) != 0L)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   290
                     jjstateSet[jjnewStateCnt++] = 11;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   291
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   292
               case 19:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   293
                  if ((0x2000000020L & l) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   294
                     jjAddStates(14, 15);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   295
                  break;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   296
               case 25:
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   297
                  if ((0x2000000020L & l) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   298
                     jjAddStates(16, 17);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   299
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   300
               default : break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   301
            }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   302
         } while(i != startsAt);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   303
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   304
      else
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   305
      {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   306
         int hiByte = (curChar >> 8);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   307
         int i1 = hiByte >> 6;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   308
         long l1 = 1L << (hiByte & 077);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   309
         int i2 = (curChar & 0xff) >> 6;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   310
         long l2 = 1L << (curChar & 077);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   311
         do
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   312
         {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   313
            switch(jjstateSet[--i])
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   314
            {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   315
               case 1:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   316
                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   317
                     jjAddStates(11, 13);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   318
                  break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   319
               default : break;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   320
            }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   321
         } while(i != startsAt);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   322
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   323
      if (kind != 0x7fffffff)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   324
      {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   325
         jjmatchedKind = kind;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   326
         jjmatchedPos = curPos;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   327
         kind = 0x7fffffff;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   328
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   329
      ++curPos;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   330
      if ((i = jjnewStateCnt) == (startsAt = 29 - (jjnewStateCnt = startsAt)))
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   331
         return curPos;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   332
      try { curChar = input_stream.readChar(); }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   333
      catch(java.io.IOException e) { return curPos; }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   334
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   335
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   336
static final int[] jjnextStates = {
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   337
   14, 15, 16, 18, 19, 22, 23, 14, 15, 18, 22, 1, 2, 4, 20, 21, 
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   338
   26, 27, 
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   339
};
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   340
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   341
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   342
   switch(hiByte)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   343
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   344
      case 0:
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   345
         return ((jjbitVec2[i2] & l2) != 0L);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   346
      default :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   347
         if ((jjbitVec0[i1] & l1) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   348
            return true;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   349
         return false;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   350
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   351
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   352
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   353
/** Token literal values. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   354
public static final String[] jjstrLiteralImages = {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   355
"", null, null, null, null, null, null, null, null, null, null, null, null, 
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   356
null, null, null, "\173", "\72", "\54", "\175", "\133", "\135", };
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   357
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   358
/** Lexer state names. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   359
public static final String[] lexStateNames = {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   360
   "DEFAULT",
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   361
};
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   362
static final long[] jjtoToken = {
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   363
   0x3fe181L, 
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   364
};
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   365
static final long[] jjtoSkip = {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   366
   0x7eL, 
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   367
};
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   368
protected JavaCharStream input_stream;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   369
private final int[] jjrounds = new int[29];
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   370
private final int[] jjstateSet = new int[58];
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   371
protected char curChar;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   372
/** Constructor. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   373
public JSONParserTokenManager(JavaCharStream stream){
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   374
   if (JavaCharStream.staticFlag)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   375
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   376
   input_stream = stream;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   377
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   378
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   379
/** Constructor. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   380
public JSONParserTokenManager(JavaCharStream stream, int lexState){
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   381
   this(stream);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   382
   SwitchTo(lexState);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   383
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   384
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   385
/** Reinitialise parser. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   386
public void ReInit(JavaCharStream stream)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   387
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   388
   jjmatchedPos = jjnewStateCnt = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   389
   curLexState = defaultLexState;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   390
   input_stream = stream;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   391
   ReInitRounds();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   392
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   393
private void ReInitRounds()
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   394
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   395
   int i;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   396
   jjround = 0x80000001;
56002
60ab3b595a8e Lot of bug fixes
hb
parents: 55985
diff changeset
   397
   for (i = 29; i-- > 0;)
55985
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   398
      jjrounds[i] = 0x80000000;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   399
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   400
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   401
/** Reinitialise parser. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   402
public void ReInit(JavaCharStream stream, int lexState)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   403
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   404
   ReInit(stream);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   405
   SwitchTo(lexState);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   406
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   407
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   408
/** Switch to specified lex state. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   409
public void SwitchTo(int lexState)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   410
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   411
   if (lexState >= 1 || lexState < 0)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   412
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   413
   else
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   414
      curLexState = lexState;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   415
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   416
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   417
protected Token jjFillToken()
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   418
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   419
   final Token t;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   420
   final String curTokenImage;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   421
   final int beginLine;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   422
   final int endLine;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   423
   final int beginColumn;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   424
   final int endColumn;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   425
   String im = jjstrLiteralImages[jjmatchedKind];
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   426
   curTokenImage = (im == null) ? input_stream.GetImage() : im;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   427
   beginLine = input_stream.getBeginLine();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   428
   beginColumn = input_stream.getBeginColumn();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   429
   endLine = input_stream.getEndLine();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   430
   endColumn = input_stream.getEndColumn();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   431
   t = Token.newToken(jjmatchedKind, curTokenImage);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   432
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   433
   t.beginLine = beginLine;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   434
   t.endLine = endLine;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   435
   t.beginColumn = beginColumn;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   436
   t.endColumn = endColumn;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   437
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   438
   return t;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   439
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   440
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   441
int curLexState = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   442
int defaultLexState = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   443
int jjnewStateCnt;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   444
int jjround;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   445
int jjmatchedPos;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   446
int jjmatchedKind;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   447
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   448
/** Get the next Token. */
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   449
public Token getNextToken() 
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   450
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   451
  Token matchedToken;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   452
  int curPos = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   453
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   454
  EOFLoop :
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   455
  for (;;)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   456
  {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   457
   try
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   458
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   459
      curChar = input_stream.BeginToken();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   460
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   461
   catch(java.io.IOException e)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   462
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   463
      jjmatchedKind = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   464
      matchedToken = jjFillToken();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   465
      return matchedToken;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   466
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   467
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   468
   try { input_stream.backup(0);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   469
      while (curChar <= 32 && (0x100003700L & (1L << curChar)) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   470
         curChar = input_stream.BeginToken();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   471
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   472
   catch (java.io.IOException e1) { continue EOFLoop; }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   473
   jjmatchedKind = 0x7fffffff;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   474
   jjmatchedPos = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   475
   curPos = jjMoveStringLiteralDfa0_0();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   476
   if (jjmatchedKind != 0x7fffffff)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   477
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   478
      if (jjmatchedPos + 1 < curPos)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   479
         input_stream.backup(curPos - jjmatchedPos - 1);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   480
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   481
      {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   482
         matchedToken = jjFillToken();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   483
         return matchedToken;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   484
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   485
      else
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   486
      {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   487
         continue EOFLoop;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   488
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   489
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   490
   int error_line = input_stream.getEndLine();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   491
   int error_column = input_stream.getEndColumn();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   492
   String error_after = null;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   493
   boolean EOFSeen = false;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   494
   try { input_stream.readChar(); input_stream.backup(1); }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   495
   catch (java.io.IOException e1) {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   496
      EOFSeen = true;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   497
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   498
      if (curChar == '\n' || curChar == '\r') {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   499
         error_line++;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   500
         error_column = 0;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   501
      }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   502
      else
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   503
         error_column++;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   504
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   505
   if (!EOFSeen) {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   506
      input_stream.backup(1);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   507
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   508
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   509
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   510
  }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   511
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   512
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   513
private void jjCheckNAdd(int state)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   514
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   515
   if (jjrounds[state] != jjround)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   516
   {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   517
      jjstateSet[jjnewStateCnt++] = state;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   518
      jjrounds[state] = jjround;
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   519
   }
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   520
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   521
private void jjAddStates(int start, int end)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   522
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   523
   do {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   524
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   525
   } while (start++ != end);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   526
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   527
private void jjCheckNAddTwoStates(int state1, int state2)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   528
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   529
   jjCheckNAdd(state1);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   530
   jjCheckNAdd(state2);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   531
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   532
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   533
private void jjCheckNAddStates(int start, int end)
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   534
{
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   535
   do {
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   536
      jjCheckNAdd(jjnextStates[start]);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   537
   } while (start++ != end);
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   538
}
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   539
0c5a02edfdef REST Adapter Initial commit
hb
parents:
diff changeset
   540
}