1 /* Generated By:JavaCC: Do not edit this line. SheetFormulaParserTokenManager.java */
2 package org.simantics.spreadsheet.graph.parser;
3 import org.simantics.spreadsheet.graph.parser.ast.*;
4 import java.util.ArrayList;
6 import java.util.Collections;
9 public class SheetFormulaParserTokenManager implements SheetFormulaParserConstants
13 public java.io.PrintStream debugStream = System.out;
14 /** Set debug output. */
15 public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
16 private final int jjStopStringLiteralDfa_0(int pos, long active0)
21 if ((active0 & 0x30000000L) != 0L)
26 if ((active0 & 0xe000000L) != 0L)
31 if ((active0 & 0x180000L) != 0L)
33 if ((active0 & 0x10000L) != 0L)
37 if ((active0 & 0x30000000L) != 0L)
43 if ((active0 & 0xe000000L) != 0L)
51 if ((active0 & 0x30000000L) != 0L)
57 if ((active0 & 0xe000000L) != 0L)
65 if ((active0 & 0x20000000L) != 0L)
71 if ((active0 & 0x10000000L) != 0L)
73 if ((active0 & 0x4000000L) != 0L)
79 if ((active0 & 0xa000000L) != 0L)
86 private final int jjStartNfa_0(int pos, long active0)
88 return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
90 private int jjStopAtPos(int pos, int kind)
96 private int jjMoveStringLiteralDfa0_0()
101 return jjStopAtPos(0, 42);
103 return jjMoveStringLiteralDfa1_0(0x80000000000L);
105 return jjStopAtPos(0, 13);
107 return jjStopAtPos(0, 5);
109 return jjStopAtPos(0, 6);
111 return jjStopAtPos(0, 15);
113 return jjStopAtPos(0, 14);
115 return jjStopAtPos(0, 18);
117 return jjStopAtPos(0, 46);
120 return jjMoveStringLiteralDfa1_0(0x80000L);
122 return jjStartNfaWithStates_0(0, 16, 27);
124 return jjStopAtPos(0, 4);
127 return jjMoveStringLiteralDfa1_0(0x100001000000L);
129 return jjStopAtPos(0, 21);
132 return jjMoveStringLiteralDfa1_0(0x200000000000L);
134 return jjStopAtPos(0, 7);
136 return jjMoveStringLiteralDfa1_0(0x20000000L);
138 return jjMoveStringLiteralDfa1_0(0x10000000L);
140 return jjStopAtPos(0, 8);
142 return jjStopAtPos(0, 9);
144 return jjStopAtPos(0, 17);
146 return jjMoveStringLiteralDfa1_0(0x4000000L);
148 return jjMoveStringLiteralDfa1_0(0x8000000L);
150 return jjMoveStringLiteralDfa1_0(0x2000000L);
152 return jjStopAtPos(0, 10);
154 return jjStopAtPos(0, 12);
156 return jjStopAtPos(0, 11);
158 return jjMoveNfa_0(0, 0);
161 private int jjMoveStringLiteralDfa1_0(long active0)
163 try { curChar = input_stream.readChar(); }
164 catch(java.io.IOException e) {
165 jjStopStringLiteralDfa_0(0, active0);
171 if ((active0 & 0x80000L) != 0L)
172 return jjStopAtPos(1, 19);
175 if ((active0 & 0x100000000000L) != 0L)
176 return jjStopAtPos(1, 44);
177 else if ((active0 & 0x200000000000L) != 0L)
178 return jjStopAtPos(1, 45);
181 if ((active0 & 0x1000000L) != 0L)
182 return jjStopAtPos(1, 24);
185 return jjMoveStringLiteralDfa2_0(active0, 0x20000000L);
187 return jjMoveStringLiteralDfa2_0(active0, 0x80010000000L);
189 return jjMoveStringLiteralDfa2_0(active0, 0x4000000L);
191 return jjMoveStringLiteralDfa2_0(active0, 0x2000000L);
193 return jjMoveStringLiteralDfa2_0(active0, 0x8000000L);
197 return jjStartNfa_0(0, active0);
199 private int jjMoveStringLiteralDfa2_0(long old0, long active0)
201 if (((active0 &= old0)) == 0L)
202 return jjStartNfa_0(0, old0);
203 try { curChar = input_stream.readChar(); }
204 catch(java.io.IOException e) {
205 jjStopStringLiteralDfa_0(1, active0);
211 return jjMoveStringLiteralDfa3_0(active0, 0x80000000000L);
213 return jjMoveStringLiteralDfa3_0(active0, 0x20000000L);
215 return jjMoveStringLiteralDfa3_0(active0, 0x10000000L);
217 return jjMoveStringLiteralDfa3_0(active0, 0xc000000L);
219 return jjMoveStringLiteralDfa3_0(active0, 0x2000000L);
223 return jjStartNfa_0(1, active0);
225 private int jjMoveStringLiteralDfa3_0(long old0, long active0)
227 if (((active0 &= old0)) == 0L)
228 return jjStartNfa_0(1, old0);
229 try { curChar = input_stream.readChar(); }
230 catch(java.io.IOException e) {
231 jjStopStringLiteralDfa_0(2, active0);
237 if ((active0 & 0x10000000L) != 0L)
238 return jjStartNfaWithStates_0(3, 28, 84);
241 return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L);
243 return jjMoveStringLiteralDfa4_0(active0, 0x20000000L);
245 if ((active0 & 0x2000000L) != 0L)
246 return jjStartNfaWithStates_0(3, 25, 21);
249 if ((active0 & 0x8000000L) != 0L)
250 return jjStartNfaWithStates_0(3, 27, 21);
253 return jjMoveStringLiteralDfa4_0(active0, 0x4000000L);
257 return jjStartNfa_0(2, active0);
259 private int jjMoveStringLiteralDfa4_0(long old0, long active0)
261 if (((active0 &= old0)) == 0L)
262 return jjStartNfa_0(2, old0);
263 try { curChar = input_stream.readChar(); }
264 catch(java.io.IOException e) {
265 jjStopStringLiteralDfa_0(3, active0);
271 if ((active0 & 0x80000000000L) != 0L)
272 return jjStopAtPos(4, 43);
275 if ((active0 & 0x20000000L) != 0L)
276 return jjStartNfaWithStates_0(4, 29, 85);
279 if ((active0 & 0x4000000L) != 0L)
280 return jjStartNfaWithStates_0(4, 26, 21);
285 return jjStartNfa_0(3, active0);
287 private int jjStartNfaWithStates_0(int pos, int kind, int state)
289 jjmatchedKind = kind;
291 try { curChar = input_stream.readChar(); }
292 catch(java.io.IOException e) { return pos + 1; }
293 return jjMoveNfa_0(state, pos + 1);
295 static final long[] jjbitVec0 = {
296 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
298 static final long[] jjbitVec2 = {
299 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
301 static final long[] jjbitVec3 = {
302 0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x1600000000000000L
304 static final long[] jjbitVec4 = {
305 0x0L, 0x0L, 0xc603c0000000000L, 0xff7fffffff7fffffL
307 static final long[] jjbitVec5 = {
308 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
310 static final long[] jjbitVec6 = {
311 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
313 static final long[] jjbitVec7 = {
314 0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
316 static final long[] jjbitVec8 = {
317 0x3fffffffffffL, 0x0L, 0x0L, 0x0L
319 static final long[] jjbitVec9 = {
320 0x7f7ffdff80f8007fL, 0xffffffffffffffdbL, 0xffffffffffffffffL, 0xffffffffffffffffL
322 static final long[] jjbitVec10 = {
323 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fff000000ffffffL
325 static final long[] jjbitVec11 = {
326 0x0L, 0xffff000000000000L, 0xffffffffffffffffL, 0x1fffffffffffffffL
328 static final long[] jjbitVec12 = {
329 0x87ffffff80000000L, 0xfffffffe7fffffffL, 0x7fffffffffffffffL, 0x1cfcfcfcL
331 private int jjMoveNfa_0(int startState, int curPos)
336 jjstateSet[0] = startState;
337 int kind = 0x7fffffff;
340 if (++jjround == 0x7fffffff)
344 long l = 1L << curChar;
347 switch(jjstateSet[--i])
350 if ((0x3ff001000000000L & l) != 0L)
356 else if (curChar == 58)
357 jjCheckNAddTwoStates(50, 51);
358 if ((0x3ff000000000000L & l) != 0L)
359 jjCheckNAddStates(0, 4);
360 else if (curChar == 36)
361 jjCheckNAddTwoStates(49, 62);
362 if ((0x3ff000000000000L & l) != 0L)
366 jjstateSet[jjnewStateCnt++] = 39;
368 else if (curChar == 36)
369 jjstateSet[jjnewStateCnt++] = 38;
372 if ((0x3ff001000000000L & l) != 0L)
378 else if (curChar == 58)
379 jjCheckNAddTwoStates(50, 51);
380 if ((0x3ff000000000000L & l) != 0L)
381 jjCheckNAddStates(0, 4);
382 else if (curChar == 36)
383 jjCheckNAddTwoStates(49, 62);
384 if ((0x3ff000000000000L & l) != 0L)
388 jjstateSet[jjnewStateCnt++] = 39;
390 else if (curChar == 36)
391 jjstateSet[jjnewStateCnt++] = 38;
394 if ((0x3ff001000000000L & l) != 0L)
400 else if (curChar == 58)
401 jjCheckNAddTwoStates(50, 51);
402 if ((0x3ff000000000000L & l) != 0L)
403 jjCheckNAddStates(0, 4);
404 else if (curChar == 36)
405 jjCheckNAddTwoStates(49, 62);
406 if ((0x3ff000000000000L & l) != 0L)
410 jjstateSet[jjnewStateCnt++] = 39;
412 else if (curChar == 36)
413 jjstateSet[jjnewStateCnt++] = 38;
416 if ((0x3ff001000000000L & l) != 0L)
422 else if (curChar == 58)
423 jjCheckNAddTwoStates(50, 51);
424 if ((0x3ff000000000000L & l) != 0L)
425 jjCheckNAddStates(0, 4);
426 else if (curChar == 36)
427 jjCheckNAddTwoStates(49, 62);
428 if ((0x3ff000000000000L & l) != 0L)
432 jjstateSet[jjnewStateCnt++] = 39;
434 else if (curChar == 36)
435 jjstateSet[jjnewStateCnt++] = 38;
438 if ((0x3ff001000000000L & l) != 0L)
444 else if (curChar == 58)
445 jjCheckNAddTwoStates(50, 51);
446 if ((0x3ff000000000000L & l) != 0L)
447 jjCheckNAddStates(0, 4);
448 else if (curChar == 36)
449 jjCheckNAddTwoStates(49, 62);
450 if ((0x3ff000000000000L & l) != 0L)
454 jjstateSet[jjnewStateCnt++] = 39;
456 else if (curChar == 36)
457 jjstateSet[jjnewStateCnt++] = 38;
466 else if (curChar == 42)
467 jjCheckNAddStates(5, 7);
470 if ((0x3ff000000000000L & l) != 0L)
474 jjCheckNAddStates(8, 12);
476 else if ((0x100002600L & l) != 0L)
481 else if (curChar == 36)
483 else if (curChar == 47)
485 else if (curChar == 46)
487 else if (curChar == 34)
488 jjstateSet[jjnewStateCnt++] = 18;
489 else if (curChar == 39)
490 jjCheckNAddStates(17, 19);
497 else if (curChar == 34)
498 jjCheckNAddStates(20, 22);
502 jjCheckNAddStates(20, 22);
505 if ((0xfffffffbfffffbffL & l) != 0L)
506 jjCheckNAddStates(20, 22);
509 if ((0xfffffffffffffbffL & l) != 0L)
510 jjCheckNAddStates(20, 22);
513 if (curChar == 34 && kind > 32)
518 jjCheckNAddStates(17, 19);
521 if ((0xffffff7ffffffbffL & l) != 0L)
522 jjCheckNAddStates(17, 19);
525 if ((0xfffffffffffffbffL & l) != 0L)
526 jjCheckNAddStates(17, 19);
529 if (curChar == 39 && kind > 33)
534 jjCheckNAddStates(23, 25);
537 if ((0xfffffffbffffffffL & l) != 0L)
538 jjCheckNAddStates(23, 25);
550 if (curChar == 34 && kind > 34)
555 jjstateSet[jjnewStateCnt++] = 16;
559 jjstateSet[jjnewStateCnt++] = 11;
563 jjstateSet[jjnewStateCnt++] = 18;
573 if ((0x3ff001000000000L & l) == 0L)
584 if ((0x3ff000000000000L & l) == 0L)
588 jjCheckNAddTwoStates(23, 24);
591 if ((0x3ff000000000000L & l) == 0L)
595 jjstateSet[jjnewStateCnt++] = 25;
602 if ((0xfffffbffffffffffL & l) != 0L)
603 jjCheckNAddStates(5, 7);
607 jjstateSet[jjnewStateCnt++] = 30;
610 if ((0xffff7fffffffffffL & l) != 0L)
611 jjCheckNAddStates(5, 7);
614 if (curChar == 47 && kind > 2)
619 jjstateSet[jjnewStateCnt++] = 31;
629 if ((0xfffffffffffffbffL & l) == 0L)
641 jjstateSet[jjnewStateCnt++] = 38;
644 if ((0x3ff000000000000L & l) == 0L)
648 jjstateSet[jjnewStateCnt++] = 39;
651 if ((0x3ff000000000000L & l) == 0L)
655 jjCheckNAddStates(28, 30);
658 if ((0x3ff000000000000L & l) != 0L && kind > 35)
662 if ((0x3ff000000000000L & l) == 0L)
669 if ((0x3ff000000000000L & l) == 0L)
673 jjCheckNAddTwoStates(40, 41);
677 jjCheckNAddTwoStates(49, 62);
681 jjCheckNAddTwoStates(50, 51);
692 jjstateSet[jjnewStateCnt++] = 53;
695 if ((0x3ff000000000000L & l) == 0L)
699 jjCheckNAddStates(31, 34);
702 if ((0x3ff000000000000L & l) != 0L && kind > 37)
706 if ((0x3ff000000000000L & l) == 0L)
713 if ((0x3ff000000000000L & l) == 0L)
717 jjCheckNAddTwoStates(54, 55);
720 if ((0x3ff000000000000L & l) == 0L)
724 jjCheckNAddStates(35, 37);
727 if ((0x3ff000000000000L & l) != 0L)
728 jjCheckNAddStates(0, 4);
731 if ((0x3ff000000000000L & l) != 0L)
735 if ((0x3ff000000000000L & l) != 0L)
736 jjCheckNAddTwoStates(63, 49);
739 if ((0x3ff000000000000L & l) != 0L)
740 jjCheckNAddStates(38, 40);
743 if ((0x3ff000000000000L & l) != 0L)
744 jjCheckNAddStates(41, 44);
747 if ((0x3ff000000000000L & l) == 0L)
751 jjCheckNAddStates(8, 12);
754 if ((0x3ff000000000000L & l) != 0L)
755 jjCheckNAddTwoStates(73, 74);
762 if ((0x3ff000000000000L & l) == 0L)
766 jjCheckNAddTwoStates(75, 76);
769 if ((0x3ff000000000000L & l) == 0L)
773 jjstateSet[jjnewStateCnt++] = 77;
776 if ((0x3ff000000000000L & l) != 0L)
777 jjCheckNAddTwoStates(78, 79);
780 if ((0x3ff000000000000L & l) == 0L)
784 jjstateSet[jjnewStateCnt++] = 80;
787 if ((0x3ff000000000000L & l) == 0L)
795 } while(i != startsAt);
797 else if (curChar < 128)
799 long l = 1L << (curChar & 077);
802 switch(jjstateSet[--i])
805 if ((0x7fffffe87fffffeL & l) != 0L)
811 if ((0x7fffffeL & l) != 0L)
812 jjCheckNAddStates(45, 47);
813 if ((0x7fffffeL & l) != 0L)
814 jjCheckNAddTwoStates(37, 38);
817 if ((0x7fffffe87fffffeL & l) != 0L)
823 if ((0x7fffffeL & l) != 0L)
824 jjCheckNAddStates(48, 51);
825 if ((0x7fffffeL & l) != 0L)
826 jjCheckNAddStates(52, 54);
827 if ((0x7fffffeL & l) != 0L)
828 jjCheckNAddStates(55, 59);
829 if ((0x7fffffeL & l) != 0L)
830 jjCheckNAddStates(60, 63);
831 if ((0x7fffffeL & l) != 0L)
832 jjCheckNAddStates(45, 47);
833 if ((0x7fffffeL & l) != 0L)
834 jjCheckNAddTwoStates(37, 38);
838 if ((0x7fffffe87fffffeL & l) == 0L)
845 if ((0x7fffffe87fffffeL & l) != 0L)
851 if ((0x7fffffeL & l) != 0L)
852 jjCheckNAddStates(52, 54);
853 if ((0x7fffffeL & l) != 0L)
854 jjCheckNAddStates(60, 63);
855 if ((0x7fffffeL & l) != 0L)
856 jjCheckNAddStates(45, 47);
857 if ((0x7fffffeL & l) != 0L)
858 jjCheckNAddTwoStates(37, 38);
861 if ((0x7fffffe87fffffeL & l) != 0L)
867 if ((0x7fffffeL & l) != 0L)
868 jjCheckNAddStates(64, 68);
869 if ((0x7fffffeL & l) != 0L)
870 jjCheckNAddStates(69, 74);
873 if ((0x7fffffe87fffffeL & l) != 0L)
879 if ((0x7fffffeL & l) != 0L)
880 jjCheckNAddStates(75, 81);
883 if ((0xffffffffefffffffL & l) != 0L)
884 jjCheckNAddStates(20, 22);
888 jjstateSet[jjnewStateCnt++] = 4;
891 jjCheckNAddStates(20, 22);
894 if ((0xffffffffefffffffL & l) != 0L)
895 jjCheckNAddStates(17, 19);
899 jjstateSet[jjnewStateCnt++] = 9;
902 jjCheckNAddStates(17, 19);
908 if ((0x7fffffe87fffffeL & l) == 0L)
915 if ((0x2000000020L & l) != 0L)
916 jjstateSet[jjnewStateCnt++] = 25;
920 jjCheckNAddStates(5, 7);
925 jjstateSet[jjnewStateCnt++] = 34;
928 if ((0x7fffffeL & l) != 0L)
929 jjCheckNAddStates(82, 84);
932 if ((0x7fffffeL & l) != 0L)
933 jjCheckNAddStates(64, 68);
936 if ((0x7fffffeL & l) != 0L)
937 jjCheckNAddTwoStates(37, 38);
940 if ((0x7fffffeL & l) != 0L)
941 jjCheckNAddStates(52, 54);
944 if ((0x7fffffeL & l) != 0L)
945 jjCheckNAddStates(48, 51);
948 if ((0x7fffffeL & l) != 0L)
949 jjCheckNAddStates(85, 88);
952 if ((0x7fffffeL & l) == 0L)
956 jjCheckNAddStates(89, 91);
959 if ((0x7fffffeL & l) == 0L)
963 jjCheckNAddStates(92, 96);
966 if ((0x7fffffeL & l) == 0L)
970 jjCheckNAddTwoStates(52, 53);
973 if ((0x7fffffeL & l) == 0L)
977 jjCheckNAddStates(97, 99);
980 if ((0x7fffffeL & l) == 0L)
984 jjCheckNAddStates(100, 103);
987 if ((0x7fffffeL & l) != 0L)
988 jjCheckNAddStates(69, 74);
991 if ((0x7fffffeL & l) != 0L)
992 jjCheckNAddStates(45, 47);
995 if ((0x7fffffeL & l) != 0L)
996 jjCheckNAddStates(60, 63);
999 if ((0x7fffffeL & l) != 0L)
1000 jjCheckNAddStates(75, 81);
1003 if ((0x2000000020L & l) != 0L)
1004 jjstateSet[jjnewStateCnt++] = 77;
1007 if ((0x2000000020L & l) != 0L)
1008 jjstateSet[jjnewStateCnt++] = 80;
1012 } while(i != startsAt);
1016 int hiByte = (int)(curChar >> 8);
1017 int i1 = hiByte >> 6;
1018 long l1 = 1L << (hiByte & 077);
1019 int i2 = (curChar & 0xff) >> 6;
1020 long l2 = 1L << (curChar & 077);
1023 switch(jjstateSet[--i])
1027 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
1034 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
1041 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
1048 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
1055 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
1062 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
1070 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
1071 jjCheckNAddStates(20, 22);
1075 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
1076 jjCheckNAddStates(17, 19);
1079 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
1080 jjAddStates(23, 25);
1084 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
1085 jjCheckNAddStates(5, 7);
1088 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
1092 jjstateSet[jjnewStateCnt++] = 34;
1096 } while(i != startsAt);
1098 if (kind != 0x7fffffff)
1100 jjmatchedKind = kind;
1101 jjmatchedPos = curPos;
1105 if ((i = jjnewStateCnt) == (startsAt = 82 - (jjnewStateCnt = startsAt)))
1107 try { curChar = input_stream.readChar(); }
1108 catch(java.io.IOException e) { return curPos; }
1111 static final int[] jjnextStates = {
1112 63, 49, 64, 65, 66, 28, 29, 32, 73, 74, 78, 79, 81, 36, 47, 27,
1113 33, 7, 8, 10, 2, 3, 5, 12, 13, 14, 15, 17, 40, 41, 42, 54,
1114 55, 56, 57, 54, 55, 56, 63, 49, 64, 63, 49, 64, 65, 48, 49, 62,
1115 44, 37, 38, 45, 44, 37, 38, 68, 48, 49, 62, 69, 68, 48, 49, 62,
1116 44, 37, 38, 45, 46, 68, 48, 49, 62, 69, 70, 37, 38, 48, 49, 62,
1117 67, 43, 37, 38, 43, 48, 49, 62, 67, 52, 53, 58, 59, 52, 53, 60,
1118 61, 59, 52, 53, 59, 52, 53, 60,
1120 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
1125 return ((jjbitVec2[i2] & l2) != 0L);
1127 if ((jjbitVec0[i1] & l1) != 0L)
1132 private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
1137 return ((jjbitVec4[i2] & l2) != 0L);
1139 return ((jjbitVec5[i2] & l2) != 0L);
1141 return ((jjbitVec6[i2] & l2) != 0L);
1143 return ((jjbitVec7[i2] & l2) != 0L);
1145 return ((jjbitVec8[i2] & l2) != 0L);
1147 return ((jjbitVec9[i2] & l2) != 0L);
1149 return ((jjbitVec10[i2] & l2) != 0L);
1151 return ((jjbitVec11[i2] & l2) != 0L);
1153 return ((jjbitVec12[i2] & l2) != 0L);
1155 if ((jjbitVec3[i1] & l1) != 0L)
1161 /** Token literal values. */
1162 public static final String[] jjstrLiteralImages = {
1163 "", null, null, null, "\73", "\50", "\51", "\77", "\133", "\135", "\173",
1164 "\175", "\174", "\46", "\53", "\52", "\57", "\136", "\54", "\56\56", "\56", "\75",
1165 "\74", "\76", "\74\76", "\164\162\165\145", "\146\141\154\163\145",
1166 "\156\165\154\154", "\124\122\125\105", "\106\101\114\123\105", null, null, null, null, null, null,
1167 null, null, null, null, null, null, "\41", "\43\122\105\106\41", "\74\75", "\76\75",
1170 /** Lexer state names. */
1171 public static final String[] lexStateNames = {
1174 static final long[] jjtoToken = {
1177 static final long[] jjtoSkip = {
1180 protected SimpleCharStream input_stream;
1181 private final int[] jjrounds = new int[82];
1182 private final int[] jjstateSet = new int[164];
1183 private final StringBuilder jjimage = new StringBuilder();
1184 private StringBuilder image = jjimage;
1185 private int jjimageLen;
1186 private int lengthOfMatch;
1187 protected char curChar;
1189 public SheetFormulaParserTokenManager(SimpleCharStream stream){
1190 if (SimpleCharStream.staticFlag)
1191 throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
1192 input_stream = stream;
1196 public SheetFormulaParserTokenManager(SimpleCharStream stream, int lexState){
1201 /** Reinitialise parser. */
1202 public void ReInit(SimpleCharStream stream)
1204 jjmatchedPos = jjnewStateCnt = 0;
1205 curLexState = defaultLexState;
1206 input_stream = stream;
1209 private void ReInitRounds()
1212 jjround = 0x80000001;
1213 for (i = 82; i-- > 0;)
1214 jjrounds[i] = 0x80000000;
1217 /** Reinitialise parser. */
1218 public void ReInit(SimpleCharStream stream, int lexState)
1224 /** Switch to specified lex state. */
1225 public void SwitchTo(int lexState)
1227 if (lexState >= 1 || lexState < 0)
1228 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1230 curLexState = lexState;
1233 protected Token jjFillToken()
1236 final String curTokenImage;
1237 final int beginLine;
1239 final int beginColumn;
1240 final int endColumn;
1241 String im = jjstrLiteralImages[jjmatchedKind];
1242 curTokenImage = (im == null) ? input_stream.GetImage() : im;
1243 beginLine = input_stream.getBeginLine();
1244 beginColumn = input_stream.getBeginColumn();
1245 endLine = input_stream.getEndLine();
1246 endColumn = input_stream.getEndColumn();
1247 t = Token.newToken(jjmatchedKind, curTokenImage);
1249 t.beginLine = beginLine;
1250 t.endLine = endLine;
1251 t.beginColumn = beginColumn;
1252 t.endColumn = endColumn;
1257 int curLexState = 0;
1258 int defaultLexState = 0;
1264 /** Get the next Token. */
1265 public Token getNextToken()
1275 curChar = input_stream.BeginToken();
1277 catch(java.io.IOException e)
1280 matchedToken = jjFillToken();
1281 return matchedToken;
1287 jjmatchedKind = 0x7fffffff;
1289 curPos = jjMoveStringLiteralDfa0_0();
1290 if (jjmatchedKind != 0x7fffffff)
1292 if (jjmatchedPos + 1 < curPos)
1293 input_stream.backup(curPos - jjmatchedPos - 1);
1294 if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
1296 matchedToken = jjFillToken();
1297 TokenLexicalActions(matchedToken);
1298 return matchedToken;
1305 int error_line = input_stream.getEndLine();
1306 int error_column = input_stream.getEndColumn();
1307 String error_after = null;
1308 boolean EOFSeen = false;
1309 try { input_stream.readChar(); input_stream.backup(1); }
1310 catch (java.io.IOException e1) {
1312 error_after = curPos <= 1 ? "" : input_stream.GetImage();
1313 if (curChar == '\n' || curChar == '\r') {
1321 input_stream.backup(1);
1322 error_after = curPos <= 1 ? "" : input_stream.GetImage();
1324 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
1328 void TokenLexicalActions(Token matchedToken)
1330 switch(jjmatchedKind)
1333 image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
1334 matchedToken.image = SheetParserUtils.unescape(
1335 matchedToken.image.substring(1,matchedToken.image.length()-1));
1338 image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
1339 matchedToken.image = SheetParserUtils.unescape(
1340 matchedToken.image.substring(1,matchedToken.image.length()-1));
1343 image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
1344 matchedToken.image = matchedToken.image.substring(3,matchedToken.image.length()-3);
1350 private void jjCheckNAdd(int state)
1352 if (jjrounds[state] != jjround)
1354 jjstateSet[jjnewStateCnt++] = state;
1355 jjrounds[state] = jjround;
1358 private void jjAddStates(int start, int end)
1361 jjstateSet[jjnewStateCnt++] = jjnextStates[start];
1362 } while (start++ != end);
1364 private void jjCheckNAddTwoStates(int state1, int state2)
1366 jjCheckNAdd(state1);
1367 jjCheckNAdd(state2);
1370 private void jjCheckNAddStates(int start, int end)
1373 jjCheckNAdd(jjnextStates[start]);
1374 } while (start++ != end);