KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > actions > cpp > ActionLexer


1 // $ANTLR : "action.g" -> "ActionLexer.java"$
2

3     package persistence.antlr.actions.cpp;
4
5 import java.io.InputStream JavaDoc;
6 import persistence.antlr.TokenStreamException;
7 import persistence.antlr.TokenStreamIOException;
8 import persistence.antlr.TokenStreamRecognitionException;
9 import persistence.antlr.CharStreamException;
10 import persistence.antlr.CharStreamIOException;
11 import persistence.antlr.ANTLRException;
12 import java.io.Reader JavaDoc;
13 import java.util.Hashtable JavaDoc;
14 import persistence.antlr.CharScanner;
15 import persistence.antlr.InputBuffer;
16 import persistence.antlr.ByteBuffer;
17 import persistence.antlr.CharBuffer;
18 import persistence.antlr.Token;
19 import persistence.antlr.CommonToken;
20 import persistence.antlr.RecognitionException;
21 import persistence.antlr.NoViableAltForCharException;
22 import persistence.antlr.MismatchedCharException;
23 import persistence.antlr.TokenStream;
24 import persistence.antlr.ANTLRHashString;
25 import persistence.antlr.LexerSharedInputState;
26 import persistence.antlr.collections.impl.BitSet;
27 import persistence.antlr.SemanticException;
28
29     import java.io.StringReader JavaDoc;
30     import persistence.antlr.collections.impl.Vector;
31     import persistence.antlr.*;
32
33 /** Perform the following translations:
34
35     AST related translations
36
37     ## -> currentRule_AST
38     #(x,y,z) -> codeGenerator.getASTCreateString(vector-of(x,y,z))
39     #[x] -> codeGenerator.getASTCreateString(x)
40     #x -> codeGenerator.mapTreeId(x)
41
42     Inside context of #(...), you can ref (x,y,z), [x], and x as shortcuts.
43
44     Text related translations
45
46     $append(x) -> text.append(x)
47     $setText(x) -> text.setLength(_begin); text.append(x)
48     $getText -> new String(text.getBuffer(),_begin,text.length()-_begin)
49     $setToken(x) -> _token = x
50     $setType(x) -> _ttype = x
51    $FOLLOW(r) -> FOLLOW set name for rule r (optional arg)
52    $FIRST(r) -> FIRST set name for rule r (optional arg)
53  */

54 public class ActionLexer extends persistence.antlr.CharScanner implements ActionLexerTokenTypes, TokenStream
55  {
56
57     protected RuleBlock currentRule;
58     protected CodeGenerator generator;
59     protected int lineOffset = 0;
60     private Tool antlrTool; // The ANTLR tool
61
ActionTransInfo transInfo;
62
63     public ActionLexer(String JavaDoc s, RuleBlock currentRule,
64                              CodeGenerator generator,
65                              ActionTransInfo transInfo )
66     {
67         this(new StringReader JavaDoc(s));
68         this.currentRule = currentRule;
69         this.generator = generator;
70         this.transInfo = transInfo;
71     }
72
73     public void setLineOffset(int lineOffset)
74     {
75         setLine(lineOffset);
76     }
77
78     public void setTool(Tool tool)
79     {
80         this.antlrTool = tool;
81     }
82
83     public void reportError(RecognitionException e)
84     {
85         antlrTool.error("Syntax error in action: "+e,getFilename(),getLine(),getColumn());
86     }
87
88     public void reportError(String JavaDoc s)
89     {
90         antlrTool.error(s,getFilename(),getLine(),getColumn());
91     }
92
93     public void reportWarning(String JavaDoc s)
94     {
95         if ( getFilename()==null )
96             antlrTool.warning(s);
97         else
98             antlrTool.warning(s,getFilename(),getLine(),getColumn());
99     }
100 public ActionLexer(InputStream JavaDoc in) {
101     this(new ByteBuffer(in));
102 }
103 public ActionLexer(Reader JavaDoc in) {
104     this(new CharBuffer(in));
105 }
106 public ActionLexer(InputBuffer ib) {
107     this(new LexerSharedInputState(ib));
108 }
109 public ActionLexer(LexerSharedInputState state) {
110     super(state);
111     caseSensitiveLiterals = true;
112     setCaseSensitive(true);
113     literals = new Hashtable JavaDoc();
114 }
115
116 public Token nextToken() throws TokenStreamException {
117     Token theRetToken=null;
118 tryAgain:
119     for (;;) {
120         Token _token = null;
121         int _ttype = Token.INVALID_TYPE;
122         resetText();
123         try { // for char stream error handling
124
try { // for lexical error handling
125
if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff'))) {
126                     mACTION(true);
127                     theRetToken=_returnToken;
128                 }
129                 else {
130                     if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
131                 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
132                 }
133                 
134                 if ( _returnToken==null ) continue tryAgain; // found SKIP token
135
_ttype = _returnToken.getType();
136                 _returnToken.setType(_ttype);
137                 return _returnToken;
138             }
139             catch (RecognitionException e) {
140                 throw new TokenStreamRecognitionException(e);
141             }
142         }
143         catch (CharStreamException cse) {
144             if ( cse instanceof CharStreamIOException ) {
145                 throw new TokenStreamIOException(((CharStreamIOException)cse).io);
146             }
147             else {
148                 throw new TokenStreamException(cse.getMessage());
149             }
150         }
151     }
152 }
153
154     public final void mACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
155         int _ttype; Token _token=null; int _begin=text.length();
156         _ttype = ACTION;
157         int _saveIndex;
158         
159         {
160         int _cnt502=0;
161         _loop502:
162         do {
163             switch ( LA(1)) {
164             case '#':
165             {
166                 mAST_ITEM(false);
167                 break;
168             }
169             case '$':
170             {
171                 mTEXT_ITEM(false);
172                 break;
173             }
174             default:
175                 if ((_tokenSet_0.member(LA(1)))) {
176                     mSTUFF(false);
177                 }
178             else {
179                 if ( _cnt502>=1 ) { break _loop502; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
180             }
181             }
182             _cnt502++;
183         } while (true);
184         }
185         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
186             _token = makeToken(_ttype);
187             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
188         }
189         _returnToken = _token;
190     }
191     
192 /** stuff in between #(...) and #id items
193  * Allow the escaping of the # for C preprocessor stuff.
194  */

195     protected final void mSTUFF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
196         int _ttype; Token _token=null; int _begin=text.length();
197         _ttype = STUFF;
198         int _saveIndex;
199         
200         switch ( LA(1)) {
201         case '"':
202         {
203             mSTRING(false);
204             break;
205         }
206         case '\'':
207         {
208             mCHAR(false);
209             break;
210         }
211         case '\n':
212         {
213             match('\n');
214             newline();
215             break;
216         }
217         default:
218             if ((LA(1)=='/') && (LA(2)=='*'||LA(2)=='/')) {
219                 mCOMMENT(false);
220             }
221             else if ((LA(1)=='\r') && (LA(2)=='\n') && (true)) {
222                 match("\r\n");
223                 newline();
224             }
225             else if ((LA(1)=='\\') && (LA(2)=='#') && (true)) {
226                 match('\\');
227                 match('#');
228                 text.setLength(_begin); text.append("#");
229             }
230             else if ((LA(1)=='/') && (_tokenSet_1.member(LA(2)))) {
231                 match('/');
232                 {
233                 match(_tokenSet_1);
234                 }
235             }
236             else if ((LA(1)=='\r') && (true) && (true)) {
237                 match('\r');
238                 newline();
239             }
240             else if ((_tokenSet_2.member(LA(1))) && (true) && (true)) {
241                 {
242                 match(_tokenSet_2);
243                 }
244             }
245         else {
246             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
247         }
248         }
249         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
250             _token = makeToken(_ttype);
251             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
252         }
253         _returnToken = _token;
254     }
255     
256     protected final void mAST_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
257         int _ttype; Token _token=null; int _begin=text.length();
258         _ttype = AST_ITEM;
259         int _saveIndex;
260         Token t=null;
261         Token id=null;
262         Token ctor=null;
263         
264         if ((LA(1)=='#') && (LA(2)=='(')) {
265             _saveIndex=text.length();
266             match('#');
267             text.setLength(_saveIndex);
268             mTREE(true);
269             t=_returnToken;
270         }
271         else if ((LA(1)=='#') && (_tokenSet_3.member(LA(2)))) {
272             _saveIndex=text.length();
273             match('#');
274             text.setLength(_saveIndex);
275             {
276             switch ( LA(1)) {
277             case '\t': case '\n': case '\r': case ' ':
278             {
279                 mWS(false);
280                 break;
281             }
282             case ':': case 'A': case 'B': case 'C':
283             case 'D': case 'E': case 'F': case 'G':
284             case 'H': case 'I': case 'J': case 'K':
285             case 'L': case 'M': case 'N': case 'O':
286             case 'P': case 'Q': case 'R': case 'S':
287             case 'T': case 'U': case 'V': case 'W':
288             case 'X': case 'Y': case 'Z': case '_':
289             case 'a': case 'b': case 'c': case 'd':
290             case 'e': case 'f': case 'g': case 'h':
291             case 'i': case 'j': case 'k': case 'l':
292             case 'm': case 'n': case 'o': case 'p':
293             case 'q': case 'r': case 's': case 't':
294             case 'u': case 'v': case 'w': case 'x':
295             case 'y': case 'z':
296             {
297                 break;
298             }
299             default:
300             {
301                 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
302             }
303             }
304             }
305             mID(true);
306             id=_returnToken;
307             
308                         String JavaDoc idt = id.getText();
309                         String JavaDoc mapped = generator.mapTreeId(id.getText(), transInfo);
310             
311                         // verify that it's not a preprocessor macro...
312
if( mapped!=null && ! idt.equals( mapped ) )
313                         {
314                             text.setLength(_begin); text.append(mapped);
315                         }
316                         else
317                         {
318                             if(idt.equals("if") ||
319                                 idt.equals("define") ||
320                                 idt.equals("ifdef") ||
321                                 idt.equals("ifndef") ||
322                                 idt.equals("else") ||
323                                 idt.equals("elif") ||
324                                 idt.equals("endif") ||
325                                 idt.equals("warning") ||
326                                 idt.equals("error") ||
327                                 idt.equals("ident") ||
328                                 idt.equals("pragma") ||
329                                 idt.equals("include"))
330                             {
331                                 text.setLength(_begin); text.append("#"+idt);
332                             }
333                         }
334                     
335             {
336             if ((_tokenSet_4.member(LA(1))) && (true) && (true)) {
337                 mWS(false);
338             }
339             else {
340             }
341             
342             }
343             {
344             if ((LA(1)=='=') && (true) && (true)) {
345                 mVAR_ASSIGN(false);
346             }
347             else {
348             }
349             
350             }
351         }
352         else if ((LA(1)=='#') && (LA(2)=='[')) {
353             _saveIndex=text.length();
354             match('#');
355             text.setLength(_saveIndex);
356             mAST_CONSTRUCTOR(true);
357             ctor=_returnToken;
358         }
359         else if ((LA(1)=='#') && (LA(2)=='#')) {
360             match("##");
361             
362                         if( currentRule != null )
363                         {
364                             String JavaDoc r = currentRule.getRuleName()+"_AST";
365                             text.setLength(_begin); text.append(r);
366             
367                             if ( transInfo!=null ) {
368                                 transInfo.refRuleRoot=r; // we ref root of tree
369
}
370                         }
371                         else
372                         {
373                             reportWarning("\"##\" not valid in this context");
374                             text.setLength(_begin); text.append("##");
375                         }
376                     
377             {
378             if ((_tokenSet_4.member(LA(1))) && (true) && (true)) {
379                 mWS(false);
380             }
381             else {
382             }
383             
384             }
385             {
386             if ((LA(1)=='=') && (true) && (true)) {
387                 mVAR_ASSIGN(false);
388             }
389             else {
390             }
391             
392             }
393         }
394         else {
395             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
396         }
397         
398         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
399             _token = makeToken(_ttype);
400             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
401         }
402         _returnToken = _token;
403     }
404     
405     protected final void mTEXT_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
406         int _ttype; Token _token=null; int _begin=text.length();
407         _ttype = TEXT_ITEM;
408         int _saveIndex;
409         Token a1=null;
410         Token a2=null;
411         Token a3=null;
412         Token a4=null;
413         Token a5=null;
414         Token a6=null;
415         
416         if ((LA(1)=='$') && (LA(2)=='F') && (LA(3)=='O')) {
417             match("$FOLLOW");
418             {
419             if ((_tokenSet_5.member(LA(1))) && (_tokenSet_6.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
420                 {
421                 switch ( LA(1)) {
422                 case '\t': case '\n': case '\r': case ' ':
423                 {
424                     mWS(false);
425                     break;
426                 }
427                 case '(':
428                 {
429                     break;
430                 }
431                 default:
432                 {
433                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
434                 }
435                 }
436                 }
437                 match('(');
438                 mTEXT_ARG(true);
439                 a5=_returnToken;
440                 match(')');
441             }
442             else {
443             }
444             
445             }
446             
447                         String JavaDoc rule = currentRule.getRuleName();
448                         if ( a5!=null ) {
449                             rule = a5.getText();
450                         }
451                         String JavaDoc setName = generator.getFOLLOWBitSet(rule, 1);
452                         // System.out.println("FOLLOW("+rule+")="+setName);
453
if ( setName==null ) {
454                             reportError("$FOLLOW("+rule+")"+
455                                         ": unknown rule or bad lookahead computation");
456                         }
457                         else {
458                             text.setLength(_begin); text.append(setName);
459                         }
460                     
461         }
462         else if ((LA(1)=='$') && (LA(2)=='F') && (LA(3)=='I')) {
463             match("$FIRST");
464             {
465             if ((_tokenSet_5.member(LA(1))) && (_tokenSet_6.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
466                 {
467                 switch ( LA(1)) {
468                 case '\t': case '\n': case '\r': case ' ':
469                 {
470                     mWS(false);
471                     break;
472                 }
473                 case '(':
474                 {
475                     break;
476                 }
477                 default:
478                 {
479                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
480                 }
481                 }
482                 }
483                 match('(');
484                 mTEXT_ARG(true);
485                 a6=_returnToken;
486                 match(')');
487             }
488             else {
489             }
490             
491             }
492             
493                         String JavaDoc rule = currentRule.getRuleName();
494                         if ( a6!=null ) {
495                             rule = a6.getText();
496                         }
497                         String JavaDoc setName = generator.getFIRSTBitSet(rule, 1);
498                         // System.out.println("FIRST("+rule+")="+setName);
499
if ( setName==null ) {
500                             reportError("$FIRST("+rule+")"+
501                                         ": unknown rule or bad lookahead computation");
502                         }
503                         else {
504                             text.setLength(_begin); text.append(setName);
505                         }
506                     
507         }
508         else if ((LA(1)=='$') && (LA(2)=='a')) {
509             match("$append");
510             {
511             switch ( LA(1)) {
512             case '\t': case '\n': case '\r': case ' ':
513             {
514                 mWS(false);
515                 break;
516             }
517             case '(':
518             {
519                 break;
520             }
521             default:
522             {
523                 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
524             }
525             }
526             }
527             match('(');
528             mTEXT_ARG(true);
529             a1=_returnToken;
530             match(')');
531             
532                         String JavaDoc t = "text += "+a1.getText();
533                         text.setLength(_begin); text.append(t);
534                     
535         }
536         else if ((LA(1)=='$') && (LA(2)=='s')) {
537             match("$set");
538             {
539             if ((LA(1)=='T') && (LA(2)=='e')) {
540                 match("Text");
541                 {
542                 switch ( LA(1)) {
543                 case '\t': case '\n': case '\r': case ' ':
544                 {
545                     mWS(false);
546                     break;
547                 }
548                 case '(':
549                 {
550                     break;
551                 }
552                 default:
553                 {
554                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
555                 }
556                 }
557                 }
558                 match('(');
559                 mTEXT_ARG(true);
560                 a2=_returnToken;
561                 match(')');
562                 
563                                 String JavaDoc t;
564                                 t = "{ text.erase(_begin); text += "+a2.getText()+"; }";
565                                 text.setLength(_begin); text.append(t);
566                             
567             }
568             else if ((LA(1)=='T') && (LA(2)=='o')) {
569                 match("Token");
570                 {
571                 switch ( LA(1)) {
572                 case '\t': case '\n': case '\r': case ' ':
573                 {
574                     mWS(false);
575                     break;
576                 }
577                 case '(':
578                 {
579                     break;
580                 }
581                 default:
582                 {
583                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
584                 }
585                 }
586                 }
587                 match('(');
588                 mTEXT_ARG(true);
589                 a3=_returnToken;
590                 match(')');
591                 
592                                 String JavaDoc t="_token = "+a3.getText();
593                                 text.setLength(_begin); text.append(t);
594                             
595             }
596             else if ((LA(1)=='T') && (LA(2)=='y')) {
597                 match("Type");
598                 {
599                 switch ( LA(1)) {
600                 case '\t': case '\n': case '\r': case ' ':
601                 {
602                     mWS(false);
603                     break;
604                 }
605                 case '(':
606                 {
607                     break;
608                 }
609                 default:
610                 {
611                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
612                 }
613                 }
614                 }
615                 match('(');
616                 mTEXT_ARG(true);
617                 a4=_returnToken;
618                 match(')');
619                 
620                                 String JavaDoc t="_ttype = "+a4.getText();
621                                 text.setLength(_begin); text.append(t);
622                             
623             }
624             else {
625                 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
626             }
627             
628             }
629         }
630         else if ((LA(1)=='$') && (LA(2)=='g')) {
631             match("$getText");
632             
633                         text.setLength(_begin); text.append("text.substr(_begin,text.length()-_begin)");
634                     
635         }
636         else {
637             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
638         }
639         
640         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
641             _token = makeToken(_ttype);
642             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
643         }
644         _returnToken = _token;
645     }
646     
647     protected final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
648         int _ttype; Token _token=null; int _begin=text.length();
649         _ttype = COMMENT;
650         int _saveIndex;
651         
652         if ((LA(1)=='/') && (LA(2)=='/')) {
653             mSL_COMMENT(false);
654         }
655         else if ((LA(1)=='/') && (LA(2)=='*')) {
656             mML_COMMENT(false);
657         }
658         else {
659             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
660         }
661         
662         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
663             _token = makeToken(_ttype);
664             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
665         }
666         _returnToken = _token;
667     }
668     
669     protected final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
670         int _ttype; Token _token=null; int _begin=text.length();
671         _ttype = STRING;
672         int _saveIndex;
673         
674         match('"');
675         {
676         _loop599:
677         do {
678             if ((LA(1)=='\\')) {
679                 mESC(false);
680             }
681             else if ((_tokenSet_7.member(LA(1)))) {
682                 matchNot('"');
683             }
684             else {
685                 break _loop599;
686             }
687             
688         } while (true);
689         }
690         match('"');
691         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
692             _token = makeToken(_ttype);
693             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
694         }
695         _returnToken = _token;
696     }
697     
698     protected final void mCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
699         int _ttype; Token _token=null; int _begin=text.length();
700         _ttype = CHAR;
701         int _saveIndex;
702         
703         match('\'');
704         {
705         if ((LA(1)=='\\')) {
706             mESC(false);
707         }
708         else if ((_tokenSet_8.member(LA(1)))) {
709             matchNot('\'');
710         }
711         else {
712             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
713         }
714         
715         }
716         match('\'');
717         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
718             _token = makeToken(_ttype);
719             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
720         }
721         _returnToken = _token;
722     }
723     
724     protected final void mTREE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
725         int _ttype; Token _token=null; int _begin=text.length();
726         _ttype = TREE;
727         int _saveIndex;
728         Token t=null;
729         Token t2=null;
730         
731             StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
732             int n=0;
733             Vector terms = new Vector(10);
734         
735         
736         _saveIndex=text.length();
737         match('(');
738         text.setLength(_saveIndex);
739         {
740         switch ( LA(1)) {
741         case '\t': case '\n': case '\r': case ' ':
742         {
743             _saveIndex=text.length();
744             mWS(false);
745             text.setLength(_saveIndex);
746             break;
747         }
748         case '"': case '#': case '(': case ':':
749         case 'A': case 'B': case 'C': case 'D':
750         case 'E': case 'F': case 'G': case 'H':
751         case 'I': case 'J': case 'K': case 'L':
752         case 'M': case 'N': case 'O': case 'P':
753         case 'Q': case 'R': case 'S': case 'T':
754         case 'U': case 'V': case 'W': case 'X':
755         case 'Y': case 'Z': case '[': case '_':
756         case 'a': case 'b': case 'c': case 'd':
757         case 'e': case 'f': case 'g': case 'h':
758         case 'i': case 'j': case 'k': case 'l':
759         case 'm': case 'n': case 'o': case 'p':
760         case 'q': case 'r': case 's': case 't':
761         case 'u': case 'v': case 'w': case 'x':
762         case 'y': case 'z':
763         {
764             break;
765         }
766         default:
767         {
768             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
769         }
770         }
771         }
772         _saveIndex=text.length();
773         mTREE_ELEMENT(true);
774         text.setLength(_saveIndex);
775         t=_returnToken;
776         
777                     terms.appendElement(
778                         generator.processStringForASTConstructor(t.getText())
779                                              );
780                 
781         {
782         switch ( LA(1)) {
783         case '\t': case '\n': case '\r': case ' ':
784         {
785             _saveIndex=text.length();
786             mWS(false);
787             text.setLength(_saveIndex);
788             break;
789         }
790         case ')': case ',':
791         {
792             break;
793         }
794         default:
795         {
796             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
797         }
798         }
799         }
800         {
801         _loop528:
802         do {
803             if ((LA(1)==',')) {
804                 _saveIndex=text.length();
805                 match(',');
806                 text.setLength(_saveIndex);
807                 {
808                 switch ( LA(1)) {
809                 case '\t': case '\n': case '\r': case ' ':
810                 {
811                     _saveIndex=text.length();
812                     mWS(false);
813                     text.setLength(_saveIndex);
814                     break;
815                 }
816                 case '"': case '#': case '(': case ':':
817                 case 'A': case 'B': case 'C': case 'D':
818                 case 'E': case 'F': case 'G': case 'H':
819                 case 'I': case 'J': case 'K': case 'L':
820                 case 'M': case 'N': case 'O': case 'P':
821                 case 'Q': case 'R': case 'S': case 'T':
822                 case 'U': case 'V': case 'W': case 'X':
823                 case 'Y': case 'Z': case '[': case '_':
824                 case 'a': case 'b': case 'c': case 'd':
825                 case 'e': case 'f': case 'g': case 'h':
826                 case 'i': case 'j': case 'k': case 'l':
827                 case 'm': case 'n': case 'o': case 'p':
828                 case 'q': case 'r': case 's': case 't':
829                 case 'u': case 'v': case 'w': case 'x':
830                 case 'y': case 'z':
831                 {
832                     break;
833                 }
834                 default:
835                 {
836                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
837                 }
838                 }
839                 }
840                 _saveIndex=text.length();
841                 mTREE_ELEMENT(true);
842                 text.setLength(_saveIndex);
843                 t2=_returnToken;
844                 
845                                 terms.appendElement(
846                                     generator.processStringForASTConstructor(t2.getText())
847                                                           );
848                             
849                 {
850                 switch ( LA(1)) {
851                 case '\t': case '\n': case '\r': case ' ':
852                 {
853                     _saveIndex=text.length();
854                     mWS(false);
855                     text.setLength(_saveIndex);
856                     break;
857                 }
858                 case ')': case ',':
859                 {
860                     break;
861                 }
862                 default:
863                 {
864                     throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
865                 }
866                 }
867                 }
868             }
869             else {
870                 break _loop528;
871             }
872             
873         } while (true);
874         }
875         text.setLength(_begin); text.append(generator.getASTCreateString(terms));
876         _saveIndex=text.length();
877         match(')');
878         text.setLength(_saveIndex);
879         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
880             _token = makeToken(_ttype);
881             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
882         }
883         _returnToken = _token;
884     }
885     
886     protected final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
887         int _ttype; Token _token=null; int _begin=text.length();
888         _ttype = WS;
889         int _saveIndex;
890         
891         {
892         int _cnt619=0;
893         _loop619:
894         do {
895             if ((LA(1)=='\r') && (LA(2)=='\n') && (true)) {
896                 match('\r');
897                 match('\n');
898                 newline();
899             }
900             else if ((LA(1)==' ') && (true) && (true)) {
901                 match(' ');
902             }
903             else if ((LA(1)=='\t') && (true) && (true)) {
904                 match('\t');
905             }
906             else if ((LA(1)=='\r') && (true) && (true)) {
907                 match('\r');
908                 newline();
909             }
910             else if ((LA(1)=='\n') && (true) && (true)) {
911                 match('\n');
912                 newline();
913             }
914             else {
915                 if ( _cnt619>=1 ) { break _loop619; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
916             }
917             
918             _cnt619++;
919         } while (true);
920         }
921         if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
922             _token = makeToken(_ttype);
923             _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
924         }
925         _returnToken = _token;
926     }
927     
928     protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
929         int _ttype; Token _token=null; int _begin=text.length();
930         _ttype = ID;
931         int _saveIndex;
932         
933         {
934         switch ( LA(1)) {
935         case 'a': case 'b': case 'c': case 'd':
936         case 'e': case 'f': case 'g': case 'h':
937         case 'i': case 'j': case 'k': case 'l':
938         case 'm': case 'n': case 'o': case 'p':
939         case 'q': case 'r': case 's': case 't':
940         case 'u': case 'v': case 'w': case 'x':
941         case 'y': case 'z':
942         {
943             matchRange('a','z');
944             break;
945         }
946         case 'A': case 'B': case 'C': case 'D':
947         case 'E': case 'F': case 'G': case 'H':
948         case 'I': case 'J': case 'K': case 'L':
949         case 'M': case 'N': case 'O': case 'P':
950         case 'Q': case 'R': case 'S': case 'T':
951         case 'U': case 'V': case 'W': case 'X':
952         case 'Y': case 'Z':
953         {
954             matchRange('A','Z');
955             break;
956         }
957         case '_':
958         {
959             match('_');
960             break;
961         }
962         case ':':
963         {
964             match("::");
965             break;
966         }
967         default:
968         {
969             throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
970         }
971         }
972         }
973         {
974         _loop585:
975         do {
976             if ((_tokenSet_9.member(LA(1))) && (true) && (true)) {
977                 {
978                 switch ( LA(1)) {
979                 case 'a': case 'b': case 'c': case 'd':
980                 case 'e': case 'f': case 'g': case 'h':
981                 case 'i': case 'j': case 'k': case 'l':
982                 case 'm': case 'n': case 'o': case 'p':
983                 case 'q': case 'r': case 's': case 't':
984                 case 'u': case 'v': case 'w': case 'x':
985                 case 'y': case 'z':
986                 {
987                     matchRange('a','z');
988                     break;
989                 }
990                 case 'A': case 'B': case 'C': case 'D':
991                 case 'E': case 'F': case 'G': case 'H':
992                 case 'I': case 'J': case 'K': case 'L':
993                 case 'M': case 'N': case 'O': case 'P':
994                 case 'Q': case 'R': case 'S': case 'T':
995                 case 'U': case 'V': case 'W': case 'X':
996                 case 'Y': case 'Z':
997                 {
998                     matchRange('A','Z');
999                     break;
1000                }
1001                case '0': case '1': case '2': case '3':
1002                case '4': case '5': case '6': case '7':
1003                case '8': case '9':
1004                {
1005                    matchRange('0','9');
1006                    break;
1007                }
1008                case '_':
1009                {
1010                    match('_');
1011                    break;
1012                }
1013                case ':':
1014                {
1015                    match("::");
1016                    break;
1017                }
1018                default:
1019                {
1020                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1021                }
1022                }
1023                }
1024            }
1025            else {
1026                break _loop585;
1027            }
1028            
1029        } while (true);
1030        }
1031        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1032            _token = makeToken(_ttype);
1033            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1034        }
1035        _returnToken = _token;
1036    }
1037    
1038    protected final void mVAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1039        int _ttype; Token _token=null; int _begin=text.length();
1040        _ttype = VAR_ASSIGN;
1041        int _saveIndex;
1042        
1043        match('=');
1044        
1045                    // inform the code generator that an assignment was done to
1046
// AST root for the rule if invoker set refRuleRoot.
1047
if ( LA(1)!='=' && transInfo!=null && transInfo.refRuleRoot!=null ) {
1048                        transInfo.assignToRoot=true;
1049                    }
1050                
1051        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1052            _token = makeToken(_ttype);
1053            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1054        }
1055        _returnToken = _token;
1056    }
1057    
1058    protected final void mAST_CONSTRUCTOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1059        int _ttype; Token _token=null; int _begin=text.length();
1060        _ttype = AST_CONSTRUCTOR;
1061        int _saveIndex;
1062        Token x=null;
1063        Token y=null;
1064        
1065        _saveIndex=text.length();
1066        match('[');
1067        text.setLength(_saveIndex);
1068        {
1069        switch ( LA(1)) {
1070        case '\t': case '\n': case '\r': case ' ':
1071        {
1072            _saveIndex=text.length();
1073            mWS(false);
1074            text.setLength(_saveIndex);
1075            break;
1076        }
1077        case '"': case '#': case '(': case '0':
1078        case '1': case '2': case '3': case '4':
1079        case '5': case '6': case '7': case '8':
1080        case '9': case ':': case 'A': case 'B':
1081        case 'C': case 'D': case 'E': case 'F':
1082        case 'G': case 'H': case 'I': case 'J':
1083        case 'K': case 'L': case 'M': case 'N':
1084        case 'O': case 'P': case 'Q': case 'R':
1085        case 'S': case 'T': case 'U': case 'V':
1086        case 'W': case 'X': case 'Y': case 'Z':
1087        case '[': case '_': case 'a': case 'b':
1088        case 'c': case 'd': case 'e': case 'f':
1089        case 'g': case 'h': case 'i': case 'j':
1090        case 'k': case 'l': case 'm': case 'n':
1091        case 'o': case 'p': case 'q': case 'r':
1092        case 's': case 't': case 'u': case 'v':
1093        case 'w': case 'x': case 'y': case 'z':
1094        {
1095            break;
1096        }
1097        default:
1098        {
1099            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1100        }
1101        }
1102        }
1103        _saveIndex=text.length();
1104        mAST_CTOR_ELEMENT(true);
1105        text.setLength(_saveIndex);
1106        x=_returnToken;
1107        {
1108        switch ( LA(1)) {
1109        case '\t': case '\n': case '\r': case ' ':
1110        {
1111            _saveIndex=text.length();
1112            mWS(false);
1113            text.setLength(_saveIndex);
1114            break;
1115        }
1116        case ',': case ']':
1117        {
1118            break;
1119        }
1120        default:
1121        {
1122            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1123        }
1124        }
1125        }
1126        {
1127        switch ( LA(1)) {
1128        case ',':
1129        {
1130            _saveIndex=text.length();
1131            match(',');
1132            text.setLength(_saveIndex);
1133            {
1134            switch ( LA(1)) {
1135            case '\t': case '\n': case '\r': case ' ':
1136            {
1137                _saveIndex=text.length();
1138                mWS(false);
1139                text.setLength(_saveIndex);
1140                break;
1141            }
1142            case '"': case '#': case '(': case '0':
1143            case '1': case '2': case '3': case '4':
1144            case '5': case '6': case '7': case '8':
1145            case '9': case ':': case 'A': case 'B':
1146            case 'C': case 'D': case 'E': case 'F':
1147            case 'G': case 'H': case 'I': case 'J':
1148            case 'K': case 'L': case 'M': case 'N':
1149            case 'O': case 'P': case 'Q': case 'R':
1150            case 'S': case 'T': case 'U': case 'V':
1151            case 'W': case 'X': case 'Y': case 'Z':
1152            case '[': case '_': case 'a': case 'b':
1153            case 'c': case 'd': case 'e': case 'f':
1154            case 'g': case 'h': case 'i': case 'j':
1155            case 'k': case 'l': case 'm': case 'n':
1156            case 'o': case 'p': case 'q': case 'r':
1157            case 's': case 't': case 'u': case 'v':
1158            case 'w': case 'x': case 'y': case 'z':
1159            {
1160                break;
1161            }
1162            default:
1163            {
1164                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1165            }
1166            }
1167            }
1168            _saveIndex=text.length();
1169            mAST_CTOR_ELEMENT(true);
1170            text.setLength(_saveIndex);
1171            y=_returnToken;
1172            {
1173            switch ( LA(1)) {
1174            case '\t': case '\n': case '\r': case ' ':
1175            {
1176                _saveIndex=text.length();
1177                mWS(false);
1178                text.setLength(_saveIndex);
1179                break;
1180            }
1181            case ']':
1182            {
1183                break;
1184            }
1185            default:
1186            {
1187                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1188            }
1189            }
1190            }
1191            break;
1192        }
1193        case ']':
1194        {
1195            break;
1196        }
1197        default:
1198        {
1199            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1200        }
1201        }
1202        }
1203        _saveIndex=text.length();
1204        match(']');
1205        text.setLength(_saveIndex);
1206        
1207        // System.out.println("AST_CONSTRUCTOR: "+((x==null)?"null":x.getText())+
1208
// ", "+((y==null)?"null":y.getText()));
1209
String JavaDoc ys = generator.processStringForASTConstructor(x.getText());
1210        
1211                    // the second does not need processing coz it's a string
1212
// (eg second param of astFactory.create(x,y)
1213
if ( y!=null )
1214                        ys += ","+y.getText();
1215        
1216                    text.setLength(_begin); text.append( generator.getASTCreateString(null,ys) );
1217                
1218        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1219            _token = makeToken(_ttype);
1220            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1221        }
1222        _returnToken = _token;
1223    }
1224    
1225    protected final void mTEXT_ARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1226        int _ttype; Token _token=null; int _begin=text.length();
1227        _ttype = TEXT_ARG;
1228        int _saveIndex;
1229        
1230        {
1231        switch ( LA(1)) {
1232        case '\t': case '\n': case '\r': case ' ':
1233        {
1234            mWS(false);
1235            break;
1236        }
1237        case '"': case '$': case '\'': case '+':
1238        case '0': case '1': case '2': case '3':
1239        case '4': case '5': case '6': case '7':
1240        case '8': case '9': case ':': case 'A':
1241        case 'B': case 'C': case 'D': case 'E':
1242        case 'F': case 'G': case 'H': case 'I':
1243        case 'J': case 'K': case 'L': case 'M':
1244        case 'N': case 'O': case 'P': case 'Q':
1245        case 'R': case 'S': case 'T': case 'U':
1246        case 'V': case 'W': case 'X': case 'Y':
1247        case 'Z': case '_': case 'a': case 'b':
1248        case 'c': case 'd': case 'e': case 'f':
1249        case 'g': case 'h': case 'i': case 'j':
1250        case 'k': case 'l': case 'm': case 'n':
1251        case 'o': case 'p': case 'q': case 'r':
1252        case 's': case 't': case 'u': case 'v':
1253        case 'w': case 'x': case 'y': case 'z':
1254        {
1255            break;
1256        }
1257        default:
1258        {
1259            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1260        }
1261        }
1262        }
1263        {
1264        int _cnt559=0;
1265        _loop559:
1266        do {
1267            if ((_tokenSet_10.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
1268                mTEXT_ARG_ELEMENT(false);
1269                {
1270                if ((_tokenSet_4.member(LA(1))) && (_tokenSet_11.member(LA(2))) && (true)) {
1271                    mWS(false);
1272                }
1273                else if ((_tokenSet_11.member(LA(1))) && (true) && (true)) {
1274                }
1275                else {
1276                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1277                }
1278                
1279                }
1280            }
1281            else {
1282                if ( _cnt559>=1 ) { break _loop559; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
1283            }
1284            
1285            _cnt559++;
1286        } while (true);
1287        }
1288        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1289            _token = makeToken(_ttype);
1290            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1291        }
1292        _returnToken = _token;
1293    }
1294    
1295    protected final void mTREE_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1296        int _ttype; Token _token=null; int _begin=text.length();
1297        _ttype = TREE_ELEMENT;
1298        int _saveIndex;
1299        Token id=null;
1300        boolean was_mapped;
1301        
1302        switch ( LA(1)) {
1303        case '(':
1304        {
1305            mTREE(false);
1306            break;
1307        }
1308        case '[':
1309        {
1310            mAST_CONSTRUCTOR(false);
1311            break;
1312        }
1313        case ':': case 'A': case 'B': case 'C':
1314        case 'D': case 'E': case 'F': case 'G':
1315        case 'H': case 'I': case 'J': case 'K':
1316        case 'L': case 'M': case 'N': case 'O':
1317        case 'P': case 'Q': case 'R': case 'S':
1318        case 'T': case 'U': case 'V': case 'W':
1319        case 'X': case 'Y': case 'Z': case '_':
1320        case 'a': case 'b': case 'c': case 'd':
1321        case 'e': case 'f': case 'g': case 'h':
1322        case 'i': case 'j': case 'k': case 'l':
1323        case 'm': case 'n': case 'o': case 'p':
1324        case 'q': case 'r': case 's': case 't':
1325        case 'u': case 'v': case 'w': case 'x':
1326        case 'y': case 'z':
1327        {
1328            mID_ELEMENT(false);
1329            break;
1330        }
1331        case '"':
1332        {
1333            mSTRING(false);
1334            break;
1335        }
1336        default:
1337            if ((LA(1)=='#') && (LA(2)=='(')) {
1338                _saveIndex=text.length();
1339                match('#');
1340                text.setLength(_saveIndex);
1341                mTREE(false);
1342            }
1343            else if ((LA(1)=='#') && (LA(2)=='[')) {
1344                _saveIndex=text.length();
1345                match('#');
1346                text.setLength(_saveIndex);
1347                mAST_CONSTRUCTOR(false);
1348            }
1349            else if ((LA(1)=='#') && (_tokenSet_12.member(LA(2)))) {
1350                _saveIndex=text.length();
1351                match('#');
1352                text.setLength(_saveIndex);
1353                was_mapped=mID_ELEMENT(true);
1354                id=_returnToken;
1355                    // RK: I have a queer feeling that this maptreeid is redundant..
1356
if ( ! was_mapped )
1357                            {
1358                                String JavaDoc t = generator.mapTreeId(id.getText(), null);
1359                // System.out.println("mapped: "+id.getText()+" -> "+t);
1360
if ( t!=null ) {
1361                                    text.setLength(_begin); text.append(t);
1362                                }
1363                            }
1364                        
1365            }
1366            else if ((LA(1)=='#') && (LA(2)=='#')) {
1367                match("##");
1368                
1369                            if( currentRule != null )
1370                            {
1371                                String JavaDoc t = currentRule.getRuleName()+"_AST";
1372                                text.setLength(_begin); text.append(t);
1373                            }
1374                            else
1375                            {
1376                                reportError("\"##\" not valid in this context");
1377                                text.setLength(_begin); text.append("##");
1378                            }
1379                        
1380            }
1381        else {
1382            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1383        }
1384        }
1385        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1386            _token = makeToken(_ttype);
1387            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1388        }
1389        _returnToken = _token;
1390    }
1391    
1392/** An ID_ELEMENT can be a func call, array ref, simple var,
1393 * or AST label ref.
1394 */

1395    protected final boolean mID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1396        boolean mapped=false;
1397        int _ttype; Token _token=null; int _begin=text.length();
1398        _ttype = ID_ELEMENT;
1399        int _saveIndex;
1400        Token id=null;
1401        
1402        mID(true);
1403        id=_returnToken;
1404        {
1405        if ((_tokenSet_4.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (true)) {
1406            _saveIndex=text.length();
1407            mWS(false);
1408            text.setLength(_saveIndex);
1409        }
1410        else if ((_tokenSet_13.member(LA(1))) && (true) && (true)) {
1411        }
1412        else {
1413            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1414        }
1415        
1416        }
1417        {
1418        switch ( LA(1)) {
1419        case '(': case '<':
1420        {
1421            {
1422            switch ( LA(1)) {
1423            case '<':
1424            {
1425                match('<');
1426                {
1427                _loop542:
1428                do {
1429                    if ((_tokenSet_14.member(LA(1)))) {
1430                        matchNot('>');
1431                    }
1432                    else {
1433                        break _loop542;
1434                    }
1435                    
1436                } while (true);
1437                }
1438                match('>');
1439                break;
1440            }
1441            case '(':
1442            {
1443                break;
1444            }
1445            default:
1446            {
1447                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1448            }
1449            }
1450            }
1451            match('(');
1452            {
1453            if ((_tokenSet_4.member(LA(1))) && (_tokenSet_15.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
1454                _saveIndex=text.length();
1455                mWS(false);
1456                text.setLength(_saveIndex);
1457            }
1458            else if ((_tokenSet_15.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
1459            }
1460            else {
1461                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1462            }
1463            
1464            }
1465            {
1466            switch ( LA(1)) {
1467            case '"': case '#': case '\'': case '(':
1468            case '0': case '1': case '2': case '3':
1469            case '4': case '5': case '6': case '7':
1470            case '8': case '9': case ':': case 'A':
1471            case 'B': case 'C': case 'D': case 'E':
1472            case 'F': case 'G': case 'H': case 'I':
1473            case 'J': case 'K': case 'L': case 'M':
1474            case 'N': case 'O': case 'P': case 'Q':
1475            case 'R': case 'S': case 'T': case 'U':
1476            case 'V': case 'W': case 'X': case 'Y':
1477            case 'Z': case '[': case '_': case 'a':
1478            case 'b': case 'c': case 'd': case 'e':
1479            case 'f': case 'g': case 'h': case 'i':
1480            case 'j': case 'k': case 'l': case 'm':
1481            case 'n': case 'o': case 'p': case 'q':
1482            case 'r': case 's': case 't': case 'u':
1483            case 'v': case 'w': case 'x': case 'y':
1484            case 'z':
1485            {
1486                mARG(false);
1487                {
1488                _loop547:
1489                do {
1490                    if ((LA(1)==',')) {
1491                        match(',');
1492                        {
1493                        switch ( LA(1)) {
1494                        case '\t': case '\n': case '\r': case ' ':
1495                        {
1496                            _saveIndex=text.length();
1497                            mWS(false);
1498                            text.setLength(_saveIndex);
1499                            break;
1500                        }
1501                        case '"': case '#': case '\'': case '(':
1502                        case '0': case '1': case '2': case '3':
1503                        case '4': case '5': case '6': case '7':
1504                        case '8': case '9': case ':': case 'A':
1505                        case 'B': case 'C': case 'D': case 'E':
1506                        case 'F': case 'G': case 'H': case 'I':
1507                        case 'J': case 'K': case 'L': case 'M':
1508                        case 'N': case 'O': case 'P': case 'Q':
1509                        case 'R': case 'S': case 'T': case 'U':
1510                        case 'V': case 'W': case 'X': case 'Y':
1511                        case 'Z': case '[': case '_': case 'a':
1512                        case 'b': case 'c': case 'd': case 'e':
1513                        case 'f': case 'g': case 'h': case 'i':
1514                        case 'j': case 'k': case 'l': case 'm':
1515                        case 'n': case 'o': case 'p': case 'q':
1516                        case 'r': case 's': case 't': case 'u':
1517                        case 'v': case 'w': case 'x': case 'y':
1518                        case 'z':
1519                        {
1520                            break;
1521                        }
1522                        default:
1523                        {
1524                            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1525                        }
1526                        }
1527                        }
1528                        mARG(false);
1529                    }
1530                    else {
1531                        break _loop547;
1532                    }
1533                    
1534                } while (true);
1535                }
1536                break;
1537            }
1538            case '\t': case '\n': case '\r': case ' ':
1539            case ')':
1540            {
1541                break;
1542            }
1543            default:
1544            {
1545                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1546            }
1547            }
1548            }
1549            {
1550            switch ( LA(1)) {
1551            case '\t': case '\n': case '\r': case ' ':
1552            {
1553                _saveIndex=text.length();
1554                mWS(false);
1555                text.setLength(_saveIndex);
1556                break;
1557            }
1558            case ')':
1559            {
1560                break;
1561            }
1562            default:
1563            {
1564                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1565            }
1566            }
1567            }
1568            match(')');
1569            break;
1570        }
1571        case '[':
1572        {
1573            {
1574            int _cnt552=0;
1575            _loop552:
1576            do {
1577                if ((LA(1)=='[')) {
1578                    match('[');
1579                    {
1580                    switch ( LA(1)) {
1581                    case '\t': case '\n': case '\r': case ' ':
1582                    {
1583                        _saveIndex=text.length();
1584                        mWS(false);
1585                        text.setLength(_saveIndex);
1586                        break;
1587                    }
1588                    case '"': case '#': case '\'': case '(':
1589                    case '0': case '1': case '2': case '3':
1590                    case '4': case '5': case '6': case '7':
1591                    case '8': case '9': case ':': case 'A':
1592                    case 'B': case 'C': case 'D': case 'E':
1593                    case 'F': case 'G': case 'H': case 'I':
1594                    case 'J': case 'K': case 'L': case 'M':
1595                    case 'N': case 'O': case 'P': case 'Q':
1596                    case 'R': case 'S': case 'T': case 'U':
1597                    case 'V': case 'W': case 'X': case 'Y':
1598                    case 'Z': case '[': case '_': case 'a':
1599                    case 'b': case 'c': case 'd': case 'e':
1600                    case 'f': case 'g': case 'h': case 'i':
1601                    case 'j': case 'k': case 'l': case 'm':
1602                    case 'n': case 'o': case 'p': case 'q':
1603                    case 'r': case 's': case 't': case 'u':
1604                    case 'v': case 'w': case 'x': case 'y':
1605                    case 'z':
1606                    {
1607                        break;
1608                    }
1609                    default:
1610                    {
1611                        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1612                    }
1613                    }
1614                    }
1615                    mARG(false);
1616                    {
1617                    switch ( LA(1)) {
1618                    case '\t': case '\n': case '\r': case ' ':
1619                    {
1620                        _saveIndex=text.length();
1621                        mWS(false);
1622                        text.setLength(_saveIndex);
1623                        break;
1624                    }
1625                    case ']':
1626                    {
1627                        break;
1628                    }
1629                    default:
1630                    {
1631                        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1632                    }
1633                    }
1634                    }
1635                    match(']');
1636                }
1637                else {
1638                    if ( _cnt552>=1 ) { break _loop552; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
1639                }
1640                
1641                _cnt552++;
1642            } while (true);
1643            }
1644            break;
1645        }
1646        case '.':
1647        {
1648            match('.');
1649            mID_ELEMENT(false);
1650            break;
1651        }
1652        case ':':
1653        {
1654            match("::");
1655            mID_ELEMENT(false);
1656            break;
1657        }
1658        default:
1659            if ((LA(1)=='-') && (LA(2)=='>') && (_tokenSet_12.member(LA(3)))) {
1660                match("->");
1661                mID_ELEMENT(false);
1662            }
1663            else if ((_tokenSet_16.member(LA(1))) && (true) && (true)) {
1664                
1665                                mapped = true;
1666                                String JavaDoc t = generator.mapTreeId(id.getText(), transInfo);
1667                // System.out.println("mapped: "+id.getText()+" -> "+t);
1668
if ( t!=null ) {
1669                                    text.setLength(_begin); text.append(t);
1670                                }
1671                            
1672                {
1673                if (((_tokenSet_17.member(LA(1))) && (_tokenSet_16.member(LA(2))) && (true))&&(transInfo!=null && transInfo.refRuleRoot!=null)) {
1674                    {
1675                    switch ( LA(1)) {
1676                    case '\t': case '\n': case '\r': case ' ':
1677                    {
1678                        mWS(false);
1679                        break;
1680                    }
1681                    case '=':
1682                    {
1683                        break;
1684                    }
1685                    default:
1686                    {
1687                        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1688                    }
1689                    }
1690                    }
1691                    mVAR_ASSIGN(false);
1692                }
1693                else if ((_tokenSet_18.member(LA(1))) && (true) && (true)) {
1694                }
1695                else {
1696                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1697                }
1698                
1699                }
1700            }
1701        else {
1702            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1703        }
1704        }
1705        }
1706        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1707            _token = makeToken(_ttype);
1708            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1709        }
1710        _returnToken = _token;
1711        return mapped;
1712    }
1713    
1714/** The arguments of a #[...] constructor are text, token type,
1715 * or a tree.
1716 */

1717    protected final void mAST_CTOR_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1718        int _ttype; Token _token=null; int _begin=text.length();
1719        _ttype = AST_CTOR_ELEMENT;
1720        int _saveIndex;
1721        
1722        if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
1723            mSTRING(false);
1724        }
1725        else if ((_tokenSet_19.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
1726            mTREE_ELEMENT(false);
1727        }
1728        else if (((LA(1) >= '0' && LA(1) <= '9'))) {
1729            mINT(false);
1730        }
1731        else {
1732            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1733        }
1734        
1735        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1736            _token = makeToken(_ttype);
1737            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1738        }
1739        _returnToken = _token;
1740    }
1741    
1742    protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1743        int _ttype; Token _token=null; int _begin=text.length();
1744        _ttype = INT;
1745        int _saveIndex;
1746        
1747        {
1748        int _cnt610=0;
1749        _loop610:
1750        do {
1751            if (((LA(1) >= '0' && LA(1) <= '9'))) {
1752                mDIGIT(false);
1753            }
1754            else {
1755                if ( _cnt610>=1 ) { break _loop610; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
1756            }
1757            
1758            _cnt610++;
1759        } while (true);
1760        }
1761        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1762            _token = makeToken(_ttype);
1763            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1764        }
1765        _returnToken = _token;
1766    }
1767    
1768    protected final void mARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1769        int _ttype; Token _token=null; int _begin=text.length();
1770        _ttype = ARG;
1771        int _saveIndex;
1772        
1773        {
1774        switch ( LA(1)) {
1775        case '\'':
1776        {
1777            mCHAR(false);
1778            break;
1779        }
1780        case '0': case '1': case '2': case '3':
1781        case '4': case '5': case '6': case '7':
1782        case '8': case '9':
1783        {
1784            mINT_OR_FLOAT(false);
1785            break;
1786        }
1787        default:
1788            if ((_tokenSet_19.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
1789                mTREE_ELEMENT(false);
1790            }
1791            else if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
1792                mSTRING(false);
1793            }
1794        else {
1795            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1796        }
1797        }
1798        }
1799        {
1800        _loop580:
1801        do {
1802            if ((_tokenSet_20.member(LA(1))) && (_tokenSet_21.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
1803                {
1804                switch ( LA(1)) {
1805                case '\t': case '\n': case '\r': case ' ':
1806                {
1807                    mWS(false);
1808                    break;
1809                }
1810                case '*': case '+': case '-': case '/':
1811                {
1812                    break;
1813                }
1814                default:
1815                {
1816                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1817                }
1818                }
1819                }
1820                {
1821                switch ( LA(1)) {
1822                case '+':
1823                {
1824                    match('+');
1825                    break;
1826                }
1827                case '-':
1828                {
1829                    match('-');
1830                    break;
1831                }
1832                case '*':
1833                {
1834                    match('*');
1835                    break;
1836                }
1837                case '/':
1838                {
1839                    match('/');
1840                    break;
1841                }
1842                default:
1843                {
1844                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1845                }
1846                }
1847                }
1848                {
1849                switch ( LA(1)) {
1850                case '\t': case '\n': case '\r': case ' ':
1851                {
1852                    mWS(false);
1853                    break;
1854                }
1855                case '"': case '#': case '\'': case '(':
1856                case '0': case '1': case '2': case '3':
1857                case '4': case '5': case '6': case '7':
1858                case '8': case '9': case ':': case 'A':
1859                case 'B': case 'C': case 'D': case 'E':
1860                case 'F': case 'G': case 'H': case 'I':
1861                case 'J': case 'K': case 'L': case 'M':
1862                case 'N': case 'O': case 'P': case 'Q':
1863                case 'R': case 'S': case 'T': case 'U':
1864                case 'V': case 'W': case 'X': case 'Y':
1865                case 'Z': case '[': case '_': case 'a':
1866                case 'b': case 'c': case 'd': case 'e':
1867                case 'f': case 'g': case 'h': case 'i':
1868                case 'j': case 'k': case 'l': case 'm':
1869                case 'n': case 'o': case 'p': case 'q':
1870                case 'r': case 's': case 't': case 'u':
1871                case 'v': case 'w': case 'x': case 'y':
1872                case 'z':
1873                {
1874                    break;
1875                }
1876                default:
1877                {
1878                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1879                }
1880                }
1881                }
1882                mARG(false);
1883            }
1884            else {
1885                break _loop580;
1886            }
1887            
1888        } while (true);
1889        }
1890        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1891            _token = makeToken(_ttype);
1892            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1893        }
1894        _returnToken = _token;
1895    }
1896    
1897    protected final void mTEXT_ARG_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1898        int _ttype; Token _token=null; int _begin=text.length();
1899        _ttype = TEXT_ARG_ELEMENT;
1900        int _saveIndex;
1901        
1902        switch ( LA(1)) {
1903        case ':': case 'A': case 'B': case 'C':
1904        case 'D': case 'E': case 'F': case 'G':
1905        case 'H': case 'I': case 'J': case 'K':
1906        case 'L': case 'M': case 'N': case 'O':
1907        case 'P': case 'Q': case 'R': case 'S':
1908        case 'T': case 'U': case 'V': case 'W':
1909        case 'X': case 'Y': case 'Z': case '_':
1910        case 'a': case 'b': case 'c': case 'd':
1911        case 'e': case 'f': case 'g': case 'h':
1912        case 'i': case 'j': case 'k': case 'l':
1913        case 'm': case 'n': case 'o': case 'p':
1914        case 'q': case 'r': case 's': case 't':
1915        case 'u': case 'v': case 'w': case 'x':
1916        case 'y': case 'z':
1917        {
1918            mTEXT_ARG_ID_ELEMENT(false);
1919            break;
1920        }
1921        case '"':
1922        {
1923            mSTRING(false);
1924            break;
1925        }
1926        case '\'':
1927        {
1928            mCHAR(false);
1929            break;
1930        }
1931        case '0': case '1': case '2': case '3':
1932        case '4': case '5': case '6': case '7':
1933        case '8': case '9':
1934        {
1935            mINT_OR_FLOAT(false);
1936            break;
1937        }
1938        case '$':
1939        {
1940            mTEXT_ITEM(false);
1941            break;
1942        }
1943        case '+':
1944        {
1945            match('+');
1946            break;
1947        }
1948        default:
1949        {
1950            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1951        }
1952        }
1953        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1954            _token = makeToken(_ttype);
1955            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
1956        }
1957        _returnToken = _token;
1958    }
1959    
1960    protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
1961        int _ttype; Token _token=null; int _begin=text.length();
1962        _ttype = TEXT_ARG_ID_ELEMENT;
1963        int _saveIndex;
1964        Token id=null;
1965        
1966        mID(true);
1967        id=_returnToken;
1968        {
1969        if ((_tokenSet_4.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (true)) {
1970            _saveIndex=text.length();
1971            mWS(false);
1972            text.setLength(_saveIndex);
1973        }
1974        else if ((_tokenSet_22.member(LA(1))) && (true) && (true)) {
1975        }
1976        else {
1977            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1978        }
1979        
1980        }
1981        {
1982        switch ( LA(1)) {
1983        case '(':
1984        {
1985            match('(');
1986            {
1987            if ((_tokenSet_4.member(LA(1))) && (_tokenSet_23.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
1988                _saveIndex=text.length();
1989                mWS(false);
1990                text.setLength(_saveIndex);
1991            }
1992            else if ((_tokenSet_23.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
1993            }
1994            else {
1995                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
1996            }
1997            
1998            }
1999            {
2000            _loop568:
2001            do {
2002                if ((_tokenSet_24.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2003                    mTEXT_ARG(false);
2004                    {
2005                    _loop567:
2006                    do {
2007                        if ((LA(1)==',')) {
2008                            match(',');
2009                            mTEXT_ARG(false);
2010                        }
2011                        else {
2012                            break _loop567;
2013                        }
2014                        
2015                    } while (true);
2016                    }
2017                }
2018                else {
2019                    break _loop568;
2020                }
2021                
2022            } while (true);
2023            }
2024            {
2025            switch ( LA(1)) {
2026            case '\t': case '\n': case '\r': case ' ':
2027            {
2028                _saveIndex=text.length();
2029                mWS(false);
2030                text.setLength(_saveIndex);
2031                break;
2032            }
2033            case ')':
2034            {
2035                break;
2036            }
2037            default:
2038            {
2039                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2040            }
2041            }
2042            }
2043            match(')');
2044            break;
2045        }
2046        case '[':
2047        {
2048            {
2049            int _cnt573=0;
2050            _loop573:
2051            do {
2052                if ((LA(1)=='[')) {
2053                    match('[');
2054                    {
2055                    if ((_tokenSet_4.member(LA(1))) && (_tokenSet_24.member(LA(2))) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2056                        _saveIndex=text.length();
2057                        mWS(false);
2058                        text.setLength(_saveIndex);
2059                    }
2060                    else if ((_tokenSet_24.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2061                    }
2062                    else {
2063                        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2064                    }
2065                    
2066                    }
2067                    mTEXT_ARG(false);
2068                    {
2069                    switch ( LA(1)) {
2070                    case '\t': case '\n': case '\r': case ' ':
2071                    {
2072                        _saveIndex=text.length();
2073                        mWS(false);
2074                        text.setLength(_saveIndex);
2075                        break;
2076                    }
2077                    case ']':
2078                    {
2079                        break;
2080                    }
2081                    default:
2082                    {
2083                        throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2084                    }
2085                    }
2086                    }
2087                    match(']');
2088                }
2089                else {
2090                    if ( _cnt573>=1 ) { break _loop573; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
2091                }
2092                
2093                _cnt573++;
2094            } while (true);
2095            }
2096            break;
2097        }
2098        case '.':
2099        {
2100            match('.');
2101            mTEXT_ARG_ID_ELEMENT(false);
2102            break;
2103        }
2104        case '-':
2105        {
2106            match("->");
2107            mTEXT_ARG_ID_ELEMENT(false);
2108            break;
2109        }
2110        default:
2111            if ((LA(1)==':') && (LA(2)==':') && (_tokenSet_12.member(LA(3)))) {
2112                match("::");
2113                mTEXT_ARG_ID_ELEMENT(false);
2114            }
2115            else if ((_tokenSet_11.member(LA(1))) && (true) && (true)) {
2116            }
2117        else {
2118            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2119        }
2120        }
2121        }
2122        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
2123            _token = makeToken(_ttype);
2124            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
2125        }
2126        _returnToken = _token;
2127    }
2128    
2129    protected final void mINT_OR_FLOAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
2130        int _ttype; Token _token=null; int _begin=text.length();
2131        _ttype = INT_OR_FLOAT;
2132        int _saveIndex;
2133        
2134        {
2135        int _cnt613=0;
2136        _loop613:
2137        do {
2138            if (((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_25.member(LA(2))) && (true)) {
2139                mDIGIT(false);
2140            }
2141            else {
2142                if ( _cnt613>=1 ) { break _loop613; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
2143            }
2144            
2145            _cnt613++;
2146        } while (true);
2147        }
2148        {
2149        if ((LA(1)=='L') && (_tokenSet_26.member(LA(2))) && (true)) {
2150            match('L');
2151        }
2152        else if ((LA(1)=='l') && (_tokenSet_26.member(LA(2))) && (true)) {
2153            match('l');
2154        }
2155        else if ((LA(1)=='.')) {
2156            match('.');
2157            {
2158            _loop616:
2159            do {
2160                if (((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_26.member(LA(2))) && (true)) {
2161                    mDIGIT(false);
2162                }
2163                else {
2164                    break _loop616;
2165                }
2166                
2167            } while (true);
2168            }
2169        }
2170        else if ((_tokenSet_26.member(LA(1))) && (true) && (true)) {
2171        }
2172        else {
2173            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2174        }
2175        
2176        }
2177        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
2178            _token = makeToken(_ttype);
2179            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
2180        }
2181        _returnToken = _token;
2182    }
2183    
2184    protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
2185        int _ttype; Token _token=null; int _begin=text.length();
2186        _ttype = SL_COMMENT;
2187        int _saveIndex;
2188        
2189        match("//");
2190        {
2191        _loop590:
2192        do {
2193            // nongreedy exit test
2194
if ((LA(1)=='\n'||LA(1)=='\r') && (true) && (true)) break _loop590;
2195            if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
2196                matchNot(EOF_CHAR);
2197            }
2198            else {
2199                break _loop590;
2200            }
2201            
2202        } while (true);
2203        }
2204        {
2205        if ((LA(1)=='\r') && (LA(2)=='\n') && (true)) {
2206            match("\r\n");
2207        }
2208        else if ((LA(1)=='\n')) {
2209            match('\n');
2210        }
2211        else if ((LA(1)=='\r') && (true) && (true)) {
2212            match('\r');
2213        }
2214        else {
2215            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2216        }
2217        
2218        }
2219        newline();
2220        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
2221            _token = makeToken(_ttype);
2222            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
2223        }
2224        _returnToken = _token;
2225    }
2226    
2227    protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
2228        int _ttype; Token _token=null; int _begin=text.length();
2229        _ttype = ML_COMMENT;
2230        int _saveIndex;
2231        
2232        match("/*");
2233        {
2234        _loop594:
2235        do {
2236            // nongreedy exit test
2237
if ((LA(1)=='*') && (LA(2)=='/') && (true)) break _loop594;
2238            if ((LA(1)=='\r') && (LA(2)=='\n') && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2239                match('\r');
2240                match('\n');
2241                newline();
2242            }
2243            else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2244                match('\r');
2245                newline();
2246            }
2247            else if ((LA(1)=='\n') && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2248                match('\n');
2249                newline();
2250            }
2251            else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && ((LA(3) >= '\u0003' && LA(3) <= '\u00ff'))) {
2252                matchNot(EOF_CHAR);
2253            }
2254            else {
2255                break _loop594;
2256            }
2257            
2258        } while (true);
2259        }
2260        match("*/");
2261        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
2262            _token = makeToken(_ttype);
2263            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
2264        }
2265        _returnToken = _token;
2266    }
2267    
2268    protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
2269        int _ttype; Token _token=null; int _begin=text.length();
2270        _ttype = ESC;
2271        int _saveIndex;
2272        
2273        match('\\');
2274        {
2275        switch ( LA(1)) {
2276        case 'n':
2277        {
2278            match('n');
2279            break;
2280        }
2281        case 'r':
2282        {
2283            match('r');
2284            break;
2285        }
2286        case 't':
2287        {
2288            match('t');
2289            break;
2290        }
2291        case 'v':
2292        {
2293            match('v');
2294            break;
2295        }
2296        case 'b':
2297        {
2298            match('b');
2299            break;
2300        }
2301        case 'f':
2302        {
2303            match('f');
2304            break;
2305        }
2306        case '"':
2307        {
2308            match('"');
2309            break;
2310        }
2311        case '\'':
2312        {
2313            match('\'');
2314            break;
2315        }
2316        case '\\':
2317        {
2318            match('\\');
2319            break;
2320        }
2321        case '0': case '1': case '2': case '3':
2322        {
2323            {
2324            matchRange('0','3');
2325            }
2326            {
2327            if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
2328                mDIGIT(false);
2329                {
2330                if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
2331                    mDIGIT(false);
2332                }
2333                else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) {
2334                }
2335                else {
2336                    throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2337                }
2338                
2339                }
2340            }
2341            else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) {
2342            }
2343            else {
2344                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2345            }
2346            
2347            }
2348            break;
2349        }
2350        case '4': case '5': case '6': case '7':
2351        {
2352            {
2353            matchRange('4','7');
2354            }
2355            {
2356            if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '\u00ff')) && (true)) {
2357                mDIGIT(false);
2358            }
2359            else if (((LA(1) >= '\u0003' && LA(1) <= '\u00ff')) && (true) && (true)) {
2360            }
2361            else {
2362                throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2363            }
2364            
2365            }
2366            break;
2367        }
2368        default:
2369        {
2370            throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
2371        }
2372        }
2373        }
2374        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
2375            _token = makeToken(_ttype);
2376            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
2377        }
2378        _returnToken = _token;
2379    }
2380    
2381    protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
2382        int _ttype; Token _token=null; int _begin=text.length();
2383        _ttype = DIGIT;
2384        int _saveIndex;
2385        
2386        matchRange('0','9');
2387        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
2388            _token = makeToken(_ttype);
2389            _token.setText(new String JavaDoc(text.getBuffer(), _begin, text.length()-_begin));
2390        }
2391        _returnToken = _token;
2392    }
2393    
2394    
2395    private static final long[] mk_tokenSet_0() {
2396        long[] data = new long[8];
2397        data[0]=-103079215112L;
2398        for (int i = 1; i<=3; i++) { data[i]=-1L; }
2399        return data;
2400    }
2401    public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
2402    private static final long[] mk_tokenSet_1() {
2403        long[] data = new long[8];
2404        data[0]=-145135534866440L;
2405        for (int i = 1; i<=3; i++) { data[i]=-1L; }
2406        return data;
2407    }
2408    public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
2409    private static final long[] mk_tokenSet_2() {
2410        long[] data = new long[8];
2411        data[0]=-141407503262728L;
2412        for (int i = 1; i<=3; i++) { data[i]=-1L; }
2413        return data;
2414    }
2415    public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
2416    private static final long[] mk_tokenSet_3() {
2417        long[] data = { 288230380446688768L, 576460745995190270L, 0L, 0L, 0L};
2418        return data;
2419    }
2420    public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
2421    private static final long[] mk_tokenSet_4() {
2422        long[] data = { 4294977024L, 0L, 0L, 0L, 0L};
2423        return data;
2424    }
2425    public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
2426    private static final long[] mk_tokenSet_5() {
2427        long[] data = { 1103806604800L, 0L, 0L, 0L, 0L};
2428        return data;
2429    }
2430    public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
2431    private static final long[] mk_tokenSet_6() {
2432        long[] data = { 576189812881499648L, 576460745995190270L, 0L, 0L, 0L};
2433        return data;
2434    }
2435    public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
2436    private static final long[] mk_tokenSet_7() {
2437        long[] data = new long[8];
2438        data[0]=-17179869192L;
2439        data[1]=-268435457L;
2440        for (int i = 2; i<=3; i++) { data[i]=-1L; }
2441        return data;
2442    }
2443    public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
2444    private static final long[] mk_tokenSet_8() {
2445        long[] data = new long[8];
2446        data[0]=-549755813896L;
2447        data[1]=-268435457L;
2448        for (int i = 2; i<=3; i++) { data[i]=-1L; }
2449        return data;
2450    }
2451    public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
2452    private static final long[] mk_tokenSet_9() {
2453        long[] data = { 576179277326712832L, 576460745995190270L, 0L, 0L, 0L};
2454        return data;
2455    }
2456    public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
2457    private static final long[] mk_tokenSet_10() {
2458        long[] data = { 576188709074894848L, 576460745995190270L, 0L, 0L, 0L};
2459        return data;
2460    }
2461    public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10());
2462    private static final long[] mk_tokenSet_11() {
2463        long[] data = { 576208504579171840L, 576460746532061182L, 0L, 0L, 0L};
2464        return data;
2465    }
2466    public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11());
2467    private static final long[] mk_tokenSet_12() {
2468        long[] data = { 288230376151711744L, 576460745995190270L, 0L, 0L, 0L};
2469        return data;
2470    }
2471    public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12());
2472    private static final long[] mk_tokenSet_13() {
2473        long[] data = { 3747275269732312576L, 671088640L, 0L, 0L, 0L};
2474        return data;
2475    }
2476    public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13());
2477    private static final long[] mk_tokenSet_14() {
2478        long[] data = new long[8];
2479        data[0]=-4611686018427387912L;
2480        for (int i = 1; i<=3; i++) { data[i]=-1L; }
2481        return data;
2482    }
2483    public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14());
2484    private static final long[] mk_tokenSet_15() {
2485        long[] data = { 576183181451994624L, 576460746129407998L, 0L, 0L, 0L};
2486        return data;
2487    }
2488    public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15());
2489    private static final long[] mk_tokenSet_16() {
2490        long[] data = { 2306051920717948416L, 536870912L, 0L, 0L, 0L};
2491        return data;
2492    }
2493    public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16());
2494    private static final long[] mk_tokenSet_17() {
2495        long[] data = { 2305843013508670976L, 0L, 0L, 0L, 0L};
2496        return data;
2497    }
2498    public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17());
2499    private static final long[] mk_tokenSet_18() {
2500        long[] data = { 208911504254464L, 536870912L, 0L, 0L, 0L};
2501        return data;
2502    }
2503    public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18());
2504    private static final long[] mk_tokenSet_19() {
2505        long[] data = { 288231527202947072L, 576460746129407998L, 0L, 0L, 0L};
2506        return data;
2507    }
2508    public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19());
2509    private static final long[] mk_tokenSet_20() {
2510        long[] data = { 189120294954496L, 0L, 0L, 0L, 0L};
2511        return data;
2512    }
2513    public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20());
2514    private static final long[] mk_tokenSet_21() {
2515        long[] data = { 576370098428716544L, 576460746129407998L, 0L, 0L, 0L};
2516        return data;
2517    }
2518    public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21());
2519    private static final long[] mk_tokenSet_22() {
2520        long[] data = { 576315157207066112L, 576460746666278910L, 0L, 0L, 0L};
2521        return data;
2522    }
2523    public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22());
2524    private static final long[] mk_tokenSet_23() {
2525        long[] data = { 576190912393127424L, 576460745995190270L, 0L, 0L, 0L};
2526        return data;
2527    }
2528    public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23());
2529    private static final long[] mk_tokenSet_24() {
2530        long[] data = { 576188713369871872L, 576460745995190270L, 0L, 0L, 0L};
2531        return data;
2532    }
2533    public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24());
2534    private static final long[] mk_tokenSet_25() {
2535        long[] data = { 576459193230304768L, 576460746532061182L, 0L, 0L, 0L};
2536        return data;
2537    }
2538    public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25());
2539    private static final long[] mk_tokenSet_26() {
2540        long[] data = { 576388824486127104L, 576460746532061182L, 0L, 0L, 0L};
2541        return data;
2542    }
2543    public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26());
2544    
2545    }
2546
Popular Tags