]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/LangDumpDecl.c
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / LangDumpDecl.c
1 /** \file\r
2  *  This C source file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23\r
3  *\r
4  *     -  From the grammar source file : LangDumpDecl.g\r
5  *     -                            On : 2010-02-24 13:30:09\r
6  *     -           for the tree parser : LangDumpDeclTreeParser *\r
7  * Editing it, at least manually, is not wise. \r
8  *\r
9  * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.\r
10  *\r
11  *\r
12 */\r
13 // [The "BSD licence"]\r
14 // Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC\r
15 // http://www.temporal-wave.com\r
16 // http://www.linkedin.com/in/jimidle\r
17 //\r
18 // All rights reserved.\r
19 //\r
20 // Redistribution and use in source and binary forms, with or without\r
21 // modification, are permitted provided that the following conditions\r
22 // are met:\r
23 // 1. Redistributions of source code must retain the above copyright\r
24 //    notice, this list of conditions and the following disclaimer.\r
25 // 2. Redistributions in binary form must reproduce the above copyright\r
26 //    notice, this list of conditions and the following disclaimer in the\r
27 //    documentation and/or other materials provided with the distribution.\r
28 // 3. The name of the author may not be used to endorse or promote products\r
29 //    derived from this software without specific prior written permission.\r
30 //\r
31 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
32 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
33 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
34 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
35 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
36 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
37 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
38 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
39 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
40 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
41 \r
42 /* -----------------------------------------\r
43  * Include the ANTLR3 generated header file.\r
44  */\r
45 #include    "LangDumpDecl.h"\r
46 /* ----------------------------------------- */\r
47 \r
48 \r
49 \r
50 \r
51 \r
52 /* MACROS that hide the C interface implementations from the\r
53  * generated code, which makes it a little more understandable to the human eye.\r
54  * I am very much against using C pre-processor macros for function calls and bits\r
55  * of code as you cannot see what is happening when single stepping in debuggers\r
56  * and so on. The exception (in my book at least) is for generated code, where you are\r
57  * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()\r
58  * hides some indirect calls, but is always referring to the input stream. This is\r
59  * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig\r
60  * the runtime interfaces without changing the generated code too often, without\r
61  * confusing the reader of the generated output, who may not wish to know the gory\r
62  * details of the interface inheritance.\r
63  */\r
64  \r
65 #define         CTX     ctx\r
66 \r
67 /* Aids in accessing scopes for grammar programmers\r
68  */\r
69 #undef  SCOPE_TYPE\r
70 #undef  SCOPE_STACK\r
71 #undef  SCOPE_TOP\r
72 #define SCOPE_TYPE(scope)   pLangDumpDecl_##scope##_SCOPE\r
73 #define SCOPE_STACK(scope)  pLangDumpDecl_##scope##Stack\r
74 #define SCOPE_TOP(scope)    ctx->pLangDumpDecl_##scope##Top\r
75 #define SCOPE_SIZE(scope)               ctx->pLangDumpDecl_##scope##Stack_limit\r
76 #define SCOPE_INSTANCE(scope, i)        (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))\r
77 \r
78 /* Macros for accessing things in the parser\r
79  */\r
80  \r
81 #undef      PARSER\r
82 #undef      RECOGNIZER              \r
83 #undef      HAVEPARSEDRULE\r
84 #undef      INPUT\r
85 #undef      STRSTREAM\r
86 #undef      HASEXCEPTION\r
87 #undef      EXCEPTION\r
88 #undef      MATCHT\r
89 #undef      MATCHANYT\r
90 #undef      FOLLOWSTACK\r
91 #undef      FOLLOWPUSH\r
92 #undef      FOLLOWPOP\r
93 #undef      PRECOVER\r
94 #undef      PREPORTERROR\r
95 #undef      LA\r
96 #undef      LT\r
97 #undef      CONSTRUCTEX\r
98 #undef      CONSUME\r
99 #undef      MARK\r
100 #undef      REWIND\r
101 #undef      REWINDLAST\r
102 #undef      PERRORRECOVERY\r
103 #undef      HASFAILED\r
104 #undef      FAILEDFLAG\r
105 #undef      RECOVERFROMMISMATCHEDSET\r
106 #undef      RECOVERFROMMISMATCHEDELEMENT\r
107 #undef      BACKTRACKING\r
108 #undef      ADAPTOR\r
109 #undef      RULEMEMO            \r
110 #undef          SEEK    \r
111 #undef          INDEX\r
112 #undef          DBG\r
113 \r
114 #define     PARSER                                                      ctx->pTreeParser  \r
115 #define     RECOGNIZER                                          PARSER->rec\r
116 #define         PSRSTATE                                                RECOGNIZER->state\r
117 #define     HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)\r
118 #define     INPUT                                                       PARSER->ctnstream\r
119 #define         ISTREAM                                                 INPUT->tnstream->istream\r
120 #define     STRSTREAM                                           INPUT->tnstream\r
121 #define     HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)\r
122 #define     EXCEPTION                                           PSRSTATE->exception\r
123 #define     MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)\r
124 #define     MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)\r
125 #define     FOLLOWSTACK                                     PSRSTATE->following\r
126 #define     FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)\r
127 #define     FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)\r
128 #define     PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)\r
129 #define     PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)\r
130 #define     LA(n)                                                       ISTREAM->_LA(ISTREAM, n)\r
131 #define     LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)\r
132 #define     CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)\r
133 #define     CONSUME()                                           ISTREAM->consume(ISTREAM)\r
134 #define     MARK()                                                      ISTREAM->mark(ISTREAM)\r
135 #define     REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)\r
136 #define     REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)\r
137 #define     PERRORRECOVERY                                      PSRSTATE->errorRecovery\r
138 #define     FAILEDFLAG                                          PSRSTATE->failed\r
139 #define     HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)\r
140 #define     BACKTRACKING                                        PSRSTATE->backtracking\r
141 #define     RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)\r
142 #define     RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)\r
143 #define     ADAPTOR                         INPUT->adaptor\r
144 #define         RULEMEMO                                                PSRSTATE->ruleMemo\r
145 #define         SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)\r
146 #define         INDEX()                                                 ISTREAM->index(ISTREAM)\r
147 #define         DBG                                                             RECOGNIZER->debugger\r
148 \r
149 \r
150 #define         TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt\r
151 \r
152 /* The 4 tokens defined below may well clash with your own #defines or token types. If so\r
153  * then for the present you must use different names for your defines as these are hard coded\r
154  * in the code generator. It would be better not to use such names internally, and maybe\r
155  * we can change this in a forthcoming release. I deliberately do not #undef these\r
156  * here as this will at least give you a redefined error somewhere if they clash.\r
157  */\r
158 #define     UP      ANTLR3_TOKEN_UP\r
159 #define     DOWN    ANTLR3_TOKEN_DOWN\r
160 #define     EOR     ANTLR3_TOKEN_EOR\r
161 #define     INVALID ANTLR3_TOKEN_INVALID\r
162 \r
163 \r
164 /* =============================================================================\r
165  * Functions to create and destroy scopes. First come the rule scopes, followed\r
166  * by the global declared scopes.\r
167  */\r
168 \r
169 \r
170 \r
171 /* ============================================================================= */\r
172 \r
173 /* =============================================================================\r
174  * Start of recognizer\r
175  */\r
176 \r
177 \r
178 \r
179 /** \brief Table of all token names in symbolic order, mainly used for\r
180  *         error reporting.\r
181  */\r
182 pANTLR3_UINT8   LangDumpDeclTokenNames[7+4]\r
183      = {\r
184         (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */\r
185         (pANTLR3_UINT8) "<EOR>",\r
186         (pANTLR3_UINT8) "<DOWN>", \r
187         (pANTLR3_UINT8) "<UP>", \r
188         (pANTLR3_UINT8) "DECL",\r
189         (pANTLR3_UINT8) "ID",\r
190         (pANTLR3_UINT8) "INTTYPE",\r
191         (pANTLR3_UINT8) "FLOATTYPE",\r
192         (pANTLR3_UINT8) "INT",\r
193         (pANTLR3_UINT8) "WS",\r
194         (pANTLR3_UINT8) "';'"\r
195        };\r
196 \r
197         \r
198 \r
199 // Forward declare the locally static matching functions we have generated.\r
200 //\r
201 static void     decl    (pLangDumpDecl ctx);\r
202 static void     decls    (pLangDumpDecl ctx);\r
203 static void     type    (pLangDumpDecl ctx);\r
204 static LangDumpDecl_declarator_return   declarator    (pLangDumpDecl ctx);\r
205 static void     LangDumpDeclFree(pLangDumpDecl ctx);\r
206 /* For use in tree output where we are accumulating rule labels via label += ruleRef\r
207  * we need a function that knows how to free a return scope when the list is destroyed. \r
208  * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.\r
209  */\r
210 static  void ANTLR3_CDECL freeScope(void * scope)\r
211 {\r
212     ANTLR3_FREE(scope);\r
213 }\r
214 \r
215 /** \brief Name of the grammar file that generated this code\r
216  */\r
217 static const char fileName[] = "LangDumpDecl.g";\r
218 \r
219 /** \brief Return the name of the grammar file that generated this code.\r
220  */\r
221 static const char * getGrammarFileName()\r
222 {\r
223         return fileName;\r
224 }\r
225 /** \brief Create a new LangDumpDecl parser and return a context for it.\r
226  *\r
227  * \param[in] instream Pointer to an input stream interface.\r
228  *\r
229  * \return Pointer to new parser context upon success.\r
230  */\r
231 ANTLR3_API pLangDumpDecl\r
232 LangDumpDeclNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)\r
233 {\r
234         // See if we can create a new parser with the standard constructor\r
235         //\r
236         return LangDumpDeclNewSSD(instream, NULL);\r
237 }\r
238 \r
239 /** \brief Create a new LangDumpDecl parser and return a context for it.\r
240  *\r
241  * \param[in] instream Pointer to an input stream interface.\r
242  *\r
243  * \return Pointer to new parser context upon success.\r
244  */\r
245 ANTLR3_API pLangDumpDecl\r
246 LangDumpDeclNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)\r
247 {\r
248     pLangDumpDecl ctx;      /* Context structure we will build and return   */\r
249     \r
250     ctx = (pLangDumpDecl) ANTLR3_CALLOC(1, sizeof(LangDumpDecl));\r
251     \r
252     if  (ctx == NULL)\r
253     {\r
254                 // Failed to allocate memory for parser context\r
255                 //\r
256         return  NULL;\r
257     }\r
258     \r
259     /* -------------------------------------------------------------------\r
260      * Memory for basic structure is allocated, now to fill in\r
261      * the base ANTLR3 structures. We initialize the function pointers\r
262      * for the standard ANTLR3 parser function set, but upon return\r
263      * from here, the programmer may set the pointers to provide custom\r
264      * implementations of each function. \r
265      *\r
266      * We don't use the macros defined in LangDumpDecl.h here, in order that you can get a sense\r
267      * of what goes where.\r
268      */\r
269 \r
270     /* Create a base Tree parser/recognizer, using the supplied tree node stream\r
271      */\r
272     ctx->pTreeParser            = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);\r
273     /* Install the implementation of our LangDumpDecl interface\r
274      */\r
275     ctx->decl   = decl;\r
276     ctx->decls  = decls;\r
277     ctx->type   = type;\r
278     ctx->declarator     = declarator;\r
279     ctx->free                   = LangDumpDeclFree;\r
280     ctx->getGrammarFileName     = getGrammarFileName;\r
281     \r
282     /* Install the scope pushing methods.\r
283      */\r
284 \r
285         \r
286     \r
287 \r
288         \r
289     /* Install the token table\r
290      */\r
291     PSRSTATE->tokenNames   = LangDumpDeclTokenNames;\r
292     \r
293     \r
294     /* Return the newly built parser to the caller\r
295      */\r
296     return  ctx;\r
297 }\r
298 \r
299 /** Free the parser resources\r
300  */\r
301  static void\r
302  LangDumpDeclFree(pLangDumpDecl ctx)\r
303  {\r
304     /* Free any scope memory\r
305      */\r
306     \r
307         \r
308         // Free this parser\r
309         //\r
310     ctx->pTreeParser->free(ctx->pTreeParser);\r
311     ANTLR3_FREE(ctx);\r
312 \r
313     /* Everything is released, so we can return\r
314      */\r
315     return;\r
316  }\r
317  \r
318 /** Return token names used by this tree parser\r
319  *\r
320  * The returned pointer is used as an index into the token names table (using the token \r
321  * number as the index).\r
322  * \r
323  * \return Pointer to first char * in the table.\r
324  */\r
325 static pANTLR3_UINT8    *getTokenNames() \r
326 {\r
327         return LangDumpDeclTokenNames; \r
328 }\r
329 \r
330     \r
331 /* Declare the bitsets\r
332  */\r
333 \r
334 /** Bitset defining follow set for error recovery in rule state: FOLLOW_decls_in_decl58  */\r
335 static  ANTLR3_BITWORD FOLLOW_decls_in_decl58_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000012) };\r
336 static  ANTLR3_BITSET_LIST FOLLOW_decls_in_decl58       = { FOLLOW_decls_in_decl58_bits, 1      };\r
337 /** Bitset defining follow set for error recovery in rule state: FOLLOW_DECL_in_decls71  */\r
338 static  ANTLR3_BITWORD FOLLOW_DECL_in_decls71_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000004) };\r
339 static  ANTLR3_BITSET_LIST FOLLOW_DECL_in_decls71       = { FOLLOW_DECL_in_decls71_bits, 1      };\r
340 /** Bitset defining follow set for error recovery in rule state: FOLLOW_type_in_decls73  */\r
341 static  ANTLR3_BITWORD FOLLOW_type_in_decls73_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000020) };\r
342 static  ANTLR3_BITSET_LIST FOLLOW_type_in_decls73       = { FOLLOW_type_in_decls73_bits, 1      };\r
343 /** Bitset defining follow set for error recovery in rule state: FOLLOW_declarator_in_decls77  */\r
344 static  ANTLR3_BITWORD FOLLOW_declarator_in_decls77_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000008) };\r
345 static  ANTLR3_BITSET_LIST FOLLOW_declarator_in_decls77 = { FOLLOW_declarator_in_decls77_bits, 1        };\r
346 /** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTYPE_in_type110  */\r
347 static  ANTLR3_BITWORD FOLLOW_INTTYPE_in_type110_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };\r
348 static  ANTLR3_BITSET_LIST FOLLOW_INTTYPE_in_type110    = { FOLLOW_INTTYPE_in_type110_bits, 1   };\r
349 /** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_declarator126  */\r
350 static  ANTLR3_BITWORD FOLLOW_ID_in_declarator126_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };\r
351 static  ANTLR3_BITSET_LIST FOLLOW_ID_in_declarator126   = { FOLLOW_ID_in_declarator126_bits, 1  };\r
352      \r
353 \r
354  \r
355  \r
356 /* ==============================================\r
357  * Parsing rules\r
358  */\r
359 /** \r
360  * $ANTLR start decl\r
361  * LangDumpDecl.g:10:1: decl : ( decls )+ ;\r
362  */\r
363 static void\r
364 decl(pLangDumpDecl ctx)\r
365 {   \r
366     /* Initialize rule variables\r
367      */\r
368 \r
369 \r
370     {\r
371         // LangDumpDecl.g:10:6: ( ( decls )+ )\r
372         // LangDumpDecl.g:10:8: ( decls )+\r
373         {\r
374             // LangDumpDecl.g:10:8: ( decls )+\r
375             {\r
376                 int cnt1=0;\r
377 \r
378                 for (;;)\r
379                 {\r
380                     int alt1=2;\r
381                 switch ( LA(1) ) \r
382                 {\r
383                 case DECL:\r
384                         {\r
385                                 alt1=1;\r
386                         }\r
387                     break;\r
388 \r
389                 }\r
390 \r
391                 switch (alt1) \r
392                 {\r
393                     case 1:\r
394                         // LangDumpDecl.g:10:8: decls\r
395                         {\r
396                             FOLLOWPUSH(FOLLOW_decls_in_decl58);\r
397                             decls(ctx);\r
398 \r
399                             FOLLOWPOP();\r
400                             if  (HASEXCEPTION())\r
401                             {\r
402                                 goto ruledeclEx;\r
403                             }\r
404 \r
405 \r
406                         }\r
407                         break;\r
408 \r
409                     default:\r
410                     \r
411                         if ( cnt1 >= 1 )\r
412                         {\r
413                             goto loop1;\r
414                         }\r
415                         /* mismatchedSetEx()\r
416                          */\r
417                         CONSTRUCTEX();\r
418                         EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;\r
419                         EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;\r
420 \r
421 \r
422                         goto ruledeclEx;\r
423                 }\r
424                 cnt1++;\r
425                 }\r
426                 loop1: ;        /* Jump to here if this rule does not match */\r
427             }\r
428 \r
429         }\r
430 \r
431     }\r
432     \r
433 \r
434     // This is where rules clean up and exit\r
435     //\r
436     goto ruledeclEx; /* Prevent compiler warnings */\r
437     ruledeclEx: ;\r
438 \r
439             if (HASEXCEPTION())\r
440             {\r
441                 PREPORTERROR();\r
442                 PRECOVER();\r
443             }\r
444 \r
445 \r
446     return ;\r
447 }\r
448 /* $ANTLR end decl */\r
449 \r
450 /** \r
451  * $ANTLR start decls\r
452  * LangDumpDecl.g:13:1: decls : ^( DECL type d= declarator ) ;\r
453  */\r
454 static void\r
455 decls(pLangDumpDecl ctx)\r
456 {   \r
457     LangDumpDecl_declarator_return d;\r
458     #undef      RETURN_TYPE_d\r
459     #define     RETURN_TYPE_d LangDumpDecl_declarator_return\r
460 \r
461     /* Initialize rule variables\r
462      */\r
463 \r
464 \r
465     {\r
466         // LangDumpDecl.g:13:7: ( ^( DECL type d= declarator ) )\r
467         // LangDumpDecl.g:13:9: ^( DECL type d= declarator )\r
468         {\r
469              MATCHT(DECL, &FOLLOW_DECL_in_decls71); \r
470             if  (HASEXCEPTION())\r
471             {\r
472                 goto ruledeclsEx;\r
473             }\r
474 \r
475 \r
476             MATCHT(ANTLR3_TOKEN_DOWN, NULL); \r
477             if  (HASEXCEPTION())\r
478             {\r
479                 goto ruledeclsEx;\r
480             }\r
481 \r
482             FOLLOWPUSH(FOLLOW_type_in_decls73);\r
483             type(ctx);\r
484 \r
485             FOLLOWPOP();\r
486             if  (HASEXCEPTION())\r
487             {\r
488                 goto ruledeclsEx;\r
489             }\r
490 \r
491             FOLLOWPUSH(FOLLOW_declarator_in_decls77);\r
492             d=declarator(ctx);\r
493 \r
494             FOLLOWPOP();\r
495             if  (HASEXCEPTION())\r
496             {\r
497                 goto ruledeclsEx;\r
498             }\r
499 \r
500 \r
501             MATCHT(ANTLR3_TOKEN_UP, NULL); \r
502             if  (HASEXCEPTION())\r
503             {\r
504                 goto ruledeclsEx;\r
505             }\r
506 \r
507             {\r
508 \r
509                                         printf("int %s\n", (STRSTREAM->toStringSS(STRSTREAM, d.start, d.start))->chars);\r
510                        \r
511             }\r
512 \r
513         }\r
514 \r
515     }\r
516     \r
517 \r
518     // This is where rules clean up and exit\r
519     //\r
520     goto ruledeclsEx; /* Prevent compiler warnings */\r
521     ruledeclsEx: ;\r
522 \r
523             if (HASEXCEPTION())\r
524             {\r
525                 PREPORTERROR();\r
526                 PRECOVER();\r
527             }\r
528 \r
529 \r
530     return ;\r
531 }\r
532 /* $ANTLR end decls */\r
533 \r
534 /** \r
535  * $ANTLR start type\r
536  * LangDumpDecl.g:21:1: type : INTTYPE ;\r
537  */\r
538 static void\r
539 type(pLangDumpDecl ctx)\r
540 {   \r
541     /* Initialize rule variables\r
542      */\r
543 \r
544 \r
545     {\r
546         // LangDumpDecl.g:21:6: ( INTTYPE )\r
547         // LangDumpDecl.g:21:8: INTTYPE\r
548         {\r
549              MATCHT(INTTYPE, &FOLLOW_INTTYPE_in_type110); \r
550             if  (HASEXCEPTION())\r
551             {\r
552                 goto ruletypeEx;\r
553             }\r
554 \r
555 \r
556         }\r
557 \r
558     }\r
559     \r
560 \r
561     // This is where rules clean up and exit\r
562     //\r
563     goto ruletypeEx; /* Prevent compiler warnings */\r
564     ruletypeEx: ;\r
565 \r
566             if (HASEXCEPTION())\r
567             {\r
568                 PREPORTERROR();\r
569                 PRECOVER();\r
570             }\r
571 \r
572 \r
573     return ;\r
574 }\r
575 /* $ANTLR end type */\r
576 \r
577 /** \r
578  * $ANTLR start declarator\r
579  * LangDumpDecl.g:23:1: declarator : i= ID ;\r
580  */\r
581 static LangDumpDecl_declarator_return\r
582 declarator(pLangDumpDecl ctx)\r
583 {   \r
584     LangDumpDecl_declarator_return retval;\r
585 \r
586     pANTLR3_BASE_TREE    i;\r
587 \r
588     /* Initialize rule variables\r
589      */\r
590 \r
591 \r
592     i       = NULL;\r
593     retval.start = LT(1); retval.stop = retval.start;\r
594 \r
595     {\r
596         // LangDumpDecl.g:24:6: (i= ID )\r
597         // LangDumpDecl.g:24:8: i= ID\r
598         {\r
599             i = (pANTLR3_BASE_TREE) MATCHT(ID, &FOLLOW_ID_in_declarator126); \r
600             if  (HASEXCEPTION())\r
601             {\r
602                 goto ruledeclaratorEx;\r
603             }\r
604 \r
605 \r
606         }\r
607 \r
608     }\r
609     \r
610 \r
611     // This is where rules clean up and exit\r
612     //\r
613     goto ruledeclaratorEx; /* Prevent compiler warnings */\r
614     ruledeclaratorEx: ;\r
615 \r
616             if (HASEXCEPTION())\r
617             {\r
618                 PREPORTERROR();\r
619                 PRECOVER();\r
620             }\r
621 \r
622 \r
623     return retval;\r
624 }\r
625 /* $ANTLR end declarator */\r
626 /* End of parsing rules\r
627  * ==============================================\r
628  */\r
629 \r
630 /* ==============================================\r
631  * Syntactic predicates\r
632  */\r
633 /* End of syntactic predicates\r
634  * ==============================================\r
635  */\r
636 \r
637  \r
638  \r
639 \r
640 \r
641 \r
642 /* End of code\r
643  * =============================================================================\r
644  */\r