]> git.draconx.ca Git - gob-dx.git/blob - src/lexer.c
Release 0.92.0
[gob-dx.git] / src / lexer.c
1 /* A lexical scanner generated by flex */
2
3 /* Scanner skeleton version:
4  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
5  */
6
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
10
11 #include <stdio.h>
12
13
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
20
21
22 #ifdef __cplusplus
23
24 #include <stdlib.h>
25 #include <unistd.h>
26
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
29
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
32
33 #else   /* ! __cplusplus */
34
35 #if __STDC__
36
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
39
40 #endif  /* __STDC__ */
41 #endif  /* ! __cplusplus */
42
43 #ifdef __TURBOC__
44  #pragma warn -rch
45  #pragma warn -use
46 #include <io.h>
47 #include <stdlib.h>
48 #define YY_USE_CONST
49 #define YY_USE_PROTOS
50 #endif
51
52 #ifdef YY_USE_CONST
53 #define yyconst const
54 #else
55 #define yyconst
56 #endif
57
58
59 #ifdef YY_USE_PROTOS
60 #define YY_PROTO(proto) proto
61 #else
62 #define YY_PROTO(proto) ()
63 #endif
64
65 /* Returned upon end-of-file. */
66 #define YY_NULL 0
67
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69  * integer for use as an array index.  If the signed char is negative,
70  * we want to instead treat it as an 8-bit unsigned char, hence the
71  * double cast.
72  */
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74
75 /* Enter a start condition.  This macro really ought to take a parameter,
76  * but we do it the disgusting crufty way forced on us by the ()-less
77  * definition of BEGIN.
78  */
79 #define BEGIN yy_start = 1 + 2 *
80
81 /* Translate the current start state into a value that can be later handed
82  * to BEGIN to return to the state.  The YYSTATE alias is for lex
83  * compatibility.
84  */
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
87
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
93
94 #define YY_END_OF_BUFFER_CHAR 0
95
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
98
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
100
101 extern int yyleng;
102 extern FILE *yyin, *yyout;
103
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
107
108 /* The funky do-while in the following #define is used to turn the definition
109  * int a single C statement (which needs a semi-colon terminator).  This
110  * avoids problems with code like:
111  *
112  *      if ( condition_holds )
113  *              yyless( 5 );
114  *      else
115  *              do_something_else();
116  *
117  * Prior to using the do-while the compiler would get upset at the
118  * "else" because it interpreted the "if" statement as being all
119  * done when it reached the ';' after the yyless() call.
120  */
121
122 /* Return all but the first 'n' matched characters back to the input stream. */
123
124 #define yyless(n) \
125         do \
126                 { \
127                 /* Undo effects of setting up yytext. */ \
128                 *yy_cp = yy_hold_char; \
129                 YY_RESTORE_YY_MORE_OFFSET \
130                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
132                 } \
133         while ( 0 )
134
135 #define unput(c) yyunput( c, yytext_ptr )
136
137 /* The following is because we cannot portably get our hands on size_t
138  * (without autoconf's help, which isn't available because we want
139  * flex-generated scanners to compile on their own).
140  */
141 typedef unsigned int yy_size_t;
142
143
144 struct yy_buffer_state
145         {
146         FILE *yy_input_file;
147
148         char *yy_ch_buf;                /* input buffer */
149         char *yy_buf_pos;               /* current position in input buffer */
150
151         /* Size of input buffer in bytes, not including room for EOB
152          * characters.
153          */
154         yy_size_t yy_buf_size;
155
156         /* Number of characters read into yy_ch_buf, not including EOB
157          * characters.
158          */
159         int yy_n_chars;
160
161         /* Whether we "own" the buffer - i.e., we know we created it,
162          * and can realloc() it to grow it, and should free() it to
163          * delete it.
164          */
165         int yy_is_our_buffer;
166
167         /* Whether this is an "interactive" input source; if so, and
168          * if we're using stdio for input, then we want to use getc()
169          * instead of fread(), to make sure we stop fetching input after
170          * each newline.
171          */
172         int yy_is_interactive;
173
174         /* Whether we're considered to be at the beginning of a line.
175          * If so, '^' rules will be active on the next match, otherwise
176          * not.
177          */
178         int yy_at_bol;
179
180         /* Whether to try to fill the input buffer when we reach the
181          * end of it.
182          */
183         int yy_fill_buffer;
184
185         int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188         /* When an EOF's been seen but there's still some text to process
189          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190          * shouldn't try reading from the input source any more.  We might
191          * still have a bunch of tokens to match, though, because of
192          * possible backing-up.
193          *
194          * When we actually see the EOF, we change the status to "new"
195          * (via yyrestart()), so that the user can continue scanning by
196          * just pointing yyin at a new input file.
197          */
198 #define YY_BUFFER_EOF_PENDING 2
199         };
200
201 static YY_BUFFER_STATE yy_current_buffer = 0;
202
203 /* We provide macros for accessing buffer states in case in the
204  * future we want to put the buffer states in a more general
205  * "scanner state".
206  */
207 #define YY_CURRENT_BUFFER yy_current_buffer
208
209
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
212
213 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
214
215
216 int yyleng;
217
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p = (char *) 0;
220 static int yy_init = 1;         /* whether we need to initialize */
221 static int yy_start = 0;        /* start state number */
222
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224  * instead of setting up a fresh yyin.  A bit of a hack ...
225  */
226 static int yy_did_buffer_switch_on_eof;
227
228 void yyrestart YY_PROTO(( FILE *input_file ));
229
230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231 void yy_load_buffer_state YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
237
238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
241
242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244 static void yy_flex_free YY_PROTO(( void * ));
245
246 #define yy_new_buffer yy_create_buffer
247
248 #define yy_set_interactive(is_interactive) \
249         { \
250         if ( ! yy_current_buffer ) \
251                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252         yy_current_buffer->yy_is_interactive = is_interactive; \
253         }
254
255 #define yy_set_bol(at_bol) \
256         { \
257         if ( ! yy_current_buffer ) \
258                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259         yy_current_buffer->yy_at_bol = at_bol; \
260         }
261
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263
264
265 #define YY_USES_REJECT
266 typedef unsigned char YY_CHAR;
267 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
268 typedef int yy_state_type;
269 extern char *yytext;
270 #define yytext_ptr yytext
271
272 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
273 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
274 static int yy_get_next_buffer YY_PROTO(( void ));
275 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
276
277 /* Done after the current pattern has been matched and before the
278  * corresponding action - sets up yytext.
279  */
280 #define YY_DO_BEFORE_ACTION \
281         yytext_ptr = yy_bp; \
282         yyleng = (int) (yy_cp - yy_bp); \
283         yy_hold_char = *yy_cp; \
284         *yy_cp = '\0'; \
285         yy_c_buf_p = yy_cp;
286
287 #define YY_NUM_RULES 69
288 #define YY_END_OF_BUFFER 70
289 static yyconst short int yy_acclist[351] =
290     {   0,
291        70,   67,   69,   66,   67,   69,    1,   68,   69,   67,
292        68,   69,   67,   69,   67,   69,   67,   69,   67,   69,
293        13,   67,   69,    1,   14,   68,   69,   13,   67,   68,
294        69,   13,   67,   69,   13,   67,   69,   32,   67,   69,
295         1,   33,   68,   69,   32,   67,   68,   69,   25,   32,
296        67,   69,   32,   67,   69,   32,   67,   69,   32,   67,
297        69,   32,   67,   69,   30,   32,   67,   69,   31,   32,
298        67,   69,   32,   67,   69,   32,   67,   69,   28,   67,
299        69,    1,   29,   68,   69,   28,   67,   68,   69,   27,
300        28,   67,   69,   28,   67,   69,   28,   67,   69,   67,
301
302        69,   67,   69,   61,   67,   69,   61,   67,   69,   61,
303        67,   69,   61,   67,   69,   61,   67,   69,   63,   67,
304        69,   67,   69,   67,   69,   59,   67,   69,   59,   67,
305        69,   67,   69,   61,   67,   69,   61,   67,   69,   61,
306        67,   69,   61,   67,   69,   61,   67,   69,   61,   67,
307        69,   61,   67,   69,   61,   67,   69,   61,   67,   69,
308        61,   67,   69,   61,   67,   69,   61,   67,   69,   64,
309        67,   69,   65,   67,   69,    8,   16,   12,    9,   24,
310        17,   26,   10,   61,   60,   61,   61,   61,   61,   59,
311        11,   59,   59,   62,   61,   61,   61,   61,   61,   61,
312
313        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
314        61,   61,    3,   15,   22,   18,   20,    5,    6,   60,
315        61,   61,   61,   61,   50,   59,    7,   59,   59,   61,
316        61,   61,   61,   61,   61,   45,   61,   61,   61,   61,
317        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
318        23,   19,   21,   61,   61,   36,   61,   35,   61,   61,
319        48,   61,   61,   61,   40,   61,   61,   43,   61,   61,
320        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
321        37,   61,   34,   61,   61,   49,   61,   61,   46,   61,
322        61,   61,   61,   61,   61,   44,   61,   61,   61,   61,
323
324        39,   61,   61,   61,   61,   61,   47,   61,   61,   61,
325        61,   61,   51,   61,   56,   61,   41,   61,   38,   61,
326        61,   61,   61,   61,   58,   61,   61,   52,   61,   61,
327        61,   55,   61,   61,   54,   61,   57,   61,   61,   42,
328        61,   61,   53,   61,   61,    4,   61,    2,    2,   61
329     } ;
330
331 static yyconst short int yy_accept[273] =
332     {   0,
333         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
334         1,    1,    1,    2,    4,    7,   10,   13,   15,   17,
335        19,   21,   24,   28,   32,   35,   38,   41,   45,   49,
336        53,   56,   59,   62,   65,   69,   73,   76,   79,   82,
337        86,   90,   94,   97,  100,  102,  104,  107,  110,  113,
338       116,  119,  122,  124,  126,  129,  132,  134,  137,  140,
339       143,  146,  149,  152,  155,  158,  161,  164,  167,  170,
340       173,  176,  177,  177,  177,  177,  177,  178,  179,  179,
341       179,  179,  179,  180,  180,  181,  181,  181,  182,  183,
342       184,  184,  184,  185,  186,  187,  188,  189,  190,  190,
343
344       191,  192,  192,  192,  193,  193,  193,  194,  194,  195,
345       196,  197,  198,  199,  200,  201,  202,  203,  204,  205,
346       206,  207,  208,  209,  210,  211,  212,  213,  213,  214,
347       214,  214,  215,  216,  216,  216,  216,  217,  218,  218,
348       219,  219,  219,  220,  220,  221,  222,  223,  224,  225,
349       226,  227,  227,  228,  229,  230,  230,  231,  232,  233,
350       234,  235,  236,  238,  239,  240,  241,  242,  243,  244,
351       245,  246,  247,  248,  249,  250,  251,  251,  251,  252,
352       253,  254,  254,  255,  256,  258,  260,  261,  263,  264,
353       265,  267,  268,  270,  271,  272,  273,  274,  275,  276,
354
355       277,  278,  279,  280,  281,  283,  283,  284,  284,  285,
356       286,  288,  289,  291,  292,  293,  294,  295,  296,  298,
357       299,  300,  301,  303,  304,  305,  305,  305,  306,  307,
358       309,  310,  311,  312,  313,  315,  317,  319,  321,  322,
359       323,  323,  323,  324,  325,  327,  328,  330,  331,  332,
360       334,  334,  334,  335,  337,  339,  340,  342,  342,  342,
361       343,  345,  345,  345,  346,  346,  346,  347,  348,  349,
362       351,  351
363     } ;
364
365 static yyconst int yy_ec[256] =
366     {   0,
367         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
368         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
369         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
370         1,    2,    1,    5,    6,    1,    7,    1,    8,    1,
371         1,    9,    1,    1,    1,   10,   11,   12,   13,   13,
372        13,   13,   13,   13,   13,   14,   14,   15,    1,   16,
373         1,   17,    1,    1,   18,   18,   19,   18,   20,   21,
374        22,   23,   22,   22,   24,   22,   25,   22,   26,   22,
375        22,   27,   22,   28,   29,   22,   22,   22,   22,   22,
376        30,   31,   32,    1,   22,    1,   33,   34,   35,   36,
377
378        37,   38,   39,   40,   41,   22,   22,   42,   43,   44,
379        45,   46,   22,   47,   48,   49,   50,   51,   22,   52,
380        22,   22,   53,    1,   54,    1,    1,    1,    1,    1,
381         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
382         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
383         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
384         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
385         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
386         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
387         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
388
389         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
390         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
391         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
392         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
393         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
394         1,    1,    1,    1,    1
395     } ;
396
397 static yyconst int yy_meta[55] =
398     {   0,
399         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
400         1,    3,    3,    3,    4,    1,    1,    5,    5,    5,
401         5,    6,    6,    6,    6,    6,    6,    6,    6,    1,
402         1,    1,    5,    5,    5,    5,    5,    5,    6,    6,
403         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
404         6,    6,    1,    1
405     } ;
406
407 static yyconst short int yy_base[288] =
408     {   0,
409         0,    3,    9,   12,   36,   88,   26,   45,  142,    0,
410       187,    0,  586,  587,  587,  587,  587,    8,  559,  542,
411         2,  587,  587,  587,  572,  556,  587,  587,  587,  587,
412        15,   13,  555,    0,  587,  587,   21,  526,  587,  587,
413       587,  587,  553,    0,   34,    0,  563,   37,   11,   12,
414        18,  587,   61,   45,   68,   73,   52,   57,   82,   62,
415        64,   73,   85,   83,   86,   88,   91,   90,  189,  587,
416       587,  587,  574,  548,  542,  521,  587,  587,  565,  197,
417       564,  563,  587,  567,  587,  201,  525,  587,  587,  587,
418       565,  552,  551,  550,   95,  103,   94,  190,  554,  194,
419
420       587,  560,  197,  202,  233,    0,  242,  245,  532,   21,
421       203,  204,  211,  212,  224,  229,  238,   96,  234,  245,
422        87,  248,  249,  250,  251,  253,  255,  558,  587,  537,
423       511,  587,  587,  550,  549,  548,  587,  587,  552,  587,
424       519,  550,  587,  537,  536,  102,  257,  252,  258,  587,
425       262,  547,  587,  267,    0,  271,  272,  274,  276,  279,
426       283,  286,  534,  289,  287,  292,  293,  294,  295,  299,
427       296,  297,  300,  301,  302,  305,  528,  499,  587,  587,
428       587,  504,  303,  310,  530,  529,  312,  528,  314,  315,
429       527,  316,  526,  317,  320,  321,  323,  318,  333,  335,
430
431       334,  337,  338,  341,  525,  512,  587,  488,   99,  346,
432       522,  347,  521,  351,  356,  355,  358,  359,  520,  360,
433       363,  361,  519,  364,  365,  512,  496,  371,  370,  516,
434       372,  373,  374,  375,  515,  514,  513,  508,  380,  385,
435       491,  439,  386,  388,  455,  391,  428,  392,  390,  427,
436       422,  438,   97,  424,  423,  397,  421,  410,  415,  398,
437       410,  201,  413,  401,  186,  418,  587,  417,  587,   17,
438       587,  444,  450,  456,  462,  468,  474,  476,  480,  486,
439       492,  498,  502,  506,  512,  516,  521
440     } ;
441
442 static yyconst short int yy_def[288] =
443     {   0,
444       272,  272,  273,  273,  274,  274,  275,  275,  271,    9,
445         9,   11,  271,  271,  271,  271,  271,  271,  271,  271,
446       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
447       271,  271,  271,  276,  271,  271,  271,  271,  271,  271,
448       271,  271,  271,  277,  271,  278,  279,  279,  279,  279,
449       279,  271,  271,  271,  271,  271,  271,  279,  279,  279,
450       279,  279,  279,  279,  279,  279,  279,  279,  279,  271,
451       271,  271,  280,  271,  271,  271,  271,  271,  271,  271,
452       271,  271,  271,  281,  271,  271,  271,  271,  271,  271,
453       282,  283,  279,  284,  279,  279,  279,  279,  271,  271,
454
455       271,  285,  271,  271,  271,  286,  271,  271,  271,  279,
456       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
457       279,  279,  279,  279,  279,  279,  279,  280,  271,  271,
458       271,  271,  271,  271,  271,  271,  271,  271,  281,  271,
459       271,  282,  271,  283,  284,  279,  279,  279,  279,  271,
460       271,  285,  271,  271,  286,  271,  279,  279,  279,  279,
461       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
462       279,  279,  279,  279,  279,  279,  271,  271,  271,  271,
463       271,  271,  279,  279,  279,  279,  279,  279,  279,  279,
464       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
465
466       279,  279,  279,  279,  279,  271,  271,  271,  279,  279,
467       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
468       279,  279,  279,  279,  279,  271,  271,  279,  279,  279,
469       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
470       271,  271,  279,  279,  279,  279,  279,  279,  279,  279,
471       271,  271,  279,  279,  279,  279,  279,  271,  271,  279,
472       279,  271,  287,  279,  271,  287,  271,  279,  271,  279,
473         0,  271,  271,  271,  271,  271,  271,  271,  271,  271,
474       271,  271,  271,  271,  271,  271,  271
475     } ;
476
477 static yyconst short int yy_nxt[642] =
478     {   0,
479       271,   15,   16,   17,   15,   16,   17,  271,  271,   21,
480        18,   23,   24,   18,   23,   24,   72,   25,   73,   79,
481        25,   83,   86,   84,   19,   94,   94,   19,   40,   41,
482        42,   94,   94,   26,   20,   94,   26,   20,   28,   29,
483        30,   76,   90,   31,   91,   80,   32,   40,   41,   42,
484        43,   94,   96,  101,   77,  102,   44,   98,   97,  157,
485        33,   87,   95,  108,  108,  108,   34,   81,   82,   43,
486        99,   94,  100,  100,  100,   44,   94,  103,   94,  104,
487       104,  105,  103,  109,  107,  107,  107,   94,   35,   36,
488        28,   29,   30,   37,   38,   31,   94,   94,   32,   94,
489
490        94,   94,   94,  110,   94,   94,  113,  114,   94,   94,
491        94,   94,   33,   94,  115,  260,   94,   94,   34,  106,
492       169,  111,  146,   96,  183,  228,  112,  117,  116,  118,
493       122,  123,  165,  125,  120,  147,  119,  121,  148,  124,
494        35,   36,   14,   15,   16,   17,   14,   14,   14,   14,
495        14,   14,   45,   14,   14,   14,   46,   14,   14,   47,
496        47,   47,   47,   47,   47,   47,   48,   47,   47,   47,
497        47,   14,   14,   14,   47,   47,   49,   47,   47,   50,
498        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
499        51,   47,   47,   47,   52,   14,   53,   54,   55,   56,
500
501        56,  134,   86,   94,   94,  151,  151,  151,  154,  154,
502       154,  103,  269,  104,  104,  105,   57,   94,   94,   58,
503       265,   59,   60,   61,   62,   94,   94,   63,   64,  126,
504       149,   65,   66,  127,   67,  158,   68,   69,   94,   70,
505        71,   87,  103,   94,  105,  105,  105,  159,   94,  135,
506       136,  103,   94,  107,  107,  107,  108,  108,  108,   94,
507       160,  161,   94,   94,   94,   94,   94,   94,  162,   94,
508       166,   94,   94,  151,  151,  151,  109,  163,  154,  154,
509       154,  164,  108,  108,  108,  167,   94,  171,   94,  168,
510        94,  173,  170,   94,  185,  176,  172,   94,  174,  175,
511
512        94,   94,  109,   94,  184,  186,   94,   94,   94,   94,
513        94,   94,  190,   94,   94,   94,   94,   94,  192,   94,
514       188,  187,  209,  189,   94,  191,   94,  193,   94,   94,
515        94,   94,   94,  194,   94,   94,  198,   94,  195,  200,
516       205,  203,  197,  196,  202,  199,  201,   94,   94,   94,
517       204,   94,   94,  216,  210,   94,  212,  186,  218,  217,
518        94,   94,  211,  214,  213,   94,  215,  220,  222,   94,
519        94,  221,   94,   94,   94,   94,  224,   94,   94,   94,
520       223,  219,  229,  230,   94,   94,   94,   94,   94,   94,
521       225,  243,  234,  235,   94,  231,  232,  240,  237,   94,
522
523        94,  236,   94,  233,   94,   94,   94,  239,  246,  238,
524       247,   94,   94,  244,  253,   94,  249,  267,  245,  263,
525       268,  264,  267,  248,   94,  257,  250,  255,  256,  267,
526       263,   94,  261,  262,  267,   94,  254,   94,   94,  259,
527       258,   94,   94,  270,   14,   14,   14,   14,   14,   14,
528        22,   22,   22,   22,   22,   22,   27,   27,   27,   27,
529        27,   27,   39,   39,   39,   39,   39,   39,   85,   94,
530        85,   85,   85,   85,   89,  252,   89,   89,   89,   89,
531        92,   92,   93,   93,   93,   93,  128,  128,  128,  128,
532       128,  128,  139,  139,  139,  139,  139,  139,  142,  142,
533
534       142,  142,  142,  142,  144,  144,  144,  144,  145,  145,
535       145,  145,  152,  152,  152,  152,  152,  152,  155,  251,
536       155,  266,   94,  266,  266,  266,  266,   94,   94,   94,
537        94,  242,  241,   94,   94,   94,   94,  227,  226,   94,
538        94,   94,   94,   94,   94,  208,  207,  206,   94,  153,
539        94,   94,  143,  182,  140,  181,  180,  179,  178,  177,
540       129,  156,  153,  150,   94,   94,   94,  143,  141,  140,
541       138,  137,  133,  132,  131,  130,  129,   94,   74,   88,
542        74,   74,   78,   75,   74,  271,   13,  271,  271,  271,
543       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
544
545       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
546       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
547       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
548       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
549       271
550     } ;
551
552 static yyconst short int yy_chk[642] =
553     {   0,
554         0,    1,    1,    1,    2,    2,    2,    0,    0,    2,
555         1,    3,    3,    2,    4,    4,   18,    3,   18,   31,
556         4,   32,   37,   32,    1,   49,   50,    2,    7,    7,
557         7,  270,   51,    3,    1,  110,    4,    2,    5,    5,
558         5,   21,   45,    5,   45,   31,    5,    8,    8,    8,
559         7,   48,   49,   54,   21,   54,    7,   51,   50,  110,
560         5,   37,   48,   57,   57,   57,    5,   31,   31,    8,
561        53,   58,   53,   53,   53,    8,   60,   55,   61,   55,
562        55,   55,   56,   57,   56,   56,   56,   62,    5,    5,
563         6,    6,    6,    6,    6,    6,   59,   64,    6,   63,
564
565        65,  121,   66,   58,   68,   67,   60,   61,   97,   95,
566       118,  253,    6,  209,   62,  253,  146,   96,    6,   55,
567       121,   59,   95,   59,  146,  209,   59,   64,   63,   65,
568        67,   67,  118,   68,   66,   96,   65,   66,   97,   67,
569         6,    6,    9,    9,    9,    9,    9,    9,    9,    9,
570         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
571         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
572         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
573         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
574         9,    9,    9,    9,    9,    9,   11,   11,   11,   11,
575
576        11,   80,   86,   69,   98,  100,  100,  100,  103,  103,
577       103,  104,  265,  104,  104,  104,   11,  111,  112,   11,
578       262,   11,   11,   11,   11,  113,  114,   11,   11,   69,
579        98,   11,   11,   69,   11,  111,   11,   11,  115,   11,
580        11,   86,  105,  116,  105,  105,  105,  112,  119,   80,
581        80,  107,  117,  107,  107,  107,  108,  108,  108,  120,
582       113,  114,  122,  123,  124,  125,  148,  126,  115,  127,
583       119,  147,  149,  151,  151,  151,  108,  116,  154,  154,
584       154,  117,  156,  156,  156,  120,  157,  123,  158,  120,
585       159,  125,  122,  160,  148,  127,  124,  161,  125,  126,
586
587       162,  165,  156,  164,  147,  149,  166,  167,  168,  169,
588       171,  172,  160,  170,  173,  174,  175,  183,  162,  176,
589       158,  157,  183,  159,  184,  161,  187,  164,  189,  190,
590       192,  194,  198,  165,  195,  196,  169,  197,  166,  171,
591       176,  174,  168,  167,  173,  170,  172,  199,  201,  200,
592       175,  202,  203,  196,  187,  204,  190,  184,  198,  197,
593       210,  212,  189,  194,  192,  214,  195,  200,  201,  216,
594       215,  200,  217,  218,  220,  222,  203,  221,  224,  225,
595       202,  199,  210,  212,  229,  228,  231,  232,  233,  234,
596       204,  228,  217,  218,  239,  214,  215,  225,  221,  240,
597
598       243,  220,  244,  216,  249,  246,  248,  224,  232,  222,
599       233,  256,  260,  229,  243,  264,  239,  263,  231,  259,
600       264,  260,  266,  234,  261,  249,  240,  246,  248,  263,
601       259,  268,  256,  258,  266,  257,  244,  255,  254,  252,
602       251,  250,  247,  268,  272,  272,  272,  272,  272,  272,
603       273,  273,  273,  273,  273,  273,  274,  274,  274,  274,
604       274,  274,  275,  275,  275,  275,  275,  275,  276,  245,
605       276,  276,  276,  276,  277,  242,  277,  277,  277,  277,
606       278,  278,  279,  279,  279,  279,  280,  280,  280,  280,
607       280,  280,  281,  281,  281,  281,  281,  281,  282,  282,
608
609       282,  282,  282,  282,  283,  283,  283,  283,  284,  284,
610       284,  284,  285,  285,  285,  285,  285,  285,  286,  241,
611       286,  287,  238,  287,  287,  287,  287,  237,  236,  235,
612       230,  227,  226,  223,  219,  213,  211,  208,  206,  205,
613       193,  191,  188,  186,  185,  182,  178,  177,  163,  152,
614       145,  144,  142,  141,  139,  136,  135,  134,  131,  130,
615       128,  109,  102,   99,   94,   93,   92,   91,   87,   84,
616        82,   81,   79,   76,   75,   74,   73,   47,   43,   38,
617        33,   26,   25,   20,   19,   13,  271,  271,  271,  271,
618       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
619
620       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
621       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
622       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
623       271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
624       271
625     } ;
626
627 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
628 static char *yy_full_match;
629 static int yy_lp;
630 #define REJECT \
631 { \
632 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
633 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
634 ++yy_lp; \
635 goto find_rule; \
636 }
637 #define yymore() yymore_used_but_not_detected
638 #define YY_MORE_ADJ 0
639 #define YY_RESTORE_YY_MORE_OFFSET
640 char *yytext;
641 #line 1 "lexer.l"
642 #define INITIAL 0
643 /* GOB C Preprocessor
644  * Copyright (C) 1999 the Free Software Foundation.
645  *
646  * Author: George Lebl
647  *
648  * This program is free software; you can redistribute it and/or modify
649  * it under the terms of the GNU General Public License as published by
650  * the Free Software Foundation; either version 2 of the License, or
651  * (at your option) any later version.
652  *
653  * This program is distributed in the hope that it will be useful,
654  * but WITHOUT ANY WARRANTY; without even the implied warranty of
655  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
656  * GNU General Public License for more details.
657  *
658  * You should have received a copy of the GNU General Public License
659  * along with this program; if not, write to the  Free Software
660  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
661  * USA.
662  */
663 #line 22 "lexer.l"
664
665 #include "config.h"
666 #include <glib.h>
667 #include <string.h>
668
669 #include "parse.h"
670 #include "main.h"
671
672 extern gboolean for_cpp;
673
674 static int parenth_depth = 0;
675 static int before_comment = INITIAL;
676 static int class_after_c = FALSE;
677 static int header_c = FALSE;
678
679 static GString *cbuf = NULL;
680 int ccode_line = 1;
681
682 GList *include_files = NULL;
683 /* 0 no, 1 means yes, 2+ means don't even start looking anymore */
684 static int look_for_includes = 0;
685
686 int line_no = 1;
687
688 static void
689 clear_cbuf(void)
690 {
691         if(!cbuf) {
692                 cbuf = g_string_new("");
693         } else {
694                 cbuf = g_string_assign(cbuf,"");
695         }
696 }
697
698 static void
699 add_to_cbuf(char *s)
700 {
701         if(!cbuf) {
702                 cbuf = g_string_new(s);
703         } else {
704                 cbuf = g_string_append(cbuf,s);
705         }
706 }
707
708 #define COMMENT 1
709
710 #define C_CODE 2
711
712 #define C_CODE_STRING 3
713
714 #define CLASS_CODE 4
715
716 #define CLASS_CODE_I 5
717
718 #line 719 "lex.yy.c"
719
720 /* Macros after this point can all be overridden by user definitions in
721  * section 1.
722  */
723
724 #ifndef YY_SKIP_YYWRAP
725 #ifdef __cplusplus
726 extern "C" int yywrap YY_PROTO(( void ));
727 #else
728 extern int yywrap YY_PROTO(( void ));
729 #endif
730 #endif
731
732 #ifndef YY_NO_UNPUT
733 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
734 #endif
735
736 #ifndef yytext_ptr
737 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
738 #endif
739
740 #ifdef YY_NEED_STRLEN
741 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
742 #endif
743
744 #ifndef YY_NO_INPUT
745 #ifdef __cplusplus
746 static int yyinput YY_PROTO(( void ));
747 #else
748 static int input YY_PROTO(( void ));
749 #endif
750 #endif
751
752 #if YY_STACK_USED
753 static int yy_start_stack_ptr = 0;
754 static int yy_start_stack_depth = 0;
755 static int *yy_start_stack = 0;
756 #ifndef YY_NO_PUSH_STATE
757 static void yy_push_state YY_PROTO(( int new_state ));
758 #endif
759 #ifndef YY_NO_POP_STATE
760 static void yy_pop_state YY_PROTO(( void ));
761 #endif
762 #ifndef YY_NO_TOP_STATE
763 static int yy_top_state YY_PROTO(( void ));
764 #endif
765
766 #else
767 #define YY_NO_PUSH_STATE 1
768 #define YY_NO_POP_STATE 1
769 #define YY_NO_TOP_STATE 1
770 #endif
771
772 #ifdef YY_MALLOC_DECL
773 YY_MALLOC_DECL
774 #else
775 #if __STDC__
776 #ifndef __cplusplus
777 #include <stdlib.h>
778 #endif
779 #else
780 /* Just try to get by without declaring the routines.  This will fail
781  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
782  * or sizeof(void*) != sizeof(int).
783  */
784 #endif
785 #endif
786
787 /* Amount of stuff to slurp up with each read. */
788 #ifndef YY_READ_BUF_SIZE
789 #define YY_READ_BUF_SIZE 8192
790 #endif
791
792 /* Copy whatever the last rule matched to the standard output. */
793
794 #ifndef ECHO
795 /* This used to be an fputs(), but since the string might contain NUL's,
796  * we now use fwrite().
797  */
798 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
799 #endif
800
801 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
802  * is returned in "result".
803  */
804 #ifndef YY_INPUT
805 #define YY_INPUT(buf,result,max_size) \
806         if ( yy_current_buffer->yy_is_interactive ) \
807                 { \
808                 int c = '*', n; \
809                 for ( n = 0; n < max_size && \
810                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
811                         buf[n] = (char) c; \
812                 if ( c == '\n' ) \
813                         buf[n++] = (char) c; \
814                 if ( c == EOF && ferror( yyin ) ) \
815                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
816                 result = n; \
817                 } \
818         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
819                   && ferror( yyin ) ) \
820                 YY_FATAL_ERROR( "input in flex scanner failed" );
821 #endif
822
823 /* No semi-colon after return; correct usage is to write "yyterminate();" -
824  * we don't want an extra ';' after the "return" because that will cause
825  * some compilers to complain about unreachable statements.
826  */
827 #ifndef yyterminate
828 #define yyterminate() return YY_NULL
829 #endif
830
831 /* Number of entries by which start-condition stack grows. */
832 #ifndef YY_START_STACK_INCR
833 #define YY_START_STACK_INCR 25
834 #endif
835
836 /* Report a fatal error. */
837 #ifndef YY_FATAL_ERROR
838 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
839 #endif
840
841 /* Default declaration of generated scanner - a define so the user can
842  * easily add parameters.
843  */
844 #ifndef YY_DECL
845 #define YY_DECL int yylex YY_PROTO(( void ))
846 #endif
847
848 /* Code executed at the beginning of each rule, after yytext and yyleng
849  * have been set up.
850  */
851 #ifndef YY_USER_ACTION
852 #define YY_USER_ACTION
853 #endif
854
855 /* Code executed at the end of each rule. */
856 #ifndef YY_BREAK
857 #define YY_BREAK break;
858 #endif
859
860 #define YY_RULE_SETUP \
861         if ( yyleng > 0 ) \
862                 yy_current_buffer->yy_at_bol = \
863                                 (yytext[yyleng - 1] == '\n'); \
864         YY_USER_ACTION
865
866 YY_DECL
867         {
868         register yy_state_type yy_current_state;
869         register char *yy_cp = NULL, *yy_bp = NULL;
870         register int yy_act;
871
872 #line 74 "lexer.l"
873
874
875 #line 876 "lex.yy.c"
876
877         if ( yy_init )
878                 {
879                 yy_init = 0;
880
881 #ifdef YY_USER_INIT
882                 YY_USER_INIT;
883 #endif
884
885                 if ( ! yy_start )
886                         yy_start = 1;   /* first start state */
887
888                 if ( ! yyin )
889                         yyin = stdin;
890
891                 if ( ! yyout )
892                         yyout = stdout;
893
894                 if ( ! yy_current_buffer )
895                         yy_current_buffer =
896                                 yy_create_buffer( yyin, YY_BUF_SIZE );
897
898                 yy_load_buffer_state();
899                 }
900
901         while ( 1 )             /* loops until end-of-file is reached */
902                 {
903                 yy_cp = yy_c_buf_p;
904
905                 /* Support of yytext. */
906                 *yy_cp = yy_hold_char;
907
908                 /* yy_bp points to the position in yy_ch_buf of the start of
909                  * the current run.
910                  */
911                 yy_bp = yy_cp;
912
913                 yy_current_state = yy_start;
914                 yy_current_state += YY_AT_BOL();
915                 yy_state_ptr = yy_state_buf;
916                 *yy_state_ptr++ = yy_current_state;
917 yy_match:
918                 do
919                         {
920                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
921                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
922                                 {
923                                 yy_current_state = (int) yy_def[yy_current_state];
924                                 if ( yy_current_state >= 272 )
925                                         yy_c = yy_meta[(unsigned int) yy_c];
926                                 }
927                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
928                         *yy_state_ptr++ = yy_current_state;
929                         ++yy_cp;
930                         }
931                 while ( yy_base[yy_current_state] != 587 );
932
933 yy_find_action:
934                 yy_current_state = *--yy_state_ptr;
935                 yy_lp = yy_accept[yy_current_state];
936 find_rule: /* we branch to this label when backing up */
937                 for ( ; ; ) /* until we find what rule we matched */
938                         {
939                         if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
940                                 {
941                                 yy_act = yy_acclist[yy_lp];
942                                         {
943                                         yy_full_match = yy_cp;
944                                         break;
945                                         }
946                                 }
947                         --yy_cp;
948                         yy_current_state = *--yy_state_ptr;
949                         yy_lp = yy_accept[yy_current_state];
950                         }
951
952                 YY_DO_BEFORE_ACTION;
953
954
955 do_action:      /* This label is used only to access EOF actions. */
956
957
958                 switch ( yy_act )
959         { /* beginning of action switch */
960 case 1:
961 YY_RULE_SETUP
962 #line 76 "lexer.l"
963 { line_no++; REJECT; }
964         YY_BREAK
965 case 2:
966 YY_RULE_SETUP
967 #line 78 "lexer.l"
968 { fprintf(stderr,"You are a bad bad person!\n"); REJECT; }
969         YY_BREAK
970 case 3:
971 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
972 yy_c_buf_p = yy_cp -= 1;
973 YY_DO_BEFORE_ACTION; /* set up yytext again */
974 YY_RULE_SETUP
975 #line 80 "lexer.l"
976 { ; /*comment, ignore*/ }
977         YY_BREAK
978 case 4:
979 YY_RULE_SETUP
980 #line 81 "lexer.l"
981 {
982         if(look_for_includes==1) {
983                 char *p;
984                 char *file;
985                 char *str = g_strdup(yytext);
986                 file = strchr(str,'"');
987                 if(!file) file = strchr(str,'<');
988                 file++;
989                 p = strchr(file,'"');
990                 if(!p) p = strchr(file,'>');
991                 *p = '\0';
992                 include_files = g_list_prepend(include_files,g_strdup(file));
993                 g_free(str);
994         }
995         REJECT;
996 }
997         YY_BREAK
998 case 5:
999 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
1000 yy_c_buf_p = yy_cp -= 1;
1001 YY_DO_BEFORE_ACTION; /* set up yytext again */
1002 YY_RULE_SETUP
1003 #line 98 "lexer.l"
1004 { add_to_cbuf(yytext); /*comment, ignore*/ }
1005         YY_BREAK
1006 case 6:
1007 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
1008 yy_c_buf_p = yy_cp -= 1;
1009 YY_DO_BEFORE_ACTION; /* set up yytext again */
1010 YY_RULE_SETUP
1011 #line 99 "lexer.l"
1012 { ; /*comment, ignore*/ }
1013         YY_BREAK
1014 case 7:
1015 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
1016 yy_c_buf_p = yy_cp -= 1;
1017 YY_DO_BEFORE_ACTION; /* set up yytext again */
1018 YY_RULE_SETUP
1019 #line 100 "lexer.l"
1020 { ; /*comment, ignore*/ }
1021         YY_BREAK
1022 case 8:
1023 YY_RULE_SETUP
1024 #line 101 "lexer.l"
1025 {BEGIN(COMMENT); before_comment = INITIAL; }
1026         YY_BREAK
1027 case 9:
1028 YY_RULE_SETUP
1029 #line 102 "lexer.l"
1030 {
1031         add_to_cbuf(yytext);
1032         BEGIN(COMMENT);
1033         before_comment = C_CODE;
1034 }
1035         YY_BREAK
1036 case 10:
1037 YY_RULE_SETUP
1038 #line 107 "lexer.l"
1039 {BEGIN(COMMENT); before_comment = CLASS_CODE; }
1040         YY_BREAK
1041 case 11:
1042 YY_RULE_SETUP
1043 #line 108 "lexer.l"
1044 {BEGIN(COMMENT); before_comment = CLASS_CODE_I; }
1045         YY_BREAK
1046 case 12:
1047 YY_RULE_SETUP
1048 #line 109 "lexer.l"
1049 {
1050         if(before_comment == C_CODE) add_to_cbuf(yytext);
1051         BEGIN(before_comment);
1052                 }
1053         YY_BREAK
1054 case 13:
1055 YY_RULE_SETUP
1056 #line 113 "lexer.l"
1057 {
1058         /* comment, ignore */
1059         if(before_comment == C_CODE) add_to_cbuf(yytext);
1060                 }
1061         YY_BREAK
1062 case 14:
1063 YY_RULE_SETUP
1064 #line 117 "lexer.l"
1065 {
1066         /* comment, ignore */
1067         if(before_comment == C_CODE) add_to_cbuf(yytext);
1068                 }
1069         YY_BREAK
1070 case 15:
1071 YY_RULE_SETUP
1072 #line 122 "lexer.l"
1073 {
1074                         BEGIN(C_CODE);
1075                         parenth_depth = 1;
1076                         class_after_c = FALSE;
1077                         header_c = TRUE;
1078                         clear_cbuf();
1079                         ccode_line = line_no;
1080                 }
1081         YY_BREAK
1082 case 16:
1083 YY_RULE_SETUP
1084 #line 130 "lexer.l"
1085 {
1086                         BEGIN(C_CODE);
1087                         parenth_depth = 1;
1088                         class_after_c = FALSE;
1089                         header_c = FALSE;
1090                         clear_cbuf();
1091                         ccode_line = line_no;
1092                         if(look_for_includes==0)
1093                                 look_for_includes=1;
1094                 }
1095         YY_BREAK
1096 case 17:
1097 YY_RULE_SETUP
1098 #line 140 "lexer.l"
1099 {
1100                         BEGIN(INITIAL);
1101                         yylval.cbuf = cbuf;
1102                         cbuf = NULL;
1103                         if(look_for_includes==1)
1104                                 look_for_includes=0;
1105                         if(header_c)
1106                                 return HCODE;
1107                         else
1108                                 return CCODE;
1109                 }
1110         YY_BREAK
1111 case 18:
1112 YY_RULE_SETUP
1113 #line 152 "lexer.l"
1114 { add_to_cbuf(yytext); }
1115         YY_BREAK
1116 case 19:
1117 YY_RULE_SETUP
1118 #line 153 "lexer.l"
1119 { add_to_cbuf(yytext); }
1120         YY_BREAK
1121 case 20:
1122 YY_RULE_SETUP
1123 #line 154 "lexer.l"
1124 { add_to_cbuf(yytext); }
1125         YY_BREAK
1126 case 21:
1127 YY_RULE_SETUP
1128 #line 155 "lexer.l"
1129 { add_to_cbuf(yytext); }
1130         YY_BREAK
1131 case 22:
1132 YY_RULE_SETUP
1133 #line 156 "lexer.l"
1134 { add_to_cbuf(yytext); }
1135         YY_BREAK
1136 case 23:
1137 YY_RULE_SETUP
1138 #line 157 "lexer.l"
1139 { add_to_cbuf(yytext); }
1140         YY_BREAK
1141 case 24:
1142 YY_RULE_SETUP
1143 #line 159 "lexer.l"
1144 { add_to_cbuf(yytext); }
1145         YY_BREAK
1146 case 25:
1147 YY_RULE_SETUP
1148 #line 160 "lexer.l"
1149 {
1150                         BEGIN(C_CODE_STRING);
1151                         add_to_cbuf(yytext);
1152                 }
1153         YY_BREAK
1154 case 26:
1155 YY_RULE_SETUP
1156 #line 164 "lexer.l"
1157 { add_to_cbuf(yytext); }
1158         YY_BREAK
1159 case 27:
1160 YY_RULE_SETUP
1161 #line 165 "lexer.l"
1162 {
1163                                 BEGIN(C_CODE);
1164                                 add_to_cbuf(yytext);
1165                         }
1166         YY_BREAK
1167 case 28:
1168 YY_RULE_SETUP
1169 #line 169 "lexer.l"
1170 { add_to_cbuf(yytext); }
1171         YY_BREAK
1172 case 29:
1173 YY_RULE_SETUP
1174 #line 170 "lexer.l"
1175 { add_to_cbuf(yytext); }
1176         YY_BREAK
1177 case 30:
1178 YY_RULE_SETUP
1179 #line 172 "lexer.l"
1180 {
1181                         parenth_depth++;
1182                         add_to_cbuf(yytext);
1183                 }
1184         YY_BREAK
1185 case 31:
1186 YY_RULE_SETUP
1187 #line 176 "lexer.l"
1188 {
1189                         parenth_depth--;
1190                         if(parenth_depth<0) {
1191                                 REJECT;
1192                         } else if(parenth_depth==0 && class_after_c) {
1193                                 BEGIN(CLASS_CODE_I);
1194                                 yylval.cbuf = cbuf;
1195                                 cbuf = NULL;
1196                                 return CCODE;
1197                         }
1198                         add_to_cbuf(yytext);
1199                 }
1200         YY_BREAK
1201 case 32:
1202 YY_RULE_SETUP
1203 #line 189 "lexer.l"
1204 { add_to_cbuf(yytext); }
1205         YY_BREAK
1206 case 33:
1207 YY_RULE_SETUP
1208 #line 190 "lexer.l"
1209 { add_to_cbuf(yytext); }
1210         YY_BREAK
1211 case 34:
1212 YY_RULE_SETUP
1213 #line 192 "lexer.l"
1214 {
1215                         look_for_includes = 2;
1216                         BEGIN(CLASS_CODE);
1217                         return CLASS;
1218                 }
1219         YY_BREAK
1220 case 35:
1221 YY_RULE_SETUP
1222 #line 198 "lexer.l"
1223 {
1224                         if(for_cpp) {
1225                                 char *s;
1226                                 s = g_strdup_printf("'%s' keyword should not "
1227                                                     "be used when generating "
1228                                                     "C++ code",yytext);
1229                                 print_error(TRUE,s, line_no);
1230                                 g_free(s);
1231                         }
1232                         REJECT;
1233                 }
1234         YY_BREAK
1235 case 36:
1236 YY_RULE_SETUP
1237 #line 210 "lexer.l"
1238 {return FROM;}
1239         YY_BREAK
1240 case 37:
1241 YY_RULE_SETUP
1242 #line 212 "lexer.l"
1243 {return VOID;}
1244         YY_BREAK
1245 case 38:
1246 YY_RULE_SETUP
1247 #line 213 "lexer.l"
1248 {return STRUCT;}
1249         YY_BREAK
1250 case 39:
1251 YY_RULE_SETUP
1252 #line 214 "lexer.l"
1253 {return UNION;}
1254         YY_BREAK
1255 case 40:
1256 YY_RULE_SETUP
1257 #line 215 "lexer.l"
1258 {return ENUM;}
1259         YY_BREAK
1260 case 41:
1261 YY_RULE_SETUP
1262 #line 216 "lexer.l"
1263 {return SIGNED;}
1264         YY_BREAK
1265 case 42:
1266 YY_RULE_SETUP
1267 #line 217 "lexer.l"
1268 {return UNSIGNED;}
1269         YY_BREAK
1270 case 43:
1271 YY_RULE_SETUP
1272 #line 218 "lexer.l"
1273 {return LONG;}
1274         YY_BREAK
1275 case 44:
1276 YY_RULE_SETUP
1277 #line 219 "lexer.l"
1278 {return SHORT;}
1279         YY_BREAK
1280 case 45:
1281 YY_RULE_SETUP
1282 #line 220 "lexer.l"
1283 {return INT;}
1284         YY_BREAK
1285 case 46:
1286 YY_RULE_SETUP
1287 #line 221 "lexer.l"
1288 {return FLOAT;}
1289         YY_BREAK
1290 case 47:
1291 YY_RULE_SETUP
1292 #line 222 "lexer.l"
1293 {return DOUBLE;}
1294         YY_BREAK
1295 case 48:
1296 YY_RULE_SETUP
1297 #line 223 "lexer.l"
1298 {return CHAR;}
1299         YY_BREAK
1300 case 49:
1301 YY_RULE_SETUP
1302 #line 224 "lexer.l"
1303 {return CONST;}
1304         YY_BREAK
1305 case 50:
1306 YY_RULE_SETUP
1307 #line 226 "lexer.l"
1308 {return THREEDOTS;}
1309         YY_BREAK
1310 case 51:
1311 YY_RULE_SETUP
1312 #line 228 "lexer.l"
1313 {yylval.line = line_no; return PUBLIC;}
1314         YY_BREAK
1315 case 52:
1316 YY_RULE_SETUP
1317 #line 229 "lexer.l"
1318 {yylval.line = line_no; return PRIVATE;}
1319         YY_BREAK
1320 case 53:
1321 YY_RULE_SETUP
1322 #line 230 "lexer.l"
1323 {yylval.line = line_no; return PROTECTED;}
1324         YY_BREAK
1325 case 54:
1326 YY_RULE_SETUP
1327 #line 231 "lexer.l"
1328 {yylval.line = line_no; return ARGUMENT;}
1329         YY_BREAK
1330 case 55:
1331 YY_RULE_SETUP
1332 #line 232 "lexer.l"
1333 {yylval.line = line_no; return VIRTUAL;}
1334         YY_BREAK
1335 case 56:
1336 YY_RULE_SETUP
1337 #line 233 "lexer.l"
1338 {yylval.line = line_no; return SIGNAL;}
1339         YY_BREAK
1340 case 57:
1341 YY_RULE_SETUP
1342 #line 234 "lexer.l"
1343 {yylval.line = line_no; return OVERRIDE;}
1344         YY_BREAK
1345 case 58:
1346 YY_RULE_SETUP
1347 #line 235 "lexer.l"
1348 {return ONERROR;}
1349         YY_BREAK
1350 case 59:
1351 YY_RULE_SETUP
1352 #line 236 "lexer.l"
1353 {
1354                         yylval.id = g_strdup(yytext);
1355                         return NUMBER;
1356                 }
1357         YY_BREAK
1358 case 60:
1359 YY_RULE_SETUP
1360 #line 240 "lexer.l"
1361 {
1362                         yylval.id = g_strdup(yytext);
1363                         return TYPETOKEN;
1364                 }
1365         YY_BREAK
1366 case 61:
1367 YY_RULE_SETUP
1368 #line 244 "lexer.l"
1369 {
1370                         yylval.id = g_strdup(yytext);
1371                         return TOKEN;
1372                 }
1373         YY_BREAK
1374 case 62:
1375 YY_RULE_SETUP
1376 #line 249 "lexer.l"
1377 {
1378                         yylval.id = g_strdup(yytext);
1379                         return ARRAY_DIM;
1380                 }
1381         YY_BREAK
1382 case 63:
1383 YY_RULE_SETUP
1384 #line 254 "lexer.l"
1385 {
1386                         BEGIN(CLASS_CODE_I);
1387                         return '{';
1388                 }
1389         YY_BREAK
1390 case 64:
1391 YY_RULE_SETUP
1392 #line 258 "lexer.l"
1393 {
1394                         BEGIN(C_CODE);
1395                         parenth_depth=1;
1396                         class_after_c = TRUE;
1397                         yylval.line = line_no;
1398                         clear_cbuf();
1399                         ccode_line = line_no;
1400                         return '{';
1401                 }
1402         YY_BREAK
1403 case 65:
1404 YY_RULE_SETUP
1405 #line 267 "lexer.l"
1406 {
1407                                 BEGIN(INITIAL);
1408                                 return '}';
1409                         }
1410         YY_BREAK
1411 case 66:
1412 YY_RULE_SETUP
1413 #line 272 "lexer.l"
1414 ;  /*ignore*/
1415         YY_BREAK
1416 case 67:
1417 YY_RULE_SETUP
1418 #line 274 "lexer.l"
1419 {
1420                         yylval.line = line_no;
1421                         return yytext[0];
1422                 }
1423         YY_BREAK
1424 case 68:
1425 YY_RULE_SETUP
1426 #line 279 "lexer.l"
1427 ;  /*ignore*/
1428         YY_BREAK
1429 case 69:
1430 YY_RULE_SETUP
1431 #line 280 "lexer.l"
1432 ECHO;
1433         YY_BREAK
1434 #line 1435 "lex.yy.c"
1435                         case YY_STATE_EOF(INITIAL):
1436                         case YY_STATE_EOF(COMMENT):
1437                         case YY_STATE_EOF(C_CODE):
1438                         case YY_STATE_EOF(C_CODE_STRING):
1439                         case YY_STATE_EOF(CLASS_CODE):
1440                         case YY_STATE_EOF(CLASS_CODE_I):
1441                                 yyterminate();
1442
1443         case YY_END_OF_BUFFER:
1444                 {
1445                 /* Amount of text matched not including the EOB char. */
1446                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1447
1448                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1449                 *yy_cp = yy_hold_char;
1450                 YY_RESTORE_YY_MORE_OFFSET
1451
1452                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1453                         {
1454                         /* We're scanning a new file or input source.  It's
1455                          * possible that this happened because the user
1456                          * just pointed yyin at a new source and called
1457                          * yylex().  If so, then we have to assure
1458                          * consistency between yy_current_buffer and our
1459                          * globals.  Here is the right place to do so, because
1460                          * this is the first action (other than possibly a
1461                          * back-up) that will match for the new input source.
1462                          */
1463                         yy_n_chars = yy_current_buffer->yy_n_chars;
1464                         yy_current_buffer->yy_input_file = yyin;
1465                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1466                         }
1467
1468                 /* Note that here we test for yy_c_buf_p "<=" to the position
1469                  * of the first EOB in the buffer, since yy_c_buf_p will
1470                  * already have been incremented past the NUL character
1471                  * (since all states make transitions on EOB to the
1472                  * end-of-buffer state).  Contrast this with the test
1473                  * in input().
1474                  */
1475                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1476                         { /* This was really a NUL. */
1477                         yy_state_type yy_next_state;
1478
1479                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1480
1481                         yy_current_state = yy_get_previous_state();
1482
1483                         /* Okay, we're now positioned to make the NUL
1484                          * transition.  We couldn't have
1485                          * yy_get_previous_state() go ahead and do it
1486                          * for us because it doesn't know how to deal
1487                          * with the possibility of jamming (and we don't
1488                          * want to build jamming into it because then it
1489                          * will run more slowly).
1490                          */
1491
1492                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1493
1494                         yy_bp = yytext_ptr + YY_MORE_ADJ;
1495
1496                         if ( yy_next_state )
1497                                 {
1498                                 /* Consume the NUL. */
1499                                 yy_cp = ++yy_c_buf_p;
1500                                 yy_current_state = yy_next_state;
1501                                 goto yy_match;
1502                                 }
1503
1504                         else
1505                                 {
1506                                 yy_cp = yy_c_buf_p;
1507                                 goto yy_find_action;
1508                                 }
1509                         }
1510
1511                 else switch ( yy_get_next_buffer() )
1512                         {
1513                         case EOB_ACT_END_OF_FILE:
1514                                 {
1515                                 yy_did_buffer_switch_on_eof = 0;
1516
1517                                 if ( yywrap() )
1518                                         {
1519                                         /* Note: because we've taken care in
1520                                          * yy_get_next_buffer() to have set up
1521                                          * yytext, we can now set up
1522                                          * yy_c_buf_p so that if some total
1523                                          * hoser (like flex itself) wants to
1524                                          * call the scanner after we return the
1525                                          * YY_NULL, it'll still work - another
1526                                          * YY_NULL will get returned.
1527                                          */
1528                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1529
1530                                         yy_act = YY_STATE_EOF(YY_START);
1531                                         goto do_action;
1532                                         }
1533
1534                                 else
1535                                         {
1536                                         if ( ! yy_did_buffer_switch_on_eof )
1537                                                 YY_NEW_FILE;
1538                                         }
1539                                 break;
1540                                 }
1541
1542                         case EOB_ACT_CONTINUE_SCAN:
1543                                 yy_c_buf_p =
1544                                         yytext_ptr + yy_amount_of_matched_text;
1545
1546                                 yy_current_state = yy_get_previous_state();
1547
1548                                 yy_cp = yy_c_buf_p;
1549                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1550                                 goto yy_match;
1551
1552                         case EOB_ACT_LAST_MATCH:
1553                                 yy_c_buf_p =
1554                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1555
1556                                 yy_current_state = yy_get_previous_state();
1557
1558                                 yy_cp = yy_c_buf_p;
1559                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1560                                 goto yy_find_action;
1561                         }
1562                 break;
1563                 }
1564
1565         default:
1566                 YY_FATAL_ERROR(
1567                         "fatal flex scanner internal error--no action found" );
1568         } /* end of action switch */
1569                 } /* end of scanning one token */
1570         } /* end of yylex */
1571
1572
1573 /* yy_get_next_buffer - try to read in a new buffer
1574  *
1575  * Returns a code representing an action:
1576  *      EOB_ACT_LAST_MATCH -
1577  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1578  *      EOB_ACT_END_OF_FILE - end of file
1579  */
1580
1581 static int yy_get_next_buffer()
1582         {
1583         register char *dest = yy_current_buffer->yy_ch_buf;
1584         register char *source = yytext_ptr;
1585         register int number_to_move, i;
1586         int ret_val;
1587
1588         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1589                 YY_FATAL_ERROR(
1590                 "fatal flex scanner internal error--end of buffer missed" );
1591
1592         if ( yy_current_buffer->yy_fill_buffer == 0 )
1593                 { /* Don't try to fill the buffer, so this is an EOF. */
1594                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1595                         {
1596                         /* We matched a single character, the EOB, so
1597                          * treat this as a final EOF.
1598                          */
1599                         return EOB_ACT_END_OF_FILE;
1600                         }
1601
1602                 else
1603                         {
1604                         /* We matched some text prior to the EOB, first
1605                          * process it.
1606                          */
1607                         return EOB_ACT_LAST_MATCH;
1608                         }
1609                 }
1610
1611         /* Try to read more data. */
1612
1613         /* First move last chars to start of buffer. */
1614         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1615
1616         for ( i = 0; i < number_to_move; ++i )
1617                 *(dest++) = *(source++);
1618
1619         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1620                 /* don't do the read, it's not guaranteed to return an EOF,
1621                  * just force an EOF
1622                  */
1623                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1624
1625         else
1626                 {
1627                 int num_to_read =
1628                         yy_current_buffer->yy_buf_size - number_to_move - 1;
1629
1630                 while ( num_to_read <= 0 )
1631                         { /* Not enough room in the buffer - grow it. */
1632 #ifdef YY_USES_REJECT
1633                         YY_FATAL_ERROR(
1634 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1635 #else
1636
1637                         /* just a shorter name for the current buffer */
1638                         YY_BUFFER_STATE b = yy_current_buffer;
1639
1640                         int yy_c_buf_p_offset =
1641                                 (int) (yy_c_buf_p - b->yy_ch_buf);
1642
1643                         if ( b->yy_is_our_buffer )
1644                                 {
1645                                 int new_size = b->yy_buf_size * 2;
1646
1647                                 if ( new_size <= 0 )
1648                                         b->yy_buf_size += b->yy_buf_size / 8;
1649                                 else
1650                                         b->yy_buf_size *= 2;
1651
1652                                 b->yy_ch_buf = (char *)
1653                                         /* Include room in for 2 EOB chars. */
1654                                         yy_flex_realloc( (void *) b->yy_ch_buf,
1655                                                          b->yy_buf_size + 2 );
1656                                 }
1657                         else
1658                                 /* Can't grow it, we don't own it. */
1659                                 b->yy_ch_buf = 0;
1660
1661                         if ( ! b->yy_ch_buf )
1662                                 YY_FATAL_ERROR(
1663                                 "fatal error - scanner input buffer overflow" );
1664
1665                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1666
1667                         num_to_read = yy_current_buffer->yy_buf_size -
1668                                                 number_to_move - 1;
1669 #endif
1670                         }
1671
1672                 if ( num_to_read > YY_READ_BUF_SIZE )
1673                         num_to_read = YY_READ_BUF_SIZE;
1674
1675                 /* Read in more data. */
1676                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1677                         yy_n_chars, num_to_read );
1678
1679                 yy_current_buffer->yy_n_chars = yy_n_chars;
1680                 }
1681
1682         if ( yy_n_chars == 0 )
1683                 {
1684                 if ( number_to_move == YY_MORE_ADJ )
1685                         {
1686                         ret_val = EOB_ACT_END_OF_FILE;
1687                         yyrestart( yyin );
1688                         }
1689
1690                 else
1691                         {
1692                         ret_val = EOB_ACT_LAST_MATCH;
1693                         yy_current_buffer->yy_buffer_status =
1694                                 YY_BUFFER_EOF_PENDING;
1695                         }
1696                 }
1697
1698         else
1699                 ret_val = EOB_ACT_CONTINUE_SCAN;
1700
1701         yy_n_chars += number_to_move;
1702         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1703         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1704
1705         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1706
1707         return ret_val;
1708         }
1709
1710
1711 /* yy_get_previous_state - get the state just before the EOB char was reached */
1712
1713 static yy_state_type yy_get_previous_state()
1714         {
1715         register yy_state_type yy_current_state;
1716         register char *yy_cp;
1717
1718         yy_current_state = yy_start;
1719         yy_current_state += YY_AT_BOL();
1720         yy_state_ptr = yy_state_buf;
1721         *yy_state_ptr++ = yy_current_state;
1722
1723         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1724                 {
1725                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1726                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1727                         {
1728                         yy_current_state = (int) yy_def[yy_current_state];
1729                         if ( yy_current_state >= 272 )
1730                                 yy_c = yy_meta[(unsigned int) yy_c];
1731                         }
1732                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1733                 *yy_state_ptr++ = yy_current_state;
1734                 }
1735
1736         return yy_current_state;
1737         }
1738
1739
1740 /* yy_try_NUL_trans - try to make a transition on the NUL character
1741  *
1742  * synopsis
1743  *      next_state = yy_try_NUL_trans( current_state );
1744  */
1745
1746 #ifdef YY_USE_PROTOS
1747 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1748 #else
1749 static yy_state_type yy_try_NUL_trans( yy_current_state )
1750 yy_state_type yy_current_state;
1751 #endif
1752         {
1753         register int yy_is_jam;
1754
1755         register YY_CHAR yy_c = 1;
1756         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1757                 {
1758                 yy_current_state = (int) yy_def[yy_current_state];
1759                 if ( yy_current_state >= 272 )
1760                         yy_c = yy_meta[(unsigned int) yy_c];
1761                 }
1762         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1763         yy_is_jam = (yy_current_state == 271);
1764         if ( ! yy_is_jam )
1765                 *yy_state_ptr++ = yy_current_state;
1766
1767         return yy_is_jam ? 0 : yy_current_state;
1768         }
1769
1770
1771 #ifndef YY_NO_UNPUT
1772 #ifdef YY_USE_PROTOS
1773 static void yyunput( int c, register char *yy_bp )
1774 #else
1775 static void yyunput( c, yy_bp )
1776 int c;
1777 register char *yy_bp;
1778 #endif
1779         {
1780         register char *yy_cp = yy_c_buf_p;
1781
1782         /* undo effects of setting up yytext */
1783         *yy_cp = yy_hold_char;
1784
1785         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1786                 { /* need to shift things up to make room */
1787                 /* +2 for EOB chars. */
1788                 register int number_to_move = yy_n_chars + 2;
1789                 register char *dest = &yy_current_buffer->yy_ch_buf[
1790                                         yy_current_buffer->yy_buf_size + 2];
1791                 register char *source =
1792                                 &yy_current_buffer->yy_ch_buf[number_to_move];
1793
1794                 while ( source > yy_current_buffer->yy_ch_buf )
1795                         *--dest = *--source;
1796
1797                 yy_cp += (int) (dest - source);
1798                 yy_bp += (int) (dest - source);
1799                 yy_current_buffer->yy_n_chars =
1800                         yy_n_chars = yy_current_buffer->yy_buf_size;
1801
1802                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1803                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1804                 }
1805
1806         *--yy_cp = (char) c;
1807
1808
1809         yytext_ptr = yy_bp;
1810         yy_hold_char = *yy_cp;
1811         yy_c_buf_p = yy_cp;
1812         }
1813 #endif  /* ifndef YY_NO_UNPUT */
1814
1815
1816 #ifdef __cplusplus
1817 static int yyinput()
1818 #else
1819 static int input()
1820 #endif
1821         {
1822         int c;
1823
1824         *yy_c_buf_p = yy_hold_char;
1825
1826         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1827                 {
1828                 /* yy_c_buf_p now points to the character we want to return.
1829                  * If this occurs *before* the EOB characters, then it's a
1830                  * valid NUL; if not, then we've hit the end of the buffer.
1831                  */
1832                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1833                         /* This was really a NUL. */
1834                         *yy_c_buf_p = '\0';
1835
1836                 else
1837                         { /* need more input */
1838                         int offset = yy_c_buf_p - yytext_ptr;
1839                         ++yy_c_buf_p;
1840
1841                         switch ( yy_get_next_buffer() )
1842                                 {
1843                                 case EOB_ACT_LAST_MATCH:
1844                                         /* This happens because yy_g_n_b()
1845                                          * sees that we've accumulated a
1846                                          * token and flags that we need to
1847                                          * try matching the token before
1848                                          * proceeding.  But for input(),
1849                                          * there's no matching to consider.
1850                                          * So convert the EOB_ACT_LAST_MATCH
1851                                          * to EOB_ACT_END_OF_FILE.
1852                                          */
1853
1854                                         /* Reset buffer status. */
1855                                         yyrestart( yyin );
1856
1857                                         /* fall through */
1858
1859                                 case EOB_ACT_END_OF_FILE:
1860                                         {
1861                                         if ( yywrap() )
1862                                                 return EOF;
1863
1864                                         if ( ! yy_did_buffer_switch_on_eof )
1865                                                 YY_NEW_FILE;
1866 #ifdef __cplusplus
1867                                         return yyinput();
1868 #else
1869                                         return input();
1870 #endif
1871                                         }
1872
1873                                 case EOB_ACT_CONTINUE_SCAN:
1874                                         yy_c_buf_p = yytext_ptr + offset;
1875                                         break;
1876                                 }
1877                         }
1878                 }
1879
1880         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
1881         *yy_c_buf_p = '\0';     /* preserve yytext */
1882         yy_hold_char = *++yy_c_buf_p;
1883
1884         yy_current_buffer->yy_at_bol = (c == '\n');
1885
1886         return c;
1887         }
1888
1889
1890 #ifdef YY_USE_PROTOS
1891 void yyrestart( FILE *input_file )
1892 #else
1893 void yyrestart( input_file )
1894 FILE *input_file;
1895 #endif
1896         {
1897         if ( ! yy_current_buffer )
1898                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1899
1900         yy_init_buffer( yy_current_buffer, input_file );
1901         yy_load_buffer_state();
1902         }
1903
1904
1905 #ifdef YY_USE_PROTOS
1906 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1907 #else
1908 void yy_switch_to_buffer( new_buffer )
1909 YY_BUFFER_STATE new_buffer;
1910 #endif
1911         {
1912         if ( yy_current_buffer == new_buffer )
1913                 return;
1914
1915         if ( yy_current_buffer )
1916                 {
1917                 /* Flush out information for old buffer. */
1918                 *yy_c_buf_p = yy_hold_char;
1919                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1920                 yy_current_buffer->yy_n_chars = yy_n_chars;
1921                 }
1922
1923         yy_current_buffer = new_buffer;
1924         yy_load_buffer_state();
1925
1926         /* We don't actually know whether we did this switch during
1927          * EOF (yywrap()) processing, but the only time this flag
1928          * is looked at is after yywrap() is called, so it's safe
1929          * to go ahead and always set it.
1930          */
1931         yy_did_buffer_switch_on_eof = 1;
1932         }
1933
1934
1935 #ifdef YY_USE_PROTOS
1936 void yy_load_buffer_state( void )
1937 #else
1938 void yy_load_buffer_state()
1939 #endif
1940         {
1941         yy_n_chars = yy_current_buffer->yy_n_chars;
1942         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1943         yyin = yy_current_buffer->yy_input_file;
1944         yy_hold_char = *yy_c_buf_p;
1945         }
1946
1947
1948 #ifdef YY_USE_PROTOS
1949 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1950 #else
1951 YY_BUFFER_STATE yy_create_buffer( file, size )
1952 FILE *file;
1953 int size;
1954 #endif
1955         {
1956         YY_BUFFER_STATE b;
1957
1958         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1959         if ( ! b )
1960                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1961
1962         b->yy_buf_size = size;
1963
1964         /* yy_ch_buf has to be 2 characters longer than the size given because
1965          * we need to put in 2 end-of-buffer characters.
1966          */
1967         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1968         if ( ! b->yy_ch_buf )
1969                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1970
1971         b->yy_is_our_buffer = 1;
1972
1973         yy_init_buffer( b, file );
1974
1975         return b;
1976         }
1977
1978
1979 #ifdef YY_USE_PROTOS
1980 void yy_delete_buffer( YY_BUFFER_STATE b )
1981 #else
1982 void yy_delete_buffer( b )
1983 YY_BUFFER_STATE b;
1984 #endif
1985         {
1986         if ( ! b )
1987                 return;
1988
1989         if ( b == yy_current_buffer )
1990                 yy_current_buffer = (YY_BUFFER_STATE) 0;
1991
1992         if ( b->yy_is_our_buffer )
1993                 yy_flex_free( (void *) b->yy_ch_buf );
1994
1995         yy_flex_free( (void *) b );
1996         }
1997
1998
1999 #ifndef YY_ALWAYS_INTERACTIVE
2000 #ifndef YY_NEVER_INTERACTIVE
2001 extern int isatty YY_PROTO(( int ));
2002 #endif
2003 #endif
2004
2005 #ifdef YY_USE_PROTOS
2006 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2007 #else
2008 void yy_init_buffer( b, file )
2009 YY_BUFFER_STATE b;
2010 FILE *file;
2011 #endif
2012
2013
2014         {
2015         yy_flush_buffer( b );
2016
2017         b->yy_input_file = file;
2018         b->yy_fill_buffer = 1;
2019
2020 #if YY_ALWAYS_INTERACTIVE
2021         b->yy_is_interactive = 1;
2022 #else
2023 #if YY_NEVER_INTERACTIVE
2024         b->yy_is_interactive = 0;
2025 #else
2026         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2027 #endif
2028 #endif
2029         }
2030
2031
2032 #ifdef YY_USE_PROTOS
2033 void yy_flush_buffer( YY_BUFFER_STATE b )
2034 #else
2035 void yy_flush_buffer( b )
2036 YY_BUFFER_STATE b;
2037 #endif
2038
2039         {
2040         if ( ! b )
2041                 return;
2042
2043         b->yy_n_chars = 0;
2044
2045         /* We always need two end-of-buffer characters.  The first causes
2046          * a transition to the end-of-buffer state.  The second causes
2047          * a jam in that state.
2048          */
2049         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2050         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2051
2052         b->yy_buf_pos = &b->yy_ch_buf[0];
2053
2054         b->yy_at_bol = 1;
2055         b->yy_buffer_status = YY_BUFFER_NEW;
2056
2057         if ( b == yy_current_buffer )
2058                 yy_load_buffer_state();
2059         }
2060
2061
2062 #ifndef YY_NO_SCAN_BUFFER
2063 #ifdef YY_USE_PROTOS
2064 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2065 #else
2066 YY_BUFFER_STATE yy_scan_buffer( base, size )
2067 char *base;
2068 yy_size_t size;
2069 #endif
2070         {
2071         YY_BUFFER_STATE b;
2072
2073         if ( size < 2 ||
2074              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2075              base[size-1] != YY_END_OF_BUFFER_CHAR )
2076                 /* They forgot to leave room for the EOB's. */
2077                 return 0;
2078
2079         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2080         if ( ! b )
2081                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2082
2083         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2084         b->yy_buf_pos = b->yy_ch_buf = base;
2085         b->yy_is_our_buffer = 0;
2086         b->yy_input_file = 0;
2087         b->yy_n_chars = b->yy_buf_size;
2088         b->yy_is_interactive = 0;
2089         b->yy_at_bol = 1;
2090         b->yy_fill_buffer = 0;
2091         b->yy_buffer_status = YY_BUFFER_NEW;
2092
2093         yy_switch_to_buffer( b );
2094
2095         return b;
2096         }
2097 #endif
2098
2099
2100 #ifndef YY_NO_SCAN_STRING
2101 #ifdef YY_USE_PROTOS
2102 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2103 #else
2104 YY_BUFFER_STATE yy_scan_string( yy_str )
2105 yyconst char *yy_str;
2106 #endif
2107         {
2108         int len;
2109         for ( len = 0; yy_str[len]; ++len )
2110                 ;
2111
2112         return yy_scan_bytes( yy_str, len );
2113         }
2114 #endif
2115
2116
2117 #ifndef YY_NO_SCAN_BYTES
2118 #ifdef YY_USE_PROTOS
2119 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2120 #else
2121 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2122 yyconst char *bytes;
2123 int len;
2124 #endif
2125         {
2126         YY_BUFFER_STATE b;
2127         char *buf;
2128         yy_size_t n;
2129         int i;
2130
2131         /* Get memory for full buffer, including space for trailing EOB's. */
2132         n = len + 2;
2133         buf = (char *) yy_flex_alloc( n );
2134         if ( ! buf )
2135                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2136
2137         for ( i = 0; i < len; ++i )
2138                 buf[i] = bytes[i];
2139
2140         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2141
2142         b = yy_scan_buffer( buf, n );
2143         if ( ! b )
2144                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2145
2146         /* It's okay to grow etc. this buffer, and we should throw it
2147          * away when we're done.
2148          */
2149         b->yy_is_our_buffer = 1;
2150
2151         return b;
2152         }
2153 #endif
2154
2155
2156 #ifndef YY_NO_PUSH_STATE
2157 #ifdef YY_USE_PROTOS
2158 static void yy_push_state( int new_state )
2159 #else
2160 static void yy_push_state( new_state )
2161 int new_state;
2162 #endif
2163         {
2164         if ( yy_start_stack_ptr >= yy_start_stack_depth )
2165                 {
2166                 yy_size_t new_size;
2167
2168                 yy_start_stack_depth += YY_START_STACK_INCR;
2169                 new_size = yy_start_stack_depth * sizeof( int );
2170
2171                 if ( ! yy_start_stack )
2172                         yy_start_stack = (int *) yy_flex_alloc( new_size );
2173
2174                 else
2175                         yy_start_stack = (int *) yy_flex_realloc(
2176                                         (void *) yy_start_stack, new_size );
2177
2178                 if ( ! yy_start_stack )
2179                         YY_FATAL_ERROR(
2180                         "out of memory expanding start-condition stack" );
2181                 }
2182
2183         yy_start_stack[yy_start_stack_ptr++] = YY_START;
2184
2185         BEGIN(new_state);
2186         }
2187 #endif
2188
2189
2190 #ifndef YY_NO_POP_STATE
2191 static void yy_pop_state()
2192         {
2193         if ( --yy_start_stack_ptr < 0 )
2194                 YY_FATAL_ERROR( "start-condition stack underflow" );
2195
2196         BEGIN(yy_start_stack[yy_start_stack_ptr]);
2197         }
2198 #endif
2199
2200
2201 #ifndef YY_NO_TOP_STATE
2202 static int yy_top_state()
2203         {
2204         return yy_start_stack[yy_start_stack_ptr - 1];
2205         }
2206 #endif
2207
2208 #ifndef YY_EXIT_FAILURE
2209 #define YY_EXIT_FAILURE 2
2210 #endif
2211
2212 #ifdef YY_USE_PROTOS
2213 static void yy_fatal_error( yyconst char msg[] )
2214 #else
2215 static void yy_fatal_error( msg )
2216 char msg[];
2217 #endif
2218         {
2219         (void) fprintf( stderr, "%s\n", msg );
2220         exit( YY_EXIT_FAILURE );
2221         }
2222
2223
2224
2225 /* Redefine yyless() so it works in section 3 code. */
2226
2227 #undef yyless
2228 #define yyless(n) \
2229         do \
2230                 { \
2231                 /* Undo effects of setting up yytext. */ \
2232                 yytext[yyleng] = yy_hold_char; \
2233                 yy_c_buf_p = yytext + n; \
2234                 yy_hold_char = *yy_c_buf_p; \
2235                 *yy_c_buf_p = '\0'; \
2236                 yyleng = n; \
2237                 } \
2238         while ( 0 )
2239
2240
2241 /* Internal utility routines. */
2242
2243 #ifndef yytext_ptr
2244 #ifdef YY_USE_PROTOS
2245 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2246 #else
2247 static void yy_flex_strncpy( s1, s2, n )
2248 char *s1;
2249 yyconst char *s2;
2250 int n;
2251 #endif
2252         {
2253         register int i;
2254         for ( i = 0; i < n; ++i )
2255                 s1[i] = s2[i];
2256         }
2257 #endif
2258
2259 #ifdef YY_NEED_STRLEN
2260 #ifdef YY_USE_PROTOS
2261 static int yy_flex_strlen( yyconst char *s )
2262 #else
2263 static int yy_flex_strlen( s )
2264 yyconst char *s;
2265 #endif
2266         {
2267         register int n;
2268         for ( n = 0; s[n]; ++n )
2269                 ;
2270
2271         return n;
2272         }
2273 #endif
2274
2275
2276 #ifdef YY_USE_PROTOS
2277 static void *yy_flex_alloc( yy_size_t size )
2278 #else
2279 static void *yy_flex_alloc( size )
2280 yy_size_t size;
2281 #endif
2282         {
2283         return (void *) malloc( size );
2284         }
2285
2286 #ifdef YY_USE_PROTOS
2287 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2288 #else
2289 static void *yy_flex_realloc( ptr, size )
2290 void *ptr;
2291 yy_size_t size;
2292 #endif
2293         {
2294         /* The cast to (char *) in the following accommodates both
2295          * implementations that use char* generic pointers, and those
2296          * that use void* generic pointers.  It works with the latter
2297          * because both ANSI C and C++ allow castless assignment from
2298          * any pointer type to void*, and deal with argument conversions
2299          * as though doing an assignment.
2300          */
2301         return (void *) realloc( (char *) ptr, size );
2302         }
2303
2304 #ifdef YY_USE_PROTOS
2305 static void yy_flex_free( void *ptr )
2306 #else
2307 static void yy_flex_free( ptr )
2308 void *ptr;
2309 #endif
2310         {
2311         free( ptr );
2312         }
2313
2314 #if YY_MAIN
2315 int main()
2316         {
2317         yylex();
2318         return 0;
2319         }
2320 #endif
2321 #line 280 "lexer.l"