[120] | 1 | /* Generated By:JavaCC: Do not edit this line. RccTokenManager.java */ |
---|
| 2 | /** |
---|
| 3 | * Licensed to the Apache Software Foundation (ASF) under one |
---|
| 4 | * or more contributor license agreements. See the NOTICE file |
---|
| 5 | * distributed with this work for additional information |
---|
| 6 | * regarding copyright ownership. The ASF licenses this file |
---|
| 7 | * to you under the Apache License, Version 2.0 (the |
---|
| 8 | * "License"); you may not use this file except in compliance |
---|
| 9 | * with the License. You may obtain a copy of the License at |
---|
| 10 | * |
---|
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 12 | * |
---|
| 13 | * Unless required by applicable law or agreed to in writing, software |
---|
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 16 | * See the License for the specific language governing permissions and |
---|
| 17 | * limitations under the License. |
---|
| 18 | */ |
---|
| 19 | |
---|
| 20 | package org.apache.hadoop.record.compiler.generated; |
---|
| 21 | import org.apache.hadoop.record.compiler.*; |
---|
| 22 | import java.util.ArrayList; |
---|
| 23 | import java.util.Hashtable; |
---|
| 24 | import java.util.Iterator; |
---|
| 25 | import java.io.File; |
---|
| 26 | import java.io.FileReader; |
---|
| 27 | import java.io.FileNotFoundException; |
---|
| 28 | import java.io.IOException; |
---|
| 29 | |
---|
| 30 | public class RccTokenManager implements RccConstants |
---|
| 31 | { |
---|
| 32 | public java.io.PrintStream debugStream = System.out; |
---|
| 33 | public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } |
---|
| 34 | private final int jjMoveStringLiteralDfa0_1() |
---|
| 35 | { |
---|
| 36 | return jjMoveNfa_1(0, 0); |
---|
| 37 | } |
---|
| 38 | private final void jjCheckNAdd(int state) |
---|
| 39 | { |
---|
| 40 | if (jjrounds[state] != jjround) |
---|
| 41 | { |
---|
| 42 | jjstateSet[jjnewStateCnt++] = state; |
---|
| 43 | jjrounds[state] = jjround; |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | private final void jjAddStates(int start, int end) |
---|
| 47 | { |
---|
| 48 | do { |
---|
| 49 | jjstateSet[jjnewStateCnt++] = jjnextStates[start]; |
---|
| 50 | } while (start++ != end); |
---|
| 51 | } |
---|
| 52 | private final void jjCheckNAddTwoStates(int state1, int state2) |
---|
| 53 | { |
---|
| 54 | jjCheckNAdd(state1); |
---|
| 55 | jjCheckNAdd(state2); |
---|
| 56 | } |
---|
| 57 | private final void jjCheckNAddStates(int start, int end) |
---|
| 58 | { |
---|
| 59 | do { |
---|
| 60 | jjCheckNAdd(jjnextStates[start]); |
---|
| 61 | } while (start++ != end); |
---|
| 62 | } |
---|
| 63 | private final void jjCheckNAddStates(int start) |
---|
| 64 | { |
---|
| 65 | jjCheckNAdd(jjnextStates[start]); |
---|
| 66 | jjCheckNAdd(jjnextStates[start + 1]); |
---|
| 67 | } |
---|
| 68 | private final int jjMoveNfa_1(int startState, int curPos) |
---|
| 69 | { |
---|
| 70 | int[] nextStates; |
---|
| 71 | int startsAt = 0; |
---|
| 72 | jjnewStateCnt = 3; |
---|
| 73 | int i = 1; |
---|
| 74 | jjstateSet[0] = startState; |
---|
| 75 | int j, kind = 0x7fffffff; |
---|
| 76 | for (;;) |
---|
| 77 | { |
---|
| 78 | if (++jjround == 0x7fffffff) |
---|
| 79 | ReInitRounds(); |
---|
| 80 | if (curChar < 64) |
---|
| 81 | { |
---|
| 82 | long l = 1L << curChar; |
---|
| 83 | MatchLoop: do |
---|
| 84 | { |
---|
| 85 | switch(jjstateSet[--i]) |
---|
| 86 | { |
---|
| 87 | case 0: |
---|
| 88 | if ((0x2400L & l) != 0L) |
---|
| 89 | { |
---|
| 90 | if (kind > 6) |
---|
| 91 | kind = 6; |
---|
| 92 | } |
---|
| 93 | if (curChar == 13) |
---|
| 94 | jjstateSet[jjnewStateCnt++] = 1; |
---|
| 95 | break; |
---|
| 96 | case 1: |
---|
| 97 | if (curChar == 10 && kind > 6) |
---|
| 98 | kind = 6; |
---|
| 99 | break; |
---|
| 100 | case 2: |
---|
| 101 | if (curChar == 13) |
---|
| 102 | jjstateSet[jjnewStateCnt++] = 1; |
---|
| 103 | break; |
---|
| 104 | default : break; |
---|
| 105 | } |
---|
| 106 | } while(i != startsAt); |
---|
| 107 | } |
---|
| 108 | else if (curChar < 128) |
---|
| 109 | { |
---|
| 110 | long l = 1L << (curChar & 077); |
---|
| 111 | MatchLoop: do |
---|
| 112 | { |
---|
| 113 | switch(jjstateSet[--i]) |
---|
| 114 | { |
---|
| 115 | default : break; |
---|
| 116 | } |
---|
| 117 | } while(i != startsAt); |
---|
| 118 | } |
---|
| 119 | else |
---|
| 120 | { |
---|
| 121 | int i2 = (curChar & 0xff) >> 6; |
---|
| 122 | long l2 = 1L << (curChar & 077); |
---|
| 123 | MatchLoop: do |
---|
| 124 | { |
---|
| 125 | switch(jjstateSet[--i]) |
---|
| 126 | { |
---|
| 127 | default : break; |
---|
| 128 | } |
---|
| 129 | } while(i != startsAt); |
---|
| 130 | } |
---|
| 131 | if (kind != 0x7fffffff) |
---|
| 132 | { |
---|
| 133 | jjmatchedKind = kind; |
---|
| 134 | jjmatchedPos = curPos; |
---|
| 135 | kind = 0x7fffffff; |
---|
| 136 | } |
---|
| 137 | ++curPos; |
---|
| 138 | if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) |
---|
| 139 | return curPos; |
---|
| 140 | try { curChar = input_stream.readChar(); } |
---|
| 141 | catch(java.io.IOException e) { return curPos; } |
---|
| 142 | } |
---|
| 143 | } |
---|
| 144 | private final int jjStopStringLiteralDfa_0(int pos, long active0) |
---|
| 145 | { |
---|
| 146 | switch (pos) |
---|
| 147 | { |
---|
| 148 | case 0: |
---|
| 149 | if ((active0 & 0xfff800L) != 0L) |
---|
| 150 | { |
---|
| 151 | jjmatchedKind = 32; |
---|
| 152 | return 4; |
---|
| 153 | } |
---|
| 154 | return -1; |
---|
| 155 | case 1: |
---|
| 156 | if ((active0 & 0xfff800L) != 0L) |
---|
| 157 | { |
---|
| 158 | jjmatchedKind = 32; |
---|
| 159 | jjmatchedPos = 1; |
---|
| 160 | return 4; |
---|
| 161 | } |
---|
| 162 | return -1; |
---|
| 163 | case 2: |
---|
| 164 | if ((active0 & 0x7ef800L) != 0L) |
---|
| 165 | { |
---|
| 166 | jjmatchedKind = 32; |
---|
| 167 | jjmatchedPos = 2; |
---|
| 168 | return 4; |
---|
| 169 | } |
---|
| 170 | if ((active0 & 0x810000L) != 0L) |
---|
| 171 | return 4; |
---|
| 172 | return -1; |
---|
| 173 | case 3: |
---|
| 174 | if ((active0 & 0x24000L) != 0L) |
---|
| 175 | return 4; |
---|
| 176 | if ((active0 & 0x7cb800L) != 0L) |
---|
| 177 | { |
---|
| 178 | jjmatchedKind = 32; |
---|
| 179 | jjmatchedPos = 3; |
---|
| 180 | return 4; |
---|
| 181 | } |
---|
| 182 | return -1; |
---|
| 183 | case 4: |
---|
| 184 | if ((active0 & 0x41000L) != 0L) |
---|
| 185 | return 4; |
---|
| 186 | if ((active0 & 0x78a800L) != 0L) |
---|
| 187 | { |
---|
| 188 | jjmatchedKind = 32; |
---|
| 189 | jjmatchedPos = 4; |
---|
| 190 | return 4; |
---|
| 191 | } |
---|
| 192 | return -1; |
---|
| 193 | case 5: |
---|
| 194 | if ((active0 & 0x680800L) != 0L) |
---|
| 195 | return 4; |
---|
| 196 | if ((active0 & 0x10a000L) != 0L) |
---|
| 197 | { |
---|
| 198 | jjmatchedKind = 32; |
---|
| 199 | jjmatchedPos = 5; |
---|
| 200 | return 4; |
---|
| 201 | } |
---|
| 202 | return -1; |
---|
| 203 | default : |
---|
| 204 | return -1; |
---|
| 205 | } |
---|
| 206 | } |
---|
| 207 | private final int jjStartNfa_0(int pos, long active0) |
---|
| 208 | { |
---|
| 209 | return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); |
---|
| 210 | } |
---|
| 211 | private final int jjStopAtPos(int pos, int kind) |
---|
| 212 | { |
---|
| 213 | jjmatchedKind = kind; |
---|
| 214 | jjmatchedPos = pos; |
---|
| 215 | return pos + 1; |
---|
| 216 | } |
---|
| 217 | private final int jjStartNfaWithStates_0(int pos, int kind, int state) |
---|
| 218 | { |
---|
| 219 | jjmatchedKind = kind; |
---|
| 220 | jjmatchedPos = pos; |
---|
| 221 | try { curChar = input_stream.readChar(); } |
---|
| 222 | catch(java.io.IOException e) { return pos + 1; } |
---|
| 223 | return jjMoveNfa_0(state, pos + 1); |
---|
| 224 | } |
---|
| 225 | private final int jjMoveStringLiteralDfa0_0() |
---|
| 226 | { |
---|
| 227 | switch(curChar) |
---|
| 228 | { |
---|
| 229 | case 44: |
---|
| 230 | return jjStopAtPos(0, 29); |
---|
| 231 | case 46: |
---|
| 232 | return jjStopAtPos(0, 30); |
---|
| 233 | case 47: |
---|
| 234 | return jjMoveStringLiteralDfa1_0(0x120L); |
---|
| 235 | case 59: |
---|
| 236 | return jjStopAtPos(0, 28); |
---|
| 237 | case 60: |
---|
| 238 | return jjStopAtPos(0, 26); |
---|
| 239 | case 62: |
---|
| 240 | return jjStopAtPos(0, 27); |
---|
| 241 | case 98: |
---|
| 242 | return jjMoveStringLiteralDfa1_0(0x20c000L); |
---|
| 243 | case 99: |
---|
| 244 | return jjMoveStringLiteralDfa1_0(0x1000L); |
---|
| 245 | case 100: |
---|
| 246 | return jjMoveStringLiteralDfa1_0(0x80000L); |
---|
| 247 | case 102: |
---|
| 248 | return jjMoveStringLiteralDfa1_0(0x40000L); |
---|
| 249 | case 105: |
---|
| 250 | return jjMoveStringLiteralDfa1_0(0x12000L); |
---|
| 251 | case 108: |
---|
| 252 | return jjMoveStringLiteralDfa1_0(0x20000L); |
---|
| 253 | case 109: |
---|
| 254 | return jjMoveStringLiteralDfa1_0(0x800800L); |
---|
| 255 | case 117: |
---|
| 256 | return jjMoveStringLiteralDfa1_0(0x100000L); |
---|
| 257 | case 118: |
---|
| 258 | return jjMoveStringLiteralDfa1_0(0x400000L); |
---|
| 259 | case 123: |
---|
| 260 | return jjStopAtPos(0, 24); |
---|
| 261 | case 125: |
---|
| 262 | return jjStopAtPos(0, 25); |
---|
| 263 | default : |
---|
| 264 | return jjMoveNfa_0(0, 0); |
---|
| 265 | } |
---|
| 266 | } |
---|
| 267 | private final int jjMoveStringLiteralDfa1_0(long active0) |
---|
| 268 | { |
---|
| 269 | try { curChar = input_stream.readChar(); } |
---|
| 270 | catch(java.io.IOException e) { |
---|
| 271 | jjStopStringLiteralDfa_0(0, active0); |
---|
| 272 | return 1; |
---|
| 273 | } |
---|
| 274 | switch(curChar) |
---|
| 275 | { |
---|
| 276 | case 42: |
---|
| 277 | if ((active0 & 0x100L) != 0L) |
---|
| 278 | return jjStopAtPos(1, 8); |
---|
| 279 | break; |
---|
| 280 | case 47: |
---|
| 281 | if ((active0 & 0x20L) != 0L) |
---|
| 282 | return jjStopAtPos(1, 5); |
---|
| 283 | break; |
---|
| 284 | case 97: |
---|
| 285 | return jjMoveStringLiteralDfa2_0(active0, 0x800000L); |
---|
| 286 | case 101: |
---|
| 287 | return jjMoveStringLiteralDfa2_0(active0, 0x400000L); |
---|
| 288 | case 108: |
---|
| 289 | return jjMoveStringLiteralDfa2_0(active0, 0x41000L); |
---|
| 290 | case 110: |
---|
| 291 | return jjMoveStringLiteralDfa2_0(active0, 0x12000L); |
---|
| 292 | case 111: |
---|
| 293 | return jjMoveStringLiteralDfa2_0(active0, 0xa8800L); |
---|
| 294 | case 115: |
---|
| 295 | return jjMoveStringLiteralDfa2_0(active0, 0x100000L); |
---|
| 296 | case 117: |
---|
| 297 | return jjMoveStringLiteralDfa2_0(active0, 0x200000L); |
---|
| 298 | case 121: |
---|
| 299 | return jjMoveStringLiteralDfa2_0(active0, 0x4000L); |
---|
| 300 | default : |
---|
| 301 | break; |
---|
| 302 | } |
---|
| 303 | return jjStartNfa_0(0, active0); |
---|
| 304 | } |
---|
| 305 | private final int jjMoveStringLiteralDfa2_0(long old0, long active0) |
---|
| 306 | { |
---|
| 307 | if (((active0 &= old0)) == 0L) |
---|
| 308 | return jjStartNfa_0(0, old0); |
---|
| 309 | try { curChar = input_stream.readChar(); } |
---|
| 310 | catch(java.io.IOException e) { |
---|
| 311 | jjStopStringLiteralDfa_0(1, active0); |
---|
| 312 | return 2; |
---|
| 313 | } |
---|
| 314 | switch(curChar) |
---|
| 315 | { |
---|
| 316 | case 97: |
---|
| 317 | return jjMoveStringLiteralDfa3_0(active0, 0x1000L); |
---|
| 318 | case 99: |
---|
| 319 | return jjMoveStringLiteralDfa3_0(active0, 0x402000L); |
---|
| 320 | case 100: |
---|
| 321 | return jjMoveStringLiteralDfa3_0(active0, 0x800L); |
---|
| 322 | case 102: |
---|
| 323 | return jjMoveStringLiteralDfa3_0(active0, 0x200000L); |
---|
| 324 | case 110: |
---|
| 325 | return jjMoveStringLiteralDfa3_0(active0, 0x20000L); |
---|
| 326 | case 111: |
---|
| 327 | return jjMoveStringLiteralDfa3_0(active0, 0x48000L); |
---|
| 328 | case 112: |
---|
| 329 | if ((active0 & 0x800000L) != 0L) |
---|
| 330 | return jjStartNfaWithStates_0(2, 23, 4); |
---|
| 331 | break; |
---|
| 332 | case 116: |
---|
| 333 | if ((active0 & 0x10000L) != 0L) |
---|
| 334 | return jjStartNfaWithStates_0(2, 16, 4); |
---|
| 335 | return jjMoveStringLiteralDfa3_0(active0, 0x104000L); |
---|
| 336 | case 117: |
---|
| 337 | return jjMoveStringLiteralDfa3_0(active0, 0x80000L); |
---|
| 338 | default : |
---|
| 339 | break; |
---|
| 340 | } |
---|
| 341 | return jjStartNfa_0(1, active0); |
---|
| 342 | } |
---|
| 343 | private final int jjMoveStringLiteralDfa3_0(long old0, long active0) |
---|
| 344 | { |
---|
| 345 | if (((active0 &= old0)) == 0L) |
---|
| 346 | return jjStartNfa_0(1, old0); |
---|
| 347 | try { curChar = input_stream.readChar(); } |
---|
| 348 | catch(java.io.IOException e) { |
---|
| 349 | jjStopStringLiteralDfa_0(2, active0); |
---|
| 350 | return 3; |
---|
| 351 | } |
---|
| 352 | switch(curChar) |
---|
| 353 | { |
---|
| 354 | case 97: |
---|
| 355 | return jjMoveStringLiteralDfa4_0(active0, 0x40000L); |
---|
| 356 | case 98: |
---|
| 357 | return jjMoveStringLiteralDfa4_0(active0, 0x80000L); |
---|
| 358 | case 101: |
---|
| 359 | if ((active0 & 0x4000L) != 0L) |
---|
| 360 | return jjStartNfaWithStates_0(3, 14, 4); |
---|
| 361 | break; |
---|
| 362 | case 102: |
---|
| 363 | return jjMoveStringLiteralDfa4_0(active0, 0x200000L); |
---|
| 364 | case 103: |
---|
| 365 | if ((active0 & 0x20000L) != 0L) |
---|
| 366 | return jjStartNfaWithStates_0(3, 17, 4); |
---|
| 367 | break; |
---|
| 368 | case 108: |
---|
| 369 | return jjMoveStringLiteralDfa4_0(active0, 0xa000L); |
---|
| 370 | case 114: |
---|
| 371 | return jjMoveStringLiteralDfa4_0(active0, 0x100000L); |
---|
| 372 | case 115: |
---|
| 373 | return jjMoveStringLiteralDfa4_0(active0, 0x1000L); |
---|
| 374 | case 116: |
---|
| 375 | return jjMoveStringLiteralDfa4_0(active0, 0x400000L); |
---|
| 376 | case 117: |
---|
| 377 | return jjMoveStringLiteralDfa4_0(active0, 0x800L); |
---|
| 378 | default : |
---|
| 379 | break; |
---|
| 380 | } |
---|
| 381 | return jjStartNfa_0(2, active0); |
---|
| 382 | } |
---|
| 383 | private final int jjMoveStringLiteralDfa4_0(long old0, long active0) |
---|
| 384 | { |
---|
| 385 | if (((active0 &= old0)) == 0L) |
---|
| 386 | return jjStartNfa_0(2, old0); |
---|
| 387 | try { curChar = input_stream.readChar(); } |
---|
| 388 | catch(java.io.IOException e) { |
---|
| 389 | jjStopStringLiteralDfa_0(3, active0); |
---|
| 390 | return 4; |
---|
| 391 | } |
---|
| 392 | switch(curChar) |
---|
| 393 | { |
---|
| 394 | case 101: |
---|
| 395 | return jjMoveStringLiteralDfa5_0(active0, 0x208000L); |
---|
| 396 | case 105: |
---|
| 397 | return jjMoveStringLiteralDfa5_0(active0, 0x100000L); |
---|
| 398 | case 108: |
---|
| 399 | return jjMoveStringLiteralDfa5_0(active0, 0x80800L); |
---|
| 400 | case 111: |
---|
| 401 | return jjMoveStringLiteralDfa5_0(active0, 0x400000L); |
---|
| 402 | case 115: |
---|
| 403 | if ((active0 & 0x1000L) != 0L) |
---|
| 404 | return jjStartNfaWithStates_0(4, 12, 4); |
---|
| 405 | break; |
---|
| 406 | case 116: |
---|
| 407 | if ((active0 & 0x40000L) != 0L) |
---|
| 408 | return jjStartNfaWithStates_0(4, 18, 4); |
---|
| 409 | break; |
---|
| 410 | case 117: |
---|
| 411 | return jjMoveStringLiteralDfa5_0(active0, 0x2000L); |
---|
| 412 | default : |
---|
| 413 | break; |
---|
| 414 | } |
---|
| 415 | return jjStartNfa_0(3, active0); |
---|
| 416 | } |
---|
| 417 | private final int jjMoveStringLiteralDfa5_0(long old0, long active0) |
---|
| 418 | { |
---|
| 419 | if (((active0 &= old0)) == 0L) |
---|
| 420 | return jjStartNfa_0(3, old0); |
---|
| 421 | try { curChar = input_stream.readChar(); } |
---|
| 422 | catch(java.io.IOException e) { |
---|
| 423 | jjStopStringLiteralDfa_0(4, active0); |
---|
| 424 | return 5; |
---|
| 425 | } |
---|
| 426 | switch(curChar) |
---|
| 427 | { |
---|
| 428 | case 97: |
---|
| 429 | return jjMoveStringLiteralDfa6_0(active0, 0x8000L); |
---|
| 430 | case 100: |
---|
| 431 | return jjMoveStringLiteralDfa6_0(active0, 0x2000L); |
---|
| 432 | case 101: |
---|
| 433 | if ((active0 & 0x800L) != 0L) |
---|
| 434 | return jjStartNfaWithStates_0(5, 11, 4); |
---|
| 435 | else if ((active0 & 0x80000L) != 0L) |
---|
| 436 | return jjStartNfaWithStates_0(5, 19, 4); |
---|
| 437 | break; |
---|
| 438 | case 110: |
---|
| 439 | return jjMoveStringLiteralDfa6_0(active0, 0x100000L); |
---|
| 440 | case 114: |
---|
| 441 | if ((active0 & 0x200000L) != 0L) |
---|
| 442 | return jjStartNfaWithStates_0(5, 21, 4); |
---|
| 443 | else if ((active0 & 0x400000L) != 0L) |
---|
| 444 | return jjStartNfaWithStates_0(5, 22, 4); |
---|
| 445 | break; |
---|
| 446 | default : |
---|
| 447 | break; |
---|
| 448 | } |
---|
| 449 | return jjStartNfa_0(4, active0); |
---|
| 450 | } |
---|
| 451 | private final int jjMoveStringLiteralDfa6_0(long old0, long active0) |
---|
| 452 | { |
---|
| 453 | if (((active0 &= old0)) == 0L) |
---|
| 454 | return jjStartNfa_0(4, old0); |
---|
| 455 | try { curChar = input_stream.readChar(); } |
---|
| 456 | catch(java.io.IOException e) { |
---|
| 457 | jjStopStringLiteralDfa_0(5, active0); |
---|
| 458 | return 6; |
---|
| 459 | } |
---|
| 460 | switch(curChar) |
---|
| 461 | { |
---|
| 462 | case 101: |
---|
| 463 | if ((active0 & 0x2000L) != 0L) |
---|
| 464 | return jjStartNfaWithStates_0(6, 13, 4); |
---|
| 465 | break; |
---|
| 466 | case 103: |
---|
| 467 | if ((active0 & 0x100000L) != 0L) |
---|
| 468 | return jjStartNfaWithStates_0(6, 20, 4); |
---|
| 469 | break; |
---|
| 470 | case 110: |
---|
| 471 | if ((active0 & 0x8000L) != 0L) |
---|
| 472 | return jjStartNfaWithStates_0(6, 15, 4); |
---|
| 473 | break; |
---|
| 474 | default : |
---|
| 475 | break; |
---|
| 476 | } |
---|
| 477 | return jjStartNfa_0(5, active0); |
---|
| 478 | } |
---|
| 479 | static final long[] jjbitVec0 = { |
---|
| 480 | 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL |
---|
| 481 | }; |
---|
| 482 | private final int jjMoveNfa_0(int startState, int curPos) |
---|
| 483 | { |
---|
| 484 | int[] nextStates; |
---|
| 485 | int startsAt = 0; |
---|
| 486 | jjnewStateCnt = 5; |
---|
| 487 | int i = 1; |
---|
| 488 | jjstateSet[0] = startState; |
---|
| 489 | int j, kind = 0x7fffffff; |
---|
| 490 | for (;;) |
---|
| 491 | { |
---|
| 492 | if (++jjround == 0x7fffffff) |
---|
| 493 | ReInitRounds(); |
---|
| 494 | if (curChar < 64) |
---|
| 495 | { |
---|
| 496 | long l = 1L << curChar; |
---|
| 497 | MatchLoop: do |
---|
| 498 | { |
---|
| 499 | switch(jjstateSet[--i]) |
---|
| 500 | { |
---|
| 501 | case 0: |
---|
| 502 | if (curChar == 34) |
---|
| 503 | jjCheckNAdd(1); |
---|
| 504 | break; |
---|
| 505 | case 1: |
---|
| 506 | if ((0xfffffffbffffffffL & l) != 0L) |
---|
| 507 | jjCheckNAddTwoStates(1, 2); |
---|
| 508 | break; |
---|
| 509 | case 2: |
---|
| 510 | if (curChar == 34 && kind > 31) |
---|
| 511 | kind = 31; |
---|
| 512 | break; |
---|
| 513 | case 4: |
---|
| 514 | if ((0x3ff000000000000L & l) == 0L) |
---|
| 515 | break; |
---|
| 516 | if (kind > 32) |
---|
| 517 | kind = 32; |
---|
| 518 | jjstateSet[jjnewStateCnt++] = 4; |
---|
| 519 | break; |
---|
| 520 | default : break; |
---|
| 521 | } |
---|
| 522 | } while(i != startsAt); |
---|
| 523 | } |
---|
| 524 | else if (curChar < 128) |
---|
| 525 | { |
---|
| 526 | long l = 1L << (curChar & 077); |
---|
| 527 | MatchLoop: do |
---|
| 528 | { |
---|
| 529 | switch(jjstateSet[--i]) |
---|
| 530 | { |
---|
| 531 | case 0: |
---|
| 532 | if ((0x7fffffe07fffffeL & l) == 0L) |
---|
| 533 | break; |
---|
| 534 | if (kind > 32) |
---|
| 535 | kind = 32; |
---|
| 536 | jjCheckNAdd(4); |
---|
| 537 | break; |
---|
| 538 | case 1: |
---|
| 539 | jjAddStates(0, 1); |
---|
| 540 | break; |
---|
| 541 | case 4: |
---|
| 542 | if ((0x7fffffe87fffffeL & l) == 0L) |
---|
| 543 | break; |
---|
| 544 | if (kind > 32) |
---|
| 545 | kind = 32; |
---|
| 546 | jjCheckNAdd(4); |
---|
| 547 | break; |
---|
| 548 | default : break; |
---|
| 549 | } |
---|
| 550 | } while(i != startsAt); |
---|
| 551 | } |
---|
| 552 | else |
---|
| 553 | { |
---|
| 554 | int i2 = (curChar & 0xff) >> 6; |
---|
| 555 | long l2 = 1L << (curChar & 077); |
---|
| 556 | MatchLoop: do |
---|
| 557 | { |
---|
| 558 | switch(jjstateSet[--i]) |
---|
| 559 | { |
---|
| 560 | case 1: |
---|
| 561 | if ((jjbitVec0[i2] & l2) != 0L) |
---|
| 562 | jjAddStates(0, 1); |
---|
| 563 | break; |
---|
| 564 | default : break; |
---|
| 565 | } |
---|
| 566 | } while(i != startsAt); |
---|
| 567 | } |
---|
| 568 | if (kind != 0x7fffffff) |
---|
| 569 | { |
---|
| 570 | jjmatchedKind = kind; |
---|
| 571 | jjmatchedPos = curPos; |
---|
| 572 | kind = 0x7fffffff; |
---|
| 573 | } |
---|
| 574 | ++curPos; |
---|
| 575 | if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) |
---|
| 576 | return curPos; |
---|
| 577 | try { curChar = input_stream.readChar(); } |
---|
| 578 | catch(java.io.IOException e) { return curPos; } |
---|
| 579 | } |
---|
| 580 | } |
---|
| 581 | private final int jjMoveStringLiteralDfa0_2() |
---|
| 582 | { |
---|
| 583 | switch(curChar) |
---|
| 584 | { |
---|
| 585 | case 42: |
---|
| 586 | return jjMoveStringLiteralDfa1_2(0x200L); |
---|
| 587 | default : |
---|
| 588 | return 1; |
---|
| 589 | } |
---|
| 590 | } |
---|
| 591 | private final int jjMoveStringLiteralDfa1_2(long active0) |
---|
| 592 | { |
---|
| 593 | try { curChar = input_stream.readChar(); } |
---|
| 594 | catch(java.io.IOException e) { |
---|
| 595 | return 1; |
---|
| 596 | } |
---|
| 597 | switch(curChar) |
---|
| 598 | { |
---|
| 599 | case 47: |
---|
| 600 | if ((active0 & 0x200L) != 0L) |
---|
| 601 | return jjStopAtPos(1, 9); |
---|
| 602 | break; |
---|
| 603 | default : |
---|
| 604 | return 2; |
---|
| 605 | } |
---|
| 606 | return 2; |
---|
| 607 | } |
---|
| 608 | static final int[] jjnextStates = { |
---|
| 609 | 1, 2, |
---|
| 610 | }; |
---|
| 611 | public static final String[] jjstrLiteralImages = { |
---|
| 612 | "", null, null, null, null, null, null, null, null, null, null, |
---|
| 613 | "\155\157\144\165\154\145", "\143\154\141\163\163", "\151\156\143\154\165\144\145", "\142\171\164\145", |
---|
| 614 | "\142\157\157\154\145\141\156", "\151\156\164", "\154\157\156\147", "\146\154\157\141\164", |
---|
| 615 | "\144\157\165\142\154\145", "\165\163\164\162\151\156\147", "\142\165\146\146\145\162", |
---|
| 616 | "\166\145\143\164\157\162", "\155\141\160", "\173", "\175", "\74", "\76", "\73", "\54", "\56", null, null, }; |
---|
| 617 | public static final String[] lexStateNames = { |
---|
| 618 | "DEFAULT", |
---|
| 619 | "WithinOneLineComment", |
---|
| 620 | "WithinMultiLineComment", |
---|
| 621 | }; |
---|
| 622 | public static final int[] jjnewLexState = { |
---|
| 623 | -1, -1, -1, -1, -1, 1, 0, -1, 2, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 624 | -1, -1, -1, -1, -1, -1, -1, -1, |
---|
| 625 | }; |
---|
| 626 | static final long[] jjtoToken = { |
---|
| 627 | 0x1fffff801L, |
---|
| 628 | }; |
---|
| 629 | static final long[] jjtoSkip = { |
---|
| 630 | 0x37eL, |
---|
| 631 | }; |
---|
| 632 | static final long[] jjtoSpecial = { |
---|
| 633 | 0x360L, |
---|
| 634 | }; |
---|
| 635 | static final long[] jjtoMore = { |
---|
| 636 | 0x480L, |
---|
| 637 | }; |
---|
| 638 | protected SimpleCharStream input_stream; |
---|
| 639 | private final int[] jjrounds = new int[5]; |
---|
| 640 | private final int[] jjstateSet = new int[10]; |
---|
| 641 | StringBuffer image; |
---|
| 642 | int jjimageLen; |
---|
| 643 | int lengthOfMatch; |
---|
| 644 | protected char curChar; |
---|
| 645 | public RccTokenManager(SimpleCharStream stream){ |
---|
| 646 | if (SimpleCharStream.staticFlag) |
---|
| 647 | throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); |
---|
| 648 | input_stream = stream; |
---|
| 649 | } |
---|
| 650 | public RccTokenManager(SimpleCharStream stream, int lexState){ |
---|
| 651 | this(stream); |
---|
| 652 | SwitchTo(lexState); |
---|
| 653 | } |
---|
| 654 | public void ReInit(SimpleCharStream stream) |
---|
| 655 | { |
---|
| 656 | jjmatchedPos = jjnewStateCnt = 0; |
---|
| 657 | curLexState = defaultLexState; |
---|
| 658 | input_stream = stream; |
---|
| 659 | ReInitRounds(); |
---|
| 660 | } |
---|
| 661 | private final void ReInitRounds() |
---|
| 662 | { |
---|
| 663 | int i; |
---|
| 664 | jjround = 0x80000001; |
---|
| 665 | for (i = 5; i-- > 0;) |
---|
| 666 | jjrounds[i] = 0x80000000; |
---|
| 667 | } |
---|
| 668 | public void ReInit(SimpleCharStream stream, int lexState) |
---|
| 669 | { |
---|
| 670 | ReInit(stream); |
---|
| 671 | SwitchTo(lexState); |
---|
| 672 | } |
---|
| 673 | public void SwitchTo(int lexState) |
---|
| 674 | { |
---|
| 675 | if (lexState >= 3 || lexState < 0) |
---|
| 676 | throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); |
---|
| 677 | else |
---|
| 678 | curLexState = lexState; |
---|
| 679 | } |
---|
| 680 | |
---|
| 681 | protected Token jjFillToken() |
---|
| 682 | { |
---|
| 683 | Token t = Token.newToken(jjmatchedKind); |
---|
| 684 | t.kind = jjmatchedKind; |
---|
| 685 | String im = jjstrLiteralImages[jjmatchedKind]; |
---|
| 686 | t.image = (im == null) ? input_stream.GetImage() : im; |
---|
| 687 | t.beginLine = input_stream.getBeginLine(); |
---|
| 688 | t.beginColumn = input_stream.getBeginColumn(); |
---|
| 689 | t.endLine = input_stream.getEndLine(); |
---|
| 690 | t.endColumn = input_stream.getEndColumn(); |
---|
| 691 | return t; |
---|
| 692 | } |
---|
| 693 | |
---|
| 694 | int curLexState = 0; |
---|
| 695 | int defaultLexState = 0; |
---|
| 696 | int jjnewStateCnt; |
---|
| 697 | int jjround; |
---|
| 698 | int jjmatchedPos; |
---|
| 699 | int jjmatchedKind; |
---|
| 700 | |
---|
| 701 | public Token getNextToken() |
---|
| 702 | { |
---|
| 703 | int kind; |
---|
| 704 | Token specialToken = null; |
---|
| 705 | Token matchedToken; |
---|
| 706 | int curPos = 0; |
---|
| 707 | |
---|
| 708 | EOFLoop : |
---|
| 709 | for (;;) |
---|
| 710 | { |
---|
| 711 | try |
---|
| 712 | { |
---|
| 713 | curChar = input_stream.BeginToken(); |
---|
| 714 | } |
---|
| 715 | catch(java.io.IOException e) |
---|
| 716 | { |
---|
| 717 | jjmatchedKind = 0; |
---|
| 718 | matchedToken = jjFillToken(); |
---|
| 719 | matchedToken.specialToken = specialToken; |
---|
| 720 | return matchedToken; |
---|
| 721 | } |
---|
| 722 | image = null; |
---|
| 723 | jjimageLen = 0; |
---|
| 724 | |
---|
| 725 | for (;;) |
---|
| 726 | { |
---|
| 727 | switch(curLexState) |
---|
| 728 | { |
---|
| 729 | case 0: |
---|
| 730 | try { input_stream.backup(0); |
---|
| 731 | while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L) |
---|
| 732 | curChar = input_stream.BeginToken(); |
---|
| 733 | } |
---|
| 734 | catch (java.io.IOException e1) { continue EOFLoop; } |
---|
| 735 | jjmatchedKind = 0x7fffffff; |
---|
| 736 | jjmatchedPos = 0; |
---|
| 737 | curPos = jjMoveStringLiteralDfa0_0(); |
---|
| 738 | break; |
---|
| 739 | case 1: |
---|
| 740 | jjmatchedKind = 0x7fffffff; |
---|
| 741 | jjmatchedPos = 0; |
---|
| 742 | curPos = jjMoveStringLiteralDfa0_1(); |
---|
| 743 | if (jjmatchedPos == 0 && jjmatchedKind > 7) |
---|
| 744 | { |
---|
| 745 | jjmatchedKind = 7; |
---|
| 746 | } |
---|
| 747 | break; |
---|
| 748 | case 2: |
---|
| 749 | jjmatchedKind = 0x7fffffff; |
---|
| 750 | jjmatchedPos = 0; |
---|
| 751 | curPos = jjMoveStringLiteralDfa0_2(); |
---|
| 752 | if (jjmatchedPos == 0 && jjmatchedKind > 10) |
---|
| 753 | { |
---|
| 754 | jjmatchedKind = 10; |
---|
| 755 | } |
---|
| 756 | break; |
---|
| 757 | } |
---|
| 758 | if (jjmatchedKind != 0x7fffffff) |
---|
| 759 | { |
---|
| 760 | if (jjmatchedPos + 1 < curPos) |
---|
| 761 | input_stream.backup(curPos - jjmatchedPos - 1); |
---|
| 762 | if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) |
---|
| 763 | { |
---|
| 764 | matchedToken = jjFillToken(); |
---|
| 765 | matchedToken.specialToken = specialToken; |
---|
| 766 | if (jjnewLexState[jjmatchedKind] != -1) |
---|
| 767 | curLexState = jjnewLexState[jjmatchedKind]; |
---|
| 768 | return matchedToken; |
---|
| 769 | } |
---|
| 770 | else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) |
---|
| 771 | { |
---|
| 772 | if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) |
---|
| 773 | { |
---|
| 774 | matchedToken = jjFillToken(); |
---|
| 775 | if (specialToken == null) |
---|
| 776 | specialToken = matchedToken; |
---|
| 777 | else |
---|
| 778 | { |
---|
| 779 | matchedToken.specialToken = specialToken; |
---|
| 780 | specialToken = (specialToken.next = matchedToken); |
---|
| 781 | } |
---|
| 782 | SkipLexicalActions(matchedToken); |
---|
| 783 | } |
---|
| 784 | else |
---|
| 785 | SkipLexicalActions(null); |
---|
| 786 | if (jjnewLexState[jjmatchedKind] != -1) |
---|
| 787 | curLexState = jjnewLexState[jjmatchedKind]; |
---|
| 788 | continue EOFLoop; |
---|
| 789 | } |
---|
| 790 | jjimageLen += jjmatchedPos + 1; |
---|
| 791 | if (jjnewLexState[jjmatchedKind] != -1) |
---|
| 792 | curLexState = jjnewLexState[jjmatchedKind]; |
---|
| 793 | curPos = 0; |
---|
| 794 | jjmatchedKind = 0x7fffffff; |
---|
| 795 | try { |
---|
| 796 | curChar = input_stream.readChar(); |
---|
| 797 | continue; |
---|
| 798 | } |
---|
| 799 | catch (java.io.IOException e1) { } |
---|
| 800 | } |
---|
| 801 | int error_line = input_stream.getEndLine(); |
---|
| 802 | int error_column = input_stream.getEndColumn(); |
---|
| 803 | String error_after = null; |
---|
| 804 | boolean EOFSeen = false; |
---|
| 805 | try { input_stream.readChar(); input_stream.backup(1); } |
---|
| 806 | catch (java.io.IOException e1) { |
---|
| 807 | EOFSeen = true; |
---|
| 808 | error_after = curPos <= 1 ? "" : input_stream.GetImage(); |
---|
| 809 | if (curChar == '\n' || curChar == '\r') { |
---|
| 810 | error_line++; |
---|
| 811 | error_column = 0; |
---|
| 812 | } |
---|
| 813 | else |
---|
| 814 | error_column++; |
---|
| 815 | } |
---|
| 816 | if (!EOFSeen) { |
---|
| 817 | input_stream.backup(1); |
---|
| 818 | error_after = curPos <= 1 ? "" : input_stream.GetImage(); |
---|
| 819 | } |
---|
| 820 | throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); |
---|
| 821 | } |
---|
| 822 | } |
---|
| 823 | } |
---|
| 824 | |
---|
| 825 | void SkipLexicalActions(Token matchedToken) |
---|
| 826 | { |
---|
| 827 | switch(jjmatchedKind) |
---|
| 828 | { |
---|
| 829 | default : |
---|
| 830 | break; |
---|
| 831 | } |
---|
| 832 | } |
---|
| 833 | } |
---|