001/*
002 * Copyright 2006 - 2013
003 *     Stefan Balev     <stefan.balev@graphstream-project.org>
004 *     Julien Baudry    <julien.baudry@graphstream-project.org>
005 *     Antoine Dutot    <antoine.dutot@graphstream-project.org>
006 *     Yoann Pigné      <yoann.pigne@graphstream-project.org>
007 *     Guilhelm Savin   <guilhelm.savin@graphstream-project.org>
008 * 
009 * This file is part of GraphStream <http://graphstream-project.org>.
010 * 
011 * GraphStream is a library whose purpose is to handle static or dynamic
012 * graph, create them from scratch, file or any source and display them.
013 * 
014 * This program is free software distributed under the terms of two licenses, the
015 * CeCILL-C license that fits European law, and the GNU Lesser General Public
016 * License. You can  use, modify and/ or redistribute the software under the terms
017 * of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following
018 * URL <http://www.cecill.info> or under the terms of the GNU LGPL as published by
019 * the Free Software Foundation, either version 3 of the License, or (at your
020 * option) any later version.
021 * 
022 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
023 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
024 * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
025 * 
026 * You should have received a copy of the GNU Lesser General Public License
027 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
028 * 
029 * The fact that you are presently reading this means that you have had
030 * knowledge of the CeCILL-C and LGPL licenses and that you accept their terms.
031 */
032package org.graphstream.stream.file.dot;
033
034import org.graphstream.util.parser.SimpleCharStream;
035import org.graphstream.util.parser.Token;
036import org.graphstream.util.parser.TokenMgrError;
037
038/** Token Manager. */
039public class DOTParserTokenManager implements DOTParserConstants {
040
041        /** Debug output. */
042        public java.io.PrintStream debugStream = System.out;
043
044        /** Set debug output. */
045        public void setDebugStream(java.io.PrintStream ds) {
046                debugStream = ds;
047        }
048
049        private final int jjStopStringLiteralDfa_0(int pos, long active0) {
050                switch (pos) {
051                case 0:
052                        if ((active0 & 0x3ff07e0000L) != 0L) {
053                                jjmatchedKind = 26;
054                                return 16;
055                        }
056                        return -1;
057                case 1:
058                        if ((active0 & 0xaa07e0000L) != 0L) {
059                                jjmatchedKind = 26;
060                                jjmatchedPos = 1;
061                                return 16;
062                        }
063                        return -1;
064                case 2:
065                        if ((active0 & 0x7e0000L) != 0L) {
066                                jjmatchedKind = 26;
067                                jjmatchedPos = 2;
068                                return 16;
069                        }
070                        return -1;
071                case 3:
072                        if ((active0 & 0x300000L) != 0L)
073                                return 16;
074                        if ((active0 & 0x4e0000L) != 0L) {
075                                jjmatchedKind = 26;
076                                jjmatchedPos = 3;
077                                return 16;
078                        }
079                        return -1;
080                case 4:
081                        if ((active0 & 0x20000L) != 0L)
082                                return 16;
083                        if ((active0 & 0x4c0000L) != 0L) {
084                                jjmatchedKind = 26;
085                                jjmatchedPos = 4;
086                                return 16;
087                        }
088                        return -1;
089                case 5:
090                        if ((active0 & 0xc0000L) != 0L) {
091                                jjmatchedKind = 26;
092                                jjmatchedPos = 5;
093                                return 16;
094                        }
095                        if ((active0 & 0x400000L) != 0L)
096                                return 16;
097                        return -1;
098                case 6:
099                        if ((active0 & 0x40000L) != 0L)
100                                return 16;
101                        if ((active0 & 0x80000L) != 0L) {
102                                jjmatchedKind = 26;
103                                jjmatchedPos = 6;
104                                return 16;
105                        }
106                        return -1;
107                default:
108                        return -1;
109                }
110        }
111
112        private final int jjStartNfa_0(int pos, long active0) {
113                return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
114        }
115
116        private int jjStopAtPos(int pos, int kind) {
117                jjmatchedKind = kind;
118                jjmatchedPos = pos;
119                return pos + 1;
120        }
121
122        private int jjMoveStringLiteralDfa0_0() {
123                switch (curChar) {
124                case 44:
125                        return jjStopAtPos(0, 15);
126                case 58:
127                        return jjStopAtPos(0, 14);
128                case 59:
129                        return jjStopAtPos(0, 27);
130                case 61:
131                        return jjStopAtPos(0, 16);
132                case 91:
133                        return jjStopAtPos(0, 10);
134                case 93:
135                        return jjStopAtPos(0, 11);
136                case 95:
137                        return jjStartNfaWithStates_0(0, 26, 16);
138                case 67:
139                case 99:
140                        return jjStartNfaWithStates_0(0, 26, 16);
141                case 68:
142                case 100:
143                        return jjMoveStringLiteralDfa1_0(0x40000L);
144                case 69:
145                case 101:
146                        jjmatchedKind = 26;
147                        return jjMoveStringLiteralDfa1_0(0x200000L);
148                case 71:
149                case 103:
150                        return jjMoveStringLiteralDfa1_0(0x20000L);
151                case 78:
152                case 110:
153                        jjmatchedKind = 26;
154                        return jjMoveStringLiteralDfa1_0(0x820100000L);
155                case 83:
156                case 115:
157                        jjmatchedKind = 26;
158                        return jjMoveStringLiteralDfa1_0(0x280480000L);
159                case 87:
160                case 119:
161                        return jjStartNfaWithStates_0(0, 26, 16);
162                case 123:
163                        return jjStopAtPos(0, 12);
164                case 125:
165                        return jjStopAtPos(0, 13);
166                default:
167                        return jjMoveNfa_0(0, 0);
168                }
169        }
170
171        private int jjMoveStringLiteralDfa1_0(long active0) {
172                try {
173                        curChar = input_stream.readChar();
174                } catch (java.io.IOException e) {
175                        jjStopStringLiteralDfa_0(0, active0);
176                        return 1;
177                }
178                switch (curChar) {
179                case 68:
180                case 100:
181                        return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
182                case 69:
183                case 101:
184                        if ((active0 & 0x20000000L) != 0L)
185                                return jjStartNfaWithStates_0(1, 26, 16);
186                        else if ((active0 & 0x80000000L) != 0L)
187                                return jjStartNfaWithStates_0(1, 26, 16);
188                        break;
189                case 73:
190                case 105:
191                        return jjMoveStringLiteralDfa2_0(active0, 0x40000L);
192                case 79:
193                case 111:
194                        return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
195                case 82:
196                case 114:
197                        return jjMoveStringLiteralDfa2_0(active0, 0x20000L);
198                case 84:
199                case 116:
200                        return jjMoveStringLiteralDfa2_0(active0, 0x400000L);
201                case 85:
202                case 117:
203                        return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
204                case 87:
205                case 119:
206                        if ((active0 & 0x200000000L) != 0L)
207                                return jjStartNfaWithStates_0(1, 26, 16);
208                        else if ((active0 & 0x800000000L) != 0L)
209                                return jjStartNfaWithStates_0(1, 26, 16);
210                        break;
211                default:
212                        break;
213                }
214                return jjStartNfa_0(0, active0);
215        }
216
217        private int jjMoveStringLiteralDfa2_0(long old0, long active0) {
218                if (((active0 &= old0)) == 0L)
219                        return jjStartNfa_0(0, old0);
220                try {
221                        curChar = input_stream.readChar();
222                } catch (java.io.IOException e) {
223                        jjStopStringLiteralDfa_0(1, active0);
224                        return 2;
225                }
226                switch (curChar) {
227                case 65:
228                case 97:
229                        return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
230                case 66:
231                case 98:
232                        return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
233                case 68:
234                case 100:
235                        return jjMoveStringLiteralDfa3_0(active0, 0x100000L);
236                case 71:
237                case 103:
238                        return jjMoveStringLiteralDfa3_0(active0, 0x240000L);
239                case 82:
240                case 114:
241                        return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
242                default:
243                        break;
244                }
245                return jjStartNfa_0(1, active0);
246        }
247
248        private int jjMoveStringLiteralDfa3_0(long old0, long active0) {
249                if (((active0 &= old0)) == 0L)
250                        return jjStartNfa_0(1, old0);
251                try {
252                        curChar = input_stream.readChar();
253                } catch (java.io.IOException e) {
254                        jjStopStringLiteralDfa_0(2, active0);
255                        return 3;
256                }
257                switch (curChar) {
258                case 69:
259                case 101:
260                        if ((active0 & 0x100000L) != 0L)
261                                return jjStartNfaWithStates_0(3, 20, 16);
262                        else if ((active0 & 0x200000L) != 0L)
263                                return jjStartNfaWithStates_0(3, 21, 16);
264                        break;
265                case 71:
266                case 103:
267                        return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
268                case 73:
269                case 105:
270                        return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
271                case 80:
272                case 112:
273                        return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
274                case 82:
275                case 114:
276                        return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
277                default:
278                        break;
279                }
280                return jjStartNfa_0(2, active0);
281        }
282
283        private int jjMoveStringLiteralDfa4_0(long old0, long active0) {
284                if (((active0 &= old0)) == 0L)
285                        return jjStartNfa_0(2, old0);
286                try {
287                        curChar = input_stream.readChar();
288                } catch (java.io.IOException e) {
289                        jjStopStringLiteralDfa_0(3, active0);
290                        return 4;
291                }
292                switch (curChar) {
293                case 65:
294                case 97:
295                        return jjMoveStringLiteralDfa5_0(active0, 0x40000L);
296                case 67:
297                case 99:
298                        return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
299                case 72:
300                case 104:
301                        if ((active0 & 0x20000L) != 0L)
302                                return jjStartNfaWithStates_0(4, 17, 16);
303                        break;
304                case 82:
305                case 114:
306                        return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
307                default:
308                        break;
309                }
310                return jjStartNfa_0(3, active0);
311        }
312
313        private int jjMoveStringLiteralDfa5_0(long old0, long active0) {
314                if (((active0 &= old0)) == 0L)
315                        return jjStartNfa_0(3, old0);
316                try {
317                        curChar = input_stream.readChar();
318                } catch (java.io.IOException e) {
319                        jjStopStringLiteralDfa_0(4, active0);
320                        return 5;
321                }
322                switch (curChar) {
323                case 65:
324                case 97:
325                        return jjMoveStringLiteralDfa6_0(active0, 0x80000L);
326                case 80:
327                case 112:
328                        return jjMoveStringLiteralDfa6_0(active0, 0x40000L);
329                case 84:
330                case 116:
331                        if ((active0 & 0x400000L) != 0L)
332                                return jjStartNfaWithStates_0(5, 22, 16);
333                        break;
334                default:
335                        break;
336                }
337                return jjStartNfa_0(4, active0);
338        }
339
340        private int jjMoveStringLiteralDfa6_0(long old0, long active0) {
341                if (((active0 &= old0)) == 0L)
342                        return jjStartNfa_0(4, old0);
343                try {
344                        curChar = input_stream.readChar();
345                } catch (java.io.IOException e) {
346                        jjStopStringLiteralDfa_0(5, active0);
347                        return 6;
348                }
349                switch (curChar) {
350                case 72:
351                case 104:
352                        if ((active0 & 0x40000L) != 0L)
353                                return jjStartNfaWithStates_0(6, 18, 16);
354                        break;
355                case 80:
356                case 112:
357                        return jjMoveStringLiteralDfa7_0(active0, 0x80000L);
358                default:
359                        break;
360                }
361                return jjStartNfa_0(5, active0);
362        }
363
364        private int jjMoveStringLiteralDfa7_0(long old0, long active0) {
365                if (((active0 &= old0)) == 0L)
366                        return jjStartNfa_0(5, old0);
367                try {
368                        curChar = input_stream.readChar();
369                } catch (java.io.IOException e) {
370                        jjStopStringLiteralDfa_0(6, active0);
371                        return 7;
372                }
373                switch (curChar) {
374                case 72:
375                case 104:
376                        if ((active0 & 0x80000L) != 0L)
377                                return jjStartNfaWithStates_0(7, 19, 16);
378                        break;
379                default:
380                        break;
381                }
382                return jjStartNfa_0(6, active0);
383        }
384
385        private int jjStartNfaWithStates_0(int pos, int kind, int state) {
386                jjmatchedKind = kind;
387                jjmatchedPos = pos;
388                try {
389                        curChar = input_stream.readChar();
390                } catch (java.io.IOException e) {
391                        return pos + 1;
392                }
393                return jjMoveNfa_0(state, pos + 1);
394        }
395
396        static final long[] jjbitVec0 = { 0x0L, 0x0L, 0xffffffffffffffffL,
397                        0xffffffffffffffffL };
398
399        private int jjMoveNfa_0(int startState, int curPos) {
400                int startsAt = 0;
401                jjnewStateCnt = 28;
402                int i = 1;
403                jjstateSet[0] = startState;
404                int kind = 0x7fffffff;
405                for (;;) {
406                        if (++jjround == 0x7fffffff)
407                                ReInitRounds();
408                        if (curChar < 64) {
409                                long l = 1L << curChar;
410                                do {
411                                        switch (jjstateSet[--i]) {
412                                        case 0:
413                                                if ((0x3ff000000000000L & l) != 0L) {
414                                                        if (kind > 24)
415                                                                kind = 24;
416                                                        jjCheckNAddTwoStates(4, 5);
417                                                } else if ((0x280000000000L & l) != 0L)
418                                                        jjCheckNAdd(4);
419                                                else if (curChar == 47)
420                                                        jjAddStates(0, 1);
421                                                else if (curChar == 39)
422                                                        jjCheckNAddTwoStates(13, 14);
423                                                else if (curChar == 34)
424                                                        jjCheckNAddStates(2, 4);
425                                                else if (curChar == 35)
426                                                        jjCheckNAddTwoStates(1, 2);
427                                                if (curChar == 45)
428                                                        jjAddStates(5, 6);
429                                                break;
430                                        case 1:
431                                                if ((0xffffffffffffdbffL & l) != 0L)
432                                                        jjCheckNAddTwoStates(1, 2);
433                                                break;
434                                        case 2:
435                                                if ((0x2400L & l) != 0L && kind > 6)
436                                                        kind = 6;
437                                                break;
438                                        case 3:
439                                                if ((0x280000000000L & l) != 0L)
440                                                        jjCheckNAdd(4);
441                                                break;
442                                        case 4:
443                                                if ((0x3ff000000000000L & l) == 0L)
444                                                        break;
445                                                if (kind > 24)
446                                                        kind = 24;
447                                                jjCheckNAddTwoStates(4, 5);
448                                                break;
449                                        case 5:
450                                                if (curChar == 46)
451                                                        jjCheckNAdd(6);
452                                                break;
453                                        case 6:
454                                                if ((0x3ff000000000000L & l) == 0L)
455                                                        break;
456                                                if (kind > 24)
457                                                        kind = 24;
458                                                jjCheckNAdd(6);
459                                                break;
460                                        case 7:
461                                        case 9:
462                                                if (curChar == 34)
463                                                        jjCheckNAddStates(2, 4);
464                                                break;
465                                        case 8:
466                                                if ((0xfffffffbffffffffL & l) != 0L)
467                                                        jjCheckNAddStates(2, 4);
468                                                break;
469                                        case 11:
470                                                if (curChar == 34 && kind > 25)
471                                                        kind = 25;
472                                                break;
473                                        case 12:
474                                                if (curChar == 39)
475                                                        jjCheckNAddTwoStates(13, 14);
476                                                break;
477                                        case 13:
478                                                if ((0xffffff7fffffffffL & l) != 0L)
479                                                        jjCheckNAddTwoStates(13, 14);
480                                                break;
481                                        case 14:
482                                                if (curChar == 39 && kind > 25)
483                                                        kind = 25;
484                                                break;
485                                        case 16:
486                                                if ((0x3ff000000000000L & l) == 0L)
487                                                        break;
488                                                if (kind > 26)
489                                                        kind = 26;
490                                                jjstateSet[jjnewStateCnt++] = 16;
491                                                break;
492                                        case 17:
493                                                if (curChar == 45)
494                                                        jjAddStates(5, 6);
495                                                break;
496                                        case 18:
497                                                if (curChar == 45 && kind > 23)
498                                                        kind = 23;
499                                                break;
500                                        case 19:
501                                                if (curChar == 62 && kind > 23)
502                                                        kind = 23;
503                                                break;
504                                        case 20:
505                                                if (curChar == 47)
506                                                        jjAddStates(0, 1);
507                                                break;
508                                        case 21:
509                                                if (curChar == 42)
510                                                        jjCheckNAddStates(7, 9);
511                                                break;
512                                        case 22:
513                                                if ((0xfffffbffffffffffL & l) != 0L)
514                                                        jjCheckNAddStates(7, 9);
515                                                break;
516                                        case 23:
517                                                if (curChar == 42)
518                                                        jjstateSet[jjnewStateCnt++] = 24;
519                                                break;
520                                        case 24:
521                                                if ((0xffff7fffffffffffL & l) != 0L)
522                                                        jjCheckNAddStates(7, 9);
523                                                break;
524                                        case 25:
525                                                if (curChar == 47 && kind > 5)
526                                                        kind = 5;
527                                                break;
528                                        case 26:
529                                                if (curChar == 42)
530                                                        jjstateSet[jjnewStateCnt++] = 25;
531                                                break;
532                                        case 27:
533                                                if (curChar == 47)
534                                                        jjCheckNAddTwoStates(1, 2);
535                                                break;
536                                        default:
537                                                break;
538                                        }
539                                } while (i != startsAt);
540                        } else if (curChar < 128) {
541                                long l = 1L << (curChar & 077);
542                                do {
543                                        switch (jjstateSet[--i]) {
544                                        case 0:
545                                        case 16:
546                                                if ((0x7fffffe87fffffeL & l) == 0L)
547                                                        break;
548                                                if (kind > 26)
549                                                        kind = 26;
550                                                jjCheckNAdd(16);
551                                                break;
552                                        case 1:
553                                                jjAddStates(10, 11);
554                                                break;
555                                        case 8:
556                                                jjAddStates(2, 4);
557                                                break;
558                                        case 10:
559                                                if (curChar == 92)
560                                                        jjstateSet[jjnewStateCnt++] = 9;
561                                                break;
562                                        case 13:
563                                                jjAddStates(12, 13);
564                                                break;
565                                        case 22:
566                                        case 24:
567                                                jjCheckNAddStates(7, 9);
568                                                break;
569                                        default:
570                                                break;
571                                        }
572                                } while (i != startsAt);
573                        } else {
574                                int i2 = (curChar & 0xff) >> 6;
575                                long l2 = 1L << (curChar & 077);
576                                do {
577                                        switch (jjstateSet[--i]) {
578                                        case 0:
579                                        case 16:
580                                                if ((jjbitVec0[i2] & l2) == 0L)
581                                                        break;
582                                                if (kind > 26)
583                                                        kind = 26;
584                                                jjCheckNAdd(16);
585                                                break;
586                                        case 1:
587                                                if ((jjbitVec0[i2] & l2) != 0L)
588                                                        jjAddStates(10, 11);
589                                                break;
590                                        case 8:
591                                                if ((jjbitVec0[i2] & l2) != 0L)
592                                                        jjAddStates(2, 4);
593                                                break;
594                                        case 13:
595                                                if ((jjbitVec0[i2] & l2) != 0L)
596                                                        jjAddStates(12, 13);
597                                                break;
598                                        case 22:
599                                        case 24:
600                                                if ((jjbitVec0[i2] & l2) != 0L)
601                                                        jjCheckNAddStates(7, 9);
602                                                break;
603                                        default:
604                                                break;
605                                        }
606                                } while (i != startsAt);
607                        }
608                        if (kind != 0x7fffffff) {
609                                jjmatchedKind = kind;
610                                jjmatchedPos = curPos;
611                                kind = 0x7fffffff;
612                        }
613                        ++curPos;
614                        if ((i = jjnewStateCnt) == (startsAt = 28 - (jjnewStateCnt = startsAt)))
615                                return curPos;
616                        try {
617                                curChar = input_stream.readChar();
618                        } catch (java.io.IOException e) {
619                                return curPos;
620                        }
621                }
622        }
623
624        static final int[] jjnextStates = { 21, 27, 8, 10, 11, 18, 19, 22, 23, 26,
625                        1, 2, 13, 14, };
626
627        /** Token literal values. */
628        public static final String[] jjstrLiteralImages = { "", null, null, null,
629                        null, null, null, null, null, null, "\133", "\135", "\173", "\175",
630                        "\72", "\54", "\75", null, null, null, null, null, null, null,
631                        null, null, null, "\73", null, null, null, null, null, null, null,
632                        null, null, "\137", };
633
634        /** Lexer state names. */
635        public static final String[] lexStateNames = { "DEFAULT", };
636        static final long[] jjtoToken = { 0x3ffffffc01L, };
637        static final long[] jjtoSkip = { 0x7eL, };
638        protected SimpleCharStream input_stream;
639        private final int[] jjrounds = new int[28];
640        private final int[] jjstateSet = new int[56];
641        protected char curChar;
642
643        /** Constructor. */
644        public DOTParserTokenManager(SimpleCharStream stream) {
645                if (SimpleCharStream.staticFlag)
646                        throw new Error(
647                                        "ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
648                input_stream = stream;
649        }
650
651        /** Constructor. */
652        public DOTParserTokenManager(SimpleCharStream stream, int lexState) {
653                this(stream);
654                SwitchTo(lexState);
655        }
656
657        /** Reinitialise parser. */
658        public void ReInit(SimpleCharStream stream) {
659                jjmatchedPos = jjnewStateCnt = 0;
660                curLexState = defaultLexState;
661                input_stream = stream;
662                ReInitRounds();
663        }
664
665        private void ReInitRounds() {
666                int i;
667                jjround = 0x80000001;
668                for (i = 28; i-- > 0;)
669                        jjrounds[i] = 0x80000000;
670        }
671
672        /** Reinitialise parser. */
673        public void ReInit(SimpleCharStream stream, int lexState) {
674                ReInit(stream);
675                SwitchTo(lexState);
676        }
677
678        /** Switch to specified lex state. */
679        public void SwitchTo(int lexState) {
680                if (lexState >= 1 || lexState < 0)
681                        throw new TokenMgrError("Error: Ignoring invalid lexical state : "
682                                        + lexState + ". State unchanged.",
683                                        TokenMgrError.INVALID_LEXICAL_STATE);
684                else
685                        curLexState = lexState;
686        }
687
688        protected Token jjFillToken() {
689                final Token t;
690                final String curTokenImage;
691                final int beginLine;
692                final int endLine;
693                final int beginColumn;
694                final int endColumn;
695                String im = jjstrLiteralImages[jjmatchedKind];
696                curTokenImage = (im == null) ? input_stream.GetImage() : im;
697                beginLine = input_stream.getBeginLine();
698                beginColumn = input_stream.getBeginColumn();
699                endLine = input_stream.getEndLine();
700                endColumn = input_stream.getEndColumn();
701                t = Token.newToken(jjmatchedKind, curTokenImage);
702
703                t.beginLine = beginLine;
704                t.endLine = endLine;
705                t.beginColumn = beginColumn;
706                t.endColumn = endColumn;
707
708                return t;
709        }
710
711        int curLexState = 0;
712        int defaultLexState = 0;
713        int jjnewStateCnt;
714        int jjround;
715        int jjmatchedPos;
716        int jjmatchedKind;
717
718        /** Get the next Token. */
719        public Token getNextToken() {
720                Token matchedToken;
721                int curPos = 0;
722
723                EOFLoop: for (;;) {
724                        try {
725                                curChar = input_stream.BeginToken();
726                        } catch (java.io.IOException e) {
727                                jjmatchedKind = 0;
728                                matchedToken = jjFillToken();
729                                return matchedToken;
730                        }
731
732                        try {
733                                input_stream.backup(0);
734                                while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
735                                        curChar = input_stream.BeginToken();
736                        } catch (java.io.IOException e1) {
737                                continue EOFLoop;
738                        }
739                        jjmatchedKind = 0x7fffffff;
740                        jjmatchedPos = 0;
741                        curPos = jjMoveStringLiteralDfa0_0();
742                        if (jjmatchedKind != 0x7fffffff) {
743                                if (jjmatchedPos + 1 < curPos)
744                                        input_stream.backup(curPos - jjmatchedPos - 1);
745                                if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
746                                        matchedToken = jjFillToken();
747                                        return matchedToken;
748                                } else {
749                                        continue EOFLoop;
750                                }
751                        }
752                        int error_line = input_stream.getEndLine();
753                        int error_column = input_stream.getEndColumn();
754                        String error_after = null;
755                        boolean EOFSeen = false;
756                        try {
757                                input_stream.readChar();
758                                input_stream.backup(1);
759                        } catch (java.io.IOException e1) {
760                                EOFSeen = true;
761                                error_after = curPos <= 1 ? "" : input_stream.GetImage();
762                                if (curChar == '\n' || curChar == '\r') {
763                                        error_line++;
764                                        error_column = 0;
765                                } else
766                                        error_column++;
767                        }
768                        if (!EOFSeen) {
769                                input_stream.backup(1);
770                                error_after = curPos <= 1 ? "" : input_stream.GetImage();
771                        }
772                        throw new TokenMgrError(EOFSeen, curLexState, error_line,
773                                        error_column, error_after, curChar,
774                                        TokenMgrError.LEXICAL_ERROR);
775                }
776        }
777
778        private void jjCheckNAdd(int state) {
779                if (jjrounds[state] != jjround) {
780                        jjstateSet[jjnewStateCnt++] = state;
781                        jjrounds[state] = jjround;
782                }
783        }
784
785        private void jjAddStates(int start, int end) {
786                do {
787                        jjstateSet[jjnewStateCnt++] = jjnextStates[start];
788                } while (start++ != end);
789        }
790
791        private void jjCheckNAddTwoStates(int state1, int state2) {
792                jjCheckNAdd(state1);
793                jjCheckNAdd(state2);
794        }
795
796        private void jjCheckNAddStates(int start, int end) {
797                do {
798                        jjCheckNAdd(jjnextStates[start]);
799                } while (start++ != end);
800        }
801
802}