]> andersk Git - splint.git/blob - src/cscanner.c
Added files
[splint.git] / src / cscanner.c
1 /*
2 ** Inserted at beginning of c files generated by flex
3 ** REMEMBER:  Change flex.reset too.
4 */
5
6 /*@-allmacros@*/
7 /*@-pred@*/
8 /*@-globstate@*/
9 /*@-null@*/
10 /*@+boolint@*/
11 /*@+charint@*/
12 /*@-macrospec@*/
13 /*@-macroredef@*/
14 /*@-exitarg@*/
15 /*@-compdef@*/
16 /*@-uniondef@*/
17 /*@+ignorequals@*/
18 /*@-noreturn@*/
19 /*@-mustfree@*/
20 /*@-compdestroy@*/
21 /*@-branchstate@*/
22 /*@-unreachable@*/
23 /*@-varuse@*/
24 /*@-fcnuse@*/
25 /*@-exportlocal@*/
26 /*@-evalorderuncon@*/
27 /*@-exportheader@*/
28 /*@-redecl@*/
29 /*@-loopswitchbreak@*/
30 /*@-switchswitchbreak@*/
31 /*@-sizeoftype@*/
32 /*@-czechfcns@*/
33 /*@-noparams@*/
34 /*@-ansireserved@*/
35 /*@-ifblock@*/
36 /*@-whileblock@*/
37 /*@-forblock@*/
38 /*@-elseifcomplete@*/
39 /*@+ptrnegate@*/
40 /*@-onlytrans@*/
41 /*@-temptrans@*/
42 /*@-immediatetrans@*/
43 /*@-namechecks@*/
44 /*@+matchanyintegral@*/
45 /*@-statictrans@*/
46 /*@-compmempass@*/
47 /*@-forempty@*/
48 /*@-evalorder@*/
49 /*@-retalias@*/
50 /*@-dependenttrans@*/
51 /*@-noeffect@*/
52 /*@-protoparammatch@*/
53 /*@-casebreak@*/
54 /*@-retvalother@*/
55
56 # ifdef __LCLINT__
57 /*@-redecl@*/ /*@-type@*/
58 extern int lsllex (void);
59 /*@=redecl@*/ /*@=type@*/
60
61 /*
62 ** Need to do this because ECHO is defined by the Posix library.  
63 ** flex shouldn't use it.
64 */
65
66 /*@notfunction@*/
67 # define ECHO \
68   fwrite (yytext, yyleng, 1, yyout)
69
70 # ifndef DEFFILENO
71 extern /*@external@*/ int fileno (/* FILE *stream */);
72 # define DEFFILENO
73 # endif
74 # endif
75
76 # ifdef OSF
77 # undef __GNUC__ 
78 # endif
79
80 /*@-redecl@*/
81
82 /* < end of flex.head > */
83
84 /* A lexical scanner generated by flex */
85
86 /* Scanner skeleton version:
87  * $Header$
88  */
89
90 #define FLEX_SCANNER
91 #define YY_FLEX_MAJOR_VERSION 2
92 #define YY_FLEX_MINOR_VERSION 5
93
94 #include <stdio.h>
95
96
97 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
98 #ifdef c_plusplus
99 #ifndef __cplusplus
100 #define __cplusplus
101 #endif
102 #endif
103
104
105 #ifdef __cplusplus
106
107 #include <stdlib.h>
108 #include <unistd.h>
109
110 /* Use prototypes in function declarations. */
111 #define YY_USE_PROTOS
112
113 /* The "const" storage-class-modifier is valid. */
114 #define YY_USE_CONST
115
116 #else   /* ! __cplusplus */
117
118 #if __STDC__
119
120 #define YY_USE_PROTOS
121 #define YY_USE_CONST
122
123 #endif  /* __STDC__ */
124 #endif  /* ! __cplusplus */
125
126 #ifdef __TURBOC__
127  #pragma warn -rch
128  #pragma warn -use
129 #include <io.h>
130 #include <stdlib.h>
131 #define YY_USE_CONST
132 #define YY_USE_PROTOS
133 #endif
134
135 #ifdef YY_USE_CONST
136 #define yyconst const
137 #else
138 #define yyconst
139 #endif
140
141
142 #ifdef YY_USE_PROTOS
143 #define YY_PROTO(proto) proto
144 #else
145 #define YY_PROTO(proto) ()
146 #endif
147
148 /* Returned upon end-of-file. */
149 #define YY_NULL 0
150
151 /* Promotes a possibly negative, possibly signed char to an unsigned
152  * integer for use as an array index.  If the signed char is negative,
153  * we want to instead treat it as an 8-bit unsigned char, hence the
154  * double cast.
155  */
156 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
157
158 /* Enter a start condition.  This macro really ought to take a parameter,
159  * but we do it the disgusting crufty way forced on us by the ()-less
160  * definition of BEGIN.
161  */
162 #define BEGIN yy_start = 1 + 2 *
163
164 /* Translate the current start state into a value that can be later handed
165  * to BEGIN to return to the state.  The YYSTATE alias is for lex
166  * compatibility.
167  */
168 #define YY_START ((yy_start - 1) / 2)
169 #define YYSTATE YY_START
170
171 /* Action number for EOF rule of a given start state. */
172 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
173
174 /* Special action meaning "start processing a new file". */
175 #define YY_NEW_FILE yyrestart( yyin )
176
177 #define YY_END_OF_BUFFER_CHAR 0
178
179 /* Size of default input buffer. */
180 #define YY_BUF_SIZE 16384
181
182 typedef struct yy_buffer_state *YY_BUFFER_STATE;
183
184 extern int yyleng;
185 extern FILE *yyin, *yyout;
186
187 #define EOB_ACT_CONTINUE_SCAN 0
188 #define EOB_ACT_END_OF_FILE 1
189 #define EOB_ACT_LAST_MATCH 2
190
191 /* The funky do-while in the following #define is used to turn the definition
192  * int a single C statement (which needs a semi-colon terminator).  This
193  * avoids problems with code like:
194  *
195  *      if ( condition_holds )
196  *              yyless( 5 );
197  *      else
198  *              do_something_else();
199  *
200  * Prior to using the do-while the compiler would get upset at the
201  * "else" because it interpreted the "if" statement as being all
202  * done when it reached the ';' after the yyless() call.
203  */
204
205 /* Return all but the first 'n' matched characters back to the input stream. */
206
207 #define yyless(n) \
208         do \
209                 { \
210                 /* Undo effects of setting up yytext. */ \
211                 *yy_cp = yy_hold_char; \
212                 YY_RESTORE_YY_MORE_OFFSET \
213                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
214                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
215                 } \
216         while ( 0 )
217
218 #define unput(c) yyunput( c, yytext_ptr )
219
220 /* The following is because we cannot portably get our hands on size_t
221  * (without autoconf's help, which isn't available because we want
222  * flex-generated scanners to compile on their own).
223  */
224 typedef unsigned int yy_size_t;
225
226
227 struct yy_buffer_state
228         {
229         FILE *yy_input_file;
230
231         char *yy_ch_buf;                /* input buffer */
232         char *yy_buf_pos;               /* current position in input buffer */
233
234         /* Size of input buffer in bytes, not including room for EOB
235          * characters.
236          */
237         yy_size_t yy_buf_size;
238
239         /* Number of characters read into yy_ch_buf, not including EOB
240          * characters.
241          */
242         int yy_n_chars;
243
244         /* Whether we "own" the buffer - i.e., we know we created it,
245          * and can realloc() it to grow it, and should free() it to
246          * delete it.
247          */
248         int yy_is_our_buffer;
249
250         /* Whether this is an "interactive" input source; if so, and
251          * if we're using stdio for input, then we want to use getc()
252          * instead of fread(), to make sure we stop fetching input after
253          * each newline.
254          */
255         int yy_is_interactive;
256
257         /* Whether we're considered to be at the beginning of a line.
258          * If so, '^' rules will be active on the next match, otherwise
259          * not.
260          */
261         int yy_at_bol;
262
263         /* Whether to try to fill the input buffer when we reach the
264          * end of it.
265          */
266         int yy_fill_buffer;
267
268         int yy_buffer_status;
269 #define YY_BUFFER_NEW 0
270 #define YY_BUFFER_NORMAL 1
271         /* When an EOF's been seen but there's still some text to process
272          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
273          * shouldn't try reading from the input source any more.  We might
274          * still have a bunch of tokens to match, though, because of
275          * possible backing-up.
276          *
277          * When we actually see the EOF, we change the status to "new"
278          * (via yyrestart()), so that the user can continue scanning by
279          * just pointing yyin at a new input file.
280          */
281 #define YY_BUFFER_EOF_PENDING 2
282         };
283
284 static YY_BUFFER_STATE yy_current_buffer = 0;
285
286 /* We provide macros for accessing buffer states in case in the
287  * future we want to put the buffer states in a more general
288  * "scanner state".
289  */
290 #define YY_CURRENT_BUFFER yy_current_buffer
291
292
293 /* yy_hold_char holds the character lost when yytext is formed. */
294 static char yy_hold_char;
295
296 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
297
298
299 int yyleng;
300
301 /* Points to current character in buffer. */
302 static char *yy_c_buf_p = (char *) 0;
303 static int yy_init = 1;         /* whether we need to initialize */
304 static int yy_start = 0;        /* start state number */
305
306 /* Flag which is used to allow yywrap()'s to do buffer switches
307  * instead of setting up a fresh yyin.  A bit of a hack ...
308  */
309 static int yy_did_buffer_switch_on_eof;
310
311 void yyrestart YY_PROTO(( FILE *input_file ));
312
313 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
314 void yy_load_buffer_state YY_PROTO(( void ));
315 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
316 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
317 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
318 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
319 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
320
321 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
322 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
323 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
324
325 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
326 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
327 static void yy_flex_free YY_PROTO(( void * ));
328
329 #define yy_new_buffer yy_create_buffer
330
331 #define yy_set_interactive(is_interactive) \
332         { \
333         if ( ! yy_current_buffer ) \
334                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
335         yy_current_buffer->yy_is_interactive = is_interactive; \
336         }
337
338 #define yy_set_bol(at_bol) \
339         { \
340         if ( ! yy_current_buffer ) \
341                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
342         yy_current_buffer->yy_at_bol = at_bol; \
343         }
344
345 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
346
347 typedef unsigned char YY_CHAR;
348 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
349 typedef int yy_state_type;
350 extern char *yytext;
351 #define yytext_ptr yytext
352
353 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
354 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
355 static int yy_get_next_buffer YY_PROTO(( void ));
356 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
357
358 /* Done after the current pattern has been matched and before the
359  * corresponding action - sets up yytext.
360  */
361 #define YY_DO_BEFORE_ACTION \
362         yytext_ptr = yy_bp; \
363         yyleng = (int) (yy_cp - yy_bp); \
364         yy_hold_char = *yy_cp; \
365         *yy_cp = '\0'; \
366         yy_c_buf_p = yy_cp;
367
368 #define YY_NUM_RULES 180
369 #define YY_END_OF_BUFFER 181
370 static yyconst short int yy_accept[529] =
371     {   0,
372         0,    0,  181,  179,  159,  160,  147,  179,    3,   82,
373       153,  146,  179,  141,  142,  151,  150,  138,  149,  145,
374       152,   97,   97,  139,  135,  154,  140,  155,  158,  179,
375        82,  143,  178,  144,  156,   82,   82,   82,   82,   82,
376        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
377        82,   82,   82,   82,   82,   82,  136,  157,  137,  148,
378       134,    0,   42,    0,    2,   82,  120,  176,  177,  129,
379       121,    0,    0,  118,  126,  116,  127,  117,  128,    0,
380       110,    1,  119,  113,   90,    0,   99,   98,    0,   97,
381       125,  131,  133,  132,  124,    0,    0,    0,   82,  122,
382
383        82,   82,   82,   82,   82,   82,   82,   82,    9,   82,
384        82,   82,   82,   82,   82,   82,   13,   44,   82,   82,
385        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
386        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
387        82,   82,   82,   82,   82,   82,  123,  130,    0,    0,
388         2,  104,    4,    0,  108,  109,  110,    0,  111,  112,
389        92,   91,    0,  107,  100,  101,  101,   83,  115,  114,
390       166,  167,  164,  169,  174,  165,  175,  170,  173,  168,
391       171,  172,    0,    0,   82,   82,   82,   82,   82,   82,
392        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
393
394        82,   82,   11,   82,   82,   27,   82,   82,   82,   82,
395        82,   82,   82,   82,   82,   82,   43,   82,   82,   82,
396        82,   82,   82,   74,   82,   82,   82,   82,   82,   82,
397        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
398        82,   82,   82,   82,   82,    0,   42,    0,    0,  110,
399         0,  108,  109,    0,  113,   93,   94,   94,  105,  106,
400       103,  102,   84,   86,  163,    0,    0,   82,   82,   82,
401        82,   39,   82,    6,   29,   82,   82,   82,   82,   82,
402        82,   10,   25,   82,   82,   82,   82,   12,   82,   82,
403        82,   51,   82,   31,   82,   82,   52,   82,   82,   68,
404
405        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
406        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
407        82,   82,   82,   82,   82,   26,   82,   82,   82,    0,
408       110,   96,   95,   85,   87,   87,    0,  162,   82,   82,
409        82,   82,    5,   82,   36,   82,   82,   82,   82,   82,
410        82,   82,   30,   82,   82,   82,   82,   82,   82,   82,
411        82,   82,   82,   69,   82,   82,   82,   82,   82,   82,
412        82,   32,   82,   82,   82,   82,   82,   82,   82,   82,
413        82,   82,   77,   24,   82,   82,   82,   82,   82,   18,
414        76,   89,   88,  161,   82,   80,   82,   82,   82,   82,
415
416        82,   82,   82,   28,   82,   38,   82,   21,   82,   54,
417        78,   82,   60,   82,   82,   82,   82,   82,   82,   82,
418        58,   82,   14,   75,   34,   15,   82,   41,   22,   17,
419        82,   82,   82,   82,   82,   72,   19,   20,   82,   81,
420        37,   47,   64,   82,   82,    8,   82,   59,   82,   82,
421        82,   62,   53,   82,   82,   82,   45,   82,   82,   57,
422        82,   46,   61,   82,   23,   82,   82,   82,   82,   65,
423         7,   82,   73,   82,   82,   82,   70,   16,   82,   40,
424        82,   55,   82,   33,   35,   82,   71,   56,   82,   82,
425        82,   82,   67,   82,   82,   82,   82,   63,   82,   82,
426
427        82,   82,   82,   82,   82,   82,   48,   82,   82,   82,
428        66,   82,   82,   82,   79,   82,   82,   82,   82,   82,
429        82,   82,   82,   50,   82,   82,   49,    0
430     } ;
431
432 static yyconst int yy_ec[256] =
433     {   0,
434         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
435         4,    4,    1,    1,    1,    1,    1,    1,    1,    1,
436         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
437         1,    2,    5,    6,    7,    8,    9,   10,   11,   12,
438        13,   14,   15,   16,   17,   18,   19,   20,   21,   21,
439        21,   21,   21,   21,   21,   21,   21,   22,   23,   24,
440        25,   26,   27,   28,   29,   30,   31,   30,   32,   33,
441        34,    8,    8,    8,   35,   36,   37,    8,    8,    8,
442        38,   39,   40,   41,   42,    8,   43,   44,    8,   45,
443        46,   47,   48,   49,   50,    1,   51,   52,   53,   54,
444
445        55,   56,   57,   58,   59,    8,   60,   61,   62,   63,
446        64,   65,    8,   66,   67,   68,   69,   70,   71,   72,
447        73,   74,   75,   76,   77,   78,    1,    1,    1,    1,
448         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
449         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
450         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
451         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
452         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
453         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
454         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
455
456         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
457         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
458         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
459         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
460         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
461         1,    1,    1,    1,    1
462     } ;
463
464 static yyconst int yy_meta[79] =
465     {   0,
466         1,    1,    1,    1,    1,    1,    1,    2,    1,    1,
467         3,    1,    1,    1,    1,    1,    1,    1,    1,    4,
468         4,    1,    1,    1,    1,    1,    1,    1,    5,    5,
469         5,    5,    5,    2,    2,    2,    2,    2,    2,    2,
470         2,    2,    2,    2,    2,    1,    1,    1,    1,    2,
471         5,    5,    5,    5,    5,    5,    2,    2,    2,    2,
472         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
473         2,    2,    2,    2,    1,    1,    1,    1
474     } ;
475
476 static yyconst short int yy_base[536] =
477     {   0,
478         0,    0,  678,  679,  679,  679,  652,   73,    0,    0,
479        55,   71,  629,  679,  679,  650,   67,  679,   68,   66,
480        74,   80,   85,  679,  679,   65,  649,   82,  679,   91,
481       622,  679,  679,  679,  647,  621,   28,  604,   67,   40,
482        65,   72,  605,   88,   55,  604,   79,  101,  616,  611,
483       103,   90,  602,   51,  606,  604,  679,  113,  679,  679,
484       679,  133,  163,  659,    0,    0,  679,  679,  679,  679,
485       679,  100,  139,  679,  679,  679,  679,  679,  679,  643,
486       155,  679,  679,  162,  172,  164,  160,  142,    0,  204,
487       635,  679,  679,  679,  634,  245,  621,  621,  584,  679,
488
489       602,  581,  585,  597,  584,  122,  587,  141,  580,  581,
490       578,  144,  585,  581,  578,  575,    0,   99,  579,  586,
491       579,  576,  567,  569,  575,  568,  578,  572,  564,  568,
492       564,  174,  573,  135,  158,  573,  154,  568,  564,  556,
493       559,  184,  573,  167,  563,  566,  679,  679,  242,  153,
494         0,  679,  679,  235,  679,  679,  251,  243,  679,  679,
495       233,  230,  241,  272,  165,  679,  234,  261,  679,  679,
496       679,  579,  679,  679,  679,  679,  679,  679,  679,  679,
497       679,  679,  580,  581,  228,  553,  548,  551,  563,  558,
498       546,  558,  231,  559,  554,  556,  552,  544,  541,  549,
499
500       536,  551,    0,  537,  541,  544,  529,  532,  535,  538,
501       528,  530,  531,  536,  523,  516,    0,  533,  519,  533,
502       526,  246,  515,    0,  517,  516,  518,  525,  526,  510,
503       508,  508,  510,  519,  518,  514,  516,  506,  510,  501,
504       203,  513,  515,  504,  503,  271,  308,  560,  295,  299,
505       306,  679,  679,  304,  316,  262,  679,  277,  679,  679,
506       679,  679,  298,  281,  679,  534,  522,  505,  504,  495,
507       484,    0,  496,    0,    0,  495,  486,  494,  483,  488,
508       489,    0,    0,  482,  482,  492,  478,    0,  482,  487,
509       482,    0,  284,    0,  487,  472,  472,  473,  483,    0,
510
511       483,  477,  471,  467,  478,  463,  465,  475,  461,  473,
512       463,  467,  466,  471,  470,  456,  458,  466,  464,  462,
513       454,  459,  460,  448,  460,    0,  444,  456,  456,  323,
514       325,  679,  679,  287,  679,  305,  481,  679,  457,  439,
515       439,  440,    0,  292,    0,  441,  442,  448,  446,  445,
516       436,  435,    0,  442,  430,  434,  440,  438,  436,  430,
517       435,  419,  420,    0,  436,  417,  417,  428,  422,  419,
518       427,    0,  426,  423,  427,  424,  408,  417,  419,  404,
519       417,  418,    0,    0,  407,  415,  411,  406,  407,    0,
520         0,  679,  679,  679,  411,    0,  396,  408,  408,  397,
521
522       391,  391,  403,    0,  403,  405,  386,    0,  403,    0,
523         0,  397,    0,  391,  385,  395,  385,  387,  384,  391,
524         0,  384,    0,    0,  385,    0,  382,    0,    0,    0,
525       386,  380,  384,  379,  383,    0,    0,    0,  376,    0,
526         0,    0,  369,  381,  379,    0,  370,    0,  371,  370,
527       369,    0,    0,  367,  362,  371,    0,  358,  359,    0,
528       361,    0,    0,  362,    0,  367,  367,  365,  351,    0,
529         0,  350,    0,  356,  348,  347,    0,    0,  347,    0,
530       329,    0,  340,  334,    0,  319,    0,    0,  311,  320,
531       328,  325,    0,  316,  319,  311,  324,    0,  317,  305,
532
533       318,  315,  301,  302,  310,  296,    0,  308,  311,  300,
534         0,  299,  290,  282,    0,  233,  245,  176,  186,  174,
535       151,  158,  128,    0,   48,   28,    0,  679,  386,  390,
536       394,  399,  403,  405,  410
537     } ;
538
539 static yyconst short int yy_def[536] =
540     {   0,
541       528,    1,  528,  528,  528,  528,  528,  529,  530,  531,
542       528,  528,  532,  528,  528,  528,  528,  528,  528,  528,
543       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
544       531,  528,  528,  528,  528,  531,  531,  531,  531,  531,
545       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
546       531,  531,  531,  531,  531,  531,  528,  528,  528,  528,
547       528,  529,  528,  529,  533,  531,  528,  528,  528,  528,
548       528,  532,  532,  528,  528,  528,  528,  528,  528,  528,
549       528,  528,  528,  528,  528,  528,  528,  528,  534,  528,
550       528,  528,  528,  528,  528,  528,  528,  528,  531,  528,
551
552       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
553       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
554       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
555       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
556       531,  531,  531,  531,  531,  531,  528,  528,  528,  535,
557       533,  528,  528,  528,  528,  528,  528,  528,  528,  528,
558       528,  528,  528,  528,  528,  528,  528,  534,  528,  528,
559       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
560       528,  528,  528,  528,  531,  531,  531,  531,  531,  531,
561       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
562
563       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
564       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
565       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
566       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
567       531,  531,  531,  531,  531,  535,  528,  535,  528,  528,
568       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
569       528,  528,  528,  528,  528,  528,  528,  531,  531,  531,
570       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
571       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
572       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
573
574       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
575       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
576       531,  531,  531,  531,  531,  531,  531,  531,  531,  528,
577       528,  528,  528,  528,  528,  528,  528,  528,  531,  531,
578       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
579       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
580       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
581       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
582       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
583       531,  528,  528,  528,  531,  531,  531,  531,  531,  531,
584
585       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
586       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
587       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
588       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
589       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
590       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
591       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
592       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
593       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
594       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
595
596       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
597       531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
598       531,  531,  531,  531,  531,  531,  531,    0,  528,  528,
599       528,  528,  528,  528,  528
600     } ;
601
602 static yyconst short int yy_nxt[758] =
603     {   0,
604         4,    5,    6,    5,    7,    8,    9,   10,   11,   12,
605        13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
606        23,   24,   25,   26,   27,   28,   29,   30,   10,   10,
607        10,   10,   10,   10,   10,   10,   31,   10,   10,   10,
608        10,   10,   10,   10,   10,   32,   33,   34,   35,   36,
609        37,   38,   39,   40,   41,   42,   43,   10,   44,   45,
610        46,   10,   47,   48,   49,   50,   51,   52,   53,   54,
611        55,   10,   56,   10,   57,   58,   59,   60,   63,   67,
612        70,   75,  527,   80,   77,   81,   81,   82,   91,   92,
613       102,   76,   78,   79,  108,   71,  103,   84,   83,   85,
614
615        85,  143,   84,  109,   90,   90,   94,   95,   96,  120,
616       152,   86,  526,  121,  144,   87,   86,  105,   97,   64,
617        87,   88,  113,   89,  106,  110,   88,  111,   98,   68,
618       107,   69,  114,  123,   86,  115,  112,  147,   63,   86,
619        87,  528,  124,  117,  139,   87,   73,  125,   88,   72,
620       118,   89,  126,   88,  119,  140,  127,  133,  247,  205,
621       134,  135,  141,  128,  149,  149,  206,  136,  150,  129,
622       137,  130,  191,  138,   81,   81,  192,  167,  163,   64,
623       163,  157,  157,  164,  164,  225,  154,  155,  148,   84,
624       156,   85,   85,  158,  159,  165,  194,  160,  226,  248,
625
626       525,  166,  167,   86,  230,  195,  261,  161,  199,  154,
627       155,  200,  524,  162,  227,  156,  158,  159,  523,  231,
628       165,   84,  160,   90,   90,  242,   86,  243,  166,  220,
629       221,  228,  161,  261,  222,   86,  236,  237,  522,   87,
630       162,  223,  238,  149,  149,   88,  521,  150,  520,  249,
631       239,  249,  240,  324,  250,  250,  325,  254,   86,  254,
632       164,  164,  255,  255,   87,  258,  268,  269,  256,  262,
633       157,  157,   88,  171,  257,  172,  247,  173,  174,  175,
634       176,  177,  251,  252,  178,  179,  253,  180,  181,  182,
635       258,  164,  164,  256,  262,  519,  263,  277,  278,  305,
636
637       518,  257,  264,  332,  259,  251,  252,  260,  306,  149,
638       149,  253,  333,  150,  250,  250,  336,  248,  250,  250,
639       330,  263,  330,  255,  255,  331,  331,  259,  392,  264,
640       332,  155,  260,  334,  156,  255,  255,  333,  357,  335,
641       393,  336,  331,  331,  331,  331,  399,  517,  159,  358,
642       516,  160,  515,  400,  155,  392,  514,  252,  334,  156,
643       253,  513,  512,  511,  510,  393,  335,  509,  508,  507,
644       506,  159,  505,  504,  503,  502,  160,  501,  500,  499,
645       252,  498,  497,  496,  495,  253,   62,   62,   62,   62,
646        62,   65,  494,  493,   65,   66,  492,   66,   66,   72,
647
648        72,  491,   72,   72,  151,  490,  151,  151,  168,  168,
649       246,  246,  246,  246,  246,  489,  488,  487,  486,  485,
650       484,  483,  482,  481,  480,  479,  478,  477,  476,  475,
651       474,  473,  472,  471,  470,  469,  468,  467,  466,  465,
652       464,  463,  462,  461,  460,  459,  458,  457,  456,  455,
653       454,  453,  452,  451,  450,  449,  448,  447,  446,  445,
654       444,  443,  442,  441,  440,  439,  438,  437,  436,  435,
655       434,  433,  432,  431,  430,  429,  428,  427,  426,  425,
656       424,  423,  422,  421,  420,  419,  418,  417,  416,  415,
657       414,  413,  412,  411,  410,  409,  408,  407,  406,  405,
658
659       404,  403,  402,  401,  398,  397,  396,  395,  394,  391,
660       390,  389,  388,  387,  386,  385,  384,  383,  382,  381,
661       380,  379,  378,  377,  376,  375,  374,  373,  372,  371,
662       370,  369,  368,  367,  366,  365,  364,  363,  362,  361,
663       360,  359,  356,  355,  354,  353,  352,  351,  350,  349,
664       348,  347,  346,  345,  344,  343,  342,  341,  340,  339,
665       338,  337,  528,  329,  328,  327,  326,  323,  322,  321,
666       320,  319,  318,  317,  316,  315,  314,  313,  312,  311,
667       310,  309,  308,  307,  304,  303,  302,  301,  300,  299,
668       298,  297,  296,  295,  294,  293,  292,  291,  290,  289,
669
670       288,  287,  286,  285,  284,  283,  282,  281,  280,  279,
671       276,  275,  274,  273,  272,  271,  270,  267,  266,  265,
672       245,  244,  241,  235,  234,  233,  232,  229,  224,  219,
673       218,  217,  216,  215,  214,  213,  212,  211,  210,  209,
674       208,  207,  204,  203,  202,  201,  198,  197,  196,  193,
675       190,  189,  188,  187,  186,  185,  184,  183,  170,  169,
676       153,  528,  146,  145,  142,  132,  131,  122,  116,  104,
677       101,  100,   99,   93,   74,   73,   61,  528,    3,  528,
678       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
679       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
680
681       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
682       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
683       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
684       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
685       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
686       528,  528,  528,  528,  528,  528,  528
687     } ;
688
689 static yyconst short int yy_chk[758] =
690     {   0,
691         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
692         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
693         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
694         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
695         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
696         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
697         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
698         1,    1,    1,    1,    1,    1,    1,    1,    8,   11,
699        12,   17,  526,   20,   19,   20,   20,   21,   26,   26,
700        37,   17,   19,   19,   40,   12,   37,   22,   21,   22,
701
702        22,   54,   23,   40,   23,   23,   28,   28,   30,   45,
703        72,   22,  525,   45,   54,   22,   23,   39,   30,    8,
704        23,   22,   42,   22,   39,   41,   23,   41,   30,   11,
705        39,   11,   42,   47,   22,   42,   41,   58,   62,   23,
706        22,   73,   47,   44,   52,   23,   72,   47,   22,   73,
707        44,   22,   48,   23,   44,   52,   48,   51,  150,  118,
708        51,   51,   52,   48,   63,   63,  118,   51,   63,   48,
709        51,   48,  106,   51,   81,   81,  106,   88,   86,   62,
710        86,   84,   84,   86,   86,  134,   81,   81,   58,   85,
711        81,   85,   85,   84,   84,   87,  108,   84,  134,  150,
712
713       523,   87,   88,   85,  137,  108,  165,   85,  112,   81,
714        81,  112,  522,   85,  135,   81,   84,   84,  521,  137,
715        87,   90,   84,   90,   90,  144,   85,  144,   87,  132,
716       132,  135,   85,  165,  132,   90,  142,  142,  520,   90,
717        85,  132,  142,  149,  149,   90,  519,  149,  518,  154,
718       142,  154,  142,  241,  154,  154,  241,  158,   90,  158,
719       163,  163,  158,  158,   90,  162,  185,  185,  161,  167,
720       157,  157,   90,   96,  161,   96,  246,   96,   96,   96,
721        96,   96,  157,  157,   96,   96,  157,   96,   96,   96,
722       162,  164,  164,  161,  167,  517,  168,  193,  193,  222,
723
724       516,  161,  168,  256,  164,  157,  157,  164,  222,  247,
725       247,  157,  258,  247,  249,  249,  264,  246,  250,  250,
726       251,  168,  251,  254,  254,  251,  251,  164,  334,  168,
727       256,  250,  164,  263,  250,  255,  255,  258,  293,  263,
728       336,  264,  330,  330,  331,  331,  344,  514,  255,  293,
729       513,  255,  512,  344,  250,  334,  510,  331,  263,  250,
730       331,  509,  508,  506,  505,  336,  263,  504,  503,  502,
731       501,  255,  500,  499,  497,  496,  255,  495,  494,  492,
732       331,  491,  490,  489,  486,  331,  529,  529,  529,  529,
733       529,  530,  484,  483,  530,  531,  481,  531,  531,  532,
734
735       532,  479,  532,  532,  533,  476,  533,  533,  534,  534,
736       535,  535,  535,  535,  535,  475,  474,  472,  469,  468,
737       467,  466,  464,  461,  459,  458,  456,  455,  454,  451,
738       450,  449,  447,  445,  444,  443,  439,  435,  434,  433,
739       432,  431,  427,  425,  422,  420,  419,  418,  417,  416,
740       415,  414,  412,  409,  407,  406,  405,  403,  402,  401,
741       400,  399,  398,  397,  395,  389,  388,  387,  386,  385,
742       382,  381,  380,  379,  378,  377,  376,  375,  374,  373,
743       371,  370,  369,  368,  367,  366,  365,  363,  362,  361,
744       360,  359,  358,  357,  356,  355,  354,  352,  351,  350,
745
746       349,  348,  347,  346,  342,  341,  340,  339,  337,  329,
747       328,  327,  325,  324,  323,  322,  321,  320,  319,  318,
748       317,  316,  315,  314,  313,  312,  311,  310,  309,  308,
749       307,  306,  305,  304,  303,  302,  301,  299,  298,  297,
750       296,  295,  291,  290,  289,  287,  286,  285,  284,  281,
751       280,  279,  278,  277,  276,  273,  271,  270,  269,  268,
752       267,  266,  248,  245,  244,  243,  242,  240,  239,  238,
753       237,  236,  235,  234,  233,  232,  231,  230,  229,  228,
754       227,  226,  225,  223,  221,  220,  219,  218,  216,  215,
755       214,  213,  212,  211,  210,  209,  208,  207,  206,  205,
756
757       204,  202,  201,  200,  199,  198,  197,  196,  195,  194,
758       192,  191,  190,  189,  188,  187,  186,  184,  183,  172,
759       146,  145,  143,  141,  140,  139,  138,  136,  133,  131,
760       130,  129,  128,  127,  126,  125,  124,  123,  122,  121,
761       120,  119,  116,  115,  114,  113,  111,  110,  109,  107,
762       105,  104,  103,  102,  101,   99,   98,   97,   95,   91,
763        80,   64,   56,   55,   53,   50,   49,   46,   43,   38,
764        36,   35,   31,   27,   16,   13,    7,    3,  528,  528,
765       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
766       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
767
768       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
769       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
770       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
771       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
772       528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
773       528,  528,  528,  528,  528,  528,  528
774     } ;
775
776 static yy_state_type yy_last_accepting_state;
777 static char *yy_last_accepting_cpos;
778
779 /* The intent behind this definition is that it'll catch
780  * any uses of REJECT which flex missed.
781  */
782 #define REJECT reject_used_but_not_detected
783 #define yymore() yymore_used_but_not_detected
784 #define YY_MORE_ADJ 0
785 #define YY_RESTORE_YY_MORE_OFFSET
786 char *yytext;
787 #line 1 "cscanner.l"
788 #define INITIAL 0
789 /*;-*-C-*-; 
790 ** Copyright (c) Massachusetts Institute of Technology 1994-1998.
791 **          All Rights Reserved.
792 **          Unpublished rights reserved under the copyright laws of
793 **          the United States.
794 **
795 ** THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
796 ** OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
797 **
798 ** This code is distributed freely and may be used freely under the 
799 ** following conditions:
800 **
801 **     1. This notice may not be removed or altered.
802 **
803 **     2. Works derived from this code are not distributed for
804 **        commercial gain without explicit permission from MIT 
805 **        (for permission contact lclint-request@sds.lcs.mit.edu).
806 */
807 /*
808  * Modified by Herbert 08/19/97:
809  * - added #include for IBM's OS/2 compiler.
810  * - fixed weird bug with lookup of tmp files (OS/2 and MSDOS only).
811  */
812 /*
813  * Modified by Mike Smith 
814  * Corrected missing 'line' in scanf() calls in handleSpecial().
815  * Without this, I get an error when LCLint hits a '#line' directive
816  * in the pre-pre-processed source files. For safety, I have made these
817  * conditional on OS2 and MSDOS because I don't understand why noone else
818  * has seen this problem.
819  *
820  * Modified by Mike Smith, 4th June 1997
821  * Finally resolved the #line problem.  The scanf() calls have been fixed to
822  * allow the following #line forms:-
823  *
824  *        #line 123 "filename"
825  *        #line 123
826  *        # 123 "filename"
827  *        # 123
828  *
829  * The last two are generated by the GNU pre-processor, apparently
830  */
831 #line 56 "cscanner.l"
832 /*
833 ** based on original C lexer by Nate Osgood
834 **    from hacrat@catfish.lcs.mit.edu Mon Jun 14 13:06:32 1993
835 **
836 */
837
838 # include "lclintMacros.nf"
839 # include "basic.h"
840
841 # include "cgrammar.h"
842 # include "cgrammar_tokens.h"
843
844 # include "fileIdList.h"
845 # include "portab.h"
846
847 # if defined(OS2) && defined(__IBMC__)
848    /* needed for isatty()... */
849 # include <io.h>
850 # endif
851
852 static bool lastWasString = FALSE;
853 static char savechar = '\0';
854
855 /*@notfunction@*/
856 # define yyinput() (incColumn (), getc (yyin))
857
858 /*@-noparams@*/
859 /*@-incondefs@*/
860 extern /*@external@*/ int read ();
861 /*@=incondefs@*/
862 /*@=noparams@*/
863
864 static /*@owned@*/ cstring lastidprocessed = cstring_undefined;
865
866 static int lminput (void);
867 static int tokLength = 0;
868 static bool inSpecPart = FALSE;
869 static bool continueLine = FALSE;
870
871 static int ninput (void);
872 static char processChar (void);
873 static double processFloat (void);
874 static /*@only@*/ exprNode processString (void);
875 static long processDec (void);
876 static long processHex (void);
877 static long processOctal (void);
878 static int processIdentifier (/*@only@*/ cstring)
879    /*@globals undef lastidprocessed@*/ ;
880 static bool processHashIdentifier (/*@only@*/ cstring)
881    /*@globals undef lastidprocessed@*/ ;
882
883 static int processSpec (int);
884 static bool handleSpecial (char *);
885 static int handleLlSpecial (void);
886 static void handleMacro (void);
887 static bool processMacro (void);
888 static /*@only@*/ cstring makeIdentifier (char *);
889
890 /* yes, this is exported! */
891 bool g_expectingTypeName = TRUE; /* beginning of file can be type name! */
892
893 static int returnInt (ctype, long);
894 static int returnFloat (ctype, double);
895 static int returnChar (char);
896 static void setTokLength (int) /*@modifies g_currentloc@*/ ;
897 static void setTokLengthT (size_t) /*@modifies g_currentloc@*/ ;
898
899 static void advanceLine (void)
900 {
901   tokLength = 0;
902   beginLine ();
903 }
904     
905 /*@-allmacros@*/
906 # define RETURN_INT(c,i) \
907   do { lastWasString = FALSE; \
908        return (returnInt (c, i)); } while (FALSE)
909
910 # define RETURN_FLOAT(c,f) \
911   do { lastWasString = FALSE; \
912        return (returnFloat (c, f)); \
913        } while (FALSE)
914
915 # define RETURN_CHAR(c) \
916   do { lastWasString = FALSE; \
917        return (returnChar (c)); \
918      } while (FALSE)
919
920 # define RETURN_TOK(t) \
921   do { yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, tokLength)); \
922        tokLength = 0; \
923        lastWasString = FALSE; \
924        return (t); } while (FALSE)
925
926 # define RETURN_TYPE(t, ct) \
927   do { yylval.ctyp = ct; tokLength = 0; return (t); } while (FALSE)
928
929 /* don't fileloc_decColumn (g_currentloc, tokLength));  
930    the string could have \n's in it!
931 */
932
933 # define RETURN_STRING(c) \
934  do { yylval.expr = exprNode_stringLiteral (c, fileloc_decColumn (g_currentloc, tokLength)); \
935       tokLength = 0; \
936       lastWasString = TRUE; \
937       return (CCONSTANT); } while (FALSE)
938
939 # define RETURN_EXPR(e) \
940  do { yylval.expr = e; \
941       tokLength = 0; \
942       lastWasString = TRUE; \
943       return (CCONSTANT); } while (FALSE)
944
945 /*@=allmacros@*/
946
947 static void setTokLength (int len) 
948 {
949   addColumn (len);
950   tokLength = len;
951 }
952
953 static void setTokLengthT (size_t len)
954 {
955   setTokLength (size_toInt (len));
956 }
957
958 # include "flex.head"
959 #line 877 "lex.yy.c"
960
961 /* Macros after this point can all be overridden by user definitions in
962  * section 1.
963  */
964
965 #ifndef YY_SKIP_YYWRAP
966 #ifdef __cplusplus
967 extern "C" int yywrap YY_PROTO(( void ));
968 #else
969 extern int yywrap YY_PROTO(( void ));
970 #endif
971 #endif
972
973 #ifndef YY_NO_UNPUT
974 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
975 #endif
976
977 #ifndef yytext_ptr
978 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
979 #endif
980
981 #ifdef YY_NEED_STRLEN
982 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
983 #endif
984
985 #ifndef YY_NO_INPUT
986 #ifdef __cplusplus
987 static int yyinput YY_PROTO(( void ));
988 #else
989 static int input YY_PROTO(( void ));
990 #endif
991 #endif
992
993 #if YY_STACK_USED
994 static int yy_start_stack_ptr = 0;
995 static int yy_start_stack_depth = 0;
996 static int *yy_start_stack = 0;
997 #ifndef YY_NO_PUSH_STATE
998 static void yy_push_state YY_PROTO(( int new_state ));
999 #endif
1000 #ifndef YY_NO_POP_STATE
1001 static void yy_pop_state YY_PROTO(( void ));
1002 #endif
1003 #ifndef YY_NO_TOP_STATE
1004 static int yy_top_state YY_PROTO(( void ));
1005 #endif
1006
1007 #else
1008 #define YY_NO_PUSH_STATE 1
1009 #define YY_NO_POP_STATE 1
1010 #define YY_NO_TOP_STATE 1
1011 #endif
1012
1013 #ifdef YY_MALLOC_DECL
1014 YY_MALLOC_DECL
1015 #else
1016 #if __STDC__
1017 #ifndef __cplusplus
1018 #include <stdlib.h>
1019 #endif
1020 #else
1021 /* Just try to get by without declaring the routines.  This will fail
1022  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1023  * or sizeof(void*) != sizeof(int).
1024  */
1025 #endif
1026 #endif
1027
1028 /* Amount of stuff to slurp up with each read. */
1029 #ifndef YY_READ_BUF_SIZE
1030 #define YY_READ_BUF_SIZE 8192
1031 #endif
1032
1033 /* Copy whatever the last rule matched to the standard output. */
1034
1035 #ifndef ECHO
1036 /* This used to be an fputs(), but since the string might contain NUL's,
1037  * we now use fwrite().
1038  */
1039 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1040 #endif
1041
1042 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1043  * is returned in "result".
1044  */
1045 #ifndef YY_INPUT
1046 #define YY_INPUT(buf,result,max_size) \
1047         if ( yy_current_buffer->yy_is_interactive ) \
1048                 { \
1049                 int c = '*', n; \
1050                 for ( n = 0; n < max_size && \
1051                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1052                         buf[n] = (char) c; \
1053                 if ( c == '\n' ) \
1054                         buf[n++] = (char) c; \
1055                 if ( c == EOF && ferror( yyin ) ) \
1056                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1057                 result = n; \
1058                 } \
1059         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1060                   && ferror( yyin ) ) \
1061                 YY_FATAL_ERROR( "input in flex scanner failed" );
1062 #endif
1063
1064 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1065  * we don't want an extra ';' after the "return" because that will cause
1066  * some compilers to complain about unreachable statements.
1067  */
1068 #ifndef yyterminate
1069 #define yyterminate() return YY_NULL
1070 #endif
1071
1072 /* Number of entries by which start-condition stack grows. */
1073 #ifndef YY_START_STACK_INCR
1074 #define YY_START_STACK_INCR 25
1075 #endif
1076
1077 /* Report a fatal error. */
1078 #ifndef YY_FATAL_ERROR
1079 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1080 #endif
1081
1082 /* Default declaration of generated scanner - a define so the user can
1083  * easily add parameters.
1084  */
1085 #ifndef YY_DECL
1086 #define YY_DECL int yylex YY_PROTO(( void ))
1087 #endif
1088
1089 /* Code executed at the beginning of each rule, after yytext and yyleng
1090  * have been set up.
1091  */
1092 #ifndef YY_USER_ACTION
1093 #define YY_USER_ACTION
1094 #endif
1095
1096 /* Code executed at the end of each rule. */
1097 #ifndef YY_BREAK
1098 #define YY_BREAK break;
1099 #endif
1100
1101 #define YY_RULE_SETUP \
1102         YY_USER_ACTION
1103
1104 YY_DECL
1105         {
1106         register yy_state_type yy_current_state;
1107         register char *yy_cp, *yy_bp;
1108         register int yy_act;
1109
1110 #line 185 "cscanner.l"
1111
1112
1113 #line 1031 "lex.yy.c"
1114
1115         if ( yy_init )
1116                 {
1117                 yy_init = 0;
1118
1119 #ifdef YY_USER_INIT
1120                 YY_USER_INIT;
1121 #endif
1122
1123                 if ( ! yy_start )
1124                         yy_start = 1;   /* first start state */
1125
1126                 if ( ! yyin )
1127                         yyin = stdin;
1128
1129                 if ( ! yyout )
1130                         yyout = stdout;
1131
1132                 if ( ! yy_current_buffer )
1133                         yy_current_buffer =
1134                                 yy_create_buffer( yyin, YY_BUF_SIZE );
1135
1136                 yy_load_buffer_state();
1137                 }
1138
1139         while ( 1 )             /* loops until end-of-file is reached */
1140                 {
1141                 yy_cp = yy_c_buf_p;
1142
1143                 /* Support of yytext. */
1144                 *yy_cp = yy_hold_char;
1145
1146                 /* yy_bp points to the position in yy_ch_buf of the start of
1147                  * the current run.
1148                  */
1149                 yy_bp = yy_cp;
1150
1151                 yy_current_state = yy_start;
1152 yy_match:
1153                 do
1154                         {
1155                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1156                         if ( yy_accept[yy_current_state] )
1157                                 {
1158                                 yy_last_accepting_state = yy_current_state;
1159                                 yy_last_accepting_cpos = yy_cp;
1160                                 }
1161                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1162                                 {
1163                                 yy_current_state = (int) yy_def[yy_current_state];
1164                                 if ( yy_current_state >= 529 )
1165                                         yy_c = yy_meta[(unsigned int) yy_c];
1166                                 }
1167                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1168                         ++yy_cp;
1169                         }
1170                 while ( yy_base[yy_current_state] != 679 );
1171
1172 yy_find_action:
1173                 yy_act = yy_accept[yy_current_state];
1174                 if ( yy_act == 0 )
1175                         { /* have to back up */
1176                         yy_cp = yy_last_accepting_cpos;
1177                         yy_current_state = yy_last_accepting_state;
1178                         yy_act = yy_accept[yy_current_state];
1179                         }
1180
1181                 YY_DO_BEFORE_ACTION;
1182
1183
1184 do_action:      /* This label is used only to access EOF actions. */
1185
1186
1187                 switch ( yy_act )
1188         { /* beginning of action switch */
1189                         case 0: /* must back up */
1190                         /* undo the effects of YY_DO_BEFORE_ACTION */
1191                         *yy_cp = yy_hold_char;
1192                         yy_cp = yy_last_accepting_cpos;
1193                         yy_current_state = yy_last_accepting_state;
1194                         goto yy_find_action;
1195
1196 case 1:
1197 YY_RULE_SETUP
1198 #line 187 "cscanner.l"
1199 { llfatalbug (cstring_makeLiteral ("Comment in pre-processor output")); }
1200         YY_BREAK
1201 case 2:
1202 YY_RULE_SETUP
1203 #line 189 "cscanner.l"
1204
1205                  context_saveLocation (); 
1206                  setTokLength (longUnsigned_toInt (mstring_length (yytext))); 
1207
1208                  if (processHashIdentifier (makeIdentifier (yytext + 1)))
1209                    {
1210                      if (lastWasString)
1211                        {
1212                          ;
1213                        }
1214                      else
1215                        {
1216                          RETURN_STRING (cstring_makeLiteral ("\"\""));
1217                        }
1218                    }
1219                  else
1220                    { 
1221                      if (handleSpecial (yytext)) 
1222                        { 
1223                          setTokLength (1); 
1224                          RETURN_TOK (0); 
1225                        }
1226                    }
1227                 } 
1228         YY_BREAK
1229 case 3:
1230 YY_RULE_SETUP
1231 #line 213 "cscanner.l"
1232 { if (handleSpecial (yytext)) 
1233                     { 
1234                        setTokLength (1); RETURN_TOK (0); 
1235                      }
1236                 }
1237         YY_BREAK
1238 case 4:
1239 YY_RULE_SETUP
1240 #line 218 "cscanner.l"
1241 { setTokLength (3); RETURN_TOK (CTOK_ELIPSIS); }
1242         YY_BREAK
1243 case 5:
1244 YY_RULE_SETUP
1245 #line 219 "cscanner.l"
1246 { setTokLength (5); RETURN_TOK (BREAK); }
1247         YY_BREAK
1248 case 6:
1249 YY_RULE_SETUP
1250 #line 220 "cscanner.l"
1251 { setTokLength (4); RETURN_TOK (CASE); }
1252         YY_BREAK
1253 case 7:
1254 YY_RULE_SETUP
1255 #line 221 "cscanner.l"
1256 { setTokLength (8); RETURN_TOK (CONTINUE); }
1257         YY_BREAK
1258 case 8:
1259 YY_RULE_SETUP
1260 #line 222 "cscanner.l"
1261 { setTokLength (7); RETURN_TOK (DEFAULT); }
1262         YY_BREAK
1263 case 9:
1264 YY_RULE_SETUP
1265 #line 223 "cscanner.l"
1266 { setTokLength (2); RETURN_TOK (DO); }
1267         YY_BREAK
1268 case 10:
1269 YY_RULE_SETUP
1270 #line 224 "cscanner.l"
1271 { setTokLength (4); RETURN_TOK (CELSE); }
1272         YY_BREAK
1273 case 11:
1274 YY_RULE_SETUP
1275 #line 225 "cscanner.l"
1276 { setTokLength (3); RETURN_TOK (CFOR); }
1277         YY_BREAK
1278 case 12:
1279 YY_RULE_SETUP
1280 #line 226 "cscanner.l"
1281 { setTokLength (4); RETURN_TOK (GOTO); }
1282         YY_BREAK
1283 case 13:
1284 YY_RULE_SETUP
1285 #line 227 "cscanner.l"
1286 { setTokLength (2); RETURN_TOK (CIF); }
1287         YY_BREAK
1288 case 14:
1289 YY_RULE_SETUP
1290 #line 228 "cscanner.l"
1291 { setTokLength (6); RETURN_TOK (RETURN); }
1292         YY_BREAK
1293 case 15:
1294 YY_RULE_SETUP
1295 #line 229 "cscanner.l"
1296 { setTokLength (6); RETURN_TOK (CSIZEOF); }
1297         YY_BREAK
1298 case 16:
1299 YY_RULE_SETUP
1300 #line 230 "cscanner.l"
1301 { setTokLength (8); RETURN_TOK (COFFSETOF); }
1302         YY_BREAK
1303 case 17:
1304 YY_RULE_SETUP
1305 #line 231 "cscanner.l"
1306 { setTokLength (6); RETURN_TOK (SWITCH); }
1307         YY_BREAK
1308 case 18:
1309 YY_RULE_SETUP
1310 #line 232 "cscanner.l"
1311 { setTokLength (5); RETURN_TOK (WHILE); }
1312         YY_BREAK
1313 case 19:
1314 YY_RULE_SETUP
1315 #line 233 "cscanner.l"
1316 { setTokLength (6); RETURN_TOK (VA_ARG); }   
1317         YY_BREAK
1318 case 20:
1319 YY_RULE_SETUP
1320 #line 234 "cscanner.l"
1321 { setTokLength (6); RETURN_TOK (VA_DCL); }   
1322         YY_BREAK
1323 case 21:
1324 YY_RULE_SETUP
1325 #line 235 "cscanner.l"
1326
1327                   /* gcc extension...this might not be appropriate */
1328                   setTokLength (6); RETURN_TOK (QINLINE); }
1329         YY_BREAK
1330 case 22:
1331 YY_RULE_SETUP
1332 #line 239 "cscanner.l"
1333 { setTokLength (6); RETURN_TOK (CSTRUCT); }  
1334         YY_BREAK
1335 case 23:
1336 YY_RULE_SETUP
1337 #line 240 "cscanner.l"
1338 { setTokLength (7); RETURN_TOK (CTYPEDEF); }
1339         YY_BREAK
1340 case 24:
1341 YY_RULE_SETUP
1342 #line 242 "cscanner.l"
1343 { setTokLength (5); RETURN_TOK (CUNION); }
1344         YY_BREAK
1345 case 25:
1346 YY_RULE_SETUP
1347 #line 243 "cscanner.l"
1348 { setTokLength (4); RETURN_TOK (CENUM); }
1349         YY_BREAK
1350 case 26:
1351 YY_RULE_SETUP
1352 #line 245 "cscanner.l"
1353 { setTokLength (4); RETURN_TYPE (CVOID, ctype_void); }
1354         YY_BREAK
1355 case 27:
1356 YY_RULE_SETUP
1357 #line 246 "cscanner.l"
1358 { setTokLength (3); RETURN_TYPE (CINT, ctype_int); }
1359         YY_BREAK
1360 case 28:
1361 YY_RULE_SETUP
1362 #line 247 "cscanner.l"
1363 { setTokLength (6); RETURN_TYPE (CDOUBLE, ctype_double); }
1364         YY_BREAK
1365 case 29:
1366 YY_RULE_SETUP
1367 #line 248 "cscanner.l"
1368 { setTokLength (4); RETURN_TYPE (CGCHAR, ctype_char); }
1369         YY_BREAK
1370 case 30:
1371 YY_RULE_SETUP
1372 #line 249 "cscanner.l"
1373 { setTokLength (5); RETURN_TYPE (CGFLOAT, ctype_float); }
1374         YY_BREAK
1375 case 31:
1376 YY_RULE_SETUP
1377 #line 251 "cscanner.l"
1378 { setTokLength (4); RETURN_TOK (QLONG); }
1379         YY_BREAK
1380 case 32:
1381 YY_RULE_SETUP
1382 #line 252 "cscanner.l"
1383 { setTokLength (5); RETURN_TOK (QSHORT); }
1384         YY_BREAK
1385 case 33:
1386 YY_RULE_SETUP
1387 #line 253 "cscanner.l"
1388 { setTokLength (8); RETURN_TOK (QUNSIGNED); }
1389         YY_BREAK
1390 case 34:
1391 YY_RULE_SETUP
1392 #line 254 "cscanner.l"
1393 { setTokLength (6); RETURN_TOK (QSIGNED); }
1394         YY_BREAK
1395 case 35:
1396 YY_RULE_SETUP
1397 #line 256 "cscanner.l"
1398 { setTokLength (8); RETURN_TOK (QVOLATILE); }
1399         YY_BREAK
1400 case 36:
1401 YY_RULE_SETUP
1402 #line 257 "cscanner.l"
1403 { setTokLength (5); RETURN_TOK (QCONST); }
1404         YY_BREAK
1405 /* some systems expect this! [gack!] */ 
1406 case 37:
1407 YY_RULE_SETUP
1408 #line 260 "cscanner.l"
1409 { setTokLength (7); RETURN_TOK (QCONST); }
1410         YY_BREAK
1411 case 38:
1412 YY_RULE_SETUP
1413 #line 262 "cscanner.l"
1414 { setTokLength (6); RETURN_TOK (QEXTERN); }
1415         YY_BREAK
1416 case 39:
1417 YY_RULE_SETUP
1418 #line 263 "cscanner.l"
1419 { setTokLength (4); RETURN_TOK (QAUTO); }
1420         YY_BREAK
1421 case 40:
1422 YY_RULE_SETUP
1423 #line 264 "cscanner.l"
1424 { setTokLength (8); RETURN_TOK (QREGISTER); }
1425         YY_BREAK
1426 case 41:
1427 YY_RULE_SETUP
1428 #line 265 "cscanner.l"
1429 { setTokLength (6); RETURN_TOK (QSTATIC); }
1430         YY_BREAK
1431 case 42:
1432 YY_RULE_SETUP
1433 #line 267 "cscanner.l"
1434 { RETURN_EXPR (processString ()); }
1435         YY_BREAK
1436 case 43:
1437 YY_RULE_SETUP
1438 #line 268 "cscanner.l"
1439 { return (processSpec (QOUT)); }
1440         YY_BREAK
1441 case 44:
1442 YY_RULE_SETUP
1443 #line 269 "cscanner.l"
1444 { return (processSpec (QIN)); }
1445         YY_BREAK
1446 case 45:
1447 YY_RULE_SETUP
1448 #line 270 "cscanner.l"
1449 { return (processSpec (QPARTIAL)); }
1450         YY_BREAK
1451 case 46:
1452 YY_RULE_SETUP
1453 #line 271 "cscanner.l"
1454 { return (processSpec (QSPECIAL)); }
1455         YY_BREAK
1456 case 47:
1457 YY_RULE_SETUP
1458 #line 272 "cscanner.l"
1459 { return (processSpec (QANYTYPE)); }
1460         YY_BREAK
1461 case 48:
1462 YY_RULE_SETUP
1463 #line 273 "cscanner.l"
1464 { return (processSpec (QINTEGRALTYPE)); }
1465         YY_BREAK
1466 case 49:
1467 YY_RULE_SETUP
1468 #line 274 "cscanner.l"
1469 { return (processSpec (QUNSIGNEDINTEGRALTYPE)); }
1470         YY_BREAK
1471 case 50:
1472 YY_RULE_SETUP
1473 #line 275 "cscanner.l"
1474 { return (processSpec (QSIGNEDINTEGRALTYPE)); }
1475         YY_BREAK
1476 case 51:
1477 YY_RULE_SETUP
1478 #line 276 "cscanner.l"
1479 { return (processSpec (QKEEP)); }
1480         YY_BREAK
1481 case 52:
1482 YY_RULE_SETUP
1483 #line 277 "cscanner.l"
1484 { return (processSpec (QNULL)); } 
1485         YY_BREAK
1486 case 53:
1487 YY_RULE_SETUP
1488 #line 278 "cscanner.l"
1489 { return (processSpec (QNOTNULL)); } 
1490         YY_BREAK
1491 case 54:
1492 YY_RULE_SETUP
1493 #line 279 "cscanner.l"
1494 { return (processSpec (QISNULL)); } 
1495         YY_BREAK
1496 case 55:
1497 YY_RULE_SETUP
1498 #line 280 "cscanner.l"
1499 { return (processSpec (QTRUENULL)); } 
1500         YY_BREAK
1501 case 56:
1502 YY_RULE_SETUP
1503 #line 281 "cscanner.l"
1504 { return (processSpec (QFALSENULL)); } 
1505         YY_BREAK
1506 case 57:
1507 YY_RULE_SETUP
1508 #line 282 "cscanner.l"
1509 { return (processSpec (QRELNULL)); }
1510         YY_BREAK
1511 case 58:
1512 YY_RULE_SETUP
1513 #line 283 "cscanner.l"
1514 { return (processSpec (QRELDEF)); }
1515         YY_BREAK
1516 case 59:
1517 YY_RULE_SETUP
1518 #line 284 "cscanner.l"
1519 { return (processSpec (QEXPOSED)); }
1520         YY_BREAK
1521 case 60:
1522 YY_RULE_SETUP
1523 #line 285 "cscanner.l"
1524 { return (processSpec (QNEWREF)); }
1525         YY_BREAK
1526 case 61:
1527 YY_RULE_SETUP
1528 #line 286 "cscanner.l"
1529 { return (processSpec (QTEMPREF)); }
1530         YY_BREAK
1531 case 62:
1532 YY_RULE_SETUP
1533 #line 287 "cscanner.l"
1534 { return (processSpec (QKILLREF)); }
1535         YY_BREAK
1536 case 63:
1537 YY_RULE_SETUP
1538 #line 288 "cscanner.l"
1539 { return (processSpec (QREFCOUNTED)); }
1540         YY_BREAK
1541 case 64:
1542 YY_RULE_SETUP
1543 #line 289 "cscanner.l"
1544 { return (processSpec (QCHECKED)); }
1545         YY_BREAK
1546 case 65:
1547 YY_RULE_SETUP
1548 #line 290 "cscanner.l"
1549 { return (processSpec (QCHECKMOD)); }
1550         YY_BREAK
1551 case 66:
1552 YY_RULE_SETUP
1553 #line 291 "cscanner.l"
1554 { return (processSpec (QCHECKEDSTRICT)); }
1555         YY_BREAK
1556 case 67:
1557 YY_RULE_SETUP
1558 #line 292 "cscanner.l"
1559 { return (processSpec (QUNCHECKED)); }
1560         YY_BREAK
1561 case 68:
1562 YY_RULE_SETUP
1563 #line 293 "cscanner.l"
1564 { return (processSpec (QONLY)); }
1565         YY_BREAK
1566 case 69:
1567 YY_RULE_SETUP
1568 #line 294 "cscanner.l"
1569 { return (processSpec (QOWNED)); }
1570         YY_BREAK
1571 case 70:
1572 YY_RULE_SETUP
1573 #line 295 "cscanner.l"
1574 { return (processSpec (QOBSERVER)); }
1575         YY_BREAK
1576 case 71:
1577 YY_RULE_SETUP
1578 #line 296 "cscanner.l"
1579 { return (processSpec (QDEPENDENT)); }
1580         YY_BREAK
1581 case 72:
1582 YY_RULE_SETUP
1583 #line 297 "cscanner.l"
1584 { return (processSpec (QUNUSED)); }
1585         YY_BREAK
1586 case 73:
1587 YY_RULE_SETUP
1588 #line 298 "cscanner.l"
1589 { return (processSpec (QEXTERNAL)); }
1590         YY_BREAK
1591 case 74:
1592 YY_RULE_SETUP
1593 #line 299 "cscanner.l"
1594 { return (processSpec (QSEF)); }
1595         YY_BREAK
1596 case 75:
1597 YY_RULE_SETUP
1598 #line 300 "cscanner.l"
1599 { return (processSpec (QSHARED)); }
1600         YY_BREAK
1601 case 76:
1602 YY_RULE_SETUP
1603 #line 301 "cscanner.l"
1604 { return (processSpec (QYIELD)); }
1605         YY_BREAK
1606 case 77:
1607 YY_RULE_SETUP
1608 #line 302 "cscanner.l"
1609 { return (processSpec (QUNDEF)); }
1610         YY_BREAK
1611 case 78:
1612 YY_RULE_SETUP
1613 #line 303 "cscanner.l"
1614 { return (processSpec (QKILLED)); }
1615         YY_BREAK
1616 case 79:
1617 YY_RULE_SETUP
1618 #line 304 "cscanner.l"
1619 { return (processSpec (QNULLTERMINATED));}
1620         YY_BREAK
1621 case 80:
1622 YY_RULE_SETUP
1623 #line 305 "cscanner.l"
1624 { return (processSpec (QMAXSET));}
1625         YY_BREAK
1626 case 81:
1627 YY_RULE_SETUP
1628 #line 306 "cscanner.l"
1629 { return (processSpec (QMAXREAD));}
1630         YY_BREAK
1631 case 82:
1632 YY_RULE_SETUP
1633 #line 308 "cscanner.l"
1634 { int tok; 
1635                               context_saveLocation (); 
1636                               setTokLength (longUnsigned_toInt (mstring_length (yytext))); 
1637                               tok = processIdentifier (makeIdentifier (yytext)); 
1638                               if (tok != BADTOK)
1639                                 {
1640                                   return (tok);
1641                                 }
1642                             }
1643         YY_BREAK
1644 case 83:
1645 YY_RULE_SETUP
1646 #line 317 "cscanner.l"
1647 { setTokLengthT (mstring_length (yytext)); 
1648                           RETURN_INT (ctype_int, processHex ());  /* evs 2000-05-17 was ctype_uint */
1649                         }
1650         YY_BREAK
1651 case 84:
1652 YY_RULE_SETUP
1653 #line 320 "cscanner.l"
1654 { setTokLengthT (mstring_length (yytext)); 
1655                           RETURN_INT (ctype_lint, processHex ()); }
1656         YY_BREAK
1657 case 85:
1658 YY_RULE_SETUP
1659 #line 322 "cscanner.l"
1660 { setTokLengthT (mstring_length (yytext)); 
1661                           RETURN_INT (ctype_llint, processHex ()); }
1662         YY_BREAK
1663 case 86:
1664 YY_RULE_SETUP
1665 #line 324 "cscanner.l"
1666 { setTokLengthT (mstring_length (yytext)); 
1667                           RETURN_INT (ctype_uint, processHex ()); }
1668         YY_BREAK
1669 case 87:
1670 YY_RULE_SETUP
1671 #line 326 "cscanner.l"
1672 { setTokLengthT (mstring_length (yytext)); 
1673                           RETURN_INT (ctype_ulint, processHex ()); }
1674         YY_BREAK
1675 case 88:
1676 YY_RULE_SETUP
1677 #line 328 "cscanner.l"
1678 { setTokLengthT (mstring_length (yytext)); 
1679                           RETURN_INT (ctype_ullint, processHex ()); }
1680         YY_BREAK
1681 case 89:
1682 YY_RULE_SETUP
1683 #line 330 "cscanner.l"
1684 { setTokLengthT (mstring_length (yytext)); 
1685                           RETURN_INT (ctype_ullint, processHex ()); }
1686         YY_BREAK
1687 case 90:
1688 YY_RULE_SETUP
1689 #line 332 "cscanner.l"
1690 { setTokLengthT (mstring_length (yytext)); 
1691                           RETURN_INT (ctype_int, processOctal ()); } 
1692         YY_BREAK
1693 case 91:
1694 YY_RULE_SETUP
1695 #line 334 "cscanner.l"
1696 { setTokLengthT (mstring_length (yytext)); 
1697                           RETURN_INT (ctype_uint, processOctal ()); } 
1698         YY_BREAK
1699 case 92:
1700 YY_RULE_SETUP
1701 #line 336 "cscanner.l"
1702 { setTokLengthT (mstring_length (yytext)); 
1703                           RETURN_INT (ctype_lint, processOctal ()); } 
1704         YY_BREAK
1705 case 93:
1706 YY_RULE_SETUP
1707 #line 338 "cscanner.l"
1708 { setTokLengthT (mstring_length (yytext)); 
1709                           RETURN_INT (ctype_llint, processOctal ()); } 
1710         YY_BREAK
1711 case 94:
1712 YY_RULE_SETUP
1713 #line 340 "cscanner.l"
1714 { setTokLengthT (mstring_length (yytext)); 
1715                           RETURN_INT (ctype_ulint, processOctal ()); } 
1716         YY_BREAK
1717 case 95:
1718 YY_RULE_SETUP
1719 #line 342 "cscanner.l"
1720 { setTokLengthT (mstring_length (yytext)); 
1721                           RETURN_INT (ctype_ullint, processOctal ()); } 
1722         YY_BREAK
1723 case 96:
1724 YY_RULE_SETUP
1725 #line 344 "cscanner.l"
1726 { setTokLengthT (mstring_length (yytext)); 
1727                           RETURN_INT (ctype_ullint, processOctal ()); } 
1728         YY_BREAK
1729 case 97:
1730 YY_RULE_SETUP
1731 #line 346 "cscanner.l"
1732 { setTokLengthT (mstring_length (yytext)); 
1733                          RETURN_INT (ctype_int, processDec ()); } 
1734         YY_BREAK
1735 case 98:
1736 YY_RULE_SETUP
1737 #line 348 "cscanner.l"
1738 { setTokLengthT (mstring_length (yytext)); 
1739                          RETURN_INT (ctype_uint, processDec ()); } 
1740         YY_BREAK
1741 case 99:
1742 YY_RULE_SETUP
1743 #line 350 "cscanner.l"
1744 { setTokLengthT (mstring_length (yytext)); 
1745                          RETURN_INT (ctype_lint, processDec ()); } 
1746         YY_BREAK
1747 case 100:
1748 YY_RULE_SETUP
1749 #line 352 "cscanner.l"
1750 { setTokLengthT (mstring_length (yytext)); 
1751                          RETURN_INT (ctype_llint, processDec ()); } 
1752         YY_BREAK
1753 case 101:
1754 YY_RULE_SETUP
1755 #line 354 "cscanner.l"
1756 { setTokLengthT (mstring_length (yytext)); 
1757                          RETURN_INT (ctype_ulint, processDec ()); } 
1758         YY_BREAK
1759 case 102:
1760 YY_RULE_SETUP
1761 #line 356 "cscanner.l"
1762 { setTokLengthT (mstring_length (yytext)); 
1763                          RETURN_INT (ctype_ullint, processDec ()); } 
1764         YY_BREAK
1765 case 103:
1766 YY_RULE_SETUP
1767 #line 358 "cscanner.l"
1768 { setTokLengthT (mstring_length (yytext)); 
1769                          RETURN_INT (ctype_ullint, processDec ()); } 
1770         YY_BREAK
1771 case 104:
1772 YY_RULE_SETUP
1773 #line 360 "cscanner.l"
1774 { setTokLengthT (mstring_length (yytext)); 
1775                          RETURN_CHAR (processChar ()); }
1776         YY_BREAK
1777 case 105:
1778 YY_RULE_SETUP
1779 #line 362 "cscanner.l"
1780 { setTokLengthT (mstring_length (yytext)); 
1781                          RETURN_FLOAT (ctype_float, processFloat ()); }
1782         YY_BREAK
1783 case 106:
1784 YY_RULE_SETUP
1785 #line 364 "cscanner.l"
1786 { setTokLengthT (mstring_length (yytext)); 
1787                          RETURN_FLOAT (ctype_ldouble, processFloat ()); }
1788         YY_BREAK
1789 case 107:
1790 YY_RULE_SETUP
1791 #line 366 "cscanner.l"
1792 { setTokLengthT (mstring_length (yytext)); 
1793                          RETURN_FLOAT (ctype_double, processFloat ()); }
1794         YY_BREAK
1795 case 108:
1796 YY_RULE_SETUP
1797 #line 369 "cscanner.l"
1798 { setTokLengthT (mstring_length (yytext)); 
1799                                 RETURN_FLOAT (ctype_float, processFloat ()); }
1800         YY_BREAK
1801 case 109:
1802 YY_RULE_SETUP
1803 #line 371 "cscanner.l"
1804 { setTokLengthT (mstring_length (yytext)); 
1805                                 RETURN_FLOAT (ctype_ldouble, processFloat ()); }
1806         YY_BREAK
1807 case 110:
1808 YY_RULE_SETUP
1809 #line 373 "cscanner.l"
1810 { setTokLengthT (mstring_length (yytext)); 
1811                                 RETURN_FLOAT (ctype_double, processFloat ()); }
1812         YY_BREAK
1813 case 111:
1814 YY_RULE_SETUP
1815 #line 376 "cscanner.l"
1816 { setTokLengthT (mstring_length (yytext)); 
1817                                   RETURN_FLOAT (ctype_float, processFloat ()); }
1818         YY_BREAK
1819 case 112:
1820 YY_RULE_SETUP
1821 #line 378 "cscanner.l"
1822 { setTokLengthT (mstring_length (yytext)); 
1823                                   RETURN_FLOAT (ctype_ldouble, processFloat ()); }
1824         YY_BREAK
1825 case 113:
1826 YY_RULE_SETUP
1827 #line 380 "cscanner.l"
1828 { setTokLengthT (mstring_length (yytext)); 
1829                                   RETURN_FLOAT (ctype_double, processFloat ()); }
1830         YY_BREAK
1831 case 114:
1832 YY_RULE_SETUP
1833 #line 383 "cscanner.l"
1834 { setTokLength (3); RETURN_TOK (RIGHT_ASSIGN); }
1835         YY_BREAK
1836 case 115:
1837 YY_RULE_SETUP
1838 #line 384 "cscanner.l"
1839 { setTokLength (3); RETURN_TOK (LEFT_ASSIGN); }
1840         YY_BREAK
1841 case 116:
1842 YY_RULE_SETUP
1843 #line 385 "cscanner.l"
1844 { setTokLength (2); RETURN_TOK (ADD_ASSIGN); }
1845         YY_BREAK
1846 case 117:
1847 YY_RULE_SETUP
1848 #line 386 "cscanner.l"
1849 { setTokLength (2); RETURN_TOK (SUB_ASSIGN); }
1850         YY_BREAK
1851 case 118:
1852 YY_RULE_SETUP
1853 #line 387 "cscanner.l"
1854 { setTokLength (2); RETURN_TOK (MUL_ASSIGN); }
1855         YY_BREAK
1856 case 119:
1857 YY_RULE_SETUP
1858 #line 388 "cscanner.l"
1859 { setTokLength (2); RETURN_TOK (DIV_ASSIGN); }
1860         YY_BREAK
1861 case 120:
1862 YY_RULE_SETUP
1863 #line 389 "cscanner.l"
1864 { setTokLength (2); RETURN_TOK (MOD_ASSIGN); }
1865         YY_BREAK
1866 case 121:
1867 YY_RULE_SETUP
1868 #line 390 "cscanner.l"
1869 { setTokLength (2); RETURN_TOK (AND_ASSIGN); }
1870         YY_BREAK
1871 case 122:
1872 YY_RULE_SETUP
1873 #line 391 "cscanner.l"
1874 { setTokLength (2); RETURN_TOK (XOR_ASSIGN); }
1875         YY_BREAK
1876 case 123:
1877 YY_RULE_SETUP
1878 #line 392 "cscanner.l"
1879 { setTokLength (2); RETURN_TOK (OR_ASSIGN); }
1880         YY_BREAK
1881 case 124:
1882 YY_RULE_SETUP
1883 #line 393 "cscanner.l"
1884 { setTokLength (2); RETURN_TOK (RIGHT_OP); }
1885         YY_BREAK
1886 case 125:
1887 YY_RULE_SETUP
1888 #line 394 "cscanner.l"
1889 { setTokLength (2); RETURN_TOK (LEFT_OP); }
1890         YY_BREAK
1891 case 126:
1892 YY_RULE_SETUP
1893 #line 395 "cscanner.l"
1894 { setTokLength (2); RETURN_TOK (INC_OP); }
1895         YY_BREAK
1896 case 127:
1897 YY_RULE_SETUP
1898 #line 396 "cscanner.l"
1899 { setTokLength (2); RETURN_TOK (DEC_OP); }
1900         YY_BREAK
1901 case 128:
1902 YY_RULE_SETUP
1903 #line 397 "cscanner.l"
1904 { setTokLength (2); RETURN_TOK (ARROW_OP); }
1905         YY_BREAK
1906 case 129:
1907 YY_RULE_SETUP
1908 #line 398 "cscanner.l"
1909 { setTokLength (2); RETURN_TOK (AND_OP); }
1910         YY_BREAK
1911 case 130:
1912 YY_RULE_SETUP
1913 #line 399 "cscanner.l"
1914 { setTokLength (2); RETURN_TOK (OR_OP); }
1915         YY_BREAK
1916 case 131:
1917 YY_RULE_SETUP
1918 #line 400 "cscanner.l"
1919 { setTokLength (2); RETURN_TOK (LE_OP); }
1920         YY_BREAK
1921 case 132:
1922 YY_RULE_SETUP
1923 #line 401 "cscanner.l"
1924 { setTokLength (2); RETURN_TOK (GE_OP); }
1925         YY_BREAK
1926 case 133:
1927 YY_RULE_SETUP
1928 #line 402 "cscanner.l"
1929 { setTokLength (2); RETURN_TOK (EQ_OP); }
1930         YY_BREAK
1931 case 134:
1932 YY_RULE_SETUP
1933 #line 403 "cscanner.l"
1934 { setTokLength (2); RETURN_TOK (NE_OP); }
1935         YY_BREAK
1936 case 135:
1937 YY_RULE_SETUP
1938 #line 404 "cscanner.l"
1939 { setTokLength (1); RETURN_TOK (TSEMI); }
1940         YY_BREAK
1941 case 136:
1942 YY_RULE_SETUP
1943 #line 405 "cscanner.l"
1944 { setTokLength (1); RETURN_TOK (TLBRACE); }
1945         YY_BREAK
1946 case 137:
1947 YY_RULE_SETUP
1948 #line 406 "cscanner.l"
1949 { setTokLength (1); RETURN_TOK (TRBRACE); }
1950         YY_BREAK
1951 case 138:
1952 YY_RULE_SETUP
1953 #line 407 "cscanner.l"
1954 { setTokLength (1); RETURN_TOK (TCOMMA); }
1955         YY_BREAK
1956 case 139:
1957 YY_RULE_SETUP
1958 #line 408 "cscanner.l"
1959 { setTokLength (1); RETURN_TOK (TCOLON); }
1960         YY_BREAK
1961 case 140:
1962 YY_RULE_SETUP
1963 #line 409 "cscanner.l"
1964 { setTokLength (1); RETURN_TOK (TASSIGN); }
1965         YY_BREAK
1966 case 141:
1967 YY_RULE_SETUP
1968 #line 410 "cscanner.l"
1969 { setTokLength (1); RETURN_TOK (TLPAREN); }
1970         YY_BREAK
1971 case 142:
1972 YY_RULE_SETUP
1973 #line 411 "cscanner.l"
1974 { setTokLength (1); RETURN_TOK (TRPAREN); }
1975         YY_BREAK
1976 case 143:
1977 YY_RULE_SETUP
1978 #line 412 "cscanner.l"
1979 { setTokLength (1); RETURN_TOK (TLSQBR); }
1980         YY_BREAK
1981 case 144:
1982 YY_RULE_SETUP
1983 #line 413 "cscanner.l"
1984 { setTokLength (1); RETURN_TOK (TRSQBR); }
1985         YY_BREAK
1986 case 145:
1987 YY_RULE_SETUP
1988 #line 414 "cscanner.l"
1989 { setTokLength (1); RETURN_TOK (TDOT); }
1990         YY_BREAK
1991 case 146:
1992 YY_RULE_SETUP
1993 #line 415 "cscanner.l"
1994 { setTokLength (1); RETURN_TOK (TAMPERSAND); }
1995         YY_BREAK
1996 case 147:
1997 YY_RULE_SETUP
1998 #line 416 "cscanner.l"
1999 { setTokLength (1); RETURN_TOK (TEXCL); }
2000         YY_BREAK
2001 case 148:
2002 YY_RULE_SETUP
2003 #line 419 "cscanner.l"
2004 { setTokLength (1); RETURN_TOK (TTILDE); }
2005         YY_BREAK
2006 case 149:
2007 YY_RULE_SETUP
2008 #line 420 "cscanner.l"
2009 { setTokLength (1); RETURN_TOK (TMINUS); }
2010         YY_BREAK
2011 case 150:
2012 YY_RULE_SETUP
2013 #line 421 "cscanner.l"
2014 { setTokLength (1); RETURN_TOK (TPLUS); }
2015         YY_BREAK
2016 case 151:
2017 YY_RULE_SETUP
2018 #line 422 "cscanner.l"
2019 { setTokLength (1); RETURN_TOK (TMULT); }
2020         YY_BREAK
2021 case 152:
2022 YY_RULE_SETUP
2023 #line 423 "cscanner.l"
2024 { setTokLength (1); RETURN_TOK (TDIV); }
2025         YY_BREAK
2026 case 153:
2027 YY_RULE_SETUP
2028 #line 424 "cscanner.l"
2029 { setTokLength (1); RETURN_TOK (TPERCENT); }
2030         YY_BREAK
2031 case 154:
2032 YY_RULE_SETUP
2033 #line 425 "cscanner.l"
2034 { setTokLength (1); RETURN_TOK (TLT); }
2035         YY_BREAK
2036 case 155:
2037 YY_RULE_SETUP
2038 #line 426 "cscanner.l"
2039 { setTokLength (1); RETURN_TOK (TGT); }
2040         YY_BREAK
2041 case 156:
2042 YY_RULE_SETUP
2043 #line 427 "cscanner.l"
2044 { setTokLength (1); RETURN_TOK (TCIRC); }
2045         YY_BREAK
2046 case 157:
2047 YY_RULE_SETUP
2048 #line 428 "cscanner.l"
2049 { setTokLength (1); RETURN_TOK (TBAR); }
2050         YY_BREAK
2051 case 158:
2052 YY_RULE_SETUP
2053 #line 429 "cscanner.l"
2054 { setTokLength (1); RETURN_TOK (TQUEST); }
2055         YY_BREAK
2056 case 159:
2057 YY_RULE_SETUP
2058 #line 431 "cscanner.l"
2059 { incColumn (); }
2060         YY_BREAK
2061 case 160:
2062 YY_RULE_SETUP
2063 #line 432 "cscanner.l"
2064 { context_incLineno ();
2065                   if (continueLine)
2066                     {
2067                       continueLine = FALSE;
2068                     }
2069                  else 
2070                    {
2071                      if (context_inMacro ())
2072                        {
2073                          /* Don't use RETURN_TOK */
2074                          yylval.tok = lltok_create (TENDMACRO, g_currentloc);
2075                          lastWasString = FALSE;
2076                          return (TENDMACRO);
2077                        }  
2078                    }
2079                 }
2080         YY_BREAK
2081 case 161:
2082 YY_RULE_SETUP
2083 #line 448 "cscanner.l"
2084 { setTokLength (6); 
2085                   
2086                   if (processMacro ()) {
2087                     if (context_inIterDef ()) 
2088                       { 
2089                         RETURN_TOK (LLMACROITER); 
2090                       }
2091                     if (context_inIterEnd ())
2092                       {
2093                         RETURN_TOK (LLMACROEND); 
2094                       }
2095                     if (context_inMacro ())
2096                       {
2097                         RETURN_TOK (LLMACRO); 
2098                       }
2099                   }
2100                 }
2101         YY_BREAK
2102 case 162:
2103 YY_RULE_SETUP
2104 #line 465 "cscanner.l"
2105 { if (context_inHeader () || context_inFunction ())
2106                     { 
2107                       handleMacro ();
2108                     }
2109                   else
2110                     {
2111                       int nspchar = ninput ();
2112                       int nspaces;
2113
2114                       /* 
2115                       ** This is a hack to get the column number correct.
2116                       */
2117
2118                       llassert (nspchar >= '0' && nspchar <= '9');
2119                       
2120                       nspaces = nspchar - '0';
2121
2122                       setTokLength (5 + nspaces); 
2123                       
2124                       if (processMacro ()) 
2125                         {
2126                           if (context_inIterDef ()) 
2127                             {
2128                               RETURN_TOK (LLMACROITER); 
2129                             }
2130                           if (context_inIterEnd ())
2131                             {
2132                               RETURN_TOK (LLMACROEND); 
2133                             }
2134                           if (context_inMacro ())
2135                             { 
2136                               RETURN_TOK (LLMACRO); 
2137                             }
2138                         }
2139                     }
2140                 }
2141         YY_BREAK
2142 case 163:
2143 YY_RULE_SETUP
2144 #line 501 "cscanner.l"
2145 { setTokLength (4); lldiagmsg (ctype_unparseTable ()); }
2146         YY_BREAK
2147 case 164:
2148 YY_RULE_SETUP
2149 #line 502 "cscanner.l"
2150 { setTokLength (3); 
2151                   lldiagmsg (message ("%q: *** marker ***", fileloc_unparse (g_currentloc)));
2152                 }
2153         YY_BREAK
2154 case 165:
2155 YY_RULE_SETUP
2156 #line 505 "cscanner.l"
2157 { setTokLength (3); usymtab_printLocal (); }
2158         YY_BREAK
2159 case 166:
2160 YY_RULE_SETUP
2161 #line 506 "cscanner.l"
2162 { setTokLength (3); lldiagmsg (usymtab_unparseAliases ()); }
2163         YY_BREAK
2164 case 167:
2165 YY_RULE_SETUP
2166 #line 507 "cscanner.l"
2167 { setTokLength (3); lldiagmsg (context_unparse ()); }
2168         YY_BREAK
2169 case 168:
2170 YY_RULE_SETUP
2171 #line 508 "cscanner.l"
2172 { setTokLength (3); lldiagmsg (context_unparseClauses ()); }
2173         YY_BREAK
2174 case 169:
2175 YY_RULE_SETUP
2176 #line 509 "cscanner.l"
2177 { setTokLength (3); usymtab_printGuards (); }
2178         YY_BREAK
2179 case 170:
2180 YY_RULE_SETUP
2181 #line 510 "cscanner.l"
2182 { setTokLength (3); usymtab_printOut (); }
2183         YY_BREAK
2184 case 171:
2185 YY_RULE_SETUP
2186 #line 511 "cscanner.l"
2187 { setTokLength (3); usymtab_printAll (); }
2188         YY_BREAK
2189 case 172:
2190 YY_RULE_SETUP
2191 #line 512 "cscanner.l"
2192 { setTokLength (3); usymtab_printComplete (); }
2193         YY_BREAK
2194 case 173:
2195 YY_RULE_SETUP
2196 #line 513 "cscanner.l"
2197 { setTokLength (3); usymtab_printTypes (); }
2198         YY_BREAK
2199 case 174:
2200 YY_RULE_SETUP
2201 #line 514 "cscanner.l"
2202 { setTokLength (3); lldiagmsg (usymtab_unparseStack ()); }
2203         YY_BREAK
2204 case 175:
2205 YY_RULE_SETUP
2206 #line 515 "cscanner.l"
2207 { setTokLength (3); 
2208                   lldiagmsg (message ("Can modify: %q", 
2209                                   sRefSet_unparse (context_modList ()))); 
2210                 }
2211         YY_BREAK
2212 case 176:
2213 YY_RULE_SETUP
2214 #line 519 "cscanner.l"
2215 { /* BEFORE_COMMENT_MARKER */
2216                   int tok; 
2217                   incColumn (); incColumn ();
2218                   tok = handleLlSpecial (); 
2219                   if (tok != BADTOK)
2220                     {
2221                       RETURN_TOK (tok); 
2222                     }
2223                 }
2224         YY_BREAK
2225 case 177:
2226 YY_RULE_SETUP
2227 #line 528 "cscanner.l"
2228 { /* AFTER_COMMENT_MARKER */ 
2229                   setTokLength (2);
2230                   inSpecPart = FALSE;
2231                   RETURN_TOK (QENDMACRO); }
2232         YY_BREAK
2233 case 178:
2234 YY_RULE_SETUP
2235 #line 532 "cscanner.l"
2236 { incColumn (); continueLine = TRUE; }
2237         YY_BREAK
2238 case 179:
2239 YY_RULE_SETUP
2240 #line 533 "cscanner.l"
2241 { incColumn (); 
2242                   voptgenerror
2243                     (FLG_SYNTAX, 
2244                      message ("Invalid character (ascii: %d), skipping character",
2245                               (int)(*yytext)),
2246                      g_currentloc);
2247                 }
2248         YY_BREAK
2249 case 180:
2250 YY_RULE_SETUP
2251 #line 540 "cscanner.l"
2252 ECHO;
2253         YY_BREAK
2254 #line 2172 "lex.yy.c"
2255 case YY_STATE_EOF(INITIAL):
2256         yyterminate();
2257
2258         case YY_END_OF_BUFFER:
2259                 {
2260                 /* Amount of text matched not including the EOB char. */
2261                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
2262
2263                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2264                 *yy_cp = yy_hold_char;
2265                 YY_RESTORE_YY_MORE_OFFSET
2266
2267                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
2268                         {
2269                         /* We're scanning a new file or input source.  It's
2270                          * possible that this happened because the user
2271                          * just pointed yyin at a new source and called
2272                          * yylex().  If so, then we have to assure
2273                          * consistency between yy_current_buffer and our
2274                          * globals.  Here is the right place to do so, because
2275                          * this is the first action (other than possibly a
2276                          * back-up) that will match for the new input source.
2277                          */
2278                         yy_n_chars = yy_current_buffer->yy_n_chars;
2279                         yy_current_buffer->yy_input_file = yyin;
2280                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
2281                         }
2282
2283                 /* Note that here we test for yy_c_buf_p "<=" to the position
2284                  * of the first EOB in the buffer, since yy_c_buf_p will
2285                  * already have been incremented past the NUL character
2286                  * (since all states make transitions on EOB to the
2287                  * end-of-buffer state).  Contrast this with the test
2288                  * in input().
2289                  */
2290                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2291                         { /* This was really a NUL. */
2292                         yy_state_type yy_next_state;
2293
2294                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
2295
2296                         yy_current_state = yy_get_previous_state();
2297
2298                         /* Okay, we're now positioned to make the NUL
2299                          * transition.  We couldn't have
2300                          * yy_get_previous_state() go ahead and do it
2301                          * for us because it doesn't know how to deal
2302                          * with the possibility of jamming (and we don't
2303                          * want to build jamming into it because then it
2304                          * will run more slowly).
2305                          */
2306
2307                         yy_next_state = yy_try_NUL_trans( yy_current_state );
2308
2309                         yy_bp = yytext_ptr + YY_MORE_ADJ;
2310
2311                         if ( yy_next_state )
2312                                 {
2313                                 /* Consume the NUL. */
2314                                 yy_cp = ++yy_c_buf_p;
2315                                 yy_current_state = yy_next_state;
2316                                 goto yy_match;
2317                                 }
2318
2319                         else
2320                                 {
2321                                 yy_cp = yy_c_buf_p;
2322                                 goto yy_find_action;
2323                                 }
2324                         }
2325
2326                 else switch ( yy_get_next_buffer() )
2327                         {
2328                         case EOB_ACT_END_OF_FILE:
2329                                 {
2330                                 yy_did_buffer_switch_on_eof = 0;
2331
2332                                 if ( yywrap() )
2333                                         {
2334                                         /* Note: because we've taken care in
2335                                          * yy_get_next_buffer() to have set up
2336                                          * yytext, we can now set up
2337                                          * yy_c_buf_p so that if some total
2338                                          * hoser (like flex itself) wants to
2339                                          * call the scanner after we return the
2340                                          * YY_NULL, it'll still work - another
2341                                          * YY_NULL will get returned.
2342                                          */
2343                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
2344
2345                                         yy_act = YY_STATE_EOF(YY_START);
2346                                         goto do_action;
2347                                         }
2348
2349                                 else
2350                                         {
2351                                         if ( ! yy_did_buffer_switch_on_eof )
2352                                                 YY_NEW_FILE;
2353                                         }
2354                                 break;
2355                                 }
2356
2357                         case EOB_ACT_CONTINUE_SCAN:
2358                                 yy_c_buf_p =
2359                                         yytext_ptr + yy_amount_of_matched_text;
2360
2361                                 yy_current_state = yy_get_previous_state();
2362
2363                                 yy_cp = yy_c_buf_p;
2364                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
2365                                 goto yy_match;
2366
2367                         case EOB_ACT_LAST_MATCH:
2368                                 yy_c_buf_p =
2369                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
2370
2371                                 yy_current_state = yy_get_previous_state();
2372
2373                                 yy_cp = yy_c_buf_p;
2374                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
2375                                 goto yy_find_action;
2376                         }
2377                 break;
2378                 }
2379
2380         default:
2381                 YY_FATAL_ERROR(
2382                         "fatal flex scanner internal error--no action found" );
2383         } /* end of action switch */
2384                 } /* end of scanning one token */
2385         } /* end of yylex */
2386
2387
2388 /* yy_get_next_buffer - try to read in a new buffer
2389  *
2390  * Returns a code representing an action:
2391  *      EOB_ACT_LAST_MATCH -
2392  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2393  *      EOB_ACT_END_OF_FILE - end of file
2394  */
2395
2396 static int yy_get_next_buffer()
2397         {
2398         register char *dest = yy_current_buffer->yy_ch_buf;
2399         register char *source = yytext_ptr;
2400         register int number_to_move, i;
2401         int ret_val;
2402
2403         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
2404                 YY_FATAL_ERROR(
2405                 "fatal flex scanner internal error--end of buffer missed" );
2406
2407         if ( yy_current_buffer->yy_fill_buffer == 0 )
2408                 { /* Don't try to fill the buffer, so this is an EOF. */
2409                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
2410                         {
2411                         /* We matched a single character, the EOB, so
2412                          * treat this as a final EOF.
2413                          */
2414                         return EOB_ACT_END_OF_FILE;
2415                         }
2416
2417                 else
2418                         {
2419                         /* We matched some text prior to the EOB, first
2420                          * process it.
2421                          */
2422                         return EOB_ACT_LAST_MATCH;
2423                         }
2424                 }
2425
2426         /* Try to read more data. */
2427
2428         /* First move last chars to start of buffer. */
2429         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2430
2431         for ( i = 0; i < number_to_move; ++i )
2432                 *(dest++) = *(source++);
2433
2434         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2435                 /* don't do the read, it's not guaranteed to return an EOF,
2436                  * just force an EOF
2437                  */
2438                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
2439
2440         else
2441                 {
2442                 int num_to_read =
2443                         yy_current_buffer->yy_buf_size - number_to_move - 1;
2444
2445                 while ( num_to_read <= 0 )
2446                         { /* Not enough room in the buffer - grow it. */
2447 #ifdef YY_USES_REJECT
2448                         YY_FATAL_ERROR(
2449 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2450 #else
2451
2452                         /* just a shorter name for the current buffer */
2453                         YY_BUFFER_STATE b = yy_current_buffer;
2454
2455                         int yy_c_buf_p_offset =
2456                                 (int) (yy_c_buf_p - b->yy_ch_buf);
2457
2458                         if ( b->yy_is_our_buffer )
2459                                 {
2460                                 int new_size = b->yy_buf_size * 2;
2461
2462                                 if ( new_size <= 0 )
2463                                         b->yy_buf_size += b->yy_buf_size / 8;
2464                                 else
2465                                         b->yy_buf_size *= 2;
2466
2467                                 b->yy_ch_buf = (char *)
2468                                         /* Include room in for 2 EOB chars. */
2469                                         yy_flex_realloc( (void *) b->yy_ch_buf,
2470                                                          b->yy_buf_size + 2 );
2471                                 }
2472                         else
2473                                 /* Can't grow it, we don't own it. */
2474                                 b->yy_ch_buf = 0;
2475
2476                         if ( ! b->yy_ch_buf )
2477                                 YY_FATAL_ERROR(
2478                                 "fatal error - scanner input buffer overflow" );
2479
2480                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2481
2482                         num_to_read = yy_current_buffer->yy_buf_size -
2483                                                 number_to_move - 1;
2484 #endif
2485                         }
2486
2487                 if ( num_to_read > YY_READ_BUF_SIZE )
2488                         num_to_read = YY_READ_BUF_SIZE;
2489
2490                 /* Read in more data. */
2491                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
2492                         yy_n_chars, num_to_read );
2493
2494                 yy_current_buffer->yy_n_chars = yy_n_chars;
2495                 }
2496
2497         if ( yy_n_chars == 0 )
2498                 {
2499                 if ( number_to_move == YY_MORE_ADJ )
2500                         {
2501                         ret_val = EOB_ACT_END_OF_FILE;
2502                         yyrestart( yyin );
2503                         }
2504
2505                 else
2506                         {
2507                         ret_val = EOB_ACT_LAST_MATCH;
2508                         yy_current_buffer->yy_buffer_status =
2509                                 YY_BUFFER_EOF_PENDING;
2510                         }
2511                 }
2512
2513         else
2514                 ret_val = EOB_ACT_CONTINUE_SCAN;
2515
2516         yy_n_chars += number_to_move;
2517         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2518         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2519
2520         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
2521
2522         return ret_val;
2523         }
2524
2525
2526 /* yy_get_previous_state - get the state just before the EOB char was reached */
2527
2528 static yy_state_type yy_get_previous_state()
2529         {
2530         register yy_state_type yy_current_state;
2531         register char *yy_cp;
2532
2533         yy_current_state = yy_start;
2534
2535         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2536                 {
2537                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2538                 if ( yy_accept[yy_current_state] )
2539                         {
2540                         yy_last_accepting_state = yy_current_state;
2541                         yy_last_accepting_cpos = yy_cp;
2542                         }
2543                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2544                         {
2545                         yy_current_state = (int) yy_def[yy_current_state];
2546                         if ( yy_current_state >= 529 )
2547                                 yy_c = yy_meta[(unsigned int) yy_c];
2548                         }
2549                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2550                 }
2551
2552         return yy_current_state;
2553         }
2554
2555
2556 /* yy_try_NUL_trans - try to make a transition on the NUL character
2557  *
2558  * synopsis
2559  *      next_state = yy_try_NUL_trans( current_state );
2560  */
2561
2562 #ifdef YY_USE_PROTOS
2563 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2564 #else
2565 static yy_state_type yy_try_NUL_trans( yy_current_state )
2566 yy_state_type yy_current_state;
2567 #endif
2568         {
2569         register int yy_is_jam;
2570         register char *yy_cp = yy_c_buf_p;
2571
2572         register YY_CHAR yy_c = 1;
2573         if ( yy_accept[yy_current_state] )
2574                 {
2575                 yy_last_accepting_state = yy_current_state;
2576                 yy_last_accepting_cpos = yy_cp;
2577                 }
2578         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2579                 {
2580                 yy_current_state = (int) yy_def[yy_current_state];
2581                 if ( yy_current_state >= 529 )
2582                         yy_c = yy_meta[(unsigned int) yy_c];
2583                 }
2584         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2585         yy_is_jam = (yy_current_state == 528);
2586
2587         return yy_is_jam ? 0 : yy_current_state;
2588         }
2589
2590
2591 #ifndef YY_NO_UNPUT
2592 #ifdef YY_USE_PROTOS
2593 static void yyunput( int c, register char *yy_bp )
2594 #else
2595 static void yyunput( c, yy_bp )
2596 int c;
2597 register char *yy_bp;
2598 #endif
2599         {
2600         register char *yy_cp = yy_c_buf_p;
2601
2602         /* undo effects of setting up yytext */
2603         *yy_cp = yy_hold_char;
2604
2605         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2606                 { /* need to shift things up to make room */
2607                 /* +2 for EOB chars. */
2608                 register int number_to_move = yy_n_chars + 2;
2609                 register char *dest = &yy_current_buffer->yy_ch_buf[
2610                                         yy_current_buffer->yy_buf_size + 2];
2611                 register char *source =
2612                                 &yy_current_buffer->yy_ch_buf[number_to_move];
2613
2614                 while ( source > yy_current_buffer->yy_ch_buf )
2615                         *--dest = *--source;
2616
2617                 yy_cp += (int) (dest - source);
2618                 yy_bp += (int) (dest - source);
2619                 yy_current_buffer->yy_n_chars =
2620                         yy_n_chars = yy_current_buffer->yy_buf_size;
2621
2622                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2623                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2624                 }
2625
2626         *--yy_cp = (char) c;
2627
2628
2629         yytext_ptr = yy_bp;
2630         yy_hold_char = *yy_cp;
2631         yy_c_buf_p = yy_cp;
2632         }
2633 #endif  /* ifndef YY_NO_UNPUT */
2634
2635
2636 #ifdef __cplusplus
2637 static int yyinput()
2638 #else
2639 static int input()
2640 #endif
2641         {
2642         int c;
2643
2644         *yy_c_buf_p = yy_hold_char;
2645
2646         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2647                 {
2648                 /* yy_c_buf_p now points to the character we want to return.
2649                  * If this occurs *before* the EOB characters, then it's a
2650                  * valid NUL; if not, then we've hit the end of the buffer.
2651                  */
2652                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2653                         /* This was really a NUL. */
2654                         *yy_c_buf_p = '\0';
2655
2656                 else
2657                         { /* need more input */
2658                         int offset = yy_c_buf_p - yytext_ptr;
2659                         ++yy_c_buf_p;
2660
2661                         switch ( yy_get_next_buffer() )
2662                                 {
2663                                 case EOB_ACT_LAST_MATCH:
2664                                         /* This happens because yy_g_n_b()
2665                                          * sees that we've accumulated a
2666                                          * token and flags that we need to
2667                                          * try matching the token before
2668                                          * proceeding.  But for input(),
2669                                          * there's no matching to consider.
2670                                          * So convert the EOB_ACT_LAST_MATCH
2671                                          * to EOB_ACT_END_OF_FILE.
2672                                          */
2673
2674                                         /* Reset buffer status. */
2675                                         yyrestart( yyin );
2676
2677                                         /* fall through */
2678
2679                                 case EOB_ACT_END_OF_FILE:
2680                                         {
2681                                         if ( yywrap() )
2682                                                 return EOF;
2683
2684                                         if ( ! yy_did_buffer_switch_on_eof )
2685                                                 YY_NEW_FILE;
2686 #ifdef __cplusplus
2687                                         return yyinput();
2688 #else
2689                                         return input();
2690 #endif
2691                                         }
2692
2693                                 case EOB_ACT_CONTINUE_SCAN:
2694                                         yy_c_buf_p = yytext_ptr + offset;
2695                                         break;
2696                                 }
2697                         }
2698                 }
2699
2700         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
2701         *yy_c_buf_p = '\0';     /* preserve yytext */
2702         yy_hold_char = *++yy_c_buf_p;
2703
2704
2705         return c;
2706         }
2707
2708
2709 #ifdef YY_USE_PROTOS
2710 void yyrestart( FILE *input_file )
2711 #else
2712 void yyrestart( input_file )
2713 FILE *input_file;
2714 #endif
2715         {
2716         if ( ! yy_current_buffer )
2717                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2718
2719         yy_init_buffer( yy_current_buffer, input_file );
2720         yy_load_buffer_state();
2721         }
2722
2723
2724 #ifdef YY_USE_PROTOS
2725 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2726 #else
2727 void yy_switch_to_buffer( new_buffer )
2728 YY_BUFFER_STATE new_buffer;
2729 #endif
2730         {
2731         if ( yy_current_buffer == new_buffer )
2732                 return;
2733
2734         if ( yy_current_buffer )
2735                 {
2736                 /* Flush out information for old buffer. */
2737                 *yy_c_buf_p = yy_hold_char;
2738                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2739                 yy_current_buffer->yy_n_chars = yy_n_chars;
2740                 }
2741
2742         yy_current_buffer = new_buffer;
2743         yy_load_buffer_state();
2744
2745         /* We don't actually know whether we did this switch during
2746          * EOF (yywrap()) processing, but the only time this flag
2747          * is looked at is after yywrap() is called, so it's safe
2748          * to go ahead and always set it.
2749          */
2750         yy_did_buffer_switch_on_eof = 1;
2751         }
2752
2753
2754 #ifdef YY_USE_PROTOS
2755 void yy_load_buffer_state( void )
2756 #else
2757 void yy_load_buffer_state()
2758 #endif
2759         {
2760         yy_n_chars = yy_current_buffer->yy_n_chars;
2761         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2762         yyin = yy_current_buffer->yy_input_file;
2763         yy_hold_char = *yy_c_buf_p;
2764         }
2765
2766
2767 #ifdef YY_USE_PROTOS
2768 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2769 #else
2770 YY_BUFFER_STATE yy_create_buffer( file, size )
2771 FILE *file;
2772 int size;
2773 #endif
2774         {
2775         YY_BUFFER_STATE b;
2776
2777         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2778         if ( ! b )
2779                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2780
2781         b->yy_buf_size = size;
2782
2783         /* yy_ch_buf has to be 2 characters longer than the size given because
2784          * we need to put in 2 end-of-buffer characters.
2785          */
2786         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2787         if ( ! b->yy_ch_buf )
2788                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2789
2790         b->yy_is_our_buffer = 1;
2791
2792         yy_init_buffer( b, file );
2793
2794         return b;
2795         }
2796
2797
2798 #ifdef YY_USE_PROTOS
2799 void yy_delete_buffer( YY_BUFFER_STATE b )
2800 #else
2801 void yy_delete_buffer( b )
2802 YY_BUFFER_STATE b;
2803 #endif
2804         {
2805         if ( ! b )
2806                 return;
2807
2808         if ( b == yy_current_buffer )
2809                 yy_current_buffer = (YY_BUFFER_STATE) 0;
2810
2811         if ( b->yy_is_our_buffer )
2812                 yy_flex_free( (void *) b->yy_ch_buf );
2813
2814         yy_flex_free( (void *) b );
2815         }
2816
2817
2818 #ifndef YY_ALWAYS_INTERACTIVE
2819 #ifndef YY_NEVER_INTERACTIVE
2820 extern int isatty YY_PROTO(( int ));
2821 #endif
2822 #endif
2823
2824 #ifdef YY_USE_PROTOS
2825 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2826 #else
2827 void yy_init_buffer( b, file )
2828 YY_BUFFER_STATE b;
2829 FILE *file;
2830 #endif
2831
2832
2833         {
2834         yy_flush_buffer( b );
2835
2836         b->yy_input_file = file;
2837         b->yy_fill_buffer = 1;
2838
2839 #if YY_ALWAYS_INTERACTIVE
2840         b->yy_is_interactive = 1;
2841 #else
2842 #if YY_NEVER_INTERACTIVE
2843         b->yy_is_interactive = 0;
2844 #else
2845         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2846 #endif
2847 #endif
2848         }
2849
2850
2851 #ifdef YY_USE_PROTOS
2852 void yy_flush_buffer( YY_BUFFER_STATE b )
2853 #else
2854 void yy_flush_buffer( b )
2855 YY_BUFFER_STATE b;
2856 #endif
2857
2858         {
2859         if ( ! b )
2860                 return;
2861
2862         b->yy_n_chars = 0;
2863
2864         /* We always need two end-of-buffer characters.  The first causes
2865          * a transition to the end-of-buffer state.  The second causes
2866          * a jam in that state.
2867          */
2868         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2869         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2870
2871         b->yy_buf_pos = &b->yy_ch_buf[0];
2872
2873         b->yy_at_bol = 1;
2874         b->yy_buffer_status = YY_BUFFER_NEW;
2875
2876         if ( b == yy_current_buffer )
2877                 yy_load_buffer_state();
2878         }
2879
2880
2881 #ifndef YY_NO_SCAN_BUFFER
2882 #ifdef YY_USE_PROTOS
2883 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2884 #else
2885 YY_BUFFER_STATE yy_scan_buffer( base, size )
2886 char *base;
2887 yy_size_t size;
2888 #endif
2889         {
2890         YY_BUFFER_STATE b;
2891
2892         if ( size < 2 ||
2893              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2894              base[size-1] != YY_END_OF_BUFFER_CHAR )
2895                 /* They forgot to leave room for the EOB's. */
2896                 return 0;
2897
2898         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2899         if ( ! b )
2900                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2901
2902         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2903         b->yy_buf_pos = b->yy_ch_buf = base;
2904         b->yy_is_our_buffer = 0;
2905         b->yy_input_file = 0;
2906         b->yy_n_chars = b->yy_buf_size;
2907         b->yy_is_interactive = 0;
2908         b->yy_at_bol = 1;
2909         b->yy_fill_buffer = 0;
2910         b->yy_buffer_status = YY_BUFFER_NEW;
2911
2912         yy_switch_to_buffer( b );
2913
2914         return b;
2915         }
2916 #endif
2917
2918
2919 #ifndef YY_NO_SCAN_STRING
2920 #ifdef YY_USE_PROTOS
2921 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2922 #else
2923 YY_BUFFER_STATE yy_scan_string( yy_str )
2924 yyconst char *yy_str;
2925 #endif
2926         {
2927         int len;
2928         for ( len = 0; yy_str[len]; ++len )
2929                 ;
2930
2931         return yy_scan_bytes( yy_str, len );
2932         }
2933 #endif
2934
2935
2936 #ifndef YY_NO_SCAN_BYTES
2937 #ifdef YY_USE_PROTOS
2938 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2939 #else
2940 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2941 yyconst char *bytes;
2942 int len;
2943 #endif
2944         {
2945         YY_BUFFER_STATE b;
2946         char *buf;
2947         yy_size_t n;
2948         int i;
2949
2950         /* Get memory for full buffer, including space for trailing EOB's. */
2951         n = len + 2;
2952         buf = (char *) yy_flex_alloc( n );
2953         if ( ! buf )
2954                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2955
2956         for ( i = 0; i < len; ++i )
2957                 buf[i] = bytes[i];
2958
2959         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2960
2961         b = yy_scan_buffer( buf, n );
2962         if ( ! b )
2963                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2964
2965         /* It's okay to grow etc. this buffer, and we should throw it
2966          * away when we're done.
2967          */
2968         b->yy_is_our_buffer = 1;
2969
2970         return b;
2971         }
2972 #endif
2973
2974
2975 #ifndef YY_NO_PUSH_STATE
2976 #ifdef YY_USE_PROTOS
2977 static void yy_push_state( int new_state )
2978 #else
2979 static void yy_push_state( new_state )
2980 int new_state;
2981 #endif
2982         {
2983         if ( yy_start_stack_ptr >= yy_start_stack_depth )
2984                 {
2985                 yy_size_t new_size;
2986
2987                 yy_start_stack_depth += YY_START_STACK_INCR;
2988                 new_size = yy_start_stack_depth * sizeof( int );
2989
2990                 if ( ! yy_start_stack )
2991                         yy_start_stack = (int *) yy_flex_alloc( new_size );
2992
2993                 else
2994                         yy_start_stack = (int *) yy_flex_realloc(
2995                                         (void *) yy_start_stack, new_size );
2996
2997                 if ( ! yy_start_stack )
2998                         YY_FATAL_ERROR(
2999                         "out of memory expanding start-condition stack" );
3000                 }
3001
3002         yy_start_stack[yy_start_stack_ptr++] = YY_START;
3003
3004         BEGIN(new_state);
3005         }
3006 #endif
3007
3008
3009 #ifndef YY_NO_POP_STATE
3010 static void yy_pop_state()
3011         {
3012         if ( --yy_start_stack_ptr < 0 )
3013                 YY_FATAL_ERROR( "start-condition stack underflow" );
3014
3015         BEGIN(yy_start_stack[yy_start_stack_ptr]);
3016         }
3017 #endif
3018
3019
3020 #ifndef YY_NO_TOP_STATE
3021 static int yy_top_state()
3022         {
3023         return yy_start_stack[yy_start_stack_ptr - 1];
3024         }
3025 #endif
3026
3027 #ifndef YY_EXIT_FAILURE
3028 #define YY_EXIT_FAILURE 2
3029 #endif
3030
3031 #ifdef YY_USE_PROTOS
3032 static void yy_fatal_error( yyconst char msg[] )
3033 #else
3034 static void yy_fatal_error( msg )
3035 char msg[];
3036 #endif
3037         {
3038         (void) fprintf( stderr, "%s\n", msg );
3039         exit( YY_EXIT_FAILURE );
3040         }
3041
3042
3043
3044 /* Redefine yyless() so it works in section 3 code. */
3045
3046 #undef yyless
3047 #define yyless(n) \
3048         do \
3049                 { \
3050                 /* Undo effects of setting up yytext. */ \
3051                 yytext[yyleng] = yy_hold_char; \
3052                 yy_c_buf_p = yytext + n; \
3053                 yy_hold_char = *yy_c_buf_p; \
3054                 *yy_c_buf_p = '\0'; \
3055                 yyleng = n; \
3056                 } \
3057         while ( 0 )
3058
3059
3060 /* Internal utility routines. */
3061
3062 #ifndef yytext_ptr
3063 #ifdef YY_USE_PROTOS
3064 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3065 #else
3066 static void yy_flex_strncpy( s1, s2, n )
3067 char *s1;
3068 yyconst char *s2;
3069 int n;
3070 #endif
3071         {
3072         register int i;
3073         for ( i = 0; i < n; ++i )
3074                 s1[i] = s2[i];
3075         }
3076 #endif
3077
3078 #ifdef YY_NEED_STRLEN
3079 #ifdef YY_USE_PROTOS
3080 static int yy_flex_strlen( yyconst char *s )
3081 #else
3082 static int yy_flex_strlen( s )
3083 yyconst char *s;
3084 #endif
3085         {
3086         register int n;
3087         for ( n = 0; s[n]; ++n )
3088                 ;
3089
3090         return n;
3091         }
3092 #endif
3093
3094
3095 #ifdef YY_USE_PROTOS
3096 static void *yy_flex_alloc( yy_size_t size )
3097 #else
3098 static void *yy_flex_alloc( size )
3099 yy_size_t size;
3100 #endif
3101         {
3102         return (void *) malloc( size );
3103         }
3104
3105 #ifdef YY_USE_PROTOS
3106 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3107 #else
3108 static void *yy_flex_realloc( ptr, size )
3109 void *ptr;
3110 yy_size_t size;
3111 #endif
3112         {
3113         /* The cast to (char *) in the following accommodates both
3114          * implementations that use char* generic pointers, and those
3115          * that use void* generic pointers.  It works with the latter
3116          * because both ANSI C and C++ allow castless assignment from
3117          * any pointer type to void*, and deal with argument conversions
3118          * as though doing an assignment.
3119          */
3120         return (void *) realloc( (char *) ptr, size );
3121         }
3122
3123 #ifdef YY_USE_PROTOS
3124 static void yy_flex_free( void *ptr )
3125 #else
3126 static void yy_flex_free( ptr )
3127 void *ptr;
3128 #endif
3129         {
3130         free( ptr );
3131         }
3132
3133 #if YY_MAIN
3134 int main()
3135         {
3136         yylex();
3137         return 0;
3138         }
3139 #endif
3140 #line 540 "cscanner.l"
3141
3142
3143 struct skeyword
3144 {
3145   /*@null@*/ /*@observer@*/ char *name;
3146   int token;
3147 } ;
3148
3149 /*
3150 ** These tokens are followed by syntax that is parsed by the 
3151 ** grammar proper.
3152 */
3153
3154 struct skeyword s_parsetable[] = {
3155   { "modifies", QMODIFIES } ,
3156   { "globals", QGLOBALS } ,
3157   { "alt", QALT } ,
3158   { "constant", QCONSTANT } ,
3159   { "function", QFUNCTION } ,
3160   { "iter", QITER } ,
3161   { "defines", QDEFINES } ,
3162   { "uses", QUSES } ,
3163   { "allocates", QALLOCATES } ,
3164   { "sets", QSETS } ,
3165   { "releases", QRELEASES } ,
3166   { "pre", QPRECLAUSE } ,
3167   { "post", QPOSTCLAUSE } ,
3168   {"setBufferSize", QSETBUFFERSIZE},
3169   {"bufferConstraint", QBUFFERCONSTRAINT},
3170   {"ensuresConstraint", QENSURESCONSTRAINT},
3171   {"setStringLength", QSETSTRINGLENGTH},
3172   {"testinRange", QTESTINRANGE},
3173   { NULL, BADTOK }
3174 } ;
3175
3176 /*
3177 ** These tokens are either stand-alone tokens, or followed by 
3178 ** token-specific text.
3179 */
3180
3181 struct skeyword s_keytable[] = {
3182   { "anytype", QANYTYPE } ,
3183   { "integraltype", QINTEGRALTYPE } ,
3184   { "unsignedintegraltype", QUNSIGNEDINTEGRALTYPE } ,
3185   { "signedintegraltype", QSIGNEDINTEGRALTYPE } ,
3186   { "out", QOUT } ,
3187   { "in", QIN } ,
3188   { "only", QONLY } , 
3189   { "owned", QOWNED } ,
3190   { "dependent", QDEPENDENT } ,
3191   { "partial", QPARTIAL } ,
3192   { "special", QSPECIAL } ,
3193   { "truenull", QTRUENULL } ,
3194   { "falsenull", QFALSENULL } ,
3195   { "keep", QKEEP } ,
3196   { "kept", QKEPT } ,
3197   { "notnull", QNOTNULL } ,
3198   { "abstract", QABSTRACT } ,
3199   { "concrete", QCONCRETE } ,
3200   { "mutable", QMUTABLE } ,
3201   { "immutable", QIMMUTABLE } ,
3202   { "unused", QUNUSED } ,
3203   { "external", QEXTERNAL } ,
3204   { "sef", QSEF } ,
3205   { "unique", QUNIQUE } ,
3206   { "returned", QRETURNED } ,
3207   { "exposed", QEXPOSED } ,
3208   { "refcounted", QREFCOUNTED } ,
3209   { "refs", QREFS } ,
3210   { "newref", QNEWREF } ,
3211   { "tempref", QTEMPREF } ,
3212   { "killref", QKILLREF } ,
3213   { "null", QNULL } ,
3214   { "relnull", QRELNULL } ,
3215   { "nullterminated", QNULLTERMINATED }, 
3216   { "setBufferSize", QSETBUFFERSIZE },
3217   { "bufferConstraint", QBUFFERCONSTRAINT },
3218   { "ensuresConstraint", QENSURESCONSTRAINT },
3219   { "testInRange", QTESTINRANGE},
3220   { "MaxSet", QMAXSET},
3221   { "MaxRead", QMAXREAD},
3222   { "reldef", QRELDEF } ,
3223   { "observer", QOBSERVER } ,
3224   { "exits", QEXITS } ,
3225   { "mayexit", QMAYEXIT } ,
3226   { "trueexit", QTRUEEXIT } ,
3227   { "falseexit", QFALSEEXIT } ,
3228   { "neverexit", QNEVEREXIT } ,
3229   { "temp", QTEMP } ,
3230   { "shared", QSHARED } ,
3231   { "ref", QREF } ,
3232   { "unchecked", QUNCHECKED } ,
3233   { "checked", QCHECKED } ,
3234   { "checkmod", QCHECKMOD } ,
3235   { "checkedstrict", QCHECKEDSTRICT } ,
3236   { "innercontinue", QINNERCONTINUE } ,
3237   { "innerbreak", QINNERBREAK } ,
3238   { "loopbreak", QLOOPBREAK } ,
3239   { "switchbreak", QSWITCHBREAK } ,
3240   { "safebreak", QSAFEBREAK } , 
3241   { "fallthrough", QFALLTHROUGH } ,
3242   { "l_fallthrou", QLINTFALLTHROUGH } , 
3243   { "l_fallth", QLINTFALLTHRU } ,
3244   { "notreached", QNOTREACHED } ,
3245   { "l_notreach", QLINTNOTREACHED } ,
3246   { "printflike", QPRINTFLIKE } ,
3247   { "l_printfli", QLINTPRINTFLIKE } ,
3248   { "scanflike", QSCANFLIKE } ,
3249   { "messagelike", QMESSAGELIKE } ,
3250   { "l_argsus", QARGSUSED } ,
3251   { NULL, BADTOK } 
3252 } ;
3253
3254 /*
3255 ** would be better if these weren't hard coded...
3256 */
3257
3258 static bool isArtificial (cstring s)
3259 {
3260   return (cstring_equalLit (s, "modifies") 
3261           || cstring_equalLit (s, "globals") 
3262           || cstring_equalLit (s, "alt"));
3263 }
3264
3265 void swallowMacro (void)
3266 {
3267   int i;
3268   bool skipnext = FALSE;
3269
3270   while ((i = lminput ()) != EOF)
3271     {
3272       char c = (char) i;
3273       
3274       
3275       if (c == '\\')
3276         {
3277           skipnext = TRUE;
3278         }
3279       else if (c == '\n')
3280         {
3281           if (skipnext)
3282             {
3283               skipnext = FALSE;
3284             }
3285           else
3286             {
3287               checkUngetc (i, yyin);
3288               return;
3289             }
3290         }
3291     }
3292
3293   if (i != EOF)
3294     {
3295       checkUngetc (i, yyin);
3296     }
3297 }
3298
3299 static int commentMarkerToken (cstring s)
3300 {
3301   int i = 0;
3302   
3303   while (s_parsetable[i].name != NULL) 
3304     {
3305       if (cstring_equalLit (s, s_parsetable[i].name))
3306         {
3307           return s_parsetable[i].token;
3308         }
3309
3310       i++;
3311     }
3312
3313   return BADTOK;
3314 }
3315
3316 static int tokenMacroCode (cstring s)
3317 {
3318   int i = 0;
3319   
3320   while (s_keytable[i].name != NULL) 
3321     {
3322       if (cstring_equalLit (s, s_keytable[i].name)) 
3323         {
3324           if (s_keytable[i].token == QLINTFALLTHROUGH) 
3325             {
3326               voptgenerror
3327                 (FLG_WARNLINTCOMMENTS,
3328                  cstring_makeLiteral
3329                  ("Traditional lint comment /*FALLTHROUGH*/ used.  "
3330                   "This is interpreted by "
3331                   "LCLint in the same way as most Unix lints, but it is "
3332                   "preferable to replace it with the /*@fallthrough@*/ "
3333                   "stylized comment"),
3334                  g_currentloc);
3335               return QFALLTHROUGH;            
3336             }
3337           else if (s_keytable[i].token == QLINTFALLTHRU)
3338             {
3339               voptgenerror 
3340                 (FLG_WARNLINTCOMMENTS,
3341                  cstring_makeLiteral
3342                  ("Traditional lint comment /*FALLTHRU*/ used.  "
3343                   "This is interpreted by "
3344                   "LCLint in the same way as most Unix lints, but it is "
3345                   "preferable to replace it with the /*@fallthrough@*/ "
3346                   "stylized comment"),
3347                  g_currentloc);
3348               return QFALLTHROUGH;
3349             }
3350           else if (s_keytable[i].token == QLINTNOTREACHED)
3351             {
3352               voptgenerror 
3353                 (FLG_WARNLINTCOMMENTS,
3354                  cstring_makeLiteral
3355                  ("Traditional lint comment /*NOTREACHED*/ used.  "
3356                   "This is interpreted by "
3357                   "LCLint in the same way as most Unix lints, but it is "
3358                   "preferable to replace it with the /*@notreached@*/ "
3359                   "stylized comment."),
3360                  g_currentloc);
3361               
3362               return QNOTREACHED;
3363             }
3364           else if (s_keytable[i].token == QPRINTFLIKE)
3365             {
3366               setSpecialFunction (QU_PRINTFLIKE);
3367               return SKIPTOK;
3368             }
3369           else if (s_keytable[i].token == QLINTPRINTFLIKE)
3370             {         
3371               voptgenerror 
3372                 (FLG_WARNLINTCOMMENTS,
3373                  cstring_makeLiteral
3374                  ("Traditional lint comment /*PRINTFLIKE*/ used.  "
3375                   "This is interpreted by "
3376                   "LCLint in the same way as most Unix lints, but it is "
3377                   "preferable to replace it with either /*@printflike@*/, "
3378                   "/*@scanflike@*/ or /*@messagelike@*/."),
3379                  g_currentloc);
3380               
3381               setSpecialFunction (QU_PRINTFLIKE);
3382               return SKIPTOK;
3383             }
3384           else if (s_keytable[i].token == QSCANFLIKE)
3385             {
3386               setSpecialFunction (QU_SCANFLIKE);
3387               return SKIPTOK;
3388             }
3389           else if (s_keytable[i].token == QMESSAGELIKE)
3390             {
3391               setSpecialFunction (QU_MESSAGELIKE);
3392               return SKIPTOK;
3393             }
3394           else if (s_keytable[i].token == QARGSUSED)
3395             {
3396               voptgenerror
3397                 (FLG_WARNLINTCOMMENTS,
3398                  cstring_makeLiteral
3399                  ("Traditional lint comment /*ARGSUSED*/ used.  "
3400                   "This is interpreted by "
3401                   "LCLint in the same way as most Unix lints, but it is "
3402                   "preferable to use /*@unused@*/ annotations on "
3403                   "the unused parameters."),
3404                  g_currentloc);
3405               
3406               setArgsUsed ();
3407               return SKIPTOK;
3408             }
3409           
3410           return s_keytable[i].token;
3411         }
3412       
3413       i++;
3414     }
3415   
3416   return BADTOK;
3417 }
3418
3419 static int lminput ()
3420 {
3421   if (savechar == '\0')
3422     {
3423       incColumn ();
3424       return (input ());
3425     }
3426   else
3427     {
3428       int save = (int) savechar;
3429       savechar = '\0';
3430       return save;
3431     }
3432 }
3433
3434 static void lmsavechar (char c)
3435 {
3436   if (savechar == '\0') savechar = c;
3437   else
3438     {
3439       llbuglit ("lmsavechar: override");
3440     }
3441 }
3442
3443 static int returnFloat (ctype ct, double f)
3444 {
3445   yylval.expr = exprNode_floatLiteral (f, ct, cstring_fromChars (yytext), 
3446                                        fileloc_decColumn (g_currentloc, tokLength));
3447   tokLength = 0; 
3448   return (CCONSTANT);
3449 }
3450
3451 static int returnInt (ctype ct, long i)
3452 {
3453   ctype c = ct;
3454
3455   if (ctype_equal (ct, ctype_int))
3456     {
3457       if (i == 0)
3458         {
3459           c = context_typeofZero ();
3460         }
3461       else if (i == 1)
3462         {
3463           c = context_typeofOne ();
3464         }
3465     }
3466   
3467   yylval.expr = exprNode_numLiteral (c, cstring_fromChars (yytext), 
3468                                      fileloc_decColumn (g_currentloc, tokLength), i);   
3469   tokLength = 0; 
3470   return (CCONSTANT);
3471 }
3472
3473 static int returnChar (char c)
3474 {
3475   yylval.expr = exprNode_charLiteral (c, cstring_fromChars (yytext), 
3476                                       fileloc_decColumn (g_currentloc, tokLength));
3477   tokLength = 0; 
3478   return (CCONSTANT);
3479 }
3480
3481 static int ninput ()  
3482 {
3483   int c = lminput ();
3484
3485   if (c != EOF && ((char)c == '\n'))
3486     {
3487       context_incLineno ();
3488     }
3489
3490   return c;
3491 }
3492
3493 static char macro_nextChar ()
3494 {
3495   static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE;
3496   int ic;
3497   char c;
3498
3499   ic = lminput ();
3500   c = char_fromInt (ic);
3501   
3502   if (!in_quote && !in_char && (c == '\\' || c == BEFORE_COMMENT_MARKER[0]))
3503     {
3504       if (c == '\\')
3505         {
3506           while ((c = char_fromInt (lminput ())) != '\0' && c != '\n')
3507             {
3508               ; /* skip to newline */
3509             }
3510           
3511           context_incLineno ();
3512           
3513           if (c != '\0')
3514             {
3515               return macro_nextChar ();
3516             }
3517           else 
3518             {
3519               return c;
3520             }
3521         }
3522       else /* if (c == '@') */
3523         {
3524           if (handleLlSpecial () != BADTOK)
3525             {
3526               llerrorlit (FLG_SYNTAX, "Macro cannot use special syntax");
3527             }
3528
3529           return macro_nextChar ();
3530         }
3531     }
3532   else if (!in_escape && c == '\"')
3533     {
3534       in_quote = !in_quote;
3535     }
3536   else if (!in_escape && c == '\'')
3537     {
3538       in_char = !in_char;
3539     }
3540   else if ((in_quote || in_char) && c == '\\')
3541     {
3542       in_escape = !in_escape;
3543     }
3544   else if ((in_quote || in_char) && in_escape)
3545     {
3546       in_escape = FALSE;
3547     }
3548   else if (!in_quote && c == '/')
3549     {
3550       char c2;
3551       
3552       if ((c2 = char_fromInt (lminput ())) == '*')
3553         {
3554           while (c2 != '\0')
3555             {
3556               while ((c2 = char_fromInt (lminput ())) != '\0'
3557                      && c2 != '\n' && c2 != '*')
3558                 {
3559                   ;
3560                 }
3561               
3562               if (c2 == '*')
3563                 {
3564                   while ((c2 = char_fromInt (lminput ())) != '\0' 
3565                          && c2 == '*')
3566                     {
3567                       ;
3568                     }
3569
3570                   if (c2 == '/')
3571                     {
3572                       goto outofcomment;
3573                     }
3574                 }
3575               else 
3576                 {
3577                   llfatalerror (cstring_makeLiteral ("Macro: bad comment!"));
3578                 }
3579             }
3580         outofcomment:
3581           return macro_nextChar ();
3582         }
3583       else
3584         {
3585           /*** putchar does not work!  why?  puts to stdio...??! ***/
3586           lmsavechar (c2);
3587         }
3588     }
3589   return c;
3590 }
3591
3592 /*
3593 ** keeps stylized comments
3594 */
3595
3596 static char macro_nextCharC ()
3597 {
3598   static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE;
3599   char c;
3600
3601   c = char_fromInt (lminput ());
3602
3603   if (!in_quote && !in_char && c == '\\')
3604     {
3605       while ((c = char_fromInt (lminput ())) != '\0' && c != '\n')
3606         {
3607           ; /* skip to newline */
3608         }
3609       
3610       context_incLineno ();
3611       
3612       if (c != '\0')
3613         {
3614           return macro_nextCharC ();
3615         }
3616       else
3617         {
3618           return c;
3619         }
3620     }
3621   else if (!in_escape && c == '\"')
3622     {
3623       in_quote = !in_quote;
3624     }
3625   else if (!in_escape && c == '\'')
3626     {
3627       in_char = !in_char;
3628     }
3629   else if ((in_quote || in_char) && c == '\\')
3630     {
3631       in_escape = !in_escape;
3632     }
3633   else if ((in_quote || in_char) && in_escape)
3634     {
3635       in_escape = FALSE;
3636     }
3637   else if (!in_quote && c == '/')
3638     {
3639       char c2;
3640       
3641       if ((c2 = char_fromInt (lminput ())) == '*')
3642         {
3643           while (c2 != '\0')
3644             {
3645               while ((c2 = char_fromInt (lminput ())) != '\0' 
3646                      && c2 != '\n' && c2 != '*')
3647                 {
3648                   ;
3649                 }
3650               
3651               if (c2 == '*')
3652                 {
3653                   while ((c2 = char_fromInt (lminput ())) != '\0'
3654                          && c2 == '*')
3655                     {
3656                       ;
3657                     }
3658
3659                   if (c2 == '/') 
3660                     {
3661                       goto outofcomment;
3662                     }
3663                 }
3664               else 
3665                 {
3666                   llfatalerror (cstring_makeLiteral ("Macro: bad comment!"));
3667                 }
3668             }
3669         outofcomment:
3670           return macro_nextCharC ();
3671         }
3672       else
3673         {
3674           lmsavechar (c2);
3675         }
3676     }
3677   return c;
3678 }
3679
3680 /*
3681 ** skips whitespace (handles line continuations)
3682 ** returns first non-whitespace character
3683 */
3684
3685 static char skip_whitespace ()
3686 {
3687   char c;
3688
3689   while ((c = macro_nextChar ()) == ' ' || c == '\t')
3690     {
3691       ;
3692     }
3693
3694   return c;
3695 }
3696
3697 static void handleMacro ()
3698 {
3699   cstring mac = cstring_undefined;
3700   int macrocode;
3701   char c;
3702
3703   while (currentColumn () > 2)
3704     {
3705       mac = cstring_appendChar (mac, ' ');
3706       setTokLength (-1);
3707     }
3708
3709   c = macro_nextCharC ();
3710
3711   if (c >= '0' && c <= '9')
3712     {
3713       int i;
3714
3715       for (i = 0; i < ((c - '0') + 1); i++)
3716         {
3717           mac = cstring_appendChar (mac, ' ');
3718         }
3719     }
3720   else
3721     {
3722       BADBRANCH;
3723     }
3724
3725   while (((c = macro_nextCharC ()) != '\0') && (c != '\n'))
3726     {
3727       mac = cstring_appendChar (mac, c);
3728     }
3729
3730   
3731   macrocode = tokenMacroCode (mac);
3732
3733   if (macrocode == BADTOK && !isArtificial (mac))
3734     {
3735       DPRINTF (("Add macro: %s", mac));
3736       context_addMacroCache (mac);
3737     }
3738   else
3739     {
3740       cstring_free (mac);
3741     }
3742
3743   if (c == '\n')
3744     {
3745       context_incLineno ();
3746     }
3747 }
3748
3749 static bool processMacro (void)
3750 {
3751   uentry e2;
3752   ctype ct;
3753   int noparams = 0;
3754   cstring fname = cstring_undefined;
3755   bool res = TRUE;
3756   bool isspecfcn = FALSE;
3757   bool isiter = FALSE;
3758   bool skipparam = FALSE;
3759   bool isenditer = FALSE;
3760   bool unknownm = FALSE;
3761   bool hasParams = FALSE;
3762   bool emptyMacro = FALSE;
3763   char c = skip_whitespace ();
3764   fileloc loc = fileloc_noColumn (g_currentloc);
3765
3766   /* are both of these necessary?  what do they mean? */
3767   uentryList specparams = uentryList_undefined;
3768   uentryList pn = uentryList_undefined;
3769
3770   context_resetMacroMissingParams ();
3771
3772   if (c == '\0' || c == '\n')
3773     {
3774       llcontbug (cstring_makeLiteral ("Bad macro"));
3775       fileloc_free (loc);
3776       return FALSE;
3777     }
3778   
3779   fname = cstring_appendChar (fname, c);  
3780
3781   while ((c = macro_nextChar ()) != '(' && c != '\0'
3782          && c != ' ' && c != '\t' && c != '\n')
3783     {
3784       fname = cstring_appendChar (fname, c);
3785     }
3786
3787   if (c == ' ' || c == '\t' || c == '\n')
3788     {
3789       char oldc = c;
3790
3791       if (c != '\n')
3792         {
3793           while (c == ' ' || c == '\t')
3794             {
3795               c = macro_nextChar ();
3796             }
3797           unput (c);
3798         }
3799
3800       if (c == '\n')
3801         {
3802           emptyMacro = TRUE;
3803           unput (c);
3804         }
3805
3806       c = oldc;
3807     }
3808
3809   hasParams = (c == '(');
3810
3811   
3812   if (usymtab_exists (fname))
3813     {
3814       e2 = usymtab_lookupExpose (fname);
3815       ct = uentry_getType (e2);
3816
3817       
3818       if (uentry_isCodeDefined (e2) 
3819           && fileloc_isUser (uentry_whereDefined (e2)))
3820         {
3821           if (optgenerror 
3822               (FLG_MACROREDEF,
3823                message ("Macro %s already defined", fname),
3824                loc))
3825             {
3826               uentry_showWhereDefined (e2);
3827               uentry_clearDefined (e2);
3828             }
3829
3830           if (uentry_isFunction (e2))
3831             {
3832               uentry_setType (e2, ctype_unknown);
3833               ct = ctype_unknown;
3834               unknownm = TRUE;
3835               context_enterUnknownMacro (e2); 
3836             }
3837           else
3838             {
3839               context_enterConstantMacro (e2);
3840             }
3841         }
3842       else
3843         {
3844           if (uentry_isForward (e2) && uentry_isFunction (e2))
3845             {
3846               unknownm = TRUE;
3847
3848               voptgenerror 
3849                 (FLG_MACROFCNDECL,
3850                  message
3851                  ("Parameterized macro has no prototype or specification: %s ", 
3852                   fname),
3853                  loc);
3854               
3855               ct = ctype_unknown;
3856               uentry_setType (e2, ctype_unknown);
3857               uentry_setFunctionDefined (e2, loc); 
3858               uentry_setUsed (e2, fileloc_undefined);
3859               context_enterUnknownMacro (e2); 
3860             }
3861           else
3862             {
3863               if (uentry_isIter (e2))
3864                 {
3865                   isiter = TRUE;
3866                   specparams = uentry_getParams (e2);
3867                   noparams = uentryList_size (specparams);
3868                   uentry_setDefined (e2, loc);
3869                   context_enterIterDef (e2); 
3870                 }
3871               else if (uentry_isEndIter (e2))
3872                 {
3873                   isenditer = TRUE;
3874                   uentry_setDefined (e2, loc);
3875                   context_enterIterEnd (e2); /* don't care about it now */
3876                   /* but should parse like an iter! */
3877                 }
3878               else if (uentry_isConstant (e2))
3879                 {
3880                   if (hasParams)
3881                     {
3882                       voptgenerror 
3883                         (FLG_INCONDEFS, 
3884                          message ("Constant %s implemented as parameterized macro",
3885                                   fname),
3886                          g_currentloc);
3887                       
3888                       uentry_showWhereSpecified (e2);
3889                       uentry_setType (e2, ctype_unknown);
3890                       uentry_makeVarFunction (e2);
3891                       uentry_setDefined (e2, g_currentloc);
3892                       uentry_setFunctionDefined (e2, g_currentloc);
3893                       context_enterUnknownMacro (e2); 
3894                     }
3895                   else
3896                     {
3897                       if (!uentry_isSpecified (e2))
3898                         {
3899                           fileloc oloc = uentry_whereDeclared (e2);
3900
3901                           if (fileloc_isLib (oloc))
3902                             {
3903                               ;
3904                             }
3905                           else if (fileloc_isUndefined (oloc)
3906                                    || fileloc_isPreproc (oloc))
3907                             {
3908                               if (!emptyMacro)
3909                                 {
3910                                   voptgenerror
3911                                     (FLG_MACROCONSTDECL,
3912                                      message 
3913                                      ("Macro constant %q not declared",
3914                                       uentry_getName (e2)),
3915                                      loc);                       
3916                                 }
3917                             }
3918                           else if (!fileloc_withinLines (oloc, loc, 2))
3919                             { /* bogus!  will give errors if there is too much whitespace */
3920                               voptgenerror
3921                                 (FLG_SYNTAX,
3922                                  message 
3923                                  ("Macro constant name %s does not match name in "
3924                                   "previous constant declaration.  This constant "
3925                                   "is declared at %q", fname, 
3926                                   fileloc_unparse (oloc)),
3927                                  loc);
3928                             }
3929                         }
3930
3931                       context_enterConstantMacro (e2);        
3932                       cstring_free (fname);
3933                       fileloc_free (loc);
3934                       return res;
3935                     }
3936
3937                 }
3938               else if (ctype_isFunction (ct))
3939                 {
3940                   isspecfcn = TRUE;
3941                   specparams = ctype_argsFunction (ct);
3942                   noparams = uentryList_size (specparams);
3943                   
3944                   uentry_setFunctionDefined (e2, loc); 
3945                   context_enterMacro (e2);
3946                 }
3947               else if (uentry_isVar (e2))
3948                 {
3949                   if (hasParams)
3950                     {
3951                       voptgenerror
3952                         (FLG_INCONDEFS,
3953                          message ("Variable %s implemented as parameterized macro", 
3954                                   fname),
3955                          loc);
3956
3957                       uentry_showWhereSpecified (e2);
3958                       uentry_setType (e2, ctype_unknown);
3959                       uentry_makeVarFunction (e2);
3960                       uentry_setDefined (e2, g_currentloc);
3961                       uentry_setFunctionDefined (e2, g_currentloc);
3962                       context_enterUnknownMacro (e2); 
3963                     }
3964                   else
3965                     {
3966                       uentry ucons = uentry_makeConstant (fname,
3967                                                           ctype_unknown,
3968                                                           loc);
3969                       if (uentry_isExpandedMacro (e2))
3970                         {
3971                           ; /* okay */
3972                         }
3973                       else
3974                         {
3975                           if (optgenerror 
3976                               (FLG_INCONDEFS,
3977                                message ("Variable %s implemented by a macro",
3978                                         fname),
3979                                loc))
3980                             {
3981                               uentry_showWhereSpecified (e2);
3982                             }
3983                         }
3984
3985                       uentry_setDefined (e2, loc);
3986                       uentry_setUsed (ucons, loc);
3987
3988                       context_enterConstantMacro (ucons);
3989                       uentry_markOwned (ucons);
3990                       cstring_free (fname);
3991                       return res;
3992                     }
3993                 }
3994               else
3995                 {
3996                   if (uentry_isDatatype (e2))
3997                     {
3998                       vgenhinterror 
3999                         (FLG_SYNTAX,
4000                          message ("Type implemented as macro: %x", 
4001                                   uentry_getName (e2)),
4002                          message ("A type is implemented using a macro definition.  A "
4003                                   "typedef should be used instead."),
4004                          g_currentloc);
4005
4006                       swallowMacro ();
4007                       /* Must exit scope (not sure why a new scope was entered?) */
4008                       usymtab_quietExitScope (g_currentloc);
4009                       uentry_setDefined (e2, g_currentloc);
4010                       res = FALSE;
4011                     }
4012                   else
4013                     {
4014                       llcontbug 
4015                         (message ("Unexpanded macro not function or constant: %q", 
4016                                   uentry_unparse (e2)));
4017                       uentry_setType (e2, ctype_unknown);
4018                       
4019                       if (hasParams)
4020                         {
4021                           uentry_makeVarFunction (e2);
4022                           uentry_setDefined (e2, g_currentloc);
4023                           uentry_setFunctionDefined (e2, g_currentloc);
4024                           context_enterUnknownMacro (e2); 
4025                         }
4026                     }
4027                 }
4028             }
4029         }
4030     }
4031   else
4032     {
4033       uentry ce;
4034
4035       voptgenerror 
4036         (FLG_MACROMATCHNAME,
4037          message ("Unexpanded macro %s does not match name of a constant "
4038                   "or iter declaration.  The name used in the control "
4039                   "comment on the previous line should match.  "
4040                   "(Assuming macro defines a constant.)", 
4041                   fname),
4042          loc);
4043
4044
4045       ce = uentry_makeConstant (fname, ctype_unknown, fileloc_undefined);      
4046       uentry_setUsed (ce, loc); /* perhaps bogus? */
4047       e2 = usymtab_supEntryReturn (ce);
4048       
4049       context_enterConstantMacro (e2);        
4050       cstring_free (fname);
4051       fileloc_free (loc);
4052       return res;
4053     }
4054   
4055   /* in macros, ( must follow immediatetly after name */
4056   
4057   if (hasParams)
4058     {
4059       int paramno = 0;
4060       
4061       c = skip_whitespace ();
4062
4063       while (c != ')' && c != '\0')
4064         {
4065           uentry  param;
4066           bool    suppress = context_inSuppressRegion ();
4067           cstring paramname = cstring_undefined;
4068
4069           /*
4070           ** save the parameter location
4071           */
4072
4073           decColumn ();
4074           context_saveLocation ();
4075           incColumn ();
4076
4077           while (c != ' ' && c != '\t' && c != ',' && c != '\0' && c != ')')
4078             {
4079               paramname = cstring_appendChar (paramname, c);
4080               c = macro_nextChar ();
4081             }
4082           
4083           if (c == ' ' || c == '\t') c = skip_whitespace ();
4084
4085           if (c == ',')
4086             {
4087               c = macro_nextChar ();
4088               if (c == ' ' || c == '\t') c = skip_whitespace ();
4089             }
4090           
4091           if (c == '\0')
4092             {
4093               llfatalerror (cstring_makeLiteral
4094                             ("Bad macro syntax: uentryList"));
4095             }
4096           
4097           if ((isspecfcn || isiter) && (paramno < noparams)
4098               && !uentry_isElipsisMarker (uentryList_getN 
4099                                           (specparams, paramno)))
4100             {
4101               uentry decl = uentryList_getN (specparams, paramno);
4102               sRef sr;
4103               
4104               param = uentry_nameCopy (paramname, decl);
4105
4106                               
4107               uentry_setParam (param);
4108               sr = sRef_makeParam (paramno, uentry_getType (param));
4109
4110               if (sRef_getNullState (sr) == NS_ABSNULL)
4111                 {
4112                   ctype pt = ctype_realType (uentry_getType (param));
4113
4114                   if (ctype_isUser (pt))
4115                     {
4116                       uentry te = usymtab_getTypeEntrySafe (ctype_typeId (pt));
4117                       
4118                       if (uentry_isValid (te))
4119                         {
4120                           sRef_setStateFromUentry (sr, te);
4121                         }
4122                     }
4123                   else
4124                     {
4125                       sRef_setNullState (sr, NS_UNKNOWN, g_currentloc);
4126                     }
4127                 }
4128
4129               uentry_setSref (param, sr);
4130               uentry_setDeclaredForceOnly (param, context_getSaveLocation ());
4131
4132               skipparam = isiter && uentry_isOut (uentryList_getN (specparams, paramno));
4133             }
4134           else
4135             {
4136               fileloc sloc = context_getSaveLocation ();
4137
4138               param = uentry_makeVariableSrefParam 
4139                 (paramname, ctype_unknown, sRef_makeParam (paramno, ctype_unknown));
4140               cstring_free (paramname);
4141
4142               sRef_setPosNull  (uentry_getSref (param), sloc);
4143
4144               uentry_setDeclaredForce (param, sloc);
4145
4146               skipparam = FALSE;
4147               fileloc_free (sloc);
4148             }
4149
4150           if (!skipparam)
4151             {
4152               llassert (!uentry_isElipsisMarker (param));
4153
4154               if (!suppress)
4155                 {
4156                   sRef_makeUnsafe (uentry_getSref (param));
4157                 }
4158               
4159               pn = uentryList_add (pn, uentry_copy (param));
4160               usymtab_supEntry (param);
4161             }
4162           else
4163             {
4164               /* don't add param */
4165               uentry_free (param);
4166             }
4167
4168           if (c == ',') 
4169             {
4170               (void) macro_nextChar ();
4171               c = skip_whitespace ();
4172             }
4173
4174           paramno++;
4175         }
4176       
4177       if (c == ')')
4178         {
4179           if (isspecfcn || isiter)
4180             {
4181               if (paramno != noparams && noparams >= 0)
4182                 {
4183                   advanceLine ();
4184
4185                   voptgenerror 
4186                     (FLG_INCONDEFS,
4187                      message ("Macro %s specified with %d args, defined with %d", 
4188                               fname, noparams, paramno),
4189                      g_currentloc);
4190
4191                   uentry_showWhereSpecified (e2);
4192                   uentry_resetParams (e2, pn);
4193                 }
4194             }
4195           else
4196             {
4197               uentry_resetParams (e2, pn);
4198             }
4199         }
4200     }
4201   else
4202     {
4203       /*
4204       ** the form should be:
4205       **
4206       ** # define newname oldname
4207       ** where oldname refers to a function matching the specification
4208       ** of newname.
4209       */
4210
4211       if (unknownm)
4212         {
4213           sRef_setGlobalScope ();
4214           usymtab_supGlobalEntry (uentry_makeVariableLoc (fname, ctype_unknown));
4215           sRef_clearGlobalScope ();
4216         }
4217       else
4218         {
4219           context_setMacroMissingParams ();
4220         }
4221     }
4222   
4223   
4224   /* context_setuentryList (pn); */
4225   usymtab_enterScope ();
4226
4227   fileloc_free (loc);
4228   cstring_free (fname);
4229
4230   return res;
4231 }
4232
4233 static bool handleSpecial (char *yyt)
4234 {
4235   char *l = mstring_create (MAX_NAME_LENGTH);
4236   static bool reportcpp = FALSE;
4237   int lineno = 0;
4238   char c;
4239   char *ol;
4240   cstring olc;
4241   
4242   strcpy (l, yyt + 1);
4243
4244   /* Need to safe original l for deallocating. */
4245   ol = l;
4246
4247   l += strlen (yyt) - 1;
4248   
4249   while ((c = char_fromInt (lminput ())) != '\n' && c != '\0')
4250     {
4251       *l++ = c;
4252     }
4253
4254   *l = '\0';
4255   olc = cstring_fromChars (ol);
4256   
4257   if (cstring_equalPrefix (olc, "pragma"))
4258     {
4259       char *pname = mstring_create (longUnsigned_fromInt (MAX_PRAGMA_LEN));
4260       char *opname = pname;
4261       char *ptr = ol + 6; /* pragma is six characters, plus space */
4262       int len = 0;
4263       
4264       
4265       /* skip whitespace */
4266       while (((c = *ptr) != '\0') && isspace (c))
4267         {
4268           ptr++;
4269         }
4270
4271       
4272       while (((c = *ptr) != '\0') && !isspace (c))
4273         {
4274           len++;
4275
4276           if (len > MAX_PRAGMA_LEN)
4277             {
4278               break;
4279             }
4280
4281           ptr++;
4282           *pname++ = c;
4283         }
4284
4285       *pname = '\0';
4286       
4287       if (len == PRAGMA_LEN_EXPAND 
4288           && mstring_equal (opname, PRAGMA_EXPAND))
4289         {
4290           cstring exname = cstring_undefined;
4291           uentry ue;
4292           
4293           ptr++; 
4294           while (((c = *ptr) != '\0') && !isspace (c))
4295             {
4296               exname = cstring_appendChar (exname, c);
4297               ptr++;
4298             }
4299              
4300           
4301           ue = usymtab_lookupExposeGlob (exname);
4302           
4303           if (uentry_isExpandedMacro (ue))
4304             {
4305               if (fileloc_isPreproc (uentry_whereDefined (ue)))
4306                 {
4307                   fileloc_setColumn (g_currentloc, 1);
4308                   uentry_setDefined (ue, g_currentloc);
4309                 }
4310             }
4311
4312           cstring_free (exname);
4313         }
4314     }
4315   else if (cstring_equalPrefix (olc, "ident"))
4316     {
4317       /* Some pre-processors will leave these in the code.  Ignore rest of line */
4318     }
4319   /*
4320   ** Yuk...Win32 filenames can have spaces in them...we need to read
4321   ** to the matching end quote.
4322   */
4323   else if ((sscanf (ol, "line %d \"", &lineno) == 1)
4324            || (sscanf (ol, " %d \"", &lineno) == 1))
4325     {
4326       char *tmp = ol;
4327       char *fname;
4328       fileId fid;
4329
4330       while (*tmp != '\"' && *tmp != '\0')
4331         {
4332           tmp++;
4333         }
4334
4335       llassert (*tmp == '\"');
4336
4337       tmp++;
4338       fname = tmp;
4339       
4340       while (*tmp != '\"' && *tmp != '\0')
4341         {
4342           tmp++;
4343         }
4344
4345       llassert (*tmp == '\"');
4346
4347       *tmp = '\0';
4348
4349       DPRINTF (("fname: %s", fname));
4350
4351 # if defined(OS2) || defined(MSDOS) || defined(WIN32)
4352
4353       /*
4354       ** DOS-like path delimiters get delivered in pairs, something like 
4355       ** \"..\\\\file.h\", so we have to make it normal again. We do NOT
4356       ** remove the pre dirs yet as we usually specify tmp paths relative
4357       ** to the current directory, so tmp files would not get found in
4358       ** the hash table.  If this method fails we try it again later. 
4359       */
4360
4361       {
4362         char *stmp = fname;
4363         
4364         /*
4365         ** Skip past the drive marker.
4366         */
4367         
4368         DPRINTF (("stmp: %s / %s", stmp, fname));
4369         
4370         if (strchr (stmp, ':') != NULL)
4371           {
4372             stmp = strchr (stmp, ':') + 1;
4373           }
4374         
4375         DPRINTF (("stmp: %s / %s", stmp, fname));
4376         
4377         while ((stmp = strchr (stmp, CONNECTCHAR)) != NULL )
4378           {
4379             if (*(stmp+1) == CONNECTCHAR)
4380               {
4381                 memmove (stmp, stmp+1, strlen (stmp));
4382               }
4383             
4384             stmp++;
4385             DPRINTF (("stmp: %s / %s", stmp, fname));
4386           }
4387         
4388         DPRINTF (("Now: base = %s", fname));
4389         
4390         fid = fileTable_lookupBase (context_fileTable (),
4391                                     cstring_fromChars (fname));
4392         if (!(fileId_isValid (fid)))
4393           {
4394             fname = removePreDirs (fname);
4395             fid = fileTable_lookupBase (context_fileTable (),
4396                                         cstring_fromChars (fname));
4397           }
4398       }
4399 # else  /* !defined(OS2) && !defined(MSDOS) */
4400       fname = removePreDirs (fname);
4401       fid = fileTable_lookupBase (context_fileTable (),
4402                                   cstring_fromChars (fname));
4403 # endif /* !defined(OS2) && !defined(MSDOS) */
4404       
4405       if (!(fileId_isValid (fid)))
4406         {
4407           if (isHeaderFile (cstring_fromChars (fname)))
4408             {
4409               fid = fileTable_addHeaderFile (context_fileTable (), 
4410                                              cstring_fromChars (fname));
4411             }
4412           else
4413             {
4414               fid = fileTable_addFile (context_fileTable (), 
4415                                        cstring_fromChars (fname));
4416             }
4417         }
4418       
4419       setFileLine (fid, lineno);
4420     }
4421   else if ((sscanf (ol, "line %d", &lineno) == 1) 
4422            || (sscanf (ol, " %d", &lineno) == 1))
4423     {
4424       setLine (lineno); /* next line is <cr> */
4425     }
4426   else
4427     {
4428       if (mstring_equal (ol, "")) {
4429         DPRINTF (("Empty pp command!"));
4430         /*
4431         ** evs 2000-05-16: This is a horrible kludge, to get around a bug (well, difficulty) in the pre-processor.
4432         ** We handle a plain # in the input file, by echoing it, and ignoring it in the post-pp-file.
4433         */
4434         mstring_free (ol);
4435         return FALSE;
4436       } else {
4437         if (!reportcpp)
4438           {
4439             
4440           } else {
4441             llbug (message ("File contains preprocessor command: #%s", 
4442                             cstring_fromChars (ol)));
4443             reportcpp = TRUE;
4444           }
4445       }
4446       
4447       sfree (ol);
4448       return TRUE;
4449     }
4450
4451   sfree (ol);
4452   return FALSE;
4453 }
4454   
4455 static int handleLlSpecial ()
4456
4457   int ic; 
4458   char c;
4459   char *s = mstring_createEmpty ();
4460   char *os; 
4461   int tok;
4462   int charsread = 0;
4463
4464   while (((ic = ninput ()) != 0) && isalpha (ic))
4465     {
4466       c = (char) ic;
4467       s = mstring_append (s, c);
4468       charsread++;
4469     }
4470
4471   os = s;
4472
4473   if (charsread == 0 && ic == (int) AFTER_COMMENT_MARKER[0])
4474     {
4475       ic = ninput ();
4476
4477       llassert (ic == AFTER_COMMENT_MARKER[1]);
4478
4479             
4480       if (isProcessingGlobMods () && (*s == '\0'))
4481         {
4482           sfree (os);
4483           return QNOMODS; /* special token no modifications token */
4484         }
4485       else
4486         {
4487           ;
4488         }
4489     }
4490   
4491   tok = commentMarkerToken (cstring_fromChars (os));
4492
4493   if (tok != BADTOK)
4494     {
4495       tokLength = charsread;
4496       sfree (os);
4497       inSpecPart = TRUE;
4498       return tok;
4499     }
4500   
4501   /* Add rest of the comment */
4502   
4503   if (ic != 0 && ic != EOF)
4504     {
4505       c = (char) ic;
4506
4507       
4508       s = mstring_append (s, c);
4509       charsread++;
4510
4511       while (((ic = ninput ()) != 0) && (ic != EOF)
4512              && (ic != AFTER_COMMENT_MARKER[0]))
4513         {
4514           c = (char) ic;
4515           s = mstring_append (s, c);
4516           charsread++;
4517         }
4518     }
4519
4520   if (ic == AFTER_COMMENT_MARKER[0]) 
4521     {
4522       int nc = ninput ();
4523       llassert ((char) nc ==  AFTER_COMMENT_MARKER[1]);
4524       charsread++;
4525     }
4526
4527   
4528   os = s;
4529
4530   while (*s == ' ' || *s == '\t' || *s == '\n') 
4531     {
4532       s++;
4533     }
4534
4535   if (*s == '-' || *s == '+' || *s == '=') /* setting flags */
4536     {
4537       c = *s;
4538
4539       while (c == '-' || c == '+' || c == '=')
4540         {
4541           ynm set = ynm_fromCodeChar (c);
4542           cstring thisflag;
4543
4544           s++;
4545           
4546           thisflag = cstring_fromChars (s);
4547           
4548           while ((c = *s) != '\0' && (c != '-') && (c != '=')
4549                  && (c != '+') && (c != ' ') && (c != '\t') && (c != '\n'))
4550             {
4551               s++;
4552             }
4553
4554           *s = '\0';
4555
4556           if (!context_getFlag (FLG_NOCOMMENTS))
4557             {
4558               cstring flagname = thisflag;
4559               flagcode fflag = identifyFlag (flagname);
4560                 
4561               if (flagcode_isSkip (fflag))
4562                 {
4563                   ;
4564                 }
4565               else if (flagcode_isInvalid (fflag))
4566                 {
4567                   if (isMode (flagname))
4568                     {
4569                       if (ynm_isMaybe (set))
4570                         {
4571                           llerror
4572                             (FLG_BADFLAG, 
4573                              message 
4574                              ("Stylized comment attempts to restore flag %s.  "
4575                               "A mode flag cannot be restored.",
4576                               flagname));
4577                         }
4578                       else
4579                         {
4580                           context_setMode (flagname);
4581                         }
4582                     }
4583                   else
4584                     {
4585                       llerror
4586                         (FLG_BADFLAG, 
4587                          message ("Unrecognized option in stylized comment: %s", 
4588                                   flagname));
4589                     }
4590                 }
4591               else if (flagcode_isGlobalFlag (fflag))
4592                 {
4593                   llerror
4594                     (FLG_BADFLAG, 
4595                      message 
4596                      ("Stylized comment attempts to set global flag %s.  "
4597                       "A global flag cannot be set locally.",
4598                       flagname));
4599                 }
4600               else
4601                 {
4602                   context_fileSetFlag (fflag, set);
4603                   
4604                   if (flagcode_hasArgument (fflag))
4605                     {
4606                       if (ynm_isMaybe (set))
4607                         {
4608                           llerror
4609                             (FLG_BADFLAG, 
4610                              message 
4611                              ("Stylized comment attempts to restore flag %s.  "
4612                               "A flag for setting a value cannot be restored.",
4613                               flagname));
4614                         }
4615                       else
4616                         { /* cut-and-pastied from llmain...blecch */
4617                           cstring extra = cstring_undefined;
4618                           char *rest;
4619                           char *orest;
4620                           char rchar;
4621                           
4622                           *s = c;
4623                           rest = mstring_copy (s);
4624                           orest = rest;
4625                           *s = '\0';
4626                           
4627                           while ((rchar = *rest) != '\0'
4628                                  && (isspace (rchar)))
4629                             {
4630                               rest++;
4631                               s++;
4632                             }
4633                           
4634                           while ((rchar = *rest) != '\0'
4635                                  && !isspace (rchar))
4636                             {
4637                               extra = cstring_appendChar (extra, rchar);
4638                               rest++; 
4639                               s++;
4640                             }
4641                           
4642                           sfree (orest);
4643                           
4644                           if (cstring_isUndefined (extra))
4645                             {
4646                               llerror 
4647                                 (FLG_BADFLAG,
4648                                  message
4649                                  ("Flag %s (in stylized comment) must be followed by an argument",
4650                                   flagcode_unparse (fflag)));
4651                             }
4652                           else
4653                             {
4654                               s--;
4655                               
4656                               if (flagcode_hasValue (fflag))
4657                                 {
4658                                   setValueFlag (fflag, extra);
4659                                 }
4660                               else if (flagcode_hasString (fflag))
4661                                 {
4662                                   setStringFlag (fflag, extra);
4663                                 }
4664                               else
4665                                 {
4666                                   BADEXIT;
4667                                 }
4668                             }
4669                         }
4670                     }
4671                 }
4672             }
4673           else
4674             {
4675               ;
4676             }
4677
4678           *s = c;
4679           while ((c == ' ') || (c == '\t') || (c == '\n'))
4680             {
4681               c = *(++s);
4682             }
4683         } 
4684
4685       if (context_inHeader () && !isArtificial (cstring_fromChars (os)))
4686         {
4687                   context_addComment (cstring_fromCharsNew (os));
4688         }
4689       else
4690         {
4691           ;
4692         }
4693     }
4694   else
4695     {
4696       char *t = s;
4697       int macrocode;
4698       char tchar = '\0';
4699
4700       while (*s != '\0' && *s != ' ' && *s != '\t' && *s != '\n') 
4701         {
4702           s++;
4703         }
4704
4705       if (*s != '\0') 
4706         {
4707           tchar = *s;
4708           *s = '\0';
4709           s++;
4710         }
4711       
4712       t = cstring_toCharsSafe (cstring_downcase (cstring_fromChars (t)));
4713       macrocode = tokenMacroCode (cstring_fromChars (t));
4714
4715       if (macrocode != BADTOK)
4716         {
4717           tokLength = mstring_length (t);
4718
4719           
4720           sfree (t);
4721           sfree (os);
4722
4723           if (macrocode == SKIPTOK)
4724             {
4725               return BADTOK;
4726             }
4727
4728           return macrocode;
4729         }
4730       
4731       if (context_inHeader ())
4732         {
4733           if (tchar != '\0')
4734             {
4735               *(s-1) = tchar;
4736             }
4737           
4738           if ((context_inMacro () || context_inGlobalContext ())
4739               && macrocode != SKIPTOK
4740               && !isArtificial (cstring_fromChars (os))) 
4741             {
4742               context_addComment (cstring_fromCharsNew (os));
4743             }
4744           else
4745             {
4746               ; 
4747             }
4748           
4749           if (tchar != '\0')
4750             {
4751               *(s-1) = '\0';
4752             }
4753         }
4754
4755       if (mstring_equal (t, "ignore"))
4756         {
4757           if (!context_getFlag (FLG_NOCOMMENTS))
4758             {
4759               context_enterSuppressRegion ();
4760             }
4761         }
4762       else if ((*t == 'i' || *t == 't')
4763                && (*(t + 1) == '\0'))
4764         {
4765           if (!context_getFlag (FLG_NOCOMMENTS)
4766               && (*t == 'i' || context_getFlag (FLG_TMPCOMMENTS)))
4767             {
4768               context_enterSuppressLine (-1); /* infinite suppression */
4769             }
4770         }
4771       else if (((*t == 'i') || (*t == 't'))
4772                && ((*(t + 1) >= '0' && *(t + 1) <= '9')))
4773         {
4774           bool tmpcomment = (*t == 't');
4775           int val = -1; 
4776           char *tt = t; /* don't mangle t, since it is free'd */
4777           char lc = *(++tt);
4778
4779           if (lc >= '0' && lc <= '9')
4780             {
4781               val = (int)(lc - '0');
4782               
4783               lc = *(++tt);       
4784               while (lc >= '0' && lc <= '9')
4785                 {
4786                   val *= 10;
4787                   val += lc - '0';
4788                   lc = *(++tt);
4789                 }
4790             }
4791
4792           
4793           if (!context_getFlag (FLG_NOCOMMENTS)
4794               && (!tmpcomment || context_getFlag (FLG_TMPCOMMENTS)))
4795             {
4796               context_enterSuppressLine (val);
4797             }
4798         }
4799       else if (mstring_equal (t, "end"))
4800         {
4801           if (!context_getFlag (FLG_NOCOMMENTS))
4802             {
4803               context_exitSuppressRegion ();
4804             }
4805         }
4806       else if (mstring_equal (t, "notfunction"))
4807         {
4808          ; /* handled by pcpp */
4809         }
4810       else if (mstring_equal (t, "access"))
4811         {
4812           cstring tname;
4813           
4814           while (TRUE)
4815             {
4816               while ((c = *s) && (c == ' ' || c == '\t' || c == '\n'))
4817                 {
4818                   s++;
4819                 }
4820               
4821               if (c == '\0')
4822                 {
4823                    break;
4824                 }
4825
4826               tname = cstring_fromChars (s);
4827               
4828               while ((c = *s) != '\0' && c != ' ' 
4829                      && c != '\t' && c != '\n' && c != ',') 
4830                 {
4831                   s++;
4832                 }
4833
4834               *s = '\0';
4835
4836               
4837               if (!context_getFlag (FLG_NOCOMMENTS) 
4838                   && !context_getFlag (FLG_NOACCESS))
4839                 {
4840                   if (usymtab_existsType (tname))
4841                     {
4842                       usymId uid = usymtab_getTypeId (tname);
4843                       context_addFileAccessType (uid);
4844                     }
4845                   else
4846                     {
4847                       if (!(context_inSuppressRegion ()
4848                             || context_inSuppressZone (g_currentloc)))
4849                         {
4850                           llmsg 
4851                             (message
4852                              ("%q: Unrecognized type %s used in access comment",
4853                               fileloc_unparse (g_currentloc), tname));
4854                         }
4855                     }
4856                 }
4857               
4858               if (c != '\0') 
4859                 {
4860                   s++;
4861                 }
4862               
4863               if (c != ',' && c != ' ')
4864                 {
4865                   break;
4866                 }
4867             }
4868         }
4869       else if (mstring_equal (t, "noaccess"))
4870         {
4871           cstring tname;
4872           char lc;
4873           
4874           while (TRUE)
4875             {
4876               while ((lc = *s) && (lc == ' ' || lc == '\t' || lc == '\n')) 
4877                 {
4878                   s++;
4879                 }
4880               
4881               if (lc == '\0')
4882                 {
4883                  break;
4884                 }
4885
4886               tname = cstring_fromChars (s);
4887               
4888               while ((lc = *s) != '\0' && lc != ' ' && lc != '\t' 
4889                      && lc != '\n' && lc != ',') 
4890                 {
4891                   s++;
4892                 }
4893
4894               *s = '\0';
4895
4896               if (!context_getFlag (FLG_NOCOMMENTS) 
4897                   && !context_getFlag (FLG_NOACCESS))
4898                 {
4899                   if (usymtab_existsType (tname))
4900                     {
4901                       typeId tuid = usymtab_getTypeId (tname);
4902                       
4903                       if (context_couldHaveAccess (tuid))
4904                         {
4905                           context_removeFileAccessType (tuid);
4906                         }
4907                       else
4908                         {
4909                           if (!(context_inSuppressRegion () 
4910                                 || context_inSuppressZone (g_currentloc)))
4911                             {
4912                               uentry ue = usymtab_getTypeEntry (tuid);
4913                               
4914                               if (uentry_isAbstractDatatype (ue))
4915                                 {
4916                                   llmsg
4917                                     (message
4918                                      ("%q: Non-accessible abstract type %s used in noaccess comment",
4919                                       fileloc_unparse (g_currentloc), tname));
4920                                 }
4921                               else
4922                                 {
4923                                   llmsg
4924                                     (message
4925                                      ("%q: Non-abstract type %s used in noaccess comment",
4926                                       fileloc_unparse (g_currentloc), tname));
4927                                 }
4928                             }
4929                         }
4930                     }
4931                   else
4932                     {
4933                       if (!(context_inSuppressRegion () 
4934                             || context_inSuppressZone (g_currentloc)))
4935                         {
4936                           llmsg
4937                             (message
4938                              ("%q: Unrecognized type %s used in noaccess comment",
4939                               fileloc_unparse (g_currentloc), tname));
4940                         }
4941                     }
4942                 }
4943               
4944               if (lc != '\0') 
4945                 {
4946                   s++;
4947                 }
4948               
4949               if (lc != ',' && lc != ' ')
4950                 {
4951                   break;
4952                 }
4953             }
4954         }
4955       else
4956         {
4957           setTokLength (- (2 + charsread));
4958
4959           voptgenerror (FLG_UNRECOGCOMMENTS, 
4960                         message ("Stylized comment unrecognized: %s", 
4961                                  cstring_fromChars (os)), 
4962                         g_currentloc);
4963         }
4964
4965       sfree (t);
4966     }
4967   
4968   sfree (os); 
4969   return BADTOK;
4970 }
4971
4972 static /*@only@*/ cstring makeIdentifier (char *s)
4973 {
4974   char *c = mstring_create (size_toInt (strlen (s)) + 1);
4975   cstring id = cstring_fromChars (c);
4976
4977   while (isalnum (*s) || (*s == '_') || (*s == '$')) 
4978     {
4979       *c++ = *s++;
4980     }
4981
4982   *c = '\0';
4983   return (id);
4984 }
4985
4986 /*@observer@*/ /*@dependent@*/ uentry coerceId (cstring cn)
4987 {
4988   if (!(usymtab_exists (cn)))
4989     {
4990       fileloc loc = fileloc_createExternal ();
4991       
4992       /*
4993       ** We need to put this in a global scope, otherwise the sRef will be deallocated.
4994       */
4995       
4996       uentry ce = uentry_makeUnrecognized (cn, loc);
4997       
4998       if (!context_inIterEnd ())
4999         {
5000           voptgenerror 
5001             (FLG_SYSTEMUNRECOG, 
5002              message ("Unrecognized (possibly system) identifier: %q", 
5003                       uentry_getName (ce)), 
5004              g_currentloc);
5005         }
5006       
5007       return ce;
5008     }
5009   
5010   return (usymtab_lookup (cn));
5011 }
5012
5013 /*
5014 ** like, coerceId, but doesn't supercede for iters
5015 */
5016
5017 /*@observer@*/ uentry coerceIterId (cstring cn)
5018 {
5019   if (!(usymtab_exists (cn)))
5020     {
5021       return uentry_undefined;
5022     }
5023   
5024   return (usymtab_lookup (cn));
5025 }
5026
5027 /*@observer@*/ cstring LastIdentifier ()
5028 {
5029   return (lastidprocessed);
5030 }
5031
5032 static int processIdentifier (cstring id)
5033 {
5034   uentry le;
5035
5036   DPRINTF (("Process identifier: %s", id));
5037
5038   context_clearJustPopped ();
5039   lastidprocessed = id; 
5040
5041   if (context_inFunctionDecl ())
5042     {
5043       int tok = commentMarkerToken (id);
5044
5045       if (tok != BADTOK)
5046         {
5047           return tok;
5048         }
5049       else 
5050         {
5051           tok = tokenMacroCode (id);
5052
5053           if (tok != BADTOK)
5054             {
5055               return tok;
5056             }
5057         }
5058     }
5059
5060   /* Consider handling: Defined by C99 as static const char __func__[] */
5061
5062   if (context_getFlag (FLG_GNUEXTENSIONS))
5063     {
5064       int tok = BADTOK;
5065       
5066       if (cstring_equalLit (id, "__stdcall")
5067           || cstring_equalLit (id, "__cdecl")
5068           || cstring_equalLit (id, "__extension__"))
5069         {
5070           return BADTOK;
5071         }
5072       else if (cstring_equalLit (id, "__volatile__"))
5073         {
5074           tok = QVOLATILE;
5075         }
5076       else if (cstring_equalLit (id, "__signed"))
5077         {
5078           tok = QSIGNED;
5079         }
5080       else if (cstring_equalLit (id, "__unsigned"))
5081         {
5082           tok = QUNSIGNED;
5083         }
5084       else if (cstring_equalLit (id, "__const__"))
5085         {
5086           tok = QCONST;
5087         }
5088       else if (cstring_equalLit (id, "__alignof__")) 
5089         {
5090           tok = CALIGNOF; /* alignof is parsed like sizeof */
5091         }
5092       else if (cstring_equalLit (id, "__FUNCTION__")
5093                || cstring_equalLit (id, "__PRETTY_FUNCTION__")) 
5094         {
5095           /* These tokens hold the name of the current function as strings */
5096           yylval.expr = exprNode_stringLiteral (id, fileloc_copy (g_currentloc));
5097           tokLength = 0;
5098           lastWasString = TRUE;
5099           tok = CCONSTANT;
5100           return tok;
5101         }
5102       else if (cstring_equalLit (id, "__attribute__")
5103                || cstring_equalLit (id, "__asm__")
5104                || cstring_equalLit (id, "_asm")
5105                || cstring_equalLit (id, "__asm")
5106                || cstring_equalLit (id, "__declspec"))
5107         {
5108           int depth = 0;
5109           bool useparens = FALSE;
5110           bool usebraces = FALSE;
5111           bool inquote = FALSE;
5112           bool inescape = FALSE;
5113           int ic;
5114
5115           while ((ic = input ()) != EOF)
5116             {
5117                               
5118               if (inescape)
5119                 {
5120                   inescape = FALSE;
5121                 }
5122               else if (ic == '\\')
5123                 {
5124                   inescape = TRUE;
5125                 }
5126               else if (ic == '\"')
5127                 {
5128                   inquote = !inquote;
5129                 }
5130               else if (!inquote)
5131                 {
5132                   if (ic == '(')
5133                     {
5134                       if (!useparens)
5135                         {
5136                           if (!usebraces)
5137                             {
5138                               useparens = TRUE;
5139                             }
5140                         }
5141
5142                       if (useparens)
5143                         {
5144                           depth++;
5145                         }
5146                     }
5147                   else if (ic == '{')
5148                     {
5149                       if (!usebraces)
5150                         {
5151                           if (!useparens)
5152                             {
5153                               usebraces = TRUE;
5154                             }
5155                         }
5156
5157                       if (usebraces)
5158                         {
5159                           depth++;
5160                         }
5161                     }
5162                   else if (ic == ')' && useparens)
5163                     {
5164                       depth--;
5165                       if (depth == 0) break;
5166                     }
5167                   else if (ic == '}' && usebraces)
5168                     {
5169                       depth--;
5170                       if (depth == 0) break;
5171                     }
5172                   else if (ic == '}' 
5173                            && !usebraces && !useparens
5174                            && cstring_equalLit (id, "__asm"))
5175                     {
5176                       /*
5177                       ** We need this because some MS VC++ include files
5178                       ** have __asm mov ... }
5179                       ** Its a kludge, but otherwise would need to parse
5180                       ** the asm code!
5181                       */ 
5182                       return TRBRACE;
5183                     }
5184                 }
5185
5186               if (ic == '\n')
5187                 {
5188                   context_incLineno ();
5189
5190                   if (cstring_equalLit (id, "__asm")
5191                       && !useparens && !usebraces)
5192                     {
5193                       break;
5194                     }
5195                 }
5196             }
5197           
5198           llassert ((useparens && ic == ')')
5199                     || (usebraces && ic == '}')
5200                     || (!useparens && !usebraces));
5201
5202           return BADTOK;
5203         }
5204       else if (cstring_equalLit (id, "inline")
5205                || cstring_equalLit (id, "__inline")
5206                || cstring_equalLit (id, "_inline")
5207                || cstring_equalLit (id, "__inline__"))
5208         {
5209           tok = QINLINE;
5210         }
5211       
5212       if (tok != BADTOK)
5213         {
5214           RETURN_TOK (tok);
5215         }
5216     }
5217
5218   le = usymtab_lookupSafe (id);
5219
5220   /*@-dependenttrans@*/
5221   
5222   if (uentry_isIter (le))
5223     {
5224       yylval.entry = le;
5225       return (ITER_NAME);
5226     }
5227   else if (uentry_isEndIter (le))
5228     {
5229       yylval.entry = le;
5230       return (ITER_ENDNAME);
5231     }
5232   else if (uentry_isUndefined (le))
5233     {
5234       yylval.cname = id;
5235
5236       /* avoid parse errors for certain system built ins */
5237
5238       if (g_expectingTypeName && (cstring_firstChar (id) == '_')
5239           && (cstring_secondChar (id) == '_'))
5240         {
5241           return (TYPE_NAME_OR_ID);
5242         }
5243
5244       return (NEW_IDENTIFIER);
5245     }
5246   else if (!uentry_isDeclared (le) && !uentry_isCodeDefined (le))
5247     {
5248       if (uentry_isDatatype (le))
5249         {
5250           yylval.cname = id;
5251           return (NEW_IDENTIFIER);
5252         }
5253       else
5254         {
5255           yylval.entry = le;              
5256           return (IDENTIFIER); 
5257         }
5258     }
5259   else if (uentry_isDatatype (le))
5260     {
5261       if (!g_expectingTypeName)
5262         {
5263           yylval.cname = id;
5264
5265           return (NEW_IDENTIFIER);
5266         }
5267       else
5268         {
5269           yylval.ctyp = uentry_getAbstractType (le);
5270           
5271           uentry_setUsed (le, g_currentloc);
5272           return (TYPE_NAME);
5273         }
5274     }
5275   else
5276     {
5277       yylval.entry = le;            
5278       return (IDENTIFIER); 
5279     }
5280
5281   /*@=dependenttrans@*/
5282 }
5283
5284 static bool processHashIdentifier (/*@only@*/ cstring id)
5285 {
5286   if (context_inMacro () || context_inIterDef () ||
5287       context_inIterEnd ())
5288     {
5289       uentry le;
5290       
5291       context_clearJustPopped ();
5292
5293       lastidprocessed = id; 
5294       le = usymtab_lookupSafe (id);
5295
5296       if (uentry_isParam (le) || uentry_isRefParam (le))
5297         {
5298           return TRUE;
5299         }
5300       else
5301         {
5302           return FALSE;
5303         }
5304     }
5305   else
5306     {
5307       cstring_free (id);
5308       return FALSE;
5309     }
5310 }
5311
5312
5313 static /*@only@*/ exprNode processString ()
5314 {
5315   exprNode res;
5316   fileloc loc;
5317   char *nl = strchr (yytext, '\n');
5318   cstring ns = cstring_fromCharsNew (yytext);
5319
5320   if (nl == NULL)
5321     {
5322       loc = fileloc_copy (g_currentloc);
5323       addColumn (cstring_length (ns));
5324     }
5325   else
5326     {
5327       char *lastnl = nl;
5328
5329       loc = fileloc_copy (g_currentloc);
5330
5331       context_incLineno ();
5332       
5333       while ((nl = strchr ((nl + 1), '\n')) != NULL)
5334         {
5335           context_incLineno ();
5336           lastnl = nl;
5337         }
5338     }
5339
5340     
5341   res = exprNode_stringLiteral (ns, loc);
5342   return (res);
5343 }
5344
5345 static 
5346 char processChar ()
5347 {
5348   char fchar;
5349   char next;
5350
5351   llassert (*yytext != '\0');
5352   fchar = *(yytext + 1);
5353   if (fchar != '\\') return fchar;
5354   
5355   next = *(yytext + 2);
5356   
5357   switch (next)
5358     {
5359     case 'n': return '\n';
5360     case 't': return '\t';
5361     case '\"': return '\"';
5362     case '\'': return '\'';
5363     case '\\': return '\\';
5364     default: return '\0';
5365     }
5366 }
5367
5368 static
5369 double processFloat ()
5370 {
5371   double ret = atof (yytext);
5372
5373     return (ret);
5374 }
5375
5376 static
5377 long processHex ()
5378 {
5379   int index = 2;
5380   long val = 0;
5381
5382   llassert (yytext[0] == '0'
5383             && (yytext[1] == 'X' || yytext[1] == 'x'));
5384
5385   while (yytext[index] != '\0') {
5386     int tval;
5387     char c = yytext[index];
5388
5389     if (c >= '0' && c <= '9') {
5390       tval = (int) c - (int) '0';
5391     } else if (c >= 'A' && c <= 'F') {
5392       tval = (int) c - (int) 'A' + 10;
5393     } else if (c >= 'a' && c <= 'f') {
5394       tval = (int) c - (int) 'a' + 10;
5395     } else if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
5396       index++;
5397       while (yytext[index] != '\0') {
5398         if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
5399           ;
5400         } else {
5401           voptgenerror
5402             (FLG_SYNTAX, 
5403              message ("Invalid character (%c) following specifier in hex constant: %s",
5404                       c, cstring_fromChars (yytext)),
5405              g_currentloc);
5406         }
5407         index++;
5408       }
5409
5410       break;
5411     } else {
5412       voptgenerror
5413         (FLG_SYNTAX, 
5414          message ("Invalid character (%c) in hex constant: %s",
5415                   c, cstring_fromChars (yytext)),
5416          g_currentloc);
5417       break;
5418     }
5419
5420     val = (val * 16) + tval;
5421     index++;
5422   }
5423
5424   DPRINTF (("Hex constant: %s = %ld", yytext, val));
5425   return val;
5426 }
5427
5428 static
5429 long processOctal ()
5430 {
5431   int index = 1;
5432   long val = 0;
5433
5434   llassert (yytext[0] == '0' && yytext[1] != 'X' && yytext[1] != 'x');
5435     
5436   while (yytext[index] != '\0') {
5437     int tval;
5438     char c = yytext[index];
5439     
5440     if (c >= '0' && c <= '7') {
5441       tval = (int) c - (int) '0';
5442     } else {
5443       voptgenerror
5444         (FLG_SYNTAX, 
5445          message ("Invalid character (%c) in octal constant: %s",
5446                   c, cstring_fromChars (yytext)),
5447          g_currentloc);
5448       break;
5449     }
5450
5451     val = (val * 8) + tval;
5452     index++;
5453   }
5454
5455   DPRINTF (("Octal constant: %s = %ld", yytext, val));
5456   return val;
5457 }
5458
5459 static
5460 long processDec ()
5461 {
5462   return (atol (yytext));
5463 }
5464
5465 static int
5466 processSpec (int tok)
5467 {
5468   size_t length = strlen (yytext);
5469
5470   
5471   if (inSpecPart)
5472     {
5473       setTokLengthT (length);
5474       RETURN_TOK (tok);
5475     }
5476   else
5477     {
5478       
5479       context_saveLocation ();
5480       setTokLengthT (length);
5481       return (processIdentifier (makeIdentifier (yytext)));
5482     }
5483 }
This page took 0.471039 seconds and 5 git commands to generate.