KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > parser > PythonGrammar


1 /* Generated By:JJTree&JavaCC: Do not edit this line. PythonGrammar.java */
2 package org.python.parser;
3 import org.python.parser.ast.modType;
4
5 public class PythonGrammar/*@bgen(jjtree)*/implements PythonGrammarTreeConstants, PythonGrammarConstants {/*@bgen(jjtree)*/
6   protected JJTPythonGrammarState jjtree = new JJTPythonGrammarState();public IParserHost hostLiteralMkr;
7
8     void jjtreeOpenNodeScope(Node n) {
9         Token t = getToken(1);
10         jjtree.pushNodePos(t.beginLine, t.beginColumn);
11     }
12
13     void jjtreeCloseNodeScope(Node n) {
14         jjtree.setNodePos();
15     }
16
17     Object JavaDoc makeInt(String JavaDoc s, int radix) {
18         if (s.endsWith("L") || s.endsWith("l")) {
19             s = s.substring(0, s.length()-1);
20             return hostLiteralMkr.newLong(new java.math.BigInteger JavaDoc(s, radix));
21         }
22         int ndigits = s.length();
23         int i=0;
24         while (i < ndigits && s.charAt(i) == '0')
25             i++;
26         if ((ndigits - i) > 11) {
27             return hostLiteralMkr.newLong(new java.math.BigInteger JavaDoc(s, radix));
28         }
29
30         long l = Long.valueOf(s, radix).longValue();
31         if (l > 0xffffffffl || (radix == 10 && l > Integer.MAX_VALUE)) {
32             return hostLiteralMkr.newLong(new java.math.BigInteger JavaDoc(s, radix));
33         }
34         return hostLiteralMkr.newInteger((int) l);
35     }
36
37     Object JavaDoc makeFloat(String JavaDoc s) {
38         return hostLiteralMkr.newFloat(Double.valueOf(s).doubleValue());
39     }
40
41     Object JavaDoc makeLong(String JavaDoc s) {
42         return hostLiteralMkr.newLong(s);
43     }
44
45     Object JavaDoc makeComplex(String JavaDoc s) {
46         s = s.substring(0, s.length() - 1);
47         return hostLiteralMkr.newImaginary(Double.valueOf(s).doubleValue());
48     }
49
50     String JavaDoc makeString(String JavaDoc s, int quotes) {
51         //System.out.println("string: "+s);
52
char quoteChar = s.charAt(0);
53         int start=0;
54         boolean ustring = false;
55         if (quoteChar == 'u' || quoteChar == 'U') {
56             ustring = true;
57             start++;
58         }
59         quoteChar = s.charAt(start);
60         if (quoteChar == 'r' || quoteChar == 'R') {
61             return s.substring(quotes+start+1, s.length()-quotes);
62         } else {
63             StringBuffer JavaDoc sb = new StringBuffer JavaDoc(s.length());
64             char[] ca = s.toCharArray();
65             int n = ca.length-quotes;
66             int i=quotes+start;
67             int last_i=i;
68
69             return hostLiteralMkr.decode_UnicodeEscape(s, i, n, "strict", ustring);
70         }
71     }
72
73     // ! maximal currently used LOOKAHEAD is 3
74
private static final int MAX_LOOKAHEAD = 3;
75
76     public boolean partial_valid_sentence(Throwable JavaDoc t) {
77         if (t instanceof TokenMgrError) {
78            // check whether EOF condition inside multi-line string,
79
// or just after newline continuation inside a string (*NLC states)
80
TokenMgrError e = (TokenMgrError)t;
81            switch(e.lexState) {
82            case IN_STRING1NLC:
83            case IN_STRING2NLC:
84            case IN_STRING13:
85            case IN_STRING23:
86                return e.EOFSeen;
87            default:
88                return false;
89            }
90         }
91         if (!(t instanceof ParseException))
92             return false;
93         try {
94             ParseException e = (ParseException)t;
95             int tok = getNextToken().kind;
96             if (tok == EOF) return true; // all tokens eaten
97

98             // or check whether remaing tokens partially fullfill lookahead
99
// expectations
100

101             int[][] expected = e.expectedTokenSequences;
102
103             if (expected == null) return false;
104
105             int[] ahead = new int[MAX_LOOKAHEAD-1];
106
107             int i = 0;
108             for(;;) {
109                 ahead[i] = tok;
110                 i++;
111                 tok = getNextToken().kind;
112                 if (tok == EOF) break;
113                 if (i >= MAX_LOOKAHEAD-1) return false;
114             }
115
116             int nahead = i;
117
118         next_expected:
119             for(int j = 0; j<expected.length; j++) {
120                 int[] cand = expected[j];
121
122                 if (cand.length <= nahead ) continue next_expected;
123
124                 for(int k = 0; k < nahead; k++)
125                     if (ahead[k] != cand[k])
126                         continue next_expected;
127                 return true;
128             }
129
130             return false;
131         } catch (TokenMgrError e1) {
132             return false;
133         }
134     }
135
136    // constructors taking a IParserHost impl
137

138    public PythonGrammar(CharStream stream,IParserHost host) {
139        this(stream);
140        hostLiteralMkr = host;
141    }
142
143    public PythonGrammar(PythonGrammarTokenManager tm,
144                         IParserHost host)
145    {
146         this(tm);
147         hostLiteralMkr = host;
148    }
149
150 //single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
151
// apparently CPython coalesces newlines, we don't
152
final public modType single_input() throws ParseException {
153                          /*@bgen(jjtree) single_input */
154     SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTSINGLE_INPUT);
155     boolean jjtc000 = true;
156     jjtree.openNodeScope(jjtn000);
157     jjtreeOpenNodeScope(jjtn000);token_source.single_input=true;
158     try {
159       label_1:
160       while (true) {
161         if (jj_2_1(2)) {
162           ;
163         } else {
164           break label_1;
165         }
166         jj_consume_token(NEWLINE);
167       }
168       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
169       case LPAREN:
170       case LBRACE:
171       case LBRACKET:
172       case PLUS:
173       case MINUS:
174       case NOT:
175       case NOT_BOOL:
176       case LAMBDA:
177       case IF:
178       case WHILE:
179       case FOR:
180       case TRY:
181       case DEF:
182       case CLASS:
183       case PRINT:
184       case PASS:
185       case BREAK:
186       case CONTINUE:
187       case RETURN:
188       case YIELD:
189       case IMPORT:
190       case FROM:
191       case DEL:
192       case RAISE:
193       case GLOBAL:
194       case EXEC:
195       case ASSERT:
196       case AS:
197       case NAME:
198       case DECNUMBER:
199       case HEXNUMBER:
200       case OCTNUMBER:
201       case FLOAT:
202       case COMPLEX:
203       case SINGLE_STRING:
204       case SINGLE_STRING2:
205       case TRIPLE_STRING:
206       case TRIPLE_STRING2:
207       case 121:
208         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
209         case LPAREN:
210         case LBRACE:
211         case LBRACKET:
212         case PLUS:
213         case MINUS:
214         case NOT:
215         case NOT_BOOL:
216         case LAMBDA:
217         case PRINT:
218         case PASS:
219         case BREAK:
220         case CONTINUE:
221         case RETURN:
222         case YIELD:
223         case IMPORT:
224         case FROM:
225         case DEL:
226         case RAISE:
227         case GLOBAL:
228         case EXEC:
229         case ASSERT:
230         case AS:
231         case NAME:
232         case DECNUMBER:
233         case HEXNUMBER:
234         case OCTNUMBER:
235         case FLOAT:
236         case COMPLEX:
237         case SINGLE_STRING:
238         case SINGLE_STRING2:
239         case TRIPLE_STRING:
240         case TRIPLE_STRING2:
241         case 121:
242           simple_stmt();
243           break;
244         case IF:
245         case WHILE:
246         case FOR:
247         case TRY:
248         case DEF:
249         case CLASS:
250           compound_stmt();
251           jj_consume_token(NEWLINE);
252           break;
253         default:
254           jj_la1[0] = jj_gen;
255           jj_consume_token(-1);
256           throw new ParseException();
257         }
258         break;
259       default:
260         jj_la1[1] = jj_gen;
261         ;
262       }
263       label_2:
264       while (true) {
265         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
266         case NEWLINE:
267           ;
268           break;
269         default:
270           jj_la1[2] = jj_gen;
271           break label_2;
272         }
273         jj_consume_token(NEWLINE);
274       }
275       jj_consume_token(0);
276       jjtree.closeNodeScope(jjtn000, true);
277       jjtc000 = false;
278       jjtreeCloseNodeScope(jjtn000);
279       {if (true) return (modType) jjtree.popNode();}
280     } catch (Throwable JavaDoc jjte000) {
281       if (jjtc000) {
282         jjtree.clearNodeScope(jjtn000);
283         jjtc000 = false;
284       } else {
285         jjtree.popNode();
286       }
287       if (jjte000 instanceof RuntimeException JavaDoc) {
288         {if (true) throw (RuntimeException JavaDoc)jjte000;}
289       }
290       if (jjte000 instanceof ParseException) {
291         {if (true) throw (ParseException)jjte000;}
292       }
293       {if (true) throw (Error JavaDoc)jjte000;}
294     } finally {
295       if (jjtc000) {
296         jjtree.closeNodeScope(jjtn000, true);
297         jjtreeCloseNodeScope(jjtn000);
298       }
299     }
300     throw new Error JavaDoc("Missing return statement in function");
301   }
302
303 //file_input: (NEWLINE | stmt)* ENDMARKER
304
final public modType file_input() throws ParseException {
305                        /*@bgen(jjtree) file_input */
306                        SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTFILE_INPUT);
307                        boolean jjtc000 = true;
308                        jjtree.openNodeScope(jjtn000);
309                        jjtreeOpenNodeScope(jjtn000);token_source.single_input=false;
310     try {
311       label_3:
312       while (true) {
313         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
314         case NEWLINE:
315         case LPAREN:
316         case LBRACE:
317         case LBRACKET:
318         case PLUS:
319         case MINUS:
320         case NOT:
321         case NOT_BOOL:
322         case LAMBDA:
323         case IF:
324         case WHILE:
325         case FOR:
326         case TRY:
327         case DEF:
328         case CLASS:
329         case PRINT:
330         case PASS:
331         case BREAK:
332         case CONTINUE:
333         case RETURN:
334         case YIELD:
335         case IMPORT:
336         case FROM:
337         case DEL:
338         case RAISE:
339         case GLOBAL:
340         case EXEC:
341         case ASSERT:
342         case AS:
343         case NAME:
344         case DECNUMBER:
345         case HEXNUMBER:
346         case OCTNUMBER:
347         case FLOAT:
348         case COMPLEX:
349         case SINGLE_STRING:
350         case SINGLE_STRING2:
351         case TRIPLE_STRING:
352         case TRIPLE_STRING2:
353         case 121:
354           ;
355           break;
356         default:
357           jj_la1[3] = jj_gen;
358           break label_3;
359         }
360         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
361         case NEWLINE:
362           jj_consume_token(NEWLINE);
363           break;
364         case LPAREN:
365         case LBRACE:
366         case LBRACKET:
367         case PLUS:
368         case MINUS:
369         case NOT:
370         case NOT_BOOL:
371         case LAMBDA:
372         case IF:
373         case WHILE:
374         case FOR:
375         case TRY:
376         case DEF:
377         case CLASS:
378         case PRINT:
379         case PASS:
380         case BREAK:
381         case CONTINUE:
382         case RETURN:
383         case YIELD:
384         case IMPORT:
385         case FROM:
386         case DEL:
387         case RAISE:
388         case GLOBAL:
389         case EXEC:
390         case ASSERT:
391         case AS:
392         case NAME:
393         case DECNUMBER:
394         case HEXNUMBER:
395         case OCTNUMBER:
396         case FLOAT:
397         case COMPLEX:
398         case SINGLE_STRING:
399         case SINGLE_STRING2:
400         case TRIPLE_STRING:
401         case TRIPLE_STRING2:
402         case 121:
403           stmt();
404           break;
405         default:
406           jj_la1[4] = jj_gen;
407           jj_consume_token(-1);
408           throw new ParseException();
409         }
410       }
411       jj_consume_token(0);
412       jjtree.closeNodeScope(jjtn000, true);
413       jjtc000 = false;
414       jjtreeCloseNodeScope(jjtn000);
415       {if (true) return (modType) jjtree.popNode();}
416     } catch (Throwable JavaDoc jjte000) {
417       if (jjtc000) {
418         jjtree.clearNodeScope(jjtn000);
419         jjtc000 = false;
420       } else {
421         jjtree.popNode();
422       }
423       if (jjte000 instanceof RuntimeException JavaDoc) {
424         {if (true) throw (RuntimeException JavaDoc)jjte000;}
425       }
426       if (jjte000 instanceof ParseException) {
427         {if (true) throw (ParseException)jjte000;}
428       }
429       {if (true) throw (Error JavaDoc)jjte000;}
430     } finally {
431       if (jjtc000) {
432         jjtree.closeNodeScope(jjtn000, true);
433         jjtreeCloseNodeScope(jjtn000);
434       }
435     }
436     throw new Error JavaDoc("Missing return statement in function");
437   }
438
439 //eval_input: NEWLINE* testlist NEWLINE* ENDMARKER
440
final public modType eval_input() throws ParseException {
441                        /*@bgen(jjtree) eval_input */
442                        SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTEVAL_INPUT);
443                        boolean jjtc000 = true;
444                        jjtree.openNodeScope(jjtn000);
445                        jjtreeOpenNodeScope(jjtn000);token_source.single_input=false;
446     try {
447       label_4:
448       while (true) {
449         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
450         case NEWLINE:
451           ;
452           break;
453         default:
454           jj_la1[5] = jj_gen;
455           break label_4;
456         }
457         jj_consume_token(NEWLINE);
458       }
459       SmartTestList();
460       label_5:
461       while (true) {
462         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
463         case NEWLINE:
464           ;
465           break;
466         default:
467           jj_la1[6] = jj_gen;
468           break label_5;
469         }
470         jj_consume_token(NEWLINE);
471       }
472       jj_consume_token(0);
473       jjtree.closeNodeScope(jjtn000, true);
474       jjtc000 = false;
475       jjtreeCloseNodeScope(jjtn000);
476       {if (true) return (modType) jjtree.popNode();}
477     } catch (Throwable JavaDoc jjte000) {
478       if (jjtc000) {
479         jjtree.clearNodeScope(jjtn000);
480         jjtc000 = false;
481       } else {
482         jjtree.popNode();
483       }
484       if (jjte000 instanceof RuntimeException JavaDoc) {
485         {if (true) throw (RuntimeException JavaDoc)jjte000;}
486       }
487       if (jjte000 instanceof ParseException) {
488         {if (true) throw (ParseException)jjte000;}
489       }
490       {if (true) throw (Error JavaDoc)jjte000;}
491     } finally {
492       if (jjtc000) {
493         jjtree.closeNodeScope(jjtn000, true);
494         jjtreeCloseNodeScope(jjtn000);
495       }
496     }
497     throw new Error JavaDoc("Missing return statement in function");
498   }
499
500 //funcdef: 'def' NAME parameters ':' suite
501
final public void funcdef() throws ParseException {
502                  /*@bgen(jjtree) funcdef */
503   SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTFUNCDEF);
504   boolean jjtc000 = true;
505   jjtree.openNodeScope(jjtn000);
506   jjtreeOpenNodeScope(jjtn000);
507     try {
508       jj_consume_token(DEF);
509       AnyName();
510       parameters();
511       jj_consume_token(COLON);
512       suite();
513     } catch (Throwable JavaDoc jjte000) {
514     if (jjtc000) {
515       jjtree.clearNodeScope(jjtn000);
516       jjtc000 = false;
517     } else {
518       jjtree.popNode();
519     }
520     if (jjte000 instanceof RuntimeException JavaDoc) {
521       {if (true) throw (RuntimeException JavaDoc)jjte000;}
522     }
523     if (jjte000 instanceof ParseException) {
524       {if (true) throw (ParseException)jjte000;}
525     }
526     {if (true) throw (Error JavaDoc)jjte000;}
527     } finally {
528     if (jjtc000) {
529       jjtree.closeNodeScope(jjtn000, true);
530       jjtreeCloseNodeScope(jjtn000);
531     }
532     }
533   }
534
535 //parameters: '(' [varargslist] ')'
536
final public void parameters() throws ParseException {
537     jj_consume_token(LPAREN);
538     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
539     case LPAREN:
540     case MULTIPLY:
541     case POWER:
542     case AS:
543     case NAME:
544       varargslist();
545       break;
546     default:
547       jj_la1[7] = jj_gen;
548       ;
549     }
550     jj_consume_token(RPAREN);
551   }
552
553 //varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' ('**'|'*' '*') NAME] | ('**'|'*' '*') NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [',']
554
final public void varargslist() throws ParseException {
555     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
556     case LPAREN:
557     case AS:
558     case NAME:
559       defaultarg();
560       label_6:
561       while (true) {
562         if (jj_2_2(2)) {
563           ;
564         } else {
565           break label_6;
566         }
567         jj_consume_token(COMMA);
568         defaultarg();
569       }
570       if (jj_2_3(3)) {
571         jj_consume_token(COMMA);
572         ExtraArgList();
573       } else {
574         ;
575       }
576       if (jj_2_4(2)) {
577         jj_consume_token(COMMA);
578         ExtraKeywordList();
579       } else {
580         ;
581       }
582       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
583       case COMMA:
584         jj_consume_token(COMMA);
585         break;
586       default:
587         jj_la1[8] = jj_gen;
588         ;
589       }
590       break;
591     case MULTIPLY:
592     case POWER:
593       if (jj_2_5(2)) {
594         ExtraArgList();
595         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
596         case COMMA:
597           jj_consume_token(COMMA);
598           ExtraKeywordList();
599           break;
600         default:
601           jj_la1[9] = jj_gen;
602           ;
603         }
604       } else {
605         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
606         case MULTIPLY:
607         case POWER:
608           ExtraKeywordList();
609           break;
610         default:
611           jj_la1[10] = jj_gen;
612           jj_consume_token(-1);
613           throw new ParseException();
614         }
615       }
616       break;
617     default:
618       jj_la1[11] = jj_gen;
619       jj_consume_token(-1);
620       throw new ParseException();
621     }
622   }
623
624   final public void ExtraArgList() throws ParseException {
625                       /*@bgen(jjtree) ExtraArgList */
626   SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTEXTRAARGLIST);
627   boolean jjtc000 = true;
628   jjtree.openNodeScope(jjtn000);
629   jjtreeOpenNodeScope(jjtn000);
630     try {
631       jj_consume_token(MULTIPLY);
632       Name();
633     } catch (Throwable JavaDoc jjte000) {
634     if (jjtc000) {
635       jjtree.clearNodeScope(jjtn000);
636       jjtc000 = false;
637     } else {
638       jjtree.popNode();
639     }
640     if (jjte000 instanceof RuntimeException JavaDoc) {
641       {if (true) throw (RuntimeException JavaDoc)jjte000;}
642     }
643     if (jjte000 instanceof ParseException) {
644       {if (true) throw (ParseException)jjte000;}
645     }
646     {if (true) throw (Error JavaDoc)jjte000;}
647     } finally {
648     if (jjtc000) {
649       jjtree.closeNodeScope(jjtn000, true);
650       jjtreeCloseNodeScope(jjtn000);
651     }
652     }
653   }
654
655   final public void ExtraKeywordList() throws ParseException {
656                           /*@bgen(jjtree) ExtraKeywordList */
657   SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTEXTRAKEYWORDLIST);
658   boolean jjtc000 = true;
659   jjtree.openNodeScope(jjtn000);
660   jjtreeOpenNodeScope(jjtn000);
661     try {
662       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
663       case POWER:
664         jj_consume_token(POWER);
665         break;
666       case MULTIPLY:
667         jj_consume_token(MULTIPLY);
668         jj_consume_token(MULTIPLY);
669         break;
670       default:
671         jj_la1[12] = jj_gen;
672         jj_consume_token(-1);
673         throw new ParseException();
674       }
675       Name();
676     } catch (Throwable JavaDoc jjte000) {
677     if (jjtc000) {
678       jjtree.clearNodeScope(jjtn000);
679       jjtc000 = false;
680     } else {
681       jjtree.popNode();
682     }
683     if (jjte000 instanceof RuntimeException JavaDoc) {
684       {if (true) throw (RuntimeException JavaDoc)jjte000;}
685     }
686     if (jjte000 instanceof ParseException) {
687       {if (true) throw (ParseException)jjte000;}
688     }
689     {if (true) throw (Error JavaDoc)jjte000;}
690     } finally {
691     if (jjtc000) {
692       jjtree.closeNodeScope(jjtn000, true);
693       jjtreeCloseNodeScope(jjtn000);
694     }
695     }
696   }
697
698   final public void defaultarg() throws ParseException {
699                     /*@bgen(jjtree) defaultarg */
700   SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTDEFAULTARG);
701   boolean jjtc000 = true;
702   jjtree.openNodeScope(jjtn000);
703   jjtreeOpenNodeScope(jjtn000);
704     try {
705       fpdef();
706       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
707       case EQUAL:
708         jj_consume_token(EQUAL);
709         test();
710         break;
711       default:
712         jj_la1[13] = jj_gen;
713         ;
714       }
715     } catch (Throwable JavaDoc jjte000) {
716     if (jjtc000) {
717       jjtree.clearNodeScope(jjtn000);
718       jjtc000 = false;
719     } else {
720       jjtree.popNode();
721     }
722     if (jjte000 instanceof RuntimeException JavaDoc) {
723       {if (true) throw (RuntimeException JavaDoc)jjte000;}
724     }
725     if (jjte000 instanceof ParseException) {
726       {if (true) throw (ParseException)jjte000;}
727     }
728     {if (true) throw (Error JavaDoc)jjte000;}
729     } finally {
730     if (jjtc000) {
731       jjtree.closeNodeScope(jjtn000, true);
732       jjtreeCloseNodeScope(jjtn000);
733     }
734     }
735   }
736
737 //fpdef: NAME | '(' fplist ')'
738
final public void fpdef() throws ParseException {
739     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
740     case AS:
741     case NAME:
742       Name();
743       break;
744     case LPAREN:
745       jj_consume_token(LPAREN);
746       fplist();
747       jj_consume_token(RPAREN);
748       break;
749     default:
750       jj_la1[14] = jj_gen;
751       jj_consume_token(-1);
752       throw new ParseException();
753     }
754   }
755
756 //fplist: fpdef (',' fpdef)* [',']
757
final public void fplist() throws ParseException {
758                        /*@bgen(jjtree) tuple */
759   SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this, JJTTUPLE);
760   boolean jjtc000 = true;
761   jjtree.openNodeScope(jjtn000);
762   jjtreeOpenNodeScope(jjtn000);
763     try {
764       fpdef();
765       label_7:
766       while (true) {
767         if (jj_2_6(2)) {
768           ;
769         } else {
770           break label_7;
771         }
772         jj_consume_token(COMMA);
773         fpdef();
774       }
775       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
776       case COMMA:
777         jj_consume_token(COMMA);
778         break;
779       default:
780         jj_la1[15] = jj_gen;
781         ;
782       }
783     } catch (Throwable JavaDoc jjte000) {
784     if (jjtc000) {
785       jjtree.clearNodeScope(jjtn000);
786       jjtc000 = false;
787     } else {
788       jjtree.popNode();
789     }
790     if (jjte000 instanceof RuntimeException JavaDoc) {
791       {if (true) throw (RuntimeException JavaDoc)jjte000;}
792     }
793     if (jjte000 instanceof ParseException) {
794       {if (true) throw (ParseException)jjte000;}
795     }
796     {if (true) throw (Error JavaDoc)jjte000;}
797     } finally {
798     if (jjtc000) {
799       jjtree.closeNodeScope(jjtn000, true);
800       jjtreeCloseNodeScope(jjtn000);
801     }
802     }
803   }
804
805 //stmt: simple_stmt | compound_stmt
806
final public void stmt() throws ParseException {
807     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
808     case LPAREN:
809     case LBRACE:
810     case LBRACKET:
811     case PLUS:
812     case MINUS:
813     case NOT:
814     case NOT_BOOL:
815     case LAMBDA:
816     case PRINT:
817     case PASS:
818     case BREAK:
819     case CONTINUE:
820     case RETURN:
821     case YIELD:
822     case IMPORT:
823     case FROM:
824     case DEL:
825     case RAISE:
826     case GLOBAL:
827     case EXEC:
828     case ASSERT:
829     case AS:
830     case NAME:
831     case DECNUMBER:
832     case HEXNUMBER:
833     case OCTNUMBER:
834     case FLOAT:
835     case COMPLEX:
836     case SINGLE_STRING:
837     case SINGLE_STRING2:
838     case TRIPLE_STRING:
839     case TRIPLE_STRING2:
840     case 121:
841       simple_stmt();
842       break;
843     case IF:
844     case WHILE:
845     case FOR:
846     case TRY:
847     case DEF:
848     case CLASS:
849       compound_stmt();
850       break;
851     default:
852       jj_la1[16] = jj_gen;
853       jj_consume_token(-1);
854       throw new ParseException();
855     }
856   }
857
858 //simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
859
final public void simple_stmt() throws ParseException {
860     small_stmt();
861     label_8:
862     while (true) {
863       if (jj_2_7(2)) {
864         ;
865       } else {
866         break label_8;
867       }
868       jj_consume_token(SEMICOLON);
869       small_stmt();
870     }
871     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
872     case SEMICOLON:
873       jj_consume_token(SEMICOLON);
874       break;
875     default:
876       jj_la1[17] = jj_gen;
877       ;
878     }
879     jj_consume_token(NEWLINE);
880   }
881
882 //small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
883
final public void small_stmt() throws ParseException {
884     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
885     case LPAREN:
886     case LBRACE:
887     case LBRACKET:
888     case PLUS:
889     case MINUS:
890     case NOT:
891     case NOT_BOOL:
892     case LAMBDA:
893     case AS:
894     case NAME:
895     case DECNUMBER:
896     case HEXNUMBER:
897     c