]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/LangLexer.c
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoard / LangLexer.c
1 /** \file
2  *  This C source file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23
3  *
4  *     -  From the grammar source file : Lang.g
5  *     -                            On : 2010-02-24 13:27:55
6  *     -                 for the lexer : LangLexerLexer *
7  * Editing it, at least manually, is not wise. 
8  *
9  * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
10  *
11  *
12 */
13 // [The "BSD licence"]
14 // Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
15 // http://www.temporal-wave.com
16 // http://www.linkedin.com/in/jimidle
17 //
18 // All rights reserved.
19 //
20 // Redistribution and use in source and binary forms, with or without
21 // modification, are permitted provided that the following conditions
22 // are met:
23 // 1. Redistributions of source code must retain the above copyright
24 //    notice, this list of conditions and the following disclaimer.
25 // 2. Redistributions in binary form must reproduce the above copyright
26 //    notice, this list of conditions and the following disclaimer in the
27 //    documentation and/or other materials provided with the distribution.
28 // 3. The name of the author may not be used to endorse or promote products
29 //    derived from this software without specific prior written permission.
30 //
31 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
32 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
33 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
34 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
35 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
40 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
42 /* -----------------------------------------
43  * Include the ANTLR3 generated header file.
44  */
45 #include    "LangLexer.h"
46 /* ----------------------------------------- */
47
48
49 /** String literals used by LangLexer that we must do things like MATCHS() with.
50  *  C will normally just lay down 8 bit characters, and you can use L"xxx" to
51  *  get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
52  *  we perform this little trick of defining the literals as arrays of UINT32
53  *  and passing in the address of these.
54  */
55 static ANTLR3_UCHAR     lit_1[]  = { 0x69, 0x6E, 0x74,  ANTLR3_STRING_TERMINATOR};
56 static ANTLR3_UCHAR     lit_2[]  = { 0x66, 0x6C, 0x6F, 0x61, 0x74,  ANTLR3_STRING_TERMINATOR};
57
58
59
60
61 /* MACROS that hide the C interface implementations from the
62  * generated code, which makes it a little more understandable to the human eye.
63  * I am very much against using C pre-processor macros for function calls and bits
64  * of code as you cannot see what is happening when single stepping in debuggers
65  * and so on. The exception (in my book at least) is for generated code, where you are
66  * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
67  * hides some indirect calls, but is always referring to the input stream. This is
68  * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
69  * the runtime interfaces without changing the generated code too often, without
70  * confusing the reader of the generated output, who may not wish to know the gory
71  * details of the interface inheritance.
72  */
73  
74 #define         CTX     ctx
75
76 /* Aids in accessing scopes for grammar programmers
77  */
78 #undef  SCOPE_TYPE
79 #undef  SCOPE_STACK
80 #undef  SCOPE_TOP
81 #define SCOPE_TYPE(scope)   pLangLexer_##scope##_SCOPE
82 #define SCOPE_STACK(scope)  pLangLexer_##scope##Stack
83 #define SCOPE_TOP(scope)    ctx->pLangLexer_##scope##Top
84 #define SCOPE_SIZE(scope)               ctx->pLangLexer_##scope##Stack_limit
85 #define SCOPE_INSTANCE(scope, i)        (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
86
87  
88 /* Macros for accessing things in a lexer
89  */
90 #undef      LEXER
91 #undef      RECOGNIZER              
92 #undef      RULEMEMO                
93 #undef      GETCHARINDEX
94 #undef      GETLINE
95 #undef      GETCHARPOSITIONINLINE
96 #undef      EMIT
97 #undef      EMITNEW
98 #undef      MATCHC
99 #undef      MATCHS
100 #undef      MATCHRANGE
101 #undef      LTOKEN
102 #undef      HASFAILED
103 #undef      FAILEDFLAG
104 #undef      INPUT
105 #undef      STRSTREAM
106 #undef      LA
107 #undef      HASEXCEPTION
108 #undef      EXCEPTION
109 #undef      CONSTRUCTEX
110 #undef      CONSUME
111 #undef      LRECOVER
112 #undef      MARK
113 #undef      REWIND
114 #undef      REWINDLAST
115 #undef      BACKTRACKING
116 #undef          MATCHANY
117 #undef          MEMOIZE
118 #undef          HAVEPARSEDRULE
119 #undef          GETTEXT
120 #undef          INDEX
121 #undef          SEEK
122 #undef          PUSHSTREAM
123 #undef          POPSTREAM
124 #undef          SETTEXT
125 #undef          SETTEXT8
126
127 #define     LEXER                                       ctx->pLexer
128 #define     RECOGNIZER                      LEXER->rec
129 #define         LEXSTATE                                RECOGNIZER->state
130 #define         TOKSOURCE                               LEXSTATE->tokSource
131 #define     GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
132 #define     GETLINE()                           LEXER->getLine(LEXER)
133 #define     GETTEXT()                           LEXER->getText(LEXER)
134 #define     GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
135 #define     EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
136 #define     EMITNEW(t)                          LEXER->emitNew(LEXER, t)
137 #define     MATCHC(c)                           LEXER->matchc(LEXER, c)
138 #define     MATCHS(s)                           LEXER->matchs(LEXER, s)
139 #define     MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
140 #define     MATCHANY()                          LEXER->matchAny(LEXER)
141 #define     LTOKEN                              LEXSTATE->token
142 #define     HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
143 #define     BACKTRACKING                        LEXSTATE->backtracking
144 #define     FAILEDFLAG                          LEXSTATE->failed
145 #define     INPUT                                       LEXER->input
146 #define     STRSTREAM                           INPUT
147 #define         ISTREAM                                 INPUT->istream
148 #define         INDEX()                                 ISTREAM->index(ISTREAM)
149 #define         SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
150 #define     EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
151 #define     HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
152 #define     EXCEPTION                           LEXSTATE->exception
153 #define     CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
154 #define     LRECOVER()                          LEXER->recover(LEXER)
155 #define     MARK()                                      ISTREAM->mark(ISTREAM)
156 #define     REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
157 #define     REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
158 #define         MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
159 #define         HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
160 #define         PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
161 #define         POPSTREAM()                             LEXER->popCharStream(LEXER)
162 #define         SETTEXT(str)                    LEXSTATE->text = str
163 #define         SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
164 #define         USER1                                   LEXSTATE->user1
165 #define         USER2                                   LEXSTATE->user2
166 #define         USER3                                   LEXSTATE->user3
167 #define         CUSTOM                                  LEXSTATE->custom
168 #define         RULEMEMO                                LEXSTATE->ruleMemo
169 #define         DBG                                             RECOGNIZER->debugger
170
171 /* If we have been told we can rely on the standard 8 bit or 16 bit input
172  * stream, then we can define our macros to use the direct pointers
173  * in the input object, which is much faster than indirect calls. This
174  * is really only significant to lexers with a lot of fragment rules (which
175  * do not place LA(1) in a temporary at the moment) and even then
176  * only if there is a lot of input (order of say 1M or so).
177  */
178 #if     defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
179
180 # ifdef ANTLR3_INLINE_INPUT_ASCII
181
182 /* 8 bit "ASCII" (actually any 8 bit character set) */
183
184 #  define           NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
185 #  define           DATAP                               ((pANTLR3_UINT8)(INPUT->data))
186
187 # else
188
189 #  define           NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
190 #  define           DATAP                               ((pANTLR3_UINT16)(INPUT->data))
191
192 # endif
193
194 # define            LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
195 # define            CONSUME()                                                                                   \
196 {                                                                                                                                       \
197     if  (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
198     {                                                                                                                           \
199                 INPUT->charPositionInLine++;                                                            \
200                 if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
201                 {                                                                                                                       \
202                         INPUT->line++;                                                                                  \
203                         INPUT->charPositionInLine       = 0;                                            \
204                         INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
205                 }                                                                                                                       \
206                 INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
207     }                                                                                                                           \
208 }
209
210 #else
211
212 // Pick up the input character by calling the input stream implementation.
213 //
214 #define     CONSUME()                           INPUT->istream->consume(INPUT->istream)
215 #define     LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
216
217 #endif
218 #define         TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
219
220 /* The 4 tokens defined below may well clash with your own #defines or token types. If so
221  * then for the present you must use different names for your defines as these are hard coded
222  * in the code generator. It would be better not to use such names internally, and maybe
223  * we can change this in a forthcoming release. I deliberately do not #undef these
224  * here as this will at least give you a redefined error somewhere if they clash.
225  */
226 #define     UP      ANTLR3_TOKEN_UP
227 #define     DOWN    ANTLR3_TOKEN_DOWN
228 #define     EOR     ANTLR3_TOKEN_EOR
229 #define     INVALID ANTLR3_TOKEN_INVALID
230
231
232 /* =============================================================================
233  * Functions to create and destroy scopes. First come the rule scopes, followed
234  * by the global declared scopes.
235  */
236
237
238
239 /* ============================================================================= */
240
241 /* =============================================================================
242  * Start of recognizer
243  */
244
245
246 /* Forward declare the locally static matching functions we have generated and any predicate functions.
247  */
248 static ANTLR3_INLINE  void      mT__10    (pLangLexer ctx);
249 static ANTLR3_INLINE  void      mINTTYPE    (pLangLexer ctx);
250 static ANTLR3_INLINE  void      mFLOATTYPE    (pLangLexer ctx);
251 static ANTLR3_INLINE  void      mID    (pLangLexer ctx);
252 static ANTLR3_INLINE  void      mINT    (pLangLexer ctx);
253 static ANTLR3_INLINE  void      mWS    (pLangLexer ctx);
254 static ANTLR3_INLINE  void      mTokens    (pLangLexer ctx);
255 static void     LangLexerFree(pLangLexer ctx);
256
257 /* =========================================================================
258  * Lexer matching rules end.
259  * =========================================================================
260  */
261
262
263
264 static void
265 LangLexerFree  (pLangLexer ctx)
266 {
267     LEXER->free(LEXER);
268     
269     ANTLR3_FREE(ctx);
270 }
271
272 /** \brief Name of the grammar file that generated this code
273  */
274 static const char fileName[] = "Lang.g";
275
276 /** \brief Return the name of the grammar file that generated this code.
277  */
278 static const char * getGrammarFileName()
279 {
280         return fileName;
281 }
282
283 /** \brief Create a new lexer called LangLexer
284  *
285  * \param[in]    instream Pointer to an initialized input stream
286  * \return 
287  *     - Success pLangLexer initialized for the lex start
288  *     - Fail NULL
289  */
290 ANTLR3_API pLangLexer LangLexerNew         
291 (pANTLR3_INPUT_STREAM instream)
292 {
293         // See if we can create a new lexer with the standard constructor
294         //
295         return LangLexerNewSSD(instream, NULL);
296 }
297
298 /** \brief Create a new lexer called LangLexer
299  *
300  * \param[in]    instream Pointer to an initialized input stream
301  * \param[state] state Previously created shared recognizer stat
302  * \return 
303  *     - Success pLangLexer initialized for the lex start
304  *     - Fail NULL
305  */
306 ANTLR3_API pLangLexer LangLexerNewSSD         
307 (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
308 {
309     pLangLexer ctx; // Context structure we will build and return
310
311     ctx = (pLangLexer) ANTLR3_CALLOC(1, sizeof(LangLexer));
312
313     if  (ctx == NULL)
314     {
315         // Failed to allocate memory for lexer context
316         return  NULL;
317     }
318
319     /* -------------------------------------------------------------------
320      * Memory for basic structure is allocated, now to fill in
321      * in base ANTLR3 structures. We initialize the function pointers
322      * for the standard ANTLR3 lexer function set, but upon return
323      * from here, the programmer may set the pointers to provide custom
324      * implementations of each function. 
325      *
326      * We don't use the macros defined in LangLexer.h here so you can get a sense
327      * of what goes where.
328      */
329     
330     /* Create a base lexer, using the supplied input stream
331      */
332     ctx->pLexer = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
333     
334     /* Check that we allocated the memory correctly
335      */
336     if  (ctx->pLexer == NULL)
337     {
338                 ANTLR3_FREE(ctx);
339                 return  NULL;
340     }
341     /* Install the implementation of our LangLexer interface
342      */
343     ctx->mT__10 = mT__10;
344     ctx->mINTTYPE       = mINTTYPE;
345     ctx->mFLOATTYPE     = mFLOATTYPE;
346     ctx->mID    = mID;
347     ctx->mINT   = mINT;
348     ctx->mWS    = mWS;
349     ctx->mTokens        = mTokens;
350     
351     /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
352      *  it will call mTokens() in this generated code, and will pass it the ctx
353      * pointer of this lexer, not the context of the base lexer, so store that now.
354      */
355     ctx->pLexer->ctx        = ctx;
356     
357     /**Install the token matching function
358      */
359     ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
360     
361     ctx->getGrammarFileName     = getGrammarFileName;
362     ctx->free           = LangLexerFree;
363
364     
365     
366
367
368     /* Return the newly built lexer to the caller
369      */
370     return  ctx;
371 }
372  
373
374 /* =========================================================================
375  * Functions to match the lexer grammar defined tokens from the input stream
376  */
377
378 //   Comes from: 7:7: ( ';' )
379 /** \brief Lexer rule generated by ANTLR3
380  *
381  * $ANTLR start T__10
382  *
383  * Looks to match the characters the constitute the token T__10
384  * from the attached input stream.
385  *
386  *
387  * \remark
388  *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
389  */
390 static ANTLR3_INLINE
391 void mT__10(pLangLexer ctx)
392 {
393         ANTLR3_UINT32   _type;
394
395     _type           = T__10;
396        
397     
398     // Lang.g:7:7: ( ';' )
399     // Lang.g:7:9: ';'
400     {
401         MATCHC(';'); 
402         if  (HASEXCEPTION())
403         {
404             goto ruleT__10Ex;
405         }
406
407
408     }
409
410         LEXSTATE->type = _type;
411
412     // This is where rules clean up and exit
413     //
414     goto ruleT__10Ex; /* Prevent compiler warnings */
415     ruleT__10Ex: ;
416
417 }
418 // $ANTLR end T__10
419
420 //   Comes from: 30:13: ( 'int' )
421 /** \brief Lexer rule generated by ANTLR3
422  *
423  * $ANTLR start INTTYPE
424  *
425  * Looks to match the characters the constitute the token INTTYPE
426  * from the attached input stream.
427  *
428  *
429  * \remark
430  *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
431  */
432 static ANTLR3_INLINE
433 void mINTTYPE(pLangLexer ctx)
434 {
435         ANTLR3_UINT32   _type;
436
437     _type           = INTTYPE;
438        
439     
440     // Lang.g:30:13: ( 'int' )
441     // Lang.g:30:15: 'int'
442     {
443         MATCHS(lit_1); 
444         if  (HASEXCEPTION())
445         {
446             goto ruleINTTYPEEx;
447         }
448
449
450
451     }
452
453         LEXSTATE->type = _type;
454
455     // This is where rules clean up and exit
456     //
457     goto ruleINTTYPEEx; /* Prevent compiler warnings */
458     ruleINTTYPEEx: ;
459
460 }
461 // $ANTLR end INTTYPE
462
463 //   Comes from: 31:13: ( 'float' )
464 /** \brief Lexer rule generated by ANTLR3
465  *
466  * $ANTLR start FLOATTYPE
467  *
468  * Looks to match the characters the constitute the token FLOATTYPE
469  * from the attached input stream.
470  *
471  *
472  * \remark
473  *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
474  */
475 static ANTLR3_INLINE
476 void mFLOATTYPE(pLangLexer ctx)
477 {
478         ANTLR3_UINT32   _type;
479
480     _type           = FLOATTYPE;
481        
482     
483     // Lang.g:31:13: ( 'float' )
484     // Lang.g:31:15: 'float'
485     {
486         MATCHS(lit_2); 
487         if  (HASEXCEPTION())
488         {
489             goto ruleFLOATTYPEEx;
490         }
491
492
493
494     }
495
496         LEXSTATE->type = _type;
497
498     // This is where rules clean up and exit
499     //
500     goto ruleFLOATTYPEEx; /* Prevent compiler warnings */
501     ruleFLOATTYPEEx: ;
502
503 }
504 // $ANTLR end FLOATTYPE
505
506 //   Comes from: 32:8: ( ( 'a' .. 'z' )+ )
507 /** \brief Lexer rule generated by ANTLR3
508  *
509  * $ANTLR start ID
510  *
511  * Looks to match the characters the constitute the token ID
512  * from the attached input stream.
513  *
514  *
515  * \remark
516  *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
517  */
518 static ANTLR3_INLINE
519 void mID(pLangLexer ctx)
520 {
521         ANTLR3_UINT32   _type;
522
523     _type           = ID;
524        
525     
526     // Lang.g:32:8: ( ( 'a' .. 'z' )+ )
527     // Lang.g:32:10: ( 'a' .. 'z' )+
528     {
529         // Lang.g:32:10: ( 'a' .. 'z' )+
530         {
531             int cnt1=0;
532
533             for (;;)
534             {
535                 int alt1=2;
536                 switch ( LA(1) ) 
537                 {
538                 case 'a':
539                 case 'b':
540                 case 'c':
541                 case 'd':
542                 case 'e':
543                 case 'f':
544                 case 'g':
545                 case 'h':
546                 case 'i':
547                 case 'j':
548                 case 'k':
549                 case 'l':
550                 case 'm':
551                 case 'n':
552                 case 'o':
553                 case 'p':
554                 case 'q':
555                 case 'r':
556                 case 's':
557                 case 't':
558                 case 'u':
559                 case 'v':
560                 case 'w':
561                 case 'x':
562                 case 'y':
563                 case 'z':
564                         {
565                                 alt1=1;
566                         }
567                     break;
568
569                 }
570
571                 switch (alt1) 
572                 {
573                     case 1:
574                         // Lang.g:32:10: 'a' .. 'z'
575                         {
576                             MATCHRANGE('a', 'z'); 
577                             if  (HASEXCEPTION())
578                             {
579                                 goto ruleIDEx;
580                             }
581
582
583                         }
584                         break;
585
586                     default:
587                     
588                         if ( cnt1 >= 1 )
589                         {
590                             goto loop1;
591                         }
592                         /* mismatchedSetEx()
593                          */
594                         CONSTRUCTEX();
595                         EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
596                         EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
597
598
599                         goto ruleIDEx;
600                 }
601                 cnt1++;
602             }
603             loop1: ;    /* Jump to here if this rule does not match */
604         }
605
606     }
607
608         LEXSTATE->type = _type;
609
610     // This is where rules clean up and exit
611     //
612     goto ruleIDEx; /* Prevent compiler warnings */
613     ruleIDEx: ;
614
615 }
616 // $ANTLR end ID
617
618 //   Comes from: 33:9: ( ( '0' .. '9' )+ )
619 /** \brief Lexer rule generated by ANTLR3
620  *
621  * $ANTLR start INT
622  *
623  * Looks to match the characters the constitute the token INT
624  * from the attached input stream.
625  *
626  *
627  * \remark
628  *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
629  */
630 static ANTLR3_INLINE
631 void mINT(pLangLexer ctx)
632 {
633         ANTLR3_UINT32   _type;
634
635     _type           = INT;
636        
637     
638     // Lang.g:33:9: ( ( '0' .. '9' )+ )
639     // Lang.g:33:11: ( '0' .. '9' )+
640     {
641         // Lang.g:33:11: ( '0' .. '9' )+
642         {
643             int cnt2=0;
644
645             for (;;)
646             {
647                 int alt2=2;
648                 switch ( LA(1) ) 
649                 {
650                 case '0':
651                 case '1':
652                 case '2':
653                 case '3':
654                 case '4':
655                 case '5':
656                 case '6':
657                 case '7':
658                 case '8':
659                 case '9':
660                         {
661                                 alt2=1;
662                         }
663                     break;
664
665                 }
666
667                 switch (alt2) 
668                 {
669                     case 1:
670                         // Lang.g:33:11: '0' .. '9'
671                         {
672                             MATCHRANGE('0', '9'); 
673                             if  (HASEXCEPTION())
674                             {
675                                 goto ruleINTEx;
676                             }
677
678
679                         }
680                         break;
681
682                     default:
683                     
684                         if ( cnt2 >= 1 )
685                         {
686                             goto loop2;
687                         }
688                         /* mismatchedSetEx()
689                          */
690                         CONSTRUCTEX();
691                         EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
692                         EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
693
694
695                         goto ruleINTEx;
696                 }
697                 cnt2++;
698             }
699             loop2: ;    /* Jump to here if this rule does not match */
700         }
701
702     }
703
704         LEXSTATE->type = _type;
705
706     // This is where rules clean up and exit
707     //
708     goto ruleINTEx; /* Prevent compiler warnings */
709     ruleINTEx: ;
710
711 }
712 // $ANTLR end INT
713
714 //   Comes from: 34:8: ( ( ' ' | '\\n' | '\\r' ) )
715 /** \brief Lexer rule generated by ANTLR3
716  *
717  * $ANTLR start WS
718  *
719  * Looks to match the characters the constitute the token WS
720  * from the attached input stream.
721  *
722  *
723  * \remark
724  *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
725  */
726 static ANTLR3_INLINE
727 void mWS(pLangLexer ctx)
728 {
729         ANTLR3_UINT32   _type;
730
731     _type           = WS;
732        
733     
734     // Lang.g:34:8: ( ( ' ' | '\\n' | '\\r' ) )
735     // Lang.g:34:10: ( ' ' | '\\n' | '\\r' )
736     {
737         if ( LA(1) == '\n' || LA(1) == '\r' || LA(1) == ' ' )
738         {
739             CONSUME();
740
741         }
742         else 
743         {
744             CONSTRUCTEX();
745             EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
746             EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
747
748             LRECOVER();    goto ruleWSEx;
749         }
750
751         {
752             LEXSTATE->channel=HIDDEN;
753         }
754
755     }
756
757         LEXSTATE->type = _type;
758
759     // This is where rules clean up and exit
760     //
761     goto ruleWSEx; /* Prevent compiler warnings */
762     ruleWSEx: ;
763
764 }
765 // $ANTLR end WS
766
767 /** This is the entry point in to the lexer from an object that
768  *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
769  */
770 static void 
771 mTokens(pLangLexer ctx)
772 {
773     {
774         //  Lang.g:1:8: ( T__10 | INTTYPE | FLOATTYPE | ID | INT | WS )
775         
776         ANTLR3_UINT32 alt3;
777
778         alt3=6;
779
780         switch ( LA(1) ) 
781         {
782         case ';':
783                 {
784                         alt3=1;
785                 }
786             break;
787         case 'i':
788                 {
789                         switch ( LA(2) ) 
790                         {
791                         case 'n':
792                                 {
793                                         switch ( LA(3) ) 
794                                         {
795                                         case 't':
796                                                 {
797                                                         switch ( LA(4) ) 
798                                                         {
799                                                         case 'a':
800                                                         case 'b':
801                                                         case 'c':
802                                                         case 'd':
803                                                         case 'e':
804                                                         case 'f':
805                                                         case 'g':
806                                                         case 'h':
807                                                         case 'i':
808                                                         case 'j':
809                                                         case 'k':
810                                                         case 'l':
811                                                         case 'm':
812                                                         case 'n':
813                                                         case 'o':
814                                                         case 'p':
815                                                         case 'q':
816                                                         case 'r':
817                                                         case 's':
818                                                         case 't':
819                                                         case 'u':
820                                                         case 'v':
821                                                         case 'w':
822                                                         case 'x':
823                                                         case 'y':
824                                                         case 'z':
825                                                                 {
826                                                                         alt3=4;
827                                                                 }
828                                                             break;
829
830                                                         default:
831                                                             alt3=2;}
832
833                                                 }
834                                             break;
835
836                                         default:
837                                             alt3=4;}
838
839                                 }
840                             break;
841
842                         default:
843                             alt3=4;}
844
845                 }
846             break;
847         case 'f':
848                 {
849                         switch ( LA(2) ) 
850                         {
851                         case 'l':
852                                 {
853                                         switch ( LA(3) ) 
854                                         {
855                                         case 'o':
856                                                 {
857                                                         switch ( LA(4) ) 
858                                                         {
859                                                         case 'a':
860                                                                 {
861                                                                         switch ( LA(5) ) 
862                                                                         {
863                                                                         case 't':
864                                                                                 {
865                                                                                         switch ( LA(6) ) 
866                                                                                         {
867                                                                                         case 'a':
868                                                                                         case 'b':
869                                                                                         case 'c':
870                                                                                         case 'd':
871                                                                                         case 'e':
872                                                                                         case 'f':
873                                                                                         case 'g':
874                                                                                         case 'h':
875                                                                                         case 'i':
876                                                                                         case 'j':
877                                                                                         case 'k':
878                                                                                         case 'l':
879                                                                                         case 'm':
880                                                                                         case 'n':
881                                                                                         case 'o':
882                                                                                         case 'p':
883                                                                                         case 'q':
884                                                                                         case 'r':
885                                                                                         case 's':
886                                                                                         case 't':
887                                                                                         case 'u':
888                                                                                         case 'v':
889                                                                                         case 'w':
890                                                                                         case 'x':
891                                                                                         case 'y':
892                                                                                         case 'z':
893                                                                                                 {
894                                                                                                         alt3=4;
895                                                                                                 }
896                                                                                             break;
897
898                                                                                         default:
899                                                                                             alt3=3;}
900
901                                                                                 }
902                                                                             break;
903
904                                                                         default:
905                                                                             alt3=4;}
906
907                                                                 }
908                                                             break;
909
910                                                         default:
911                                                             alt3=4;}
912
913                                                 }
914                                             break;
915
916                                         default:
917                                             alt3=4;}
918
919                                 }
920                             break;
921
922                         default:
923                             alt3=4;}
924
925                 }
926             break;
927         case 'a':
928         case 'b':
929         case 'c':
930         case 'd':
931         case 'e':
932         case 'g':
933         case 'h':
934         case 'j':
935         case 'k':
936         case 'l':
937         case 'm':
938         case 'n':
939         case 'o':
940         case 'p':
941         case 'q':
942         case 'r':
943         case 's':
944         case 't':
945         case 'u':
946         case 'v':
947         case 'w':
948         case 'x':
949         case 'y':
950         case 'z':
951                 {
952                         alt3=4;
953                 }
954             break;
955         case '0':
956         case '1':
957         case '2':
958         case '3':
959         case '4':
960         case '5':
961         case '6':
962         case '7':
963         case '8':
964         case '9':
965                 {
966                         alt3=5;
967                 }
968             break;
969         case '\n':
970         case '\r':
971         case ' ':
972                 {
973                         alt3=6;
974                 }
975             break;
976
977         default:
978             CONSTRUCTEX();
979             EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
980             EXCEPTION->message      = (void *)"";
981             EXCEPTION->decisionNum  = 3;
982             EXCEPTION->state        = 0;
983
984
985             goto ruleTokensEx;
986         }
987
988         switch (alt3) 
989         {
990         case 1:
991             // Lang.g:1:10: T__10
992             {
993                 /* 1:10: T__10 */
994                 mT__10(ctx ); 
995                 if  (HASEXCEPTION())
996                 {
997                     goto ruleTokensEx;
998                 }
999
1000
1001             }
1002             break;
1003         case 2:
1004             // Lang.g:1:16: INTTYPE
1005             {
1006                 /* 1:16: INTTYPE */
1007                 mINTTYPE(ctx ); 
1008                 if  (HASEXCEPTION())
1009                 {
1010                     goto ruleTokensEx;
1011                 }
1012
1013
1014             }
1015             break;
1016         case 3:
1017             // Lang.g:1:24: FLOATTYPE
1018             {
1019                 /* 1:24: FLOATTYPE */
1020                 mFLOATTYPE(ctx ); 
1021                 if  (HASEXCEPTION())
1022                 {
1023                     goto ruleTokensEx;
1024                 }
1025
1026
1027             }
1028             break;
1029         case 4:
1030             // Lang.g:1:34: ID
1031             {
1032                 /* 1:34: ID */
1033                 mID(ctx ); 
1034                 if  (HASEXCEPTION())
1035                 {
1036                     goto ruleTokensEx;
1037                 }
1038
1039
1040             }
1041             break;
1042         case 5:
1043             // Lang.g:1:37: INT
1044             {
1045                 /* 1:37: INT */
1046                 mINT(ctx ); 
1047                 if  (HASEXCEPTION())
1048                 {
1049                     goto ruleTokensEx;
1050                 }
1051
1052
1053             }
1054             break;
1055         case 6:
1056             // Lang.g:1:41: WS
1057             {
1058                 /* 1:41: WS */
1059                 mWS(ctx ); 
1060                 if  (HASEXCEPTION())
1061                 {
1062                     goto ruleTokensEx;
1063                 }
1064
1065
1066             }
1067             break;
1068
1069         }
1070     }
1071
1072     
1073     goto ruleTokensEx; /* Prevent compiler warnings */
1074 ruleTokensEx: ;
1075 }
1076
1077 /* =========================================================================
1078  * Lexer matching rules end.
1079  * =========================================================================
1080  */
1081 /* End of Lexer code
1082  * ================================================
1083  * ================================================
1084  */ 
1085
1086
1087 /* End of code
1088  * =============================================================================
1089  */