Lexer.java revision 56ed4167b942ec265f9cee70ac4d71d10b3835ce
1/* This file was generated by SableCC (http://www.sablecc.org/). */
2
3package com.google.clearsilver.jsilver.syntax.lexer;
4
5import java.io.*;
6import com.google.clearsilver.jsilver.syntax.node.*;
7
8@SuppressWarnings("nls")
9public class Lexer
10{
11    protected Token token;
12    protected State state = State.CONTENT;
13
14    private PushbackReader in;
15    private int line;
16    private int pos;
17    private boolean cr;
18    private boolean eof;
19    private final StringBuffer text = new StringBuffer();
20
21    @SuppressWarnings("unused")
22    protected void filter() throws LexerException, IOException
23    {
24        // Do nothing
25    }
26
27    public Lexer(@SuppressWarnings("hiding") PushbackReader in)
28    {
29        this.in = in;
30    }
31
32    public Token peek() throws LexerException, IOException
33    {
34        while(this.token == null)
35        {
36            this.token = getToken();
37            filter();
38        }
39
40        return this.token;
41    }
42
43    public Token next() throws LexerException, IOException
44    {
45        while(this.token == null)
46        {
47            this.token = getToken();
48            filter();
49        }
50
51        Token result = this.token;
52        this.token = null;
53        return result;
54    }
55
56    protected Token getToken() throws IOException, LexerException
57    {
58        int dfa_state = 0;
59
60        int start_pos = this.pos;
61        int start_line = this.line;
62
63        int accept_state = -1;
64        int accept_token = -1;
65        int accept_length = -1;
66        int accept_pos = -1;
67        int accept_line = -1;
68
69        @SuppressWarnings("hiding") int[][][] gotoTable = Lexer.gotoTable[this.state.id()];
70        @SuppressWarnings("hiding") int[] accept = Lexer.accept[this.state.id()];
71        this.text.setLength(0);
72
73        while(true)
74        {
75            int c = getChar();
76
77            if(c != -1)
78            {
79                switch(c)
80                {
81                case 10:
82                    if(this.cr)
83                    {
84                        this.cr = false;
85                    }
86                    else
87                    {
88                        this.line++;
89                        this.pos = 0;
90                    }
91                    break;
92                case 13:
93                    this.line++;
94                    this.pos = 0;
95                    this.cr = true;
96                    break;
97                default:
98                    this.pos++;
99                    this.cr = false;
100                    break;
101                }
102
103                this.text.append((char) c);
104
105                do
106                {
107                    int oldState = (dfa_state < -1) ? (-2 -dfa_state) : dfa_state;
108
109                    dfa_state = -1;
110
111                    int[][] tmp1 =  gotoTable[oldState];
112                    int low = 0;
113                    int high = tmp1.length - 1;
114
115                    while(low <= high)
116                    {
117                        int middle = (low + high) / 2;
118                        int[] tmp2 = tmp1[middle];
119
120                        if(c < tmp2[0])
121                        {
122                            high = middle - 1;
123                        }
124                        else if(c > tmp2[1])
125                        {
126                            low = middle + 1;
127                        }
128                        else
129                        {
130                            dfa_state = tmp2[2];
131                            break;
132                        }
133                    }
134                }while(dfa_state < -1);
135            }
136            else
137            {
138                dfa_state = -1;
139            }
140
141            if(dfa_state >= 0)
142            {
143                if(accept[dfa_state] != -1)
144                {
145                    accept_state = dfa_state;
146                    accept_token = accept[dfa_state];
147                    accept_length = this.text.length();
148                    accept_pos = this.pos;
149                    accept_line = this.line;
150                }
151            }
152            else
153            {
154                if(accept_state != -1)
155                {
156                    switch(accept_token)
157                    {
158                    case 0:
159                        {
160                            @SuppressWarnings("hiding") Token token = new0(
161                                getText(accept_length),
162                                start_line + 1,
163                                start_pos + 1);
164                            pushBack(accept_length);
165                            this.pos = accept_pos;
166                            this.line = accept_line;
167                            switch(state.id())
168                            {
169                                case 0: state = State.CONTENT; break;
170                            }
171                            return token;
172                        }
173                    case 1:
174                        {
175                            @SuppressWarnings("hiding") Token token = new1(
176                                getText(accept_length),
177                                start_line + 1,
178                                start_pos + 1);
179                            pushBack(accept_length);
180                            this.pos = accept_pos;
181                            this.line = accept_line;
182                            switch(state.id())
183                            {
184                                case 3: state = State.COMMENT; break;
185                            }
186                            return token;
187                        }
188                    case 2:
189                        {
190                            @SuppressWarnings("hiding") Token token = new2(
191                                start_line + 1,
192                                start_pos + 1);
193                            pushBack(accept_length);
194                            this.pos = accept_pos;
195                            this.line = accept_line;
196                            switch(state.id())
197                            {
198                                case 1: state = State.COMMAND; break;
199                            }
200                            return token;
201                        }
202                    case 3:
203                        {
204                            @SuppressWarnings("hiding") Token token = new3(
205                                start_line + 1,
206                                start_pos + 1);
207                            pushBack(accept_length);
208                            this.pos = accept_pos;
209                            this.line = accept_line;
210                            switch(state.id())
211                            {
212                                case 1: state = State.COMMAND; break;
213                            }
214                            return token;
215                        }
216                    case 4:
217                        {
218                            @SuppressWarnings("hiding") Token token = new4(
219                                start_line + 1,
220                                start_pos + 1);
221                            pushBack(accept_length);
222                            this.pos = accept_pos;
223                            this.line = accept_line;
224                            switch(state.id())
225                            {
226                                case 1: state = State.COMMAND; break;
227                            }
228                            return token;
229                        }
230                    case 5:
231                        {
232                            @SuppressWarnings("hiding") Token token = new5(
233                                start_line + 1,
234                                start_pos + 1);
235                            pushBack(accept_length);
236                            this.pos = accept_pos;
237                            this.line = accept_line;
238                            switch(state.id())
239                            {
240                                case 1: state = State.COMMAND; break;
241                            }
242                            return token;
243                        }
244                    case 6:
245                        {
246                            @SuppressWarnings("hiding") Token token = new6(
247                                start_line + 1,
248                                start_pos + 1);
249                            pushBack(accept_length);
250                            this.pos = accept_pos;
251                            this.line = accept_line;
252                            switch(state.id())
253                            {
254                                case 1: state = State.COMMAND; break;
255                            }
256                            return token;
257                        }
258                    case 7:
259                        {
260                            @SuppressWarnings("hiding") Token token = new7(
261                                start_line + 1,
262                                start_pos + 1);
263                            pushBack(accept_length);
264                            this.pos = accept_pos;
265                            this.line = accept_line;
266                            switch(state.id())
267                            {
268                                case 1: state = State.COMMAND; break;
269                            }
270                            return token;
271                        }
272                    case 8:
273                        {
274                            @SuppressWarnings("hiding") Token token = new8(
275                                getText(accept_length),
276                                start_line + 1,
277                                start_pos + 1);
278                            pushBack(accept_length);
279                            this.pos = accept_pos;
280                            this.line = accept_line;
281                            switch(state.id())
282                            {
283                                case 1: state = State.COMMAND; break;
284                            }
285                            return token;
286                        }
287                    case 9:
288                        {
289                            @SuppressWarnings("hiding") Token token = new9(
290                                start_line + 1,
291                                start_pos + 1);
292                            pushBack(accept_length);
293                            this.pos = accept_pos;
294                            this.line = accept_line;
295                            switch(state.id())
296                            {
297                                case 1: state = State.COMMAND; break;
298                            }
299                            return token;
300                        }
301                    case 10:
302                        {
303                            @SuppressWarnings("hiding") Token token = new10(
304                                start_line + 1,
305                                start_pos + 1);
306                            pushBack(accept_length);
307                            this.pos = accept_pos;
308                            this.line = accept_line;
309                            switch(state.id())
310                            {
311                                case 1: state = State.COMMAND; break;
312                            }
313                            return token;
314                        }
315                    case 11:
316                        {
317                            @SuppressWarnings("hiding") Token token = new11(
318                                start_line + 1,
319                                start_pos + 1);
320                            pushBack(accept_length);
321                            this.pos = accept_pos;
322                            this.line = accept_line;
323                            switch(state.id())
324                            {
325                                case 1: state = State.COMMAND; break;
326                            }
327                            return token;
328                        }
329                    case 12:
330                        {
331                            @SuppressWarnings("hiding") Token token = new12(
332                                start_line + 1,
333                                start_pos + 1);
334                            pushBack(accept_length);
335                            this.pos = accept_pos;
336                            this.line = accept_line;
337                            switch(state.id())
338                            {
339                                case 1: state = State.COMMAND; break;
340                            }
341                            return token;
342                        }
343                    case 13:
344                        {
345                            @SuppressWarnings("hiding") Token token = new13(
346                                start_line + 1,
347                                start_pos + 1);
348                            pushBack(accept_length);
349                            this.pos = accept_pos;
350                            this.line = accept_line;
351                            switch(state.id())
352                            {
353                                case 1: state = State.COMMAND; break;
354                            }
355                            return token;
356                        }
357                    case 14:
358                        {
359                            @SuppressWarnings("hiding") Token token = new14(
360                                start_line + 1,
361                                start_pos + 1);
362                            pushBack(accept_length);
363                            this.pos = accept_pos;
364                            this.line = accept_line;
365                            switch(state.id())
366                            {
367                                case 1: state = State.COMMAND; break;
368                            }
369                            return token;
370                        }
371                    case 15:
372                        {
373                            @SuppressWarnings("hiding") Token token = new15(
374                                start_line + 1,
375                                start_pos + 1);
376                            pushBack(accept_length);
377                            this.pos = accept_pos;
378                            this.line = accept_line;
379                            switch(state.id())
380                            {
381                                case 1: state = State.COMMAND; break;
382                            }
383                            return token;
384                        }
385                    case 16:
386                        {
387                            @SuppressWarnings("hiding") Token token = new16(
388                                start_line + 1,
389                                start_pos + 1);
390                            pushBack(accept_length);
391                            this.pos = accept_pos;
392                            this.line = accept_line;
393                            switch(state.id())
394                            {
395                                case 1: state = State.COMMAND; break;
396                            }
397                            return token;
398                        }
399                    case 17:
400                        {
401                            @SuppressWarnings("hiding") Token token = new17(
402                                start_line + 1,
403                                start_pos + 1);
404                            pushBack(accept_length);
405                            this.pos = accept_pos;
406                            this.line = accept_line;
407                            switch(state.id())
408                            {
409                                case 1: state = State.COMMAND; break;
410                            }
411                            return token;
412                        }
413                    case 18:
414                        {
415                            @SuppressWarnings("hiding") Token token = new18(
416                                start_line + 1,
417                                start_pos + 1);
418                            pushBack(accept_length);
419                            this.pos = accept_pos;
420                            this.line = accept_line;
421                            switch(state.id())
422                            {
423                                case 1: state = State.COMMAND; break;
424                            }
425                            return token;
426                        }
427                    case 19:
428                        {
429                            @SuppressWarnings("hiding") Token token = new19(
430                                start_line + 1,
431                                start_pos + 1);
432                            pushBack(accept_length);
433                            this.pos = accept_pos;
434                            this.line = accept_line;
435                            switch(state.id())
436                            {
437                                case 1: state = State.COMMAND; break;
438                            }
439                            return token;
440                        }
441                    case 20:
442                        {
443                            @SuppressWarnings("hiding") Token token = new20(
444                                start_line + 1,
445                                start_pos + 1);
446                            pushBack(accept_length);
447                            this.pos = accept_pos;
448                            this.line = accept_line;
449                            switch(state.id())
450                            {
451                                case 1: state = State.COMMAND; break;
452                            }
453                            return token;
454                        }
455                    case 21:
456                        {
457                            @SuppressWarnings("hiding") Token token = new21(
458                                start_line + 1,
459                                start_pos + 1);
460                            pushBack(accept_length);
461                            this.pos = accept_pos;
462                            this.line = accept_line;
463                            switch(state.id())
464                            {
465                                case 1: state = State.COMMAND; break;
466                            }
467                            return token;
468                        }
469                    case 22:
470                        {
471                            @SuppressWarnings("hiding") Token token = new22(
472                                start_line + 1,
473                                start_pos + 1);
474                            pushBack(accept_length);
475                            this.pos = accept_pos;
476                            this.line = accept_line;
477                            switch(state.id())
478                            {
479                                case 1: state = State.COMMAND; break;
480                            }
481                            return token;
482                        }
483                    case 23:
484                        {
485                            @SuppressWarnings("hiding") Token token = new23(
486                                start_line + 1,
487                                start_pos + 1);
488                            pushBack(accept_length);
489                            this.pos = accept_pos;
490                            this.line = accept_line;
491                            switch(state.id())
492                            {
493                                case 2: state = State.ARGS; break;
494                            }
495                            return token;
496                        }
497                    case 24:
498                        {
499                            @SuppressWarnings("hiding") Token token = new24(
500                                start_line + 1,
501                                start_pos + 1);
502                            pushBack(accept_length);
503                            this.pos = accept_pos;
504                            this.line = accept_line;
505                            switch(state.id())
506                            {
507                                case 2: state = State.ARGS; break;
508                            }
509                            return token;
510                        }
511                    case 25:
512                        {
513                            @SuppressWarnings("hiding") Token token = new25(
514                                start_line + 1,
515                                start_pos + 1);
516                            pushBack(accept_length);
517                            this.pos = accept_pos;
518                            this.line = accept_line;
519                            switch(state.id())
520                            {
521                                case 2: state = State.ARGS; break;
522                            }
523                            return token;
524                        }
525                    case 26:
526                        {
527                            @SuppressWarnings("hiding") Token token = new26(
528                                start_line + 1,
529                                start_pos + 1);
530                            pushBack(accept_length);
531                            this.pos = accept_pos;
532                            this.line = accept_line;
533                            switch(state.id())
534                            {
535                                case 2: state = State.ARGS; break;
536                            }
537                            return token;
538                        }
539                    case 27:
540                        {
541                            @SuppressWarnings("hiding") Token token = new27(
542                                start_line + 1,
543                                start_pos + 1);
544                            pushBack(accept_length);
545                            this.pos = accept_pos;
546                            this.line = accept_line;
547                            switch(state.id())
548                            {
549                                case 2: state = State.ARGS; break;
550                            }
551                            return token;
552                        }
553                    case 28:
554                        {
555                            @SuppressWarnings("hiding") Token token = new28(
556                                start_line + 1,
557                                start_pos + 1);
558                            pushBack(accept_length);
559                            this.pos = accept_pos;
560                            this.line = accept_line;
561                            switch(state.id())
562                            {
563                                case 2: state = State.ARGS; break;
564                            }
565                            return token;
566                        }
567                    case 29:
568                        {
569                            @SuppressWarnings("hiding") Token token = new29(
570                                start_line + 1,
571                                start_pos + 1);
572                            pushBack(accept_length);
573                            this.pos = accept_pos;
574                            this.line = accept_line;
575                            switch(state.id())
576                            {
577                                case 2: state = State.ARGS; break;
578                            }
579                            return token;
580                        }
581                    case 30:
582                        {
583                            @SuppressWarnings("hiding") Token token = new30(
584                                start_line + 1,
585                                start_pos + 1);
586                            pushBack(accept_length);
587                            this.pos = accept_pos;
588                            this.line = accept_line;
589                            switch(state.id())
590                            {
591                                case 2: state = State.ARGS; break;
592                            }
593                            return token;
594                        }
595                    case 31:
596                        {
597                            @SuppressWarnings("hiding") Token token = new31(
598                                start_line + 1,
599                                start_pos + 1);
600                            pushBack(accept_length);
601                            this.pos = accept_pos;
602                            this.line = accept_line;
603                            switch(state.id())
604                            {
605                                case 2: state = State.ARGS; break;
606                            }
607                            return token;
608                        }
609                    case 32:
610                        {
611                            @SuppressWarnings("hiding") Token token = new32(
612                                start_line + 1,
613                                start_pos + 1);
614                            pushBack(accept_length);
615                            this.pos = accept_pos;
616                            this.line = accept_line;
617                            switch(state.id())
618                            {
619                                case 2: state = State.ARGS; break;
620                            }
621                            return token;
622                        }
623                    case 33:
624                        {
625                            @SuppressWarnings("hiding") Token token = new33(
626                                start_line + 1,
627                                start_pos + 1);
628                            pushBack(accept_length);
629                            this.pos = accept_pos;
630                            this.line = accept_line;
631                            switch(state.id())
632                            {
633                                case 2: state = State.ARGS; break;
634                            }
635                            return token;
636                        }
637                    case 34:
638                        {
639                            @SuppressWarnings("hiding") Token token = new34(
640                                getText(accept_length),
641                                start_line + 1,
642                                start_pos + 1);
643                            pushBack(accept_length);
644                            this.pos = accept_pos;
645                            this.line = accept_line;
646                            switch(state.id())
647                            {
648                                case 2: state = State.ARGS; break;
649                            }
650                            return token;
651                        }
652                    case 35:
653                        {
654                            @SuppressWarnings("hiding") Token token = new35(
655                                start_line + 1,
656                                start_pos + 1);
657                            pushBack(accept_length);
658                            this.pos = accept_pos;
659                            this.line = accept_line;
660                            switch(state.id())
661                            {
662                                case 2: state = State.ARGS; break;
663                            }
664                            return token;
665                        }
666                    case 36:
667                        {
668                            @SuppressWarnings("hiding") Token token = new36(
669                                start_line + 1,
670                                start_pos + 1);
671                            pushBack(accept_length);
672                            this.pos = accept_pos;
673                            this.line = accept_line;
674                            switch(state.id())
675                            {
676                                case 2: state = State.ARGS; break;
677                            }
678                            return token;
679                        }
680                    case 37:
681                        {
682                            @SuppressWarnings("hiding") Token token = new37(
683                                start_line + 1,
684                                start_pos + 1);
685                            pushBack(accept_length);
686                            this.pos = accept_pos;
687                            this.line = accept_line;
688                            switch(state.id())
689                            {
690                                case 2: state = State.ARGS; break;
691                            }
692                            return token;
693                        }
694                    case 38:
695                        {
696                            @SuppressWarnings("hiding") Token token = new38(
697                                start_line + 1,
698                                start_pos + 1);
699                            pushBack(accept_length);
700                            this.pos = accept_pos;
701                            this.line = accept_line;
702                            switch(state.id())
703                            {
704                                case 2: state = State.ARGS; break;
705                            }
706                            return token;
707                        }
708                    case 39:
709                        {
710                            @SuppressWarnings("hiding") Token token = new39(
711                                start_line + 1,
712                                start_pos + 1);
713                            pushBack(accept_length);
714                            this.pos = accept_pos;
715                            this.line = accept_line;
716                            switch(state.id())
717                            {
718                                case 2: state = State.ARGS; break;
719                            }
720                            return token;
721                        }
722                    case 40:
723                        {
724                            @SuppressWarnings("hiding") Token token = new40(
725                                start_line + 1,
726                                start_pos + 1);
727                            pushBack(accept_length);
728                            this.pos = accept_pos;
729                            this.line = accept_line;
730                            switch(state.id())
731                            {
732                                case 2: state = State.ARGS; break;
733                            }
734                            return token;
735                        }
736                    case 41:
737                        {
738                            @SuppressWarnings("hiding") Token token = new41(
739                                start_line + 1,
740                                start_pos + 1);
741                            pushBack(accept_length);
742                            this.pos = accept_pos;
743                            this.line = accept_line;
744                            switch(state.id())
745                            {
746                                case 2: state = State.ARGS; break;
747                            }
748                            return token;
749                        }
750                    case 42:
751                        {
752                            @SuppressWarnings("hiding") Token token = new42(
753                                start_line + 1,
754                                start_pos + 1);
755                            pushBack(accept_length);
756                            this.pos = accept_pos;
757                            this.line = accept_line;
758                            switch(state.id())
759                            {
760                                case 2: state = State.ARGS; break;
761                            }
762                            return token;
763                        }
764                    case 43:
765                        {
766                            @SuppressWarnings("hiding") Token token = new43(
767                                start_line + 1,
768                                start_pos + 1);
769                            pushBack(accept_length);
770                            this.pos = accept_pos;
771                            this.line = accept_line;
772                            switch(state.id())
773                            {
774                                case 2: state = State.ARGS; break;
775                            }
776                            return token;
777                        }
778                    case 44:
779                        {
780                            @SuppressWarnings("hiding") Token token = new44(
781                                start_line + 1,
782                                start_pos + 1);
783                            pushBack(accept_length);
784                            this.pos = accept_pos;
785                            this.line = accept_line;
786                            switch(state.id())
787                            {
788                                case 2: state = State.ARGS; break;
789                            }
790                            return token;
791                        }
792                    case 45:
793                        {
794                            @SuppressWarnings("hiding") Token token = new45(
795                                start_line + 1,
796                                start_pos + 1);
797                            pushBack(accept_length);
798                            this.pos = accept_pos;
799                            this.line = accept_line;
800                            switch(state.id())
801                            {
802                                case 2: state = State.ARGS; break;
803                            }
804                            return token;
805                        }
806                    case 46:
807                        {
808                            @SuppressWarnings("hiding") Token token = new46(
809                                start_line + 1,
810                                start_pos + 1);
811                            pushBack(accept_length);
812                            this.pos = accept_pos;
813                            this.line = accept_line;
814                            switch(state.id())
815                            {
816                                case 2: state = State.ARGS; break;
817                            }
818                            return token;
819                        }
820                    case 47:
821                        {
822                            @SuppressWarnings("hiding") Token token = new47(
823                                getText(accept_length),
824                                start_line + 1,
825                                start_pos + 1);
826                            pushBack(accept_length);
827                            this.pos = accept_pos;
828                            this.line = accept_line;
829                            switch(state.id())
830                            {
831                                case 2: state = State.ARGS; break;
832                            }
833                            return token;
834                        }
835                    case 48:
836                        {
837                            @SuppressWarnings("hiding") Token token = new48(
838                                getText(accept_length),
839                                start_line + 1,
840                                start_pos + 1);
841                            pushBack(accept_length);
842                            this.pos = accept_pos;
843                            this.line = accept_line;
844                            switch(state.id())
845                            {
846                                case 2: state = State.ARGS; break;
847                            }
848                            return token;
849                        }
850                    case 49:
851                        {
852                            @SuppressWarnings("hiding") Token token = new49(
853                                getText(accept_length),
854                                start_line + 1,
855                                start_pos + 1);
856                            pushBack(accept_length);
857                            this.pos = accept_pos;
858                            this.line = accept_line;
859                            switch(state.id())
860                            {
861                                case 2: state = State.ARGS; break;
862                            }
863                            return token;
864                        }
865                    case 50:
866                        {
867                            @SuppressWarnings("hiding") Token token = new50(
868                                getText(accept_length),
869                                start_line + 1,
870                                start_pos + 1);
871                            pushBack(accept_length);
872                            this.pos = accept_pos;
873                            this.line = accept_line;
874                            switch(state.id())
875                            {
876                                case 2: state = State.ARGS; break;
877                            }
878                            return token;
879                        }
880                    case 51:
881                        {
882                            @SuppressWarnings("hiding") Token token = new51(
883                                start_line + 1,
884                                start_pos + 1);
885                            pushBack(accept_length);
886                            this.pos = accept_pos;
887                            this.line = accept_line;
888                            switch(state.id())
889                            {
890                                case 2: state = State.ARGS; break;
891                                case 1: state = State.COMMAND; break;
892                            }
893                            return token;
894                        }
895                    case 52:
896                        {
897                            @SuppressWarnings("hiding") Token token = new52(
898                                getText(accept_length),
899                                start_line + 1,
900                                start_pos + 1);
901                            pushBack(accept_length);
902                            this.pos = accept_pos;
903                            this.line = accept_line;
904                            switch(state.id())
905                            {
906                                case 0: state = State.COMMAND; break;
907                            }
908                            return token;
909                        }
910                    case 53:
911                        {
912                            @SuppressWarnings("hiding") Token token = new53(
913                                start_line + 1,
914                                start_pos + 1);
915                            pushBack(accept_length);
916                            this.pos = accept_pos;
917                            this.line = accept_line;
918                            switch(state.id())
919                            {
920                                case 1: state = State.COMMENT; break;
921                            }
922                            return token;
923                        }
924                    case 54:
925                        {
926                            @SuppressWarnings("hiding") Token token = new54(
927                                getText(accept_length),
928                                start_line + 1,
929                                start_pos + 1);
930                            pushBack(accept_length);
931                            this.pos = accept_pos;
932                            this.line = accept_line;
933                            switch(state.id())
934                            {
935                                case 1: state = State.ARGS; break;
936                            }
937                            return token;
938                        }
939                    case 55:
940                        {
941                            @SuppressWarnings("hiding") Token token = new55(
942                                getText(accept_length),
943                                start_line + 1,
944                                start_pos + 1);
945                            pushBack(accept_length);
946                            this.pos = accept_pos;
947                            this.line = accept_line;
948                            switch(state.id())
949                            {
950                                case 1: state = State.ARGS; break;
951                            }
952                            return token;
953                        }
954                    case 56:
955                        {
956                            @SuppressWarnings("hiding") Token token = new56(
957                                getText(accept_length),
958                                start_line + 1,
959                                start_pos + 1);
960                            pushBack(accept_length);
961                            this.pos = accept_pos;
962                            this.line = accept_line;
963                            switch(state.id())
964                            {
965                                case 2: state = State.CONTENT; break;
966                                case 1: state = State.CONTENT; break;
967                                case 3: state = State.CONTENT; break;
968                            }
969                            return token;
970                        }
971                    }
972                }
973                else
974                {
975                    if(this.text.length() > 0)
976                    {
977                        throw new LexerException(
978                            "[" + (start_line + 1) + "," + (start_pos + 1) + "]" +
979                            " Unknown token: " + this.text);
980                    }
981
982                    @SuppressWarnings("hiding") EOF token = new EOF(
983                        start_line + 1,
984                        start_pos + 1);
985                    return token;
986                }
987            }
988        }
989    }
990
991    Token new0(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TData(text, line, pos); }
992    Token new1(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TComment(text, line, pos); }
993    Token new2(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TVar(line, pos); }
994    Token new3(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TLvar(line, pos); }
995    Token new4(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TEvar(line, pos); }
996    Token new5(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TUvar(line, pos); }
997    Token new6(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TSet(line, pos); }
998    Token new7(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TIf(line, pos); }
999    Token new8(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TElseIf(text, line, pos); }
1000    Token new9(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TElse(line, pos); }
1001    Token new10(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TWith(line, pos); }
1002    Token new11(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TEscape(line, pos); }
1003    Token new12(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TAutoescape(line, pos); }
1004    Token new13(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TLoop(line, pos); }
1005    Token new14(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TEach(line, pos); }
1006    Token new15(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TAlt(line, pos); }
1007    Token new16(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TName(line, pos); }
1008    Token new17(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TDef(line, pos); }
1009    Token new18(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TCall(line, pos); }
1010    Token new19(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TInclude(line, pos); }
1011    Token new20(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TLinclude(line, pos); }
1012    Token new21(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TContentType(line, pos); }
1013    Token new22(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TInline(line, pos); }
1014    Token new23(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TComma(line, pos); }
1015    Token new24(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TBang(line, pos); }
1016    Token new25(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TAssignment(line, pos); }
1017    Token new26(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TEq(line, pos); }
1018    Token new27(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TNe(line, pos); }
1019    Token new28(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TLt(line, pos); }
1020    Token new29(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TGt(line, pos); }
1021    Token new30(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TLte(line, pos); }
1022    Token new31(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TGte(line, pos); }
1023    Token new32(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TAnd(line, pos); }
1024    Token new33(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TOr(line, pos); }
1025    Token new34(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TString(text, line, pos); }
1026    Token new35(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new THash(line, pos); }
1027    Token new36(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TPlus(line, pos); }
1028    Token new37(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TMinus(line, pos); }
1029    Token new38(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TStar(line, pos); }
1030    Token new39(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TPercent(line, pos); }
1031    Token new40(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TBracketOpen(line, pos); }
1032    Token new41(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TBracketClose(line, pos); }
1033    Token new42(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TParenOpen(line, pos); }
1034    Token new43(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TParenClose(line, pos); }
1035    Token new44(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TDot(line, pos); }
1036    Token new45(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TDollar(line, pos); }
1037    Token new46(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TQuestion(line, pos); }
1038    Token new47(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TDecNumber(text, line, pos); }
1039    Token new48(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new THexNumber(text, line, pos); }
1040    Token new49(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TWord(text, line, pos); }
1041    Token new50(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TArgWhitespace(text, line, pos); }
1042    Token new51(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TSlash(line, pos); }
1043    Token new52(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TCsOpen(text, line, pos); }
1044    Token new53(@SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TCommentStart(line, pos); }
1045    Token new54(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TCommandDelimiter(text, line, pos); }
1046    Token new55(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new THardDelimiter(text, line, pos); }
1047    Token new56(@SuppressWarnings("hiding") String text, @SuppressWarnings("hiding") int line, @SuppressWarnings("hiding") int pos) { return new TCsClose(text, line, pos); }
1048
1049    private int getChar() throws IOException
1050    {
1051        if(this.eof)
1052        {
1053            return -1;
1054        }
1055
1056        int result = this.in.read();
1057
1058        if(result == -1)
1059        {
1060            this.eof = true;
1061        }
1062
1063        return result;
1064    }
1065
1066    private void pushBack(int acceptLength) throws IOException
1067    {
1068        int length = this.text.length();
1069        for(int i = length - 1; i >= acceptLength; i--)
1070        {
1071            this.eof = false;
1072
1073            this.in.unread(this.text.charAt(i));
1074        }
1075    }
1076
1077    protected void unread(@SuppressWarnings("hiding") Token token) throws IOException
1078    {
1079        @SuppressWarnings("hiding") String text = token.getText();
1080        int length = text.length();
1081
1082        for(int i = length - 1; i >= 0; i--)
1083        {
1084            this.eof = false;
1085
1086            this.in.unread(text.charAt(i));
1087        }
1088
1089        this.pos = token.getPos() - 1;
1090        this.line = token.getLine() - 1;
1091    }
1092
1093    private String getText(int acceptLength)
1094    {
1095        StringBuffer s = new StringBuffer(acceptLength);
1096        for(int i = 0; i < acceptLength; i++)
1097        {
1098            s.append(this.text.charAt(i));
1099        }
1100
1101        return s.toString();
1102    }
1103
1104    private static int[][][][] gotoTable;
1105/*  {
1106        { // CONTENT
1107            {{0, 59, 1}, {60, 60, 2}, {61, 65535, 1}, },
1108            {{0, 59, 1}, {60, 60, 3}, {61, 65535, 1}, },
1109            {{0, 62, 4}, {63, 63, 5}, {64, 65535, 4}, },
1110            {{0, 62, 4}, {63, 63, 6}, {64, 65535, 4}, },
1111            {{0, 65535, -3}, },
1112            {{0, 98, 7}, {99, 99, 8}, {100, 65535, 7}, },
1113            {{0, 98, 7}, {99, 99, 9}, {100, 65535, 7}, },
1114            {{0, 65535, -3}, },
1115            {{0, 114, 10}, {115, 115, 11}, {116, 65535, 10}, },
1116            {{0, 114, 10}, {115, 115, 12}, {116, 65535, 10}, },
1117            {{0, 65535, -3}, },
1118            {{0, 8, 13}, {9, 9, 14}, {10, 10, 15}, {11, 12, 13}, {13, 13, 16}, {14, 31, 13}, {32, 32, 17}, {33, 65535, 13}, },
1119            {{0, 8, 13}, {11, 12, 13}, {14, 31, 13}, {33, 65535, 13}, },
1120            {{0, 65535, -3}, },
1121            {{9, 10, -13}, {13, 13, 16}, {32, 32, 17}, },
1122            {{9, 32, -16}, },
1123            {{9, 32, -16}, },
1124            {{9, 32, -16}, },
1125        }
1126        { // COMMAND
1127            {{9, 9, 1}, {10, 10, 2}, {13, 13, 3}, {32, 32, 4}, {33, 33, 5}, {35, 35, 6}, {47, 47, 7}, {58, 58, 8}, {63, 63, 9}, {97, 97, 10}, {99, 99, 11}, {100, 100, 12}, {101, 101, 13}, {105, 105, 14}, {108, 108, 15}, {110, 110, 16}, {115, 115, 17}, {117, 117, 18}, {118, 118, 19}, {119, 119, 20}, },
1128            {{9, 9, 21}, {10, 10, 22}, {13, 13, 23}, {32, 32, 24}, {63, 63, 9}, },
1129            {{9, 63, -3}, },
1130            {{9, 63, -3}, },
1131            {{9, 63, -3}, },
1132            {},
1133            {},
1134            {},
1135            {},
1136            {{62, 62, 25}, },
1137            {{108, 108, 26}, {117, 117, 27}, },
1138            {{97, 97, 28}, {111, 111, 29}, },
1139            {{101, 101, 30}, },
1140            {{97, 97, 31}, {108, 108, 32}, {115, 115, 33}, {118, 118, 34}, },
1141            {{102, 102, 35}, {110, 110, 36}, },
1142            {{105, 105, 37}, {111, 111, 38}, {118, 118, 39}, },
1143            {{97, 97, 40}, },
1144            {{101, 101, 41}, },
1145            {{118, 118, 42}, },
1146            {{97, 97, 43}, },
1147            {{105, 105, 44}, },
1148            {{9, 63, -3}, },
1149            {{9, 63, -3}, },
1150            {{9, 63, -3}, },
1151            {{9, 63, -3}, },
1152            {},
1153            {{116, 116, 45}, },
1154            {{116, 116, 46}, },
1155            {{108, 108, 47}, },
1156            {{110, 110, 48}, },
1157            {{102, 102, 49}, },
1158            {{99, 99, 50}, },
1159            {{105, 105, 51}, {115, 115, 52}, },
1160            {{99, 99, 53}, },
1161            {{97, 97, 54}, },
1162            {},
1163            {{99, 99, 55}, {108, 108, 56}, },
1164            {{110, 110, 57}, },
1165            {{111, 111, 58}, },
1166            {{97, 97, 59}, },
1167            {{109, 109, 60}, },
1168            {{116, 116, 61}, },
1169            {{97, 97, 62}, },
1170            {{114, 114, 63}, },
1171            {{116, 116, 64}, },
1172            {},
1173            {{111, 111, 65}, },
1174            {{108, 108, 66}, },
1175            {{116, 116, 67}, },
1176            {},
1177            {{104, 104, 68}, },
1178            {{102, 102, 69}, },
1179            {{101, 101, 70}, },
1180            {{97, 97, 71}, },
1181            {{114, 114, 72}, },
1182            {{108, 108, 73}, },
1183            {{105, 105, 74}, },
1184            {{99, 99, 75}, },
1185            {{112, 112, 76}, },
1186            {{114, 114, 77}, },
1187            {{101, 101, 78}, },
1188            {},
1189            {{114, 114, 79}, },
1190            {},
1191            {{104, 104, 80}, },
1192            {{101, 101, 81}, },
1193            {},
1194            {{101, 101, 82}, },
1195            {},
1196            {},
1197            {{105, 105, 83}, },
1198            {{112, 112, 84}, },
1199            {},
1200            {{117, 117, 85}, },
1201            {{110, 110, 86}, },
1202            {{108, 108, 87}, },
1203            {},
1204            {},
1205            {},
1206            {},
1207            {},
1208            {{115, 115, 88}, },
1209            {{110, 110, 89}, },
1210            {{102, 102, 90}, },
1211            {{101, 101, 91}, },
1212            {{100, 100, 92}, },
1213            {{101, 101, 93}, },
1214            {{117, 117, 94}, },
1215            {{99, 99, 95}, },
1216            {{116, 116, 96}, },
1217            {},
1218            {},
1219            {{101, 101, 97}, },
1220            {},
1221            {{100, 100, 98}, },
1222            {{97, 97, 99}, },
1223            {{45, 45, 100}, },
1224            {},
1225            {{101, 101, 101}, },
1226            {{112, 112, 102}, },
1227            {{116, 116, 103}, },
1228            {},
1229            {{101, 101, 104}, },
1230            {{121, 121, 105}, },
1231            {},
1232            {{112, 112, 106}, },
1233            {{101, 101, 107}, },
1234            {},
1235        }
1236        { // ARGS
1237            {{9, 9, 1}, {10, 10, 2}, {13, 13, 3}, {32, 32, 4}, {33, 33, 5}, {34, 34, 6}, {35, 35, 7}, {36, 36, 8}, {37, 37, 9}, {38, 38, 10}, {39, 39, 11}, {40, 40, 12}, {41, 41, 13}, {42, 42, 14}, {43, 43, 15}, {44, 44, 16}, {45, 45, 17}, {46, 46, 18}, {47, 47, 19}, {48, 48, 20}, {49, 57, 21}, {60, 60, 22}, {61, 61, 23}, {62, 62, 24}, {63, 63, 25}, {65, 90, 26}, {91, 91, 27}, {93, 93, 28}, {95, 95, 29}, {97, 122, 30}, {124, 124, 31}, },
1238            {{9, 32, -2}, {63, 63, 32}, },
1239            {{9, 63, -3}, },
1240            {{9, 63, -3}, },
1241            {{9, 63, -3}, },
1242            {{61, 61, 33}, },
1243            {{0, 33, 34}, {34, 34, 35}, {35, 65535, 34}, },
1244            {},
1245            {},
1246            {},
1247            {{38, 38, 36}, },
1248            {{0, 38, 37}, {39, 39, 38}, {40, 65535, 37}, },
1249            {},
1250            {},
1251            {},
1252            {},
1253            {},
1254            {},
1255            {},
1256            {},
1257            {{48, 57, 21}, {65, 87, 26}, {88, 88, 39}, {89, 90, 26}, {95, 95, 29}, {97, 119, 30}, {120, 120, 40}, {121, 122, 30}, },
1258            {{48, 57, 21}, {65, 90, 26}, {95, 122, -2}, },
1259            {{61, 61, 41}, },
1260            {{61, 61, 42}, },
1261            {{61, 61, 43}, },
1262            {{62, 62, 44}, },
1263            {{48, 57, 45}, {65, 122, -23}, },
1264            {},
1265            {},
1266            {{48, 122, -28}, },
1267            {{48, 122, -28}, },
1268            {{124, 124, 46}, },
1269            {{62, 62, 44}, },
1270            {},
1271            {{0, 65535, -8}, },
1272            {},
1273            {},
1274            {{0, 65535, -13}, },
1275            {},
1276            {{48, 57, 47}, {65, 70, 48}, {71, 90, 26}, {95, 95, 29}, {97, 102, 49}, {103, 122, 30}, },
1277            {{48, 122, -41}, },
1278            {},
1279            {},
1280            {},
1281            {},
1282            {{48, 122, -28}, },
1283            {},
1284            {{48, 122, -41}, },
1285            {{48, 122, -41}, },
1286            {{48, 122, -41}, },
1287        }
1288        { // COMMENT
1289            {{0, 8, 1}, {9, 9, 2}, {10, 10, 3}, {11, 12, 1}, {13, 13, 4}, {14, 31, 1}, {32, 32, 5}, {33, 62, 1}, {63, 63, 6}, {64, 65535, 1}, },
1290            {{0, 62, 1}, {63, 63, 7}, {64, 65535, 1}, },
1291            {{0, 65535, -2}, },
1292            {{0, 65535, -2}, },
1293            {{0, 65535, -2}, },
1294            {{0, 65535, -2}, },
1295            {{0, 61, 8}, {62, 62, 9}, {63, 65535, 8}, },
1296            {{0, 61, 8}, {63, 65535, 8}, },
1297            {{0, 65535, -3}, },
1298            {},
1299        }
1300    };*/
1301
1302    private static int[][] accept;
1303/*  {
1304        // CONTENT
1305        {-1, 0, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1, 0, 52, 52, 52, 52, },
1306        // COMMAND
1307        {-1, 54, 54, 54, 54, 55, 53, 51, 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 15, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, -1, 2, -1, -1, 18, -1, 14, 8, 9, -1, 4, -1, -1, -1, 13, 3, 16, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 11, -1, 22, -1, -1, -1, 19, -1, -1, -1, 20, -1, -1, 12, -1, -1, 21, },
1308        // ARGS
1309        {-1, 50, 50, 50, 50, 24, -1, 35, 45, 39, -1, -1, 42, 43, 38, 36, 23, 37, 44, 51, 47, 47, 28, 25, 29, 46, 49, 40, 41, 49, 49, -1, -1, 27, -1, 34, 32, -1, 34, 49, 49, 30, 26, 31, 56, 49, 33, 48, 48, 48, },
1310        // COMMENT
1311        {-1, 1, 1, 1, 1, 1, -1, -1, 1, 56, },
1312
1313    };*/
1314
1315    public static class State
1316    {
1317        public final static State CONTENT = new State(0);
1318        public final static State COMMAND = new State(1);
1319        public final static State ARGS = new State(2);
1320        public final static State COMMENT = new State(3);
1321
1322        private int id;
1323
1324        private State(@SuppressWarnings("hiding") int id)
1325        {
1326            this.id = id;
1327        }
1328
1329        public int id()
1330        {
1331            return this.id;
1332        }
1333    }
1334
1335    static
1336    {
1337        try
1338        {
1339            DataInputStream s = new DataInputStream(
1340                new BufferedInputStream(
1341                Lexer.class.getResourceAsStream("lexer.dat")));
1342
1343            // read gotoTable
1344            int length = s.readInt();
1345            gotoTable = new int[length][][][];
1346            for(int i = 0; i < gotoTable.length; i++)
1347            {
1348                length = s.readInt();
1349                gotoTable[i] = new int[length][][];
1350                for(int j = 0; j < gotoTable[i].length; j++)
1351                {
1352                    length = s.readInt();
1353                    gotoTable[i][j] = new int[length][3];
1354                    for(int k = 0; k < gotoTable[i][j].length; k++)
1355                    {
1356                        for(int l = 0; l < 3; l++)
1357                        {
1358                            gotoTable[i][j][k][l] = s.readInt();
1359                        }
1360                    }
1361                }
1362            }
1363
1364            // read accept
1365            length = s.readInt();
1366            accept = new int[length][];
1367            for(int i = 0; i < accept.length; i++)
1368            {
1369                length = s.readInt();
1370                accept[i] = new int[length];
1371                for(int j = 0; j < accept[i].length; j++)
1372                {
1373                    accept[i][j] = s.readInt();
1374                }
1375            }
1376
1377            s.close();
1378        }
1379        catch(Exception e)
1380        {
1381            throw new RuntimeException("The file \"lexer.dat\" is either missing or corrupted.");
1382        }
1383    }
1384}
1385