source: git/old_modgen/modgen/scanner.cc @ a3f0fea

spielwiese
Last change on this file since a3f0fea was a3f0fea, checked in by Reimer Behrends <behrends@…>, 5 years ago
Modify variable declarions for pSingular.
  • Property mode set to 100644
File size: 75.1 KB
Line 
1/* A lexical scanner generated by flex */
2
3/* Scanner skeleton version:
4 * $Header: /exports/cvsroot-2/cvsroot/modules/modgen/scanner.cc,v 1.5 2007-09-12 09:31:40 Singular Exp $
5 */
6
7#define FLEX_SCANNER
8#define YY_FLEX_MAJOR_VERSION 2
9#define YY_FLEX_MINOR_VERSION 5
10
11#include <stdio.h>
12#include <unistd.h>
13
14
15/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16#ifdef c_plusplus
17#ifndef __cplusplus
18#define __cplusplus
19#endif
20#endif
21
22
23#ifdef __cplusplus
24
25#include <stdlib.h>
26
27/* Use prototypes in function declarations. */
28#define YY_USE_PROTOS
29
30/* The "const" storage-class-modifier is valid. */
31#define YY_USE_CONST
32
33#else   /* ! __cplusplus */
34
35#if __STDC__
36
37#define YY_USE_PROTOS
38#define YY_USE_CONST
39
40#endif  /* __STDC__ */
41#endif  /* ! __cplusplus */
42
43#ifdef __TURBOC__
44 #pragma warn -rch
45 #pragma warn -use
46#include <io.h>
47#include <stdlib.h>
48#define YY_USE_CONST
49#define YY_USE_PROTOS
50#endif
51
52#ifdef YY_USE_CONST
53#define yyconst const
54#else
55#define yyconst
56#endif
57
58
59#ifdef YY_USE_PROTOS
60#define YY_PROTO(proto) proto
61#else
62#define YY_PROTO(proto) ()
63#endif
64
65/* Returned upon end-of-file. */
66#define YY_NULL 0
67
68/* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index.  If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
71 * double cast.
72 */
73#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74
75/* Enter a start condition.  This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
78 */
79#define BEGIN yy_start = 1 + 2 *
80
81/* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state.  The YYSTATE alias is for lex
83 * compatibility.
84 */
85#define YY_START ((yy_start - 1) / 2)
86#define YYSTATE YY_START
87
88/* Action number for EOF rule of a given start state. */
89#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90
91/* Special action meaning "start processing a new file". */
92#define YY_NEW_FILE yyrestart( yyin )
93
94#define YY_END_OF_BUFFER_CHAR 0
95
96/* Size of default input buffer. */
97#define YY_BUF_SIZE 16384
98
99typedef struct yy_buffer_state *YY_BUFFER_STATE;
100
101EXTERN_VAR int yyleng;
102EXTERN_VAR FILE *yyin, *yyout;
103
104#define EOB_ACT_CONTINUE_SCAN 0
105#define EOB_ACT_END_OF_FILE 1
106#define EOB_ACT_LAST_MATCH 2
107
108/* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator).  This
110 * avoids problems with code like:
111 *
112 *      if ( condition_holds )
113 *              yyless( 5 );
114 *      else
115 *              do_something_else();
116 *
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
120 */
121
122/* Return all but the first 'n' matched characters back to the input stream. */
123
124#define yyless(n) \
125        do \
126                { \
127                /* Undo effects of setting up yytext. */ \
128                *yy_cp = yy_hold_char; \
129                YY_RESTORE_YY_MORE_OFFSET \
130                yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
132                } \
133        while ( 0 )
134
135#define unput(c) yyunput( c, yytext_ptr )
136
137/* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
140 */
141typedef unsigned int yy_size_t;
142
143
144struct yy_buffer_state
145        {
146        FILE *yy_input_file;
147
148        char *yy_ch_buf;                /* input buffer */
149        char *yy_buf_pos;               /* current position in input buffer */
150
151        /* Size of input buffer in bytes, not including room for EOB
152         * characters.
153         */
154        yy_size_t yy_buf_size;
155
156        /* Number of characters read into yy_ch_buf, not including EOB
157         * characters.
158         */
159        int yy_n_chars;
160
161        /* Whether we "own" the buffer - i.e., we know we created it,
162         * and can realloc() it to grow it, and should free() it to
163         * delete it.
164         */
165        int yy_is_our_buffer;
166
167        /* Whether this is an "interactive" input source; if so, and
168         * if we're using stdio for input, then we want to use getc()
169         * instead of fread(), to make sure we stop fetching input after
170         * each newline.
171         */
172        int yy_is_interactive;
173
174        /* Whether we're considered to be at the beginning of a line.
175         * If so, '^' rules will be active on the next match, otherwise
176         * not.
177         */
178        int yy_at_bol;
179
180        /* Whether to try to fill the input buffer when we reach the
181         * end of it.
182         */
183        int yy_fill_buffer;
184
185        int yy_buffer_status;
186#define YY_BUFFER_NEW 0
187#define YY_BUFFER_NORMAL 1
188        /* When an EOF's been seen but there's still some text to process
189         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190         * shouldn't try reading from the input source any more.  We might
191         * still have a bunch of tokens to match, though, because of
192         * possible backing-up.
193         *
194         * When we actually see the EOF, we change the status to "new"
195         * (via yyrestart()), so that the user can continue scanning by
196         * just pointing yyin at a new input file.
197         */
198#define YY_BUFFER_EOF_PENDING 2
199        };
200
201STATIC_VAR YY_BUFFER_STATE yy_current_buffer = 0;
202
203/* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
205 * "scanner state".
206 */
207#define YY_CURRENT_BUFFER yy_current_buffer
208
209
210/* yy_hold_char holds the character lost when yytext is formed. */
211STATIC_VAR char yy_hold_char;
212
213STATIC_VAR int yy_n_chars;              /* number of characters read into yy_ch_buf */
214
215
216VAR int yyleng;
217
218/* Points to current character in buffer. */
219STATIC_VAR char *yy_c_buf_p = (char *) 0;
220STATIC_VAR int yy_init = 1;             /* whether we need to initialize */
221STATIC_VAR int yy_start = 0;    /* start state number */
222
223/* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin.  A bit of a hack ...
225 */
226STATIC_VAR int yy_did_buffer_switch_on_eof;
227
228void yyrestart YY_PROTO(( FILE *input_file ));
229
230void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231void yy_load_buffer_state YY_PROTO(( void ));
232YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
237
238YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
241
242static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244static void yy_flex_free YY_PROTO(( void * ));
245
246#define yy_new_buffer yy_create_buffer
247
248#define yy_set_interactive(is_interactive) \
249        { \
250        if ( ! yy_current_buffer ) \
251                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252        yy_current_buffer->yy_is_interactive = is_interactive; \
253        }
254
255#define yy_set_bol(at_bol) \
256        { \
257        if ( ! yy_current_buffer ) \
258                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259        yy_current_buffer->yy_at_bol = at_bol; \
260        }
261
262#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263
264typedef unsigned char YY_CHAR;
265VAR FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266typedef int yy_state_type;
267EXTERN_VAR char *yytext;
268#define yytext_ptr yytext
269
270static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272static int yy_get_next_buffer YY_PROTO(( void ));
273static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
274
275/* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
277 */
278#define YY_DO_BEFORE_ACTION \
279        yytext_ptr = yy_bp; \
280        yytext_ptr -= yy_more_len; \
281        yyleng = (int) (yy_cp - yytext_ptr); \
282        yy_hold_char = *yy_cp; \
283        *yy_cp = '\0'; \
284        yy_c_buf_p = yy_cp;
285
286#define YY_NUM_RULES 100
287#define YY_END_OF_BUFFER 101
288static yyconst short int yy_accept[384] =
289    {   0,
290        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
291        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
292        0,    0,    0,    0,   58,   58,   64,   64,    0,    0,
293        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
294        0,    0,  101,  100,   13,   14,  100,   18,  100,   17,
295      100,   10,   16,   15,  100,  100,  100,    7,  100,  100,
296       19,   19,   19,  100,   25,  100,  100,   96,   91,   93,
297       96,   88,   89,   90,   96,   87,   95,   92,   23,   22,
298       23,   23,   86,   83,   86,   85,   80,   84,   86,   81,
299       82,   34,   33,   34,   32,   77,   76,   77,   75,   27,
300
301       26,   27,   30,   27,   43,   36,   35,   43,   43,   43,
302       37,   43,   43,   43,   43,   52,   45,   44,   52,   52,
303       52,   46,   51,   51,   51,   52,   58,   57,   58,   58,
304       58,   73,   66,   73,   62,   70,   67,   68,   69,   73,
305       63,   64,   72,   71,   65,   65,   65,   59,   56,   54,
306       53,   56,   55,   99,   99,   98,   99,   97,   13,   15,
307       14,    6,    0,    0,    0,   15,   15,    0,    0,   10,
308        0,    7,    5,    0,    0,    0,    0,    8,   19,   10,
309       19,    0,   25,    0,    0,   91,   87,   93,   94,   92,
310       22,    0,   83,   78,    0,   33,   31,   76,   74,   26,
311
312       29,   28,   36,   35,   38,    0,    0,    0,    0,   45,
313       44,   47,    0,   51,   51,   51,   58,   58,   57,    6,
314       58,   58,    5,   58,   58,   66,   60,    0,   64,   65,
315       63,   65,   54,   53,    0,   97,   98,   15,    6,    0,
316        0,    0,    9,    0,   20,   20,    5,    0,    0,    0,
317        0,   11,    0,    0,    0,   21,    0,    0,   79,    0,
318        0,   39,    0,    0,    0,    0,    0,   48,    0,   51,
319       51,    6,   58,   58,    5,   58,   58,    0,   61,    0,
320        0,    0,    0,    0,    0,    0,    0,    0,    0,   51,
321       51,   58,   58,   58,   58,    0,    0,    0,    0,    0,
322
323        0,    0,   40,    0,   51,   51,   58,   58,   58,   58,
324        0,    0,    0,    0,    0,    0,    0,   42,   51,   50,
325       58,   58,   58,   58,    0,    0,    0,    0,    0,    0,
326       41,   49,   58,   58,   58,   58,    0,    0,    0,    0,
327        0,    0,   58,   58,   58,   58,    2,    0,    1,    0,
328        0,    0,    2,   58,    1,   58,    2,    0,    1,    0,
329        0,    0,    2,   58,    1,   58,    4,    0,    3,    0,
330        4,    3,    4,    0,   12,    0,    3,    0,   24,    0,
331        4,    3,    0
332    } ;
333
334static yyconst int yy_ec[256] =
335    {   0,
336        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
337        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
338        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
339        1,    5,    1,    6,    7,    1,    8,    1,    1,    9,
340       10,   11,    1,   12,   13,   14,   15,   16,   16,   17,
341       17,   17,   17,   17,   17,   17,   17,   18,   19,    1,
342       20,    1,    1,    1,   21,   21,   22,   21,   23,   21,
343       21,   21,   21,   21,   21,   21,   21,   24,   25,   21,
344       21,   21,   26,   21,   21,   21,   21,   21,   27,   21,
345        1,   28,    1,    1,   21,    1,   29,   21,   30,   31,
346
347       32,   21,   33,   34,   35,   21,   21,   36,   37,   38,
348       39,   40,   21,   41,   42,   43,   44,   21,   21,   45,
349       27,   21,   46,    1,   47,    1,    1,    1,    1,    1,
350        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
351        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
352        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
353        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
354        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
355        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
356        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
357
358        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
359        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
360        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
361        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
362        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
363        1,    1,    1,    1,    1
364    } ;
365
366static yyconst int yy_meta[48] =
367    {   0,
368        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
369        1,    1,    3,    4,    1,    3,    3,    1,    1,    1,
370        3,    3,    3,    3,    3,    3,    3,    1,    3,    3,
371        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
372        3,    3,    3,    3,    3,    1,    1
373    } ;
374
375static yyconst short int yy_base[423] =
376    {   0,
377        0,   47,    0,    0,   92,   94,  102,    0,   96,  147,
378      153,  198,    0,    0,  149,  159,  161,  163,  177,  181,
379      244,  285,  327,  845,  174,  185,  374,    0,  192,  212,
380      216,  220,    0,    0,    0,    0,    0,    0,    0,    0,
381        0,    0,  852,  854,  171,  854,  848,  854,  186,  854,
382      835,  854,  854,  231,  835,  215,  218,  251,  235,  160,
383      834,  241,  246,  207,  854,  224,  264,  854,  260,  854,
384      844,  854,  854,  854,  828,  854,  854,    0,  854,  854,
385      842,  797,  854,  854,  840,  854,  854,  854,  175,  854,
386      854,  854,  854,  839,  826,  854,  854,  837,  824,  854,
387
388      854,  835,  854,  236,  854,  229,  854,  834,  251,  259,
389      854,  791,  794,  791,  272,  854,  280,  854,  830,  273,
390      286,  854,    0,  787,  788,  280,  827,  854,  826,  419,
391      420,  854,  854,  825,  854,  854,  854,  854,  854,  292,
392      292,  294,  854,  854,    0,  280,  175,  854,  854,  313,
393      854,  824,  854,  854,  424,  854,  823,  854,  428,  429,
394      854,    0,  790,  783,  318,  321,  430,  809,  394,  808,
395      411,  434,    0,  786,  781,  778,  448,  854,  804,  803,
396      430,  454,  854,  458,  460,  463,  854,  854,  854,    0,
397      854,  463,  854,  854,  466,  854,  854,  854,  854,  854,
398
399      854,  854,  469,  854,  854,  472,  787,  776,  785,  475,
400      854,  854,  475,    0,  784,  783,  808,  854,  854,  807,
401      289,  151,  806,  452,  444,  854,  854,  480,  472,    0,
402        0,  455,  488,  854,  489,  854,  854,  490,    0,  770,
403      768,  496,  854,  498,  776,  854,    0,  767,  773,  764,
404      500,  854,  502,  506,  508,  854,  510,  512,  854,  514,
405      516,  854,  518,  765,  771,  757,  520,  854,  522,  762,
406      755,  794,  435,  493,  793,  504,  524,  525,  854,  527,
407      762,  764,  760,  757,  761,  530,  750,  534,  754,  748,
408      752,  535,  532,  537,  541,  742,  753,  740,  745,  750,
409
410      542,  745,  545,  750,  743,  748,  538,  540,  545,  546,
411      741,  745,  739,  739,  742,  548,  740,  854,  739,    0,
412      280,  550,  551,  553,  741,  725,  739,  710,  701,  554,
413      854,    0,  556,  552,  557,  558,  692,  688,  652,  650,
414      585,  563,  566,  570,  571,  572,    0,  592,    0,  594,
415      590,  587,  618,  573,  614,  574,    0,  568,    0,  565,
416      444,  589,  437,  576,  424,  585,    0,  591,    0,  596,
417      311,  240,    0,  600,  854,  605,    0,  611,  854,  616,
418      234,  227,  854,  627,  631,  635,  639,  643,  647,  651,
419      655,  659,  663,  667,  669,  671,  675,  176,  166,  679,
420
421       98,  683,  687,  691,  695,  699,  703,  707,  711,  715,
422      719,  723,  727,  731,  735,  739,  743,  747,  751,  755,
423      759,  763
424    } ;
425
426static yyconst short int yy_def[423] =
427    {   0,
428      383,  383,  384,  384,  385,  385,  383,    7,  386,  386,
429      387,  387,  384,  384,  388,  388,  389,  389,  390,  390,
430      391,  391,  383,   23,  392,  392,  383,   27,  393,  393,
431      394,  394,  384,  384,  384,  384,  384,  384,  384,  384,
432      384,  384,  383,  383,  383,  383,  383,  383,  383,  383,
433      383,  383,  383,  383,  395,  395,  395,  383,  383,  383,
434      396,  396,  396,  397,  383,  397,  397,  383,  383,  383,
435      383,  383,  383,  383,  383,  383,  383,  398,  383,  383,
436      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
437      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
438
439      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
440      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
441      383,  383,  399,  399,  399,  383,  400,  383,  400,  400,
442      400,  383,  383,  383,  383,  383,  383,  383,  383,  383,
443      383,  383,  383,  383,  401,  401,  401,  383,  383,  383,
444      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
445      383,  402,  383,  383,  403,  383,  383,  395,  383,  395,
446      395,  383,  404,  383,  383,  383,  405,  383,  396,  396,
447      396,  397,  383,  397,  397,  383,  383,  383,  383,  398,
448      383,  406,  383,  383,  407,  383,  383,  383,  383,  383,
449
450      383,  383,  383,  383,  383,  408,  383,  383,  383,  383,
451      383,  383,  409,  399,  399,  399,  400,  383,  383,  410,
452      400,  400,  411,  400,  400,  383,  383,  412,  383,  401,
453      401,  401,  383,  383,  383,  383,  383,  383,  402,  383,
454      383,  403,  383,  403,  383,  383,  404,  383,  383,  383,
455      405,  383,  405,  397,  406,  383,  406,  407,  383,  407,
456      408,  383,  408,  383,  383,  383,  409,  383,  409,  399,
457      399,  410,  400,  400,  411,  400,  400,  412,  383,  412,
458      383,  383,  383,  383,  383,  397,  383,  383,  383,  399,
459      399,  400,  400,  400,  400,  383,  383,  383,  383,  383,
460
461      397,  383,  383,  383,  399,  399,  400,  400,  400,  400,
462      383,  383,  383,  383,  383,  397,  383,  383,  399,  399,
463      400,  400,  400,  400,  383,  383,  383,  383,  383,  397,
464      383,  399,  400,  400,  400,  400,  383,  383,  383,  383,
465      383,  397,  400,  400,  400,  400,  413,  383,  414,  383,
466      383,  397,  415,  400,  416,  400,  413,  383,  414,  383,
467      383,  397,  415,  400,  416,  400,  417,  418,  419,  420,
468      421,  422,  417,  418,  383,  418,  419,  420,  383,  420,
469      421,  422,    0,  383,  383,  383,  383,  383,  383,  383,
470      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
471
472      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
473      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
474      383,  383
475    } ;
476
477static yyconst short int yy_nxt[902] =
478    {   0,
479       44,   45,   46,   47,   45,   48,   44,   49,   44,   44,
480       44,   50,   44,   44,   51,   52,   44,   44,   53,   54,
481       55,   55,   55,   56,   55,   55,   57,   44,   55,   55,
482       55,   55,   55,   55,   55,   55,   55,   56,   55,   55,
483       55,   55,   55,   55,   55,   44,   44,   44,   58,   46,
484       47,   58,   48,   44,   59,   44,   44,   44,   50,   44,
485       44,   60,   52,   44,   44,   53,   54,   61,   61,   61,
486       62,   61,   61,   63,   44,   61,   61,   61,   61,   61,
487       61,   61,   61,   61,   62,   61,   61,   61,   61,   61,
488       61,   61,   44,   44,   65,   66,   65,   66,   80,   81,
489
490      230,   67,   68,   69,   70,   71,   69,   68,   68,   68,
491       72,   73,   68,   74,   68,   68,   68,   68,   68,   75,
492       76,   77,   78,   78,   78,   78,   78,   78,   78,   68,
493       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
494       78,   78,   78,   78,   78,   78,   78,   68,   68,   80,
495       81,   93,   94,  218,   82,   84,   85,   86,   87,   95,
496       88,   93,   94,   97,   98,   97,   98,   89,  214,   95,
497      178,   99,  159,   99,  165,  159,  128,  129,  190,  101,
498      102,  130,  103,  101,  102,  194,  103,  128,  129,  195,
499      160,  274,  131,  150,  151,  152,  150,  232,   90,   91,
500
501       84,   85,   86,   87,  104,   88,  232,  162,  104,  183,
502      184,  163,   89,  150,  151,  152,  150,  155,  156,  157,
503      155,  155,  156,  157,  155,  164,  183,  184,  169,  218,
504      203,  169,  166,  203,  158,  166,  218,  153,  158,  170,
505      171,  201,  218,   90,   91,  106,  107,  108,  106,  171,
506      167,  109,  172,  170,  169,  172,  173,  153,  110,  169,
507      174,  186,  111,  202,  186,  180,  183,  184,  181,  205,
508      160,  175,  162,  206,  176,  112,  163,  181,  187,  180,
509      177,  210,  218,  113,  210,  114,  106,  107,  108,  106,
510      164,  218,  115,  173,  162,  185,  212,  174,  163,  110,
511
512      213,  173,  227,  111,  231,  174,  228,  229,  229,  229,
513      229,  176,  164,  218,  233,  333,  112,  233,  231,  176,
514      243,  244,  166,  273,  113,  166,  114,  116,  117,  118,
515      119,  117,  116,  116,  120,  116,  116,  116,  116,  116,
516      116,  121,  116,  116,  116,  122,  116,  123,  123,  123,
517      123,  123,  123,  123,  116,  123,  123,  123,  124,  123,
518      123,  123,  123,  123,  123,  123,  123,  123,  125,  123,
519      123,  123,  116,  116,  132,  132,  133,  134,  132,  135,
520      136,  132,  137,  138,  132,  139,  132,  132,  140,  141,
521      142,  132,  143,  144,  145,  145,  145,  146,  145,  145,
522
523      147,  132,  145,  145,  145,  145,  145,  145,  145,  145,
524      145,  146,  145,  145,  145,  145,  145,  145,  145,  148,
525      132,  218,  218,  245,  169,  235,  218,  246,  235,  159,
526      238,  166,  159,  238,  166,  172,  170,  218,  172,  218,
527      220,  223,  236,  169,  221,  224,  218,  160,  160,  167,
528      252,  253,  170,  160,  218,  180,  183,  184,  222,  225,
529      183,  184,  183,  184,  186,  256,  257,  186,  259,  260,
530      203,  180,  292,  203,  262,  263,  210,  268,  269,  210,
531      231,  187,  279,  280,  277,  369,  276,  229,  229,  233,
532      235,  238,  233,  235,  238,  218,  231,  254,  243,  244,
533
534      243,  244,  252,  253,  252,  253,  218,  236,  183,  184,
535      256,  257,  256,  257,  259,  260,  259,  260,  262,  263,
536      262,  263,  268,  269,  268,  269,  218,  279,  280,  279,
537      280,  293,  183,  184,  218,  303,  286,  218,  303,  218,
538      218,  294,  218,  218,  183,  184,  303,  218,  218,  303,
539      183,  184,  218,  218,  218,  218,  183,  184,  218,  218,
540      218,  308,  295,  288,  301,  183,  184,  307,  218,  309,
541      310,  322,  218,  218,  218,  218,  218,  324,  218,  316,
542      334,  321,  330,  336,  343,  345,  335,  218,  323,  183,
543      184,  183,  184,  375,  376,  344,  342,  352,  379,  380,
544
545      368,  346,  375,  376,  364,  366,  353,  375,  376,  367,
546      354,  355,  356,  379,  380,  362,  218,  371,  379,  380,
547      218,  361,  360,  358,  370,  351,  372,   44,   44,   44,
548       44,   64,   64,   64,   64,   79,   79,   79,   79,   83,
549       83,   83,   83,   92,   92,   92,   92,   96,   96,   96,
550       96,  100,  100,  100,  100,  105,  105,  105,  105,  127,
551      127,  127,  127,  149,  149,  149,  149,  154,  154,  154,
552      154,  168,  168,  179,  179,  182,  182,  182,  182,  217,
553      217,  217,  217,  239,  350,  239,  239,  242,  242,  242,
554      242,  247,  349,  247,  247,  251,  251,  251,  251,  255,
555
556      255,  255,  255,  258,  258,  258,  258,  261,  261,  261,
557      261,  267,  267,  267,  267,  272,  272,  272,  272,  275,
558      275,  275,  275,  278,  278,  278,  278,  357,  348,  357,
559      357,  359,  347,  359,  359,  363,  363,  363,  363,  365,
560      365,  365,  365,  373,  341,  373,  373,  374,  374,  374,
561      374,  377,  340,  377,  377,  378,  378,  378,  378,  381,
562      381,  381,  381,  382,  382,  382,  382,  339,  338,  337,
563      332,  331,  329,  328,  327,  326,  325,  320,  319,  318,
564      317,  315,  314,  313,  312,  311,  306,  305,  304,  302,
565      300,  299,  298,  297,  296,  218,  218,  291,  290,  289,
566
567      288,  287,  285,  284,  283,  246,  282,  281,  218,  218,
568      218,  271,  270,  266,  265,  264,  169,  169,  250,  249,
569      248,  169,  169,  241,  240,  237,  234,  226,  219,  218,
570      216,  215,  211,  209,  208,  207,  204,  200,  199,  198,
571      197,  196,  193,  192,  191,  189,  188,  169,  169,  165,
572      161,  383,  126,   43,  383,  383,  383,  383,  383,  383,
573      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
574      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
575      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
576      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
577
578      383
579    } ;
580
581static yyconst short int yy_chk[902] =
582    {   0,
583        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
584        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
585        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
586        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
587        1,    1,    1,    1,    1,    1,    1,    2,    2,    2,
588        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
589        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
590        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
591        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
592        2,    2,    2,    2,    5,    5,    6,    6,    9,    9,
593
594      401,    6,    7,    7,    7,    7,    7,    7,    7,    7,
595        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
596        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
597        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
598        7,    7,    7,    7,    7,    7,    7,    7,    7,   10,
599       10,   15,   15,  222,   10,   11,   11,   11,   11,   15,
600       11,   16,   16,   17,   17,   18,   18,   11,  399,   16,
601       60,   17,   45,   18,   60,   45,   25,   25,  398,   19,
602       19,   25,   19,   20,   20,   89,   20,   26,   26,   89,
603       45,  222,   26,   29,   29,   29,   29,  147,   11,   11,
604
605       12,   12,   12,   12,   19,   12,  147,   49,   20,   64,
606       64,   49,   12,   30,   30,   30,   30,   31,   31,   31,
607       31,   32,   32,   32,   32,   49,   66,   66,   56,  382,
608      106,   57,   54,  106,   31,   54,  381,   29,   32,   56,
609       57,  104,  372,   12,   12,   21,   21,   21,   21,   57,
610       54,   21,   58,   56,   62,   58,   59,   30,   21,   63,
611       59,   69,   21,  104,   69,   62,   67,   67,   63,  110,
612       58,   59,  109,  110,   59,   21,  109,   63,   69,   62,
613       59,  117,  321,   21,  117,   21,   22,   22,   22,   22,
614      109,  221,   22,  115,  120,   67,  121,  115,  120,   22,
615
616      121,  126,  140,   22,  146,  126,  140,  141,  141,  142,
617      142,  115,  120,  371,  150,  321,   22,  150,  146,  126,
618      165,  165,  166,  221,   22,  166,   22,   23,   23,   23,
619       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
620       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
621       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
622       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
623       23,   23,   23,   23,   27,   27,   27,   27,   27,   27,
624       27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
625       27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
626
627       27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
628       27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
629       27,  130,  131,  169,  171,  155,  365,  169,  155,  159,
630      160,  167,  159,  160,  167,  172,  171,  273,  172,  363,
631      130,  131,  155,  181,  130,  131,  225,  159,  160,  167,
632      177,  177,  171,  172,  224,  181,  182,  182,  130,  131,
633      184,  184,  185,  185,  186,  192,  192,  186,  195,  195,
634      203,  181,  273,  203,  206,  206,  210,  213,  213,  210,
635      232,  186,  228,  228,  225,  361,  224,  229,  229,  233,
636      235,  238,  233,  235,  238,  274,  232,  185,  242,  242,
637
638      244,  244,  251,  251,  253,  253,  276,  235,  254,  254,
639      255,  255,  257,  257,  258,  258,  260,  260,  261,  261,
640      263,  263,  267,  267,  269,  269,  277,  278,  278,  280,
641      280,  274,  286,  286,  293,  288,  254,  292,  288,  294,
642      307,  276,  308,  295,  301,  301,  303,  309,  310,  303,
643      316,  316,  322,  323,  334,  324,  330,  330,  333,  335,
644      336,  293,  277,  288,  286,  342,  342,  292,  343,  294,
645      295,  308,  344,  345,  346,  354,  356,  310,  364,  301,
646      322,  307,  316,  324,  333,  335,  323,  366,  309,  352,
647      352,  362,  362,  368,  368,  334,  330,  342,  370,  370,
648
649      360,  336,  374,  374,  354,  356,  343,  376,  376,  358,
650      344,  345,  346,  378,  378,  352,  355,  364,  380,  380,
651      353,  351,  350,  348,  362,  341,  366,  384,  384,  384,
652      384,  385,  385,  385,  385,  386,  386,  386,  386,  387,
653      387,  387,  387,  388,  388,  388,  388,  389,  389,  389,
654      389,  390,  390,  390,  390,  391,  391,  391,  391,  392,
655      392,  392,  392,  393,  393,  393,  393,  394,  394,  394,
656      394,  395,  395,  396,  396,  397,  397,  397,  397,  400,
657      400,  400,  400,  402,  340,  402,  402,  403,  403,  403,
658      403,  404,  339,  404,  404,  405,  405,  405,  405,  406,
659
660      406,  406,  406,  407,  407,  407,  407,  408,  408,  408,
661      408,  409,  409,  409,  409,  410,  410,  410,  410,  411,
662      411,  411,  411,  412,  412,  412,  412,  413,  338,  413,
663      413,  414,  337,  414,  414,  415,  415,  415,  415,  416,
664      416,  416,  416,  417,  329,  417,  417,  418,  418,  418,
665      418,  419,  328,  419,  419,  420,  420,  420,  420,  421,
666      421,  421,  421,  422,  422,  422,  422,  327,  326,  325,
667      319,  317,  315,  314,  313,  312,  311,  306,  305,  304,
668      302,  300,  299,  298,  297,  296,  291,  290,  289,  287,
669      285,  284,  283,  282,  281,  275,  272,  271,  270,  266,
670
671      265,  264,  250,  249,  248,  245,  241,  240,  223,  220,
672      217,  216,  215,  209,  208,  207,  180,  179,  176,  175,
673      174,  170,  168,  164,  163,  157,  152,  134,  129,  127,
674      125,  124,  119,  114,  113,  112,  108,  102,   99,   98,
675       95,   94,   85,   82,   81,   75,   71,   61,   55,   51,
676       47,   43,   24,  383,  383,  383,  383,  383,  383,  383,
677      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
678      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
679      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
680      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
681
682      383
683    } ;
684
685STATIC_VAR yy_state_type yy_last_accepting_state;
686STATIC_VAR char *yy_last_accepting_cpos;
687
688/* The intent behind this definition is that it'll catch
689 * any uses of REJECT which flex missed.
690 */
691#define REJECT reject_used_but_not_detected
692STATIC_VAR int yy_more_flag = 0;
693STATIC_VAR int yy_more_len = 0;
694#define yymore() (yy_more_flag = 1)
695#define YY_MORE_ADJ yy_more_len
696#define YY_RESTORE_YY_MORE_OFFSET
697VAR char *yytext;
698#line 1 "scanner.l"
699#define INITIAL 0
700#line 2 "scanner.l"
701/****************************************
702*  Computer Algebra System SINGULAR     *
703****************************************/
704#include <stdio.h>
705#include <string.h>
706#include <stdlib.h>
707#include <ctype.h>
708
709#include "modgen.h"
710#include "stype.h"
711#include "../../Singular/grammar.h"
712#include "mod_grammar.h"
713
714#define DEBUG 3
715
716#  define YYLP_ERR_NONE    0
717#  define YYLP_DEF_BR2     1
718#  define YYLP_BODY_BR2    2
719#  define YYLP_BODY_BR3    3
720#  define YYLP_BODY_TMBR2  4
721#  define YYLP_BODY_TMBR3  5
722#  define YYLP_EX_BR2      6
723#  define YYLP_EX_BR3      7
724#  define YYLP_BAD_CHAR    8
725#  define YYLP_MISSQUOT    9
726#  define YYLP_MISS_BR1   10
727#  define YYLP_MISS_BR2   11
728#  define YYLP_MISS_BR3   12
729
730  EXTERN_VAR int iseof;
731
732  VAR int offset = 0;
733  VAR int yylineno = 1;
734  VAR int do_return = 0;
735
736  VAR int state_level = -1;
737  VAR int state_max = 0;
738  VAR char *yylp_buffer_start;
739
740  EXTERN_VAR int sectnum;
741  STATIC_VAR int oldsectnum = 1;
742  EXTERN_INST_VAR moddef module_def;
743  EXTERN_INST_VAR procdef procedure_decl;
744
745  VAR char *sectname[] = { "sect -0", "section 1",
746                       "Singular", "procedures", "C-part"
747  };
748
749  struct _states {
750    char name[32];
751    int state;
752  } * old_states = NULL;
753/*  int *old_states = NULL;*/
754
755  int current_pos(int i);
756  int read_string(char **buffer, long *start, long end);
757  int libread(FILE* f, char* buf, int max_size);
758  void add_action(char *new_text);
759
760  void push_state(int state, int new_state, char *name);
761  void switch_state(int state, int new_state, char *name);
762  void pop_state();
763  int return_sect_token(int passed, int old_sect, int new_sect);
764  extern int init_modgen(moddef *module_def, char *filename);
765
766static char * dupyytext()
767{
768  if (yyleng>0) yytext[yyleng-1] = '\0';
769  return strdup((char *)yytext);
770}
771
772#   undef YY_DECL
773#   define YY_DECL int yylex(YYSTYPE* lvalp)
774
775#   undef YY_INPUT
776#   define YY_INPUT(buf,result,max_size) \
777          if ( ((result = libread( (yyin), (char *) buf, max_size )) < 0 ) \
778                  && ferror( yyin ) ) \
779                YY_FATAL_ERROR( "read in flex scanner failed" );
780
781#   undef yywrap
782  extern "C"
783  {
784  int yywrap();
785  }
786
787#define ACTION_ECHO add_action( yytext )
788
789/* %start START */
790#define preamble 1
791
792#define MODINITIAL 2
793
794#define PROCCMDBLOCK 3
795
796#define CODEBLOCK 4
797
798#define CODEBLOCK2 5
799
800#define module 6
801
802#define COMMENT 7
803
804#define COMMENTB 8
805
806#define STRING 9
807
808#define SECT2 10
809
810#define SECT3 11
811
812#define SECT4 12
813
814#define PROCDECL 13
815
816#define EXAMPLE 14
817
818#define ANYLINE 15
819
820#define pdef 16
821
822#define procopt 17
823
824#define procdef 18
825
826#define ctext 19
827
828#define cstring 20
829
830
831/* Macros after this point can all be overridden by user definitions in
832 * section 1.
833 */
834
835#ifndef YY_SKIP_YYWRAP
836#ifdef __cplusplus
837extern "C" int yywrap YY_PROTO(( void ));
838#else
839extern int yywrap YY_PROTO(( void ));
840#endif
841#endif
842
843#ifndef YY_NO_UNPUT
844static void yyunput YY_PROTO(( int c, char *buf_ptr ));
845#endif
846
847#ifndef yytext_ptr
848static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
849#endif
850
851#ifdef YY_NEED_STRLEN
852static int yy_flex_strlen YY_PROTO(( yyconst char * ));
853#endif
854
855#ifndef YY_NO_INPUT
856#ifdef __cplusplus
857static int yyinput YY_PROTO(( void ));
858#else
859static int input YY_PROTO(( void ));
860#endif
861#endif
862
863#if YY_STACK_USED
864STATIC_VAR int yy_start_stack_ptr = 0;
865STATIC_VAR int yy_start_stack_depth = 0;
866STATIC_VAR int *yy_start_stack = 0;
867#ifndef YY_NO_PUSH_STATE
868static void yy_push_state YY_PROTO(( int new_state ));
869#endif
870#ifndef YY_NO_POP_STATE
871static void yy_pop_state YY_PROTO(( void ));
872#endif
873#ifndef YY_NO_TOP_STATE
874static int yy_top_state YY_PROTO(( void ));
875#endif
876
877#else
878#define YY_NO_PUSH_STATE 1
879#define YY_NO_POP_STATE 1
880#define YY_NO_TOP_STATE 1
881#endif
882
883#ifdef YY_MALLOC_DECL
884YY_MALLOC_DECL
885#else
886#if __STDC__
887#ifndef __cplusplus
888#include <stdlib.h>
889#endif
890#else
891/* Just try to get by without declaring the routines.  This will fail
892 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
893 * or sizeof(void*) != sizeof(int).
894 */
895#endif
896#endif
897
898/* Amount of stuff to slurp up with each read. */
899#ifndef YY_READ_BUF_SIZE
900#define YY_READ_BUF_SIZE 8192
901#endif
902
903/* Copy whatever the last rule matched to the standard output. */
904
905#ifndef ECHO
906/* This used to be an fputs(), but since the string might contain NUL's,
907 * we now use fwrite().
908 */
909#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
910#endif
911
912/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
913 * is returned in "result".
914 */
915#ifndef YY_INPUT
916#define YY_INPUT(buf,result,max_size) \
917        if ( yy_current_buffer->yy_is_interactive ) \
918                { \
919                int c = '*', n; \
920                for ( n = 0; n < max_size && \
921                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
922                        buf[n] = (char) c; \
923                if ( c == '\n' ) \
924                        buf[n++] = (char) c; \
925                if ( c == EOF && ferror( yyin ) ) \
926                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
927                result = n; \
928                } \
929        else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
930                  && ferror( yyin ) ) \
931                YY_FATAL_ERROR( "input in flex scanner failed" );
932#endif
933
934/* No semi-colon after return; correct usage is to write "yyterminate();" -
935 * we don't want an extra ';' after the "return" because that will cause
936 * some compilers to complain about unreachable statements.
937 */
938#ifndef yyterminate
939#define yyterminate() return YY_NULL
940#endif
941
942/* Number of entries by which start-condition stack grows. */
943#ifndef YY_START_STACK_INCR
944#define YY_START_STACK_INCR 25
945#endif
946
947/* Report a fatal error. */
948#ifndef YY_FATAL_ERROR
949#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
950#endif
951
952/* Default declaration of generated scanner - a define so the user can
953 * easily add parameters.
954 */
955#ifndef YY_DECL
956#define YY_DECL int yylex YY_PROTO(( void ))
957#endif
958
959/* Code executed at the beginning of each rule, after yytext and yyleng
960 * have been set up.
961 */
962#ifndef YY_USER_ACTION
963#define YY_USER_ACTION
964#endif
965
966/* Code executed at the end of each rule. */
967#ifndef YY_BREAK
968#define YY_BREAK break;
969#endif
970
971#define YY_RULE_SETUP \
972        if ( yyleng > 0 ) \
973                yy_current_buffer->yy_at_bol = \
974                                (yytext[yyleng - 1] == '\n'); \
975        YY_USER_ACTION
976
977YY_DECL
978        {
979        register yy_state_type yy_current_state;
980        register char *yy_cp = NULL, *yy_bp = NULL;
981        register int yy_act;
982
983#line 149 "scanner.l"
984
985       STATIC_VAR int brace1 = 0;  /* { } */
986       STATIC_VAR int brace2 = 0;  /* ( ) */
987       STATIC_VAR int brace3 = 0;  /* [ ] */
988       STATIC_VAR int quote  = 0;  /* " */
989
990
991        if ( yy_init )
992                {
993                yy_init = 0;
994
995#ifdef YY_USER_INIT
996                YY_USER_INIT;
997#endif
998
999                if ( ! yy_start )
1000                        yy_start = 1;   /* first start state */
1001
1002                if ( ! yyin )
1003                        yyin = stdin;
1004
1005                if ( ! yyout )
1006                        yyout = stdout;
1007
1008                if ( ! yy_current_buffer )
1009                        yy_current_buffer =
1010                                yy_create_buffer( yyin, YY_BUF_SIZE );
1011
1012                yy_load_buffer_state();
1013                }
1014
1015        while ( 1 )             /* loops until end-of-file is reached */
1016                {
1017                yy_more_len = 0;
1018                if ( yy_more_flag )
1019                        {
1020                        yy_more_len = yy_c_buf_p - yytext_ptr;
1021                        yy_more_flag = 0;
1022                        }
1023                yy_cp = yy_c_buf_p;
1024
1025                /* Support of yytext. */
1026                *yy_cp = yy_hold_char;
1027
1028                /* yy_bp points to the position in yy_ch_buf of the start of
1029                 * the current run.
1030                 */
1031                yy_bp = yy_cp;
1032
1033                yy_current_state = yy_start;
1034                yy_current_state += YY_AT_BOL();
1035yy_match:
1036                do
1037                        {
1038                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1039                        if ( yy_accept[yy_current_state] )
1040                                {
1041                                yy_last_accepting_state = yy_current_state;
1042                                yy_last_accepting_cpos = yy_cp;
1043                                }
1044                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1045                                {
1046                                yy_current_state = (int) yy_def[yy_current_state];
1047                                if ( yy_current_state >= 384 )
1048                                        yy_c = yy_meta[(unsigned int) yy_c];
1049                                }
1050                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1051                        ++yy_cp;
1052                        }
1053                while ( yy_base[yy_current_state] != 854 );
1054
1055yy_find_action:
1056                yy_act = yy_accept[yy_current_state];
1057                if ( yy_act == 0 )
1058                        { /* have to back up */
1059                        yy_cp = yy_last_accepting_cpos;
1060                        yy_current_state = yy_last_accepting_state;
1061                        yy_act = yy_accept[yy_current_state];
1062                        }
1063
1064                YY_DO_BEFORE_ACTION;
1065
1066
1067do_action:      /* This label is used only to access EOF actions. */
1068
1069
1070                switch ( yy_act )
1071        { /* beginning of action switch */
1072                        case 0: /* must back up */
1073                        /* undo the effects of YY_DO_BEFORE_ACTION */
1074                        *yy_cp = yy_hold_char;
1075                        yy_cp = yy_last_accepting_cpos;
1076                        yy_current_state = yy_last_accepting_state;
1077                        goto yy_find_action;
1078
1079case YY_STATE_EOF(COMMENT):
1080case YY_STATE_EOF(COMMENTB):
1081case YY_STATE_EOF(STRING):
1082case YY_STATE_EOF(INITIAL):
1083#line 155 "scanner.l"
1084{
1085          printf( "EOF encountered inside an action\n");
1086          printf("ERRRRROOOOORRR\n");
1087                 }
1088        YY_BREAK
1089
1090case 1:
1091YY_RULE_SETUP
1092#line 161 "scanner.l"
1093{
1094                  int passed = (oldsectnum == sectnum) ? 0 : 1;
1095                  int old_sect = sectnum;
1096
1097                  oldsectnum = sectnum;
1098                  sectnum = 2;
1099                  if(!passed) yyless(0);
1100                  else push_state(YYSTATE, SECT2, "SECT2");
1101                  return(return_sect_token(passed, old_sect, sectnum));
1102                }
1103        YY_BREAK
1104case 2:
1105YY_RULE_SETUP
1106#line 171 "scanner.l"
1107{
1108                  int passed = (oldsectnum == sectnum) ? 0 : 1;
1109                  int old_sect = sectnum;
1110
1111                  oldsectnum = sectnum;
1112                  sectnum = 2;
1113                  if(!passed) yyless(0);
1114                  else push_state(YYSTATE, SECT2, "SECT2");
1115                  return(return_sect_token(passed, old_sect, sectnum));
1116                }
1117        YY_BREAK
1118case 3:
1119YY_RULE_SETUP
1120#line 181 "scanner.l"
1121{
1122                  int passed = (oldsectnum == sectnum) ? 0 : 1;
1123                  int old_sect = sectnum;
1124
1125                  oldsectnum = sectnum;
1126                  sectnum = 3;
1127                  if(!passed) yyless(0);
1128                  else push_state(YYSTATE, SECT3, "SECT3");
1129                  return(return_sect_token(passed, old_sect, sectnum));
1130                }
1131        YY_BREAK
1132case 4:
1133YY_RULE_SETUP
1134#line 191 "scanner.l"
1135{
1136                  int passed = (oldsectnum == sectnum) ? 0 : 1;
1137                  int old_sect = sectnum;
1138
1139                  oldsectnum = sectnum;
1140                  sectnum = 3;
1141                  if(!passed) yyless(0);
1142                  else push_state(YYSTATE, SECT3, "SECT3");
1143                  return(return_sect_token(passed, old_sect, sectnum));
1144                }
1145        YY_BREAK
1146case 5:
1147YY_RULE_SETUP
1148#line 201 "scanner.l"
1149{
1150                  int passed = (oldsectnum == sectnum) ? 0 : 1;
1151                  int old_sect = sectnum;
1152
1153                  oldsectnum = sectnum;
1154                  sectnum = 4;
1155                  if(!passed) yyless(0);
1156                  else push_state(YYSTATE, SECT4, "SECT4");
1157                  return(return_sect_token(passed, old_sect, sectnum));
1158                }
1159        YY_BREAK
1160case 6:
1161YY_RULE_SETUP
1162#line 211 "scanner.l"
1163{
1164                  int passed = (oldsectnum == sectnum) ? 0 : 1;
1165                  int old_sect = sectnum;
1166
1167                  oldsectnum = sectnum;
1168                  sectnum = 4;
1169                  if(!passed) yyless(0);
1170                  else push_state(YYSTATE, SECT4, "SECT4-2");
1171                  return(return_sect_token(passed, old_sect, sectnum));
1172                }
1173        YY_BREAK
1174
1175
1176case 7:
1177YY_RULE_SETUP
1178#line 225 "scanner.l"
1179push_state(YYSTATE, CODEBLOCK, "CODEBLOCK");
1180        YY_BREAK
1181case 8:
1182YY_RULE_SETUP
1183#line 226 "scanner.l"
1184push_state(YYSTATE, COMMENT, "COMMENT"); yymore();
1185        YY_BREAK
1186case 9:
1187YY_RULE_SETUP
1188#line 227 "scanner.l"
1189++yylineno; ACTION_ECHO;
1190        YY_BREAK
1191case 10:
1192YY_RULE_SETUP
1193#line 228 "scanner.l"
1194{ if(yyleng == 1) sscanf(yytext, "%d", &lvalp->i);
1195                  else {
1196                    if(strcasecmp(yytext, "yes")==0) lvalp->i = 1;
1197                    else lvalp->i = 0;
1198                  }
1199                  return BOOLTOK; }
1200        YY_BREAK
1201case 11:
1202YY_RULE_SETUP
1203#line 234 "scanner.l"
1204{
1205                yylineno++;
1206                push_state(YYSTATE, CODEBLOCK, "CODEBLOCK");
1207                fprintf(module_def.fmtfp, "#line %d \"%s\"\n",
1208                                          yylineno, module_def.filename);
1209                }
1210        YY_BREAK
1211case 12:
1212YY_RULE_SETUP
1213#line 240 "scanner.l"
1214{
1215                yylineno++;
1216                push_state(YYSTATE, MODINITIAL, "MODINITIAL");
1217                fprintf(module_def.fmtfp, "#line %d \"%s\"\n",
1218                                          yylineno, module_def.filename);
1219                }
1220        YY_BREAK
1221case 13:
1222YY_RULE_SETUP
1223#line 246 "scanner.l"
1224/* discard */
1225        YY_BREAK
1226case 14:
1227YY_RULE_SETUP
1228#line 247 "scanner.l"
1229{ yylineno++; }
1230        YY_BREAK
1231case 15:
1232YY_RULE_SETUP
1233#line 249 "scanner.l"
1234{ return '='; }
1235        YY_BREAK
1236case 16:
1237YY_RULE_SETUP
1238#line 250 "scanner.l"
1239{ return ';'; }
1240        YY_BREAK
1241case 17:
1242YY_RULE_SETUP
1243#line 251 "scanner.l"
1244{ return ','; }
1245        YY_BREAK
1246case 18:
1247YY_RULE_SETUP
1248#line 253 "scanner.l"
1249{ do_return++;
1250                  lvalp->sv.lineno = yylineno;
1251                  push_state(YYSTATE, STRING, "string");
1252                }
1253        YY_BREAK
1254case 19:
1255YY_RULE_SETUP
1256#line 258 "scanner.l"
1257{
1258                  lvalp->name = strdup(yytext);
1259                  return NAME;
1260                }
1261        YY_BREAK
1262case 20:
1263YY_RULE_SETUP
1264#line 262 "scanner.l"
1265{
1266                  lvalp->name = strdup(yytext);
1267                  return FILENAME;
1268                }
1269        YY_BREAK
1270
1271
1272case 21:
1273YY_RULE_SETUP
1274#line 269 "scanner.l"
1275{
1276                   char * s, *t;
1277
1278                   yylineno++;
1279                   pop_state();
1280                   s = t = lvalp->name = dupyytext();
1281                   while (*yytext)
1282                   {
1283                     if (*yytext == '\\') yytext++;
1284                     *s++ = *yytext++;
1285                   }
1286                   if(s-t>2 && *(s-1)=='}' && *(s-2)=='%') *(s-2)='\0';
1287                   return MCCODETOK;
1288                 }
1289        YY_BREAK
1290case 22:
1291YY_RULE_SETUP
1292#line 283 "scanner.l"
1293{ yylineno++; yymore(); }
1294        YY_BREAK
1295case 23:
1296YY_RULE_SETUP
1297#line 284 "scanner.l"
1298{ yymore(); }
1299        YY_BREAK
1300
1301
1302case 24:
1303YY_RULE_SETUP
1304#line 287 "scanner.l"
1305{
1306                   yylineno++;
1307                   pop_state();
1308                 }
1309        YY_BREAK
1310case 25:
1311YY_RULE_SETUP
1312#line 291 "scanner.l"
1313{ yylineno++;
1314                   lvalp->name = yytext;
1315                   return CODEPART; }
1316        YY_BREAK
1317
1318
1319case 26:
1320YY_RULE_SETUP
1321#line 296 "scanner.l"
1322{ yylineno++; yymore(); }
1323        YY_BREAK
1324case 27:
1325YY_RULE_SETUP
1326#line 297 "scanner.l"
1327{ yymore(); }
1328        YY_BREAK
1329case 28:
1330YY_RULE_SETUP
1331#line 298 "scanner.l"
1332{ yymore(); }
1333        YY_BREAK
1334case 29:
1335YY_RULE_SETUP
1336#line 299 "scanner.l"
1337{ yymore(); }
1338        YY_BREAK
1339case 30:
1340YY_RULE_SETUP
1341#line 300 "scanner.l"
1342{
1343                    char * s, *t;
1344                    pop_state();
1345                    if(do_return) {
1346                      s = t = lvalp->sv.string = dupyytext();
1347                      while (*yytext)
1348                      {
1349                        if (*yytext == '\\') yytext++;
1350                        *s++ = *yytext++;
1351                      }
1352                      *s++ = *yytext++;
1353                      do_return = 0;
1354                      return MSTRINGTOK;
1355                    } else {
1356                      do_return = 0;
1357                      yymore();
1358                    }
1359                  }
1360        YY_BREAK
1361
1362
1363case 31:
1364YY_RULE_SETUP
1365#line 321 "scanner.l"
1366ACTION_ECHO; pop_state(); yymore();
1367        YY_BREAK
1368case 32:
1369YY_RULE_SETUP
1370#line 322 "scanner.l"
1371yymore();
1372        YY_BREAK
1373case 33:
1374YY_RULE_SETUP
1375#line 323 "scanner.l"
1376{ yylineno++; yymore(); }
1377        YY_BREAK
1378case 34:
1379YY_RULE_SETUP
1380#line 324 "scanner.l"
1381{ yymore(); }
1382        YY_BREAK
1383
1384
1385case 35:
1386YY_RULE_SETUP
1387#line 328 "scanner.l"
1388{ yylineno++; }
1389        YY_BREAK
1390case 36:
1391YY_RULE_SETUP
1392#line 329 "scanner.l"
1393/* ignore */
1394        YY_BREAK
1395case 37:
1396YY_RULE_SETUP
1397#line 330 "scanner.l"
1398/* ignore */
1399        YY_BREAK
1400case 38:
1401YY_RULE_SETUP
1402#line 331 "scanner.l"
1403push_state(YYSTATE, COMMENT, "COMMENT"); yymore();
1404        YY_BREAK
1405case 39:
1406YY_RULE_SETUP
1407#line 332 "scanner.l"
1408++yylineno; ACTION_ECHO;
1409        YY_BREAK
1410case 40:
1411YY_RULE_SETUP
1412#line 333 "scanner.l"
1413{
1414                  brace1 = 0; /* { */
1415                  brace2 = 0; /* ( */
1416                  brace3 = 0; /* [ */
1417                  push_state(YYSTATE, PROCDECL, "PROCDECL");
1418                  return PROCDECLTOK;
1419                }
1420        YY_BREAK
1421case 41:
1422YY_RULE_SETUP
1423#line 340 "scanner.l"
1424{
1425#if DEBUG > 1
1426                  printf(">>>EXAMPLE\n");
1427#endif
1428                  brace1 = 0; /* { */
1429                  brace2 = 0; /* ( */
1430                  brace3 = 0; /* [ */
1431                    push_state(YYSTATE, EXAMPLE, "EXAMPLE");
1432                        return EXAMPLETOK;
1433                }
1434        YY_BREAK
1435case 42:
1436YY_RULE_SETUP
1437#line 350 "scanner.l"
1438{ return STATICTOK; }
1439        YY_BREAK
1440case 43:
1441YY_RULE_SETUP
1442#line 351 "scanner.l"
1443{ printf("SG(%d) <<<'%s' ", yylineno, yytext); }
1444        YY_BREAK
1445
1446
1447case 44:
1448YY_RULE_SETUP
1449#line 355 "scanner.l"
1450{ yylineno++; }
1451        YY_BREAK
1452case 45:
1453YY_RULE_SETUP
1454#line 356 "scanner.l"
1455/* ignore */
1456        YY_BREAK
1457case 46:
1458YY_RULE_SETUP
1459#line 357 "scanner.l"
1460/* ignore */
1461        YY_BREAK
1462case 47:
1463YY_RULE_SETUP
1464#line 358 "scanner.l"
1465push_state(YYSTATE, COMMENT, "COMMENT"); yymore();
1466        YY_BREAK
1467case 48:
1468YY_RULE_SETUP
1469#line 359 "scanner.l"
1470++yylineno; ACTION_ECHO;
1471        YY_BREAK
1472case 49:
1473YY_RULE_SETUP
1474#line 360 "scanner.l"
1475{
1476#if DEBUG > 1
1477                  printf(">>>EXAMPLE\n");
1478#endif
1479                  brace1 = 0; /* { */
1480                  brace2 = 0; /* ( */
1481                  brace3 = 0; /* [ */
1482                  push_state(YYSTATE, EXAMPLE, "EXAMPLE");
1483                  return EXAMPLETOK;
1484                }
1485        YY_BREAK
1486case 50:
1487YY_RULE_SETUP
1488#line 370 "scanner.l"
1489{ return STATICTOK; }
1490        YY_BREAK
1491case 51:
1492YY_RULE_SETUP
1493#line 371 "scanner.l"
1494{
1495                   int i,tok;
1496#if DEBUG > 1
1497                   printf("(%d) VAR: %s\n", yylineno, yytext);
1498#endif
1499                   i = IsCmd(yytext, tok);
1500#if DEBUG > 1
1501                   printf("Res=%d, %d => %s\n", i, tok,
1502                          i ? "VARTYPETOK" : "NAME");
1503#endif
1504                   if(i) {
1505                     lvalp->tp.name = strdup(yytext);
1506                     lvalp->tp.typ = tok;
1507                     push_state(YYSTATE, PROCDECL, "PROCDECL");
1508                     return VARTYPETOK;
1509                   }
1510                   else {
1511                     //do_return++;
1512                     lvalp->name = strdup(yytext);
1513                     push_state(YYSTATE, PROCDECL, "PROCDECL");
1514                     return NAME;
1515                   }
1516                 }
1517        YY_BREAK
1518case 52:
1519YY_RULE_SETUP
1520#line 394 "scanner.l"
1521{ printf("PR(%d) <<<'%s' ", yylineno, yytext); }
1522        YY_BREAK
1523
1524
1525case 53:
1526YY_RULE_SETUP
1527#line 398 "scanner.l"
1528{ yylineno++; }
1529        YY_BREAK
1530case 54:
1531YY_RULE_SETUP
1532#line 399 "scanner.l"
1533/* ignore */
1534        YY_BREAK
1535case 55:
1536YY_RULE_SETUP
1537#line 400 "scanner.l"
1538{ brace1++;
1539                  switch_state(YYSTATE, CODEBLOCK2, "CODEBLOCK2");
1540                  return '{';
1541                }
1542        YY_BREAK
1543case 56:
1544YY_RULE_SETUP
1545#line 404 "scanner.l"
1546{ printf("ERROR <<<'%s' ", yytext); }
1547        YY_BREAK
1548
1549
1550case 57:
1551YY_RULE_SETUP
1552#line 408 "scanner.l"
1553{ yylineno++; }
1554        YY_BREAK
1555case 58:
1556YY_RULE_SETUP
1557#line 409 "scanner.l"
1558{ lvalp->name = yytext;
1559                  return CODEPART; }
1560        YY_BREAK
1561case YY_STATE_EOF(SECT4):
1562#line 412 "scanner.l"
1563{ sectnum = 0;
1564                   iseof=1;
1565                   lvalp->name = yytext;
1566                   return SECT4END;
1567                   /* yyterminate(); */
1568                 }
1569        YY_BREAK
1570
1571
1572case 59:
1573YY_RULE_SETUP
1574#line 421 "scanner.l"
1575{ brace1++;
1576                   switch_state(YYSTATE, CODEBLOCK2, "CODEBLOCK2");
1577                   return '{';
1578                 }
1579        YY_BREAK
1580case 60:
1581YY_RULE_SETUP
1582#line 425 "scanner.l"
1583push_state(YYSTATE, COMMENT, "COMMENT");yymore();
1584        YY_BREAK
1585case 61:
1586YY_RULE_SETUP
1587#line 426 "scanner.l"
1588++yylineno; ACTION_ECHO;
1589        YY_BREAK
1590case 62:
1591YY_RULE_SETUP
1592#line 427 "scanner.l"
1593{ do_return++;
1594                   lvalp->sv.lineno = yylineno;
1595                   push_state(YYSTATE, STRING, "string");
1596                 }
1597        YY_BREAK
1598case 63:
1599YY_RULE_SETUP
1600#line 431 "scanner.l"
1601{ if(yyleng == 1) sscanf(yytext, "%d", &lvalp->i);
1602                   else {
1603                     if(strcasecmp(yytext, "yes")==0) lvalp->i = 1;
1604                     else lvalp->i = 0;
1605                   }
1606                   return BOOLTOK; }
1607        YY_BREAK
1608case 64:
1609YY_RULE_SETUP
1610#line 437 "scanner.l"
1611{ sscanf(yytext, "%d", &lvalp->i); return NUMTOK; }
1612        YY_BREAK
1613case 65:
1614YY_RULE_SETUP
1615#line 438 "scanner.l"
1616{
1617                   int i,tok;
1618#if DEBUG > 1
1619                   printf("(%d) VAR: %s\n", yylineno, yytext);
1620#endif
1621                   i = IsCmd(yytext, tok);
1622#if DEBUG > 1
1623                   printf("Res=%d, %d => %s\n", i, tok,
1624                          i ? "VARTYPETOK" : "NAME");
1625#endif
1626                   if(i) {
1627                     lvalp->tp.name = strdup(yytext);
1628                     lvalp->tp.typ = tok;
1629                     return VARTYPETOK;
1630                   }
1631                   else {
1632                     //do_return++;
1633                     lvalp->name = strdup(yytext);
1634                     return NAME;
1635                   }
1636                 }
1637        YY_BREAK
1638case 66:
1639YY_RULE_SETUP
1640#line 459 "scanner.l"
1641{ yylineno++; }
1642        YY_BREAK
1643case 67:
1644YY_RULE_SETUP
1645#line 460 "scanner.l"
1646{ return '('; }
1647        YY_BREAK
1648case 68:
1649YY_RULE_SETUP
1650#line 461 "scanner.l"
1651{ return ')'; }
1652        YY_BREAK
1653case 69:
1654YY_RULE_SETUP
1655#line 462 "scanner.l"
1656{ return ','; }
1657        YY_BREAK
1658case 70:
1659YY_RULE_SETUP
1660#line 463 "scanner.l"
1661{ return '#'; }
1662        YY_BREAK
1663case 71:
1664YY_RULE_SETUP
1665#line 464 "scanner.l"
1666{ return '='; }
1667        YY_BREAK
1668case 72:
1669YY_RULE_SETUP
1670#line 465 "scanner.l"
1671{ return ';'; }
1672        YY_BREAK
1673case 73:
1674YY_RULE_SETUP
1675#line 466 "scanner.l"
1676{ }
1677        YY_BREAK
1678
1679
1680case 74:
1681YY_RULE_SETUP
1682#line 471 "scanner.l"
1683{ ACTION_ECHO;
1684                        pop_state();
1685                        lvalp->name = yytext;
1686                        return CMTPART;
1687                        yymore();
1688                      }
1689        YY_BREAK
1690case 75:
1691YY_RULE_SETUP
1692#line 477 "scanner.l"
1693yymore();
1694        YY_BREAK
1695case 76:
1696YY_RULE_SETUP
1697#line 478 "scanner.l"
1698{ yylineno++; yymore(); }
1699        YY_BREAK
1700case 77:
1701YY_RULE_SETUP
1702#line 479 "scanner.l"
1703{ yymore(); }
1704        YY_BREAK
1705
1706
1707case 78:
1708YY_RULE_SETUP
1709#line 483 "scanner.l"
1710push_state(YYSTATE, COMMENT, "COMMENT"); yymore();
1711        YY_BREAK
1712case 79:
1713YY_RULE_SETUP
1714#line 484 "scanner.l"
1715{ yylineno++; lvalp->name = yytext; return CODEPART; }
1716        YY_BREAK
1717case 80:
1718YY_RULE_SETUP
1719#line 485 "scanner.l"
1720{
1721                   lvalp->sv.lineno = yylineno;
1722                   push_state(YYSTATE, STRING, "string"); yymore();}
1723        YY_BREAK
1724case 81:
1725YY_RULE_SETUP
1726#line 488 "scanner.l"
1727{ brace1++; yymore();}
1728        YY_BREAK
1729case 82:
1730YY_RULE_SETUP
1731#line 489 "scanner.l"
1732{ brace1--;
1733                   if(brace1<=0) {
1734                     char * s, *t;
1735
1736                     pop_state();
1737#if 0
1738                     s = t = lvalp->name = dupyytext();
1739                     while (*yytext)
1740                     {
1741                       if (*yytext == '\\') yytext++;
1742                       *s++ = *yytext++;
1743                     }
1744                     if(s-t>2 && *(s-1)=='}' && *(s-2)=='%') *(s-2)='\0';
1745#else
1746                     lvalp->name = yytext;
1747#endif
1748#if DEBUG > 1
1749                     printf("2 BRACE DOWN=%d\n", brace1);
1750#endif
1751                     return MCODETOK;
1752                   } else {
1753                     yymore();
1754                   }
1755                 }
1756        YY_BREAK
1757case 83:
1758YY_RULE_SETUP
1759#line 513 "scanner.l"
1760{ yylineno++; lvalp->name = yytext; return CODEPART; }
1761        YY_BREAK
1762case 84:
1763YY_RULE_SETUP
1764#line 514 "scanner.l"
1765{ push_state(YYSTATE, PROCCMDBLOCK, "PROCCMDBLOCK");
1766               procedure_decl.flags.start_of_code = 1;
1767               return '%'; }
1768        YY_BREAK
1769case 85:
1770YY_RULE_SETUP
1771#line 517 "scanner.l"
1772{ yymore(); }
1773        YY_BREAK
1774case 86:
1775YY_RULE_SETUP
1776#line 518 "scanner.l"
1777{ yymore(); procedure_decl.flags.start_of_code = 1; }
1778        YY_BREAK
1779
1780
1781case 87:
1782YY_RULE_SETUP
1783#line 523 "scanner.l"
1784{ pop_state(); return ';'; }
1785        YY_BREAK
1786case 88:
1787YY_RULE_SETUP
1788#line 524 "scanner.l"
1789{ return '('; }
1790        YY_BREAK
1791case 89:
1792YY_RULE_SETUP
1793#line 525 "scanner.l"
1794{ return ')'; }
1795        YY_BREAK
1796case 90:
1797YY_RULE_SETUP
1798#line 526 "scanner.l"
1799{ return ','; }
1800        YY_BREAK
1801case 91:
1802YY_RULE_SETUP
1803#line 527 "scanner.l"
1804/* ignore */
1805        YY_BREAK
1806case 92:
1807YY_RULE_SETUP
1808#line 528 "scanner.l"
1809{ lvalp->name = strdup(yytext); return NAME; }
1810        YY_BREAK
1811case 93:
1812YY_RULE_SETUP
1813#line 529 "scanner.l"
1814{ yylineno++; }
1815        YY_BREAK
1816case 94:
1817YY_RULE_SETUP
1818#line 530 "scanner.l"
1819{ return MCOLONCOLON; }
1820        YY_BREAK
1821case 95:
1822YY_RULE_SETUP
1823#line 531 "scanner.l"
1824{ switch_state(YYSTATE, ANYLINE, "ANYLINE"); return MEQUAL; }
1825        YY_BREAK
1826case 96:
1827YY_RULE_SETUP
1828#line 532 "scanner.l"
1829{ printf("PCB: '%s'\n", yytext); }
1830        YY_BREAK
1831
1832
1833case 97:
1834YY_RULE_SETUP
1835#line 536 "scanner.l"
1836{ lvalp->name = yytext;
1837                pop_state();
1838                return ANYTOK; }
1839        YY_BREAK
1840case 98:
1841YY_RULE_SETUP
1842#line 539 "scanner.l"
1843{ yylineno++; }
1844        YY_BREAK
1845case 99:
1846YY_RULE_SETUP
1847#line 540 "scanner.l"
1848{ yymore(); }
1849        YY_BREAK
1850
1851case 100:
1852YY_RULE_SETUP
1853#line 543 "scanner.l"
1854YY_FATAL_ERROR( "flex scanner jammed" );
1855        YY_BREAK
1856case YY_STATE_EOF(preamble):
1857case YY_STATE_EOF(MODINITIAL):
1858case YY_STATE_EOF(PROCCMDBLOCK):
1859case YY_STATE_EOF(CODEBLOCK):
1860case YY_STATE_EOF(CODEBLOCK2):
1861case YY_STATE_EOF(module):
1862case YY_STATE_EOF(SECT2):
1863case YY_STATE_EOF(SECT3):
1864case YY_STATE_EOF(PROCDECL):
1865case YY_STATE_EOF(EXAMPLE):
1866case YY_STATE_EOF(ANYLINE):
1867case YY_STATE_EOF(pdef):
1868case YY_STATE_EOF(procopt):
1869case YY_STATE_EOF(procdef):
1870case YY_STATE_EOF(ctext):
1871case YY_STATE_EOF(cstring):
1872        yyterminate();
1873
1874        case YY_END_OF_BUFFER:
1875                {
1876                /* Amount of text matched not including the EOB char. */
1877                int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1878
1879                /* Undo the effects of YY_DO_BEFORE_ACTION. */
1880                *yy_cp = yy_hold_char;
1881                YY_RESTORE_YY_MORE_OFFSET
1882
1883                if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1884                        {
1885                        /* We're scanning a new file or input source.  It's
1886                         * possible that this happened because the user
1887                         * just pointed yyin at a new source and called
1888                         * yylex().  If so, then we have to assure
1889                         * consistency between yy_current_buffer and our
1890                         * globals.  Here is the right place to do so, because
1891                         * this is the first action (other than possibly a
1892                         * back-up) that will match for the new input source.
1893                         */
1894                        yy_n_chars = yy_current_buffer->yy_n_chars;
1895                        yy_current_buffer->yy_input_file = yyin;
1896                        yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1897                        }
1898
1899                /* Note that here we test for yy_c_buf_p "<=" to the position
1900                 * of the first EOB in the buffer, since yy_c_buf_p will
1901                 * already have been incremented past the NUL character
1902                 * (since all states make transitions on EOB to the
1903                 * end-of-buffer state).  Contrast this with the test
1904                 * in input().
1905                 */
1906                if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1907                        { /* This was really a NUL. */
1908                        yy_state_type yy_next_state;
1909
1910                        yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1911
1912                        yy_current_state = yy_get_previous_state();
1913
1914                        /* Okay, we're now positioned to make the NUL
1915                         * transition.  We couldn't have
1916                         * yy_get_previous_state() go ahead and do it
1917                         * for us because it doesn't know how to deal
1918                         * with the possibility of jamming (and we don't
1919                         * want to build jamming into it because then it
1920                         * will run more slowly).
1921                         */
1922
1923                        yy_next_state = yy_try_NUL_trans( yy_current_state );
1924
1925                        yy_bp = yytext_ptr + YY_MORE_ADJ;
1926
1927                        if ( yy_next_state )
1928                                {
1929                                /* Consume the NUL. */
1930                                yy_cp = ++yy_c_buf_p;
1931                                yy_current_state = yy_next_state;
1932                                goto yy_match;
1933                                }
1934
1935                        else
1936                                {
1937                                yy_cp = yy_c_buf_p;
1938                                goto yy_find_action;
1939                                }
1940                        }
1941
1942                else switch ( yy_get_next_buffer() )
1943                        {
1944                        case EOB_ACT_END_OF_FILE:
1945                                {
1946                                yy_did_buffer_switch_on_eof = 0;
1947
1948                                if ( yywrap() )
1949                                        {
1950                                        /* Note: because we've taken care in
1951                                         * yy_get_next_buffer() to have set up
1952                                         * yytext, we can now set up
1953                                         * yy_c_buf_p so that if some total
1954                                         * hoser (like flex itself) wants to
1955                                         * call the scanner after we return the
1956                                         * YY_NULL, it'll still work - another
1957                                         * YY_NULL will get returned.
1958                                         */
1959                                        yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1960
1961                                        yy_act = YY_STATE_EOF(YY_START);
1962                                        goto do_action;
1963                                        }
1964
1965                                else
1966                                        {
1967                                        if ( ! yy_did_buffer_switch_on_eof )
1968                                                YY_NEW_FILE;
1969                                        }
1970                                break;
1971                                }
1972
1973                        case EOB_ACT_CONTINUE_SCAN:
1974                                yy_c_buf_p =
1975                                        yytext_ptr + yy_amount_of_matched_text;
1976
1977                                yy_current_state = yy_get_previous_state();
1978
1979                                yy_cp = yy_c_buf_p;
1980                                yy_bp = yytext_ptr + YY_MORE_ADJ;
1981                                goto yy_match;
1982
1983                        case EOB_ACT_LAST_MATCH:
1984                                yy_c_buf_p =
1985                                &yy_current_buffer->yy_ch_buf[yy_n_chars];
1986
1987                                yy_current_state = yy_get_previous_state();
1988
1989                                yy_cp = yy_c_buf_p;
1990                                yy_bp = yytext_ptr + YY_MORE_ADJ;
1991                                goto yy_find_action;
1992                        }
1993                break;
1994                }
1995
1996        default:
1997                YY_FATAL_ERROR(
1998                        "fatal flex scanner internal error--no action found" );
1999        } /* end of action switch */
2000                } /* end of scanning one token */
2001        } /* end of yylex */
2002
2003
2004/* yy_get_next_buffer - try to read in a new buffer
2005 *
2006 * Returns a code representing an action:
2007 *      EOB_ACT_LAST_MATCH -
2008 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2009 *      EOB_ACT_END_OF_FILE - end of file
2010 */
2011
2012static int yy_get_next_buffer()
2013        {
2014        register char *dest = yy_current_buffer->yy_ch_buf;
2015        register char *source = yytext_ptr;
2016        register int number_to_move, i;
2017        int ret_val;
2018
2019        if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
2020                YY_FATAL_ERROR(
2021                "fatal flex scanner internal error--end of buffer missed" );
2022
2023        if ( yy_current_buffer->yy_fill_buffer == 0 )
2024                { /* Don't try to fill the buffer, so this is an EOF. */
2025                if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
2026                        {
2027                        /* We matched a single character, the EOB, so
2028                         * treat this as a final EOF.
2029                         */
2030                        return EOB_ACT_END_OF_FILE;
2031                        }
2032
2033                else
2034                        {
2035                        /* We matched some text prior to the EOB, first
2036                         * process it.
2037                         */
2038                        return EOB_ACT_LAST_MATCH;
2039                        }
2040                }
2041
2042        /* Try to read more data. */
2043
2044        /* First move last chars to start of buffer. */
2045        number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2046
2047        for ( i = 0; i < number_to_move; ++i )
2048                *(dest++) = *(source++);
2049
2050        if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2051                /* don't do the read, it's not guaranteed to return an EOF,
2052                 * just force an EOF
2053                 */
2054                yy_current_buffer->yy_n_chars = yy_n_chars = 0;
2055
2056        else
2057                {
2058                int num_to_read =
2059                        yy_current_buffer->yy_buf_size - number_to_move - 1;
2060
2061                while ( num_to_read <= 0 )
2062                        { /* Not enough room in the buffer - grow it. */
2063#ifdef YY_USES_REJECT
2064                        YY_FATAL_ERROR(
2065"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2066#else
2067
2068                        /* just a shorter name for the current buffer */
2069                        YY_BUFFER_STATE b = yy_current_buffer;
2070
2071                        int yy_c_buf_p_offset =
2072                                (int) (yy_c_buf_p - b->yy_ch_buf);
2073
2074                        if ( b->yy_is_our_buffer )
2075                                {
2076                                int new_size = b->yy_buf_size * 2;
2077
2078                                if ( new_size <= 0 )
2079                                        b->yy_buf_size += b->yy_buf_size / 8;
2080                                else
2081                                        b->yy_buf_size *= 2;
2082
2083                                b->yy_ch_buf = (char *)
2084                                        /* Include room in for 2 EOB chars. */
2085                                        yy_flex_realloc( (void *) b->yy_ch_buf,
2086                                                         b->yy_buf_size + 2 );
2087                                }
2088                        else
2089                                /* Can't grow it, we don't own it. */
2090                                b->yy_ch_buf = 0;
2091
2092                        if ( ! b->yy_ch_buf )
2093                                YY_FATAL_ERROR(
2094                                "fatal error - scanner input buffer overflow" );
2095
2096                        yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2097
2098                        num_to_read = yy_current_buffer->yy_buf_size -
2099                                                number_to_move - 1;
2100#endif
2101                        }
2102
2103                if ( num_to_read > YY_READ_BUF_SIZE )
2104                        num_to_read = YY_READ_BUF_SIZE;
2105
2106                /* Read in more data. */
2107                YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
2108                        yy_n_chars, num_to_read );
2109
2110                yy_current_buffer->yy_n_chars = yy_n_chars;
2111                }
2112
2113        if ( yy_n_chars == 0 )
2114                {
2115                if ( number_to_move == YY_MORE_ADJ )
2116                        {
2117                        ret_val = EOB_ACT_END_OF_FILE;
2118                        yyrestart( yyin );
2119                        }
2120
2121                else
2122                        {
2123                        ret_val = EOB_ACT_LAST_MATCH;
2124                        yy_current_buffer->yy_buffer_status =
2125                                YY_BUFFER_EOF_PENDING;
2126                        }
2127                }
2128
2129        else
2130                ret_val = EOB_ACT_CONTINUE_SCAN;
2131
2132        yy_n_chars += number_to_move;
2133        yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2134        yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2135
2136        yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
2137
2138        return ret_val;
2139        }
2140
2141
2142/* yy_get_previous_state - get the state just before the EOB char was reached */
2143
2144static yy_state_type yy_get_previous_state()
2145        {
2146        register yy_state_type yy_current_state;
2147        register char *yy_cp;
2148
2149        yy_current_state = yy_start;
2150        yy_current_state += YY_AT_BOL();
2151
2152        for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2153                {
2154                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2155                if ( yy_accept[yy_current_state] )
2156                        {
2157                        yy_last_accepting_state = yy_current_state;
2158                        yy_last_accepting_cpos = yy_cp;
2159                        }
2160                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2161                        {
2162                        yy_current_state = (int) yy_def[yy_current_state];
2163                        if ( yy_current_state >= 384 )
2164                                yy_c = yy_meta[(unsigned int) yy_c];
2165                        }
2166                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2167                }
2168
2169        return yy_current_state;
2170        }
2171
2172
2173/* yy_try_NUL_trans - try to make a transition on the NUL character
2174 *
2175 * synopsis
2176 *      next_state = yy_try_NUL_trans( current_state );
2177 */
2178
2179#ifdef YY_USE_PROTOS
2180static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2181#else
2182static yy_state_type yy_try_NUL_trans( yy_current_state )
2183yy_state_type yy_current_state;
2184#endif
2185        {
2186        register int yy_is_jam;
2187        register char *yy_cp = yy_c_buf_p;
2188
2189        register YY_CHAR yy_c = 1;
2190        if ( yy_accept[yy_current_state] )
2191                {
2192                yy_last_accepting_state = yy_current_state;
2193                yy_last_accepting_cpos = yy_cp;
2194                }
2195        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2196                {
2197                yy_current_state = (int) yy_def[yy_current_state];
2198                if ( yy_current_state >= 384 )
2199                        yy_c = yy_meta[(unsigned int) yy_c];
2200                }
2201        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2202        yy_is_jam = (yy_current_state == 383);
2203
2204        return yy_is_jam ? 0 : yy_current_state;
2205        }
2206
2207
2208#ifndef YY_NO_UNPUT
2209#ifdef YY_USE_PROTOS
2210static void yyunput( int c, register char *yy_bp )
2211#else
2212static void yyunput( c, yy_bp )
2213int c;
2214VAR register char *yy_bp;
2215#endif
2216        {
2217        register char *yy_cp = yy_c_buf_p;
2218
2219        /* undo effects of setting up yytext */
2220        *yy_cp = yy_hold_char;
2221
2222        if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2223                { /* need to shift things up to make room */
2224                /* +2 for EOB chars. */
2225                register int number_to_move = yy_n_chars + 2;
2226                register char *dest = &yy_current_buffer->yy_ch_buf[
2227                                        yy_current_buffer->yy_buf_size + 2];
2228                register char *source =
2229                                &yy_current_buffer->yy_ch_buf[number_to_move];
2230
2231                while ( source > yy_current_buffer->yy_ch_buf )
2232                        *--dest = *--source;
2233
2234                yy_cp += (int) (dest - source);
2235                yy_bp += (int) (dest - source);
2236                yy_current_buffer->yy_n_chars =
2237                        yy_n_chars = yy_current_buffer->yy_buf_size;
2238
2239                if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2240                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
2241                }
2242
2243        *--yy_cp = (char) c;
2244
2245
2246        yytext_ptr = yy_bp;
2247        yy_hold_char = *yy_cp;
2248        yy_c_buf_p = yy_cp;
2249        }
2250#endif  /* ifndef YY_NO_UNPUT */
2251
2252
2253#ifndef YY_NO_INPUT
2254#ifdef __cplusplus
2255static int yyinput()
2256#else
2257static int input()
2258#endif
2259        {
2260        int c;
2261
2262        *yy_c_buf_p = yy_hold_char;
2263
2264        if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2265                {
2266                /* yy_c_buf_p now points to the character we want to return.
2267                 * If this occurs *before* the EOB characters, then it's a
2268                 * valid NUL; if not, then we've hit the end of the buffer.
2269                 */
2270                if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2271                        /* This was really a NUL. */
2272                        *yy_c_buf_p = '\0';
2273
2274                else
2275                        { /* need more input */
2276                        int offset = yy_c_buf_p - yytext_ptr;
2277                        ++yy_c_buf_p;
2278
2279                        switch ( yy_get_next_buffer() )
2280                                {
2281                                case EOB_ACT_LAST_MATCH:
2282                                        /* This happens because yy_g_n_b()
2283                                         * sees that we've accumulated a
2284                                         * token and flags that we need to
2285                                         * try matching the token before
2286                                         * proceeding.  But for input(),
2287                                         * there's no matching to consider.
2288                                         * So convert the EOB_ACT_LAST_MATCH
2289                                         * to EOB_ACT_END_OF_FILE.
2290                                         */
2291
2292                                        /* Reset buffer status. */
2293                                        yyrestart( yyin );
2294
2295                                        /* fall through */
2296
2297                                case EOB_ACT_END_OF_FILE:
2298                                        {
2299                                        if ( yywrap() )
2300                                                return EOF;
2301
2302                                        if ( ! yy_did_buffer_switch_on_eof )
2303                                                YY_NEW_FILE;
2304#ifdef __cplusplus
2305                                        return yyinput();
2306#else
2307                                        return input();
2308#endif
2309                                        }
2310
2311                                case EOB_ACT_CONTINUE_SCAN:
2312                                        yy_c_buf_p = yytext_ptr + offset;
2313                                        break;
2314                                }
2315                        }
2316                }
2317
2318        c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
2319        *yy_c_buf_p = '\0';     /* preserve yytext */
2320        yy_hold_char = *++yy_c_buf_p;
2321
2322        yy_current_buffer->yy_at_bol = (c == '\n');
2323
2324        return c;
2325        }
2326#endif /* YY_NO_INPUT */
2327
2328#ifdef YY_USE_PROTOS
2329void yyrestart( FILE *input_file )
2330#else
2331void yyrestart( input_file )
2332FILE *input_file;
2333#endif
2334        {
2335        if ( ! yy_current_buffer )
2336                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2337
2338        yy_init_buffer( yy_current_buffer, input_file );
2339        yy_load_buffer_state();
2340        }
2341
2342
2343#ifdef YY_USE_PROTOS
2344void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2345#else
2346void yy_switch_to_buffer( new_buffer )
2347YY_BUFFER_STATE new_buffer;
2348#endif
2349        {
2350        if ( yy_current_buffer == new_buffer )
2351                return;
2352
2353        if ( yy_current_buffer )
2354                {
2355                /* Flush out information for old buffer. */
2356                *yy_c_buf_p = yy_hold_char;
2357                yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2358                yy_current_buffer->yy_n_chars = yy_n_chars;
2359                }
2360
2361        yy_current_buffer = new_buffer;
2362        yy_load_buffer_state();
2363
2364        /* We don't actually know whether we did this switch during
2365         * EOF (yywrap()) processing, but the only time this flag
2366         * is looked at is after yywrap() is called, so it's safe
2367         * to go ahead and always set it.
2368         */
2369        yy_did_buffer_switch_on_eof = 1;
2370        }
2371
2372
2373#ifdef YY_USE_PROTOS
2374void yy_load_buffer_state( void )
2375#else
2376void yy_load_buffer_state()
2377#endif
2378        {
2379        yy_n_chars = yy_current_buffer->yy_n_chars;
2380        yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2381        yyin = yy_current_buffer->yy_input_file;
2382        yy_hold_char = *yy_c_buf_p;
2383        }
2384
2385
2386#ifdef YY_USE_PROTOS
2387YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2388#else
2389YY_BUFFER_STATE yy_create_buffer( file, size )
2390FILE *file;
2391VAR int size;
2392#endif
2393        {
2394        YY_BUFFER_STATE b;
2395
2396        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2397        if ( ! b )
2398                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2399
2400        b->yy_buf_size = size;
2401
2402        /* yy_ch_buf has to be 2 characters longer than the size given because
2403         * we need to put in 2 end-of-buffer characters.
2404         */
2405        b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2406        if ( ! b->yy_ch_buf )
2407                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2408
2409        b->yy_is_our_buffer = 1;
2410
2411        yy_init_buffer( b, file );
2412
2413        return b;
2414        }
2415
2416
2417#ifdef YY_USE_PROTOS
2418void yy_delete_buffer( YY_BUFFER_STATE b )
2419#else
2420void yy_delete_buffer( b )
2421YY_BUFFER_STATE b;
2422#endif
2423        {
2424        if ( ! b )
2425                return;
2426
2427        if ( b == yy_current_buffer )
2428                yy_current_buffer = (YY_BUFFER_STATE) 0;
2429
2430        if ( b->yy_is_our_buffer )
2431                yy_flex_free( (void *) b->yy_ch_buf );
2432
2433        yy_flex_free( (void *) b );
2434        }
2435
2436
2437
2438#ifdef YY_USE_PROTOS
2439void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2440#else
2441void yy_init_buffer( b, file )
2442YY_BUFFER_STATE b;
2443VAR FILE *file;
2444#endif
2445
2446
2447        {
2448        yy_flush_buffer( b );
2449
2450        b->yy_input_file = file;
2451        b->yy_fill_buffer = 1;
2452
2453#if YY_ALWAYS_INTERACTIVE
2454        b->yy_is_interactive = 1;
2455#else
2456#if YY_NEVER_INTERACTIVE
2457        b->yy_is_interactive = 0;
2458#else
2459        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2460#endif
2461#endif
2462        }
2463
2464
2465#ifdef YY_USE_PROTOS
2466void yy_flush_buffer( YY_BUFFER_STATE b )
2467#else
2468void yy_flush_buffer( b )
2469YY_BUFFER_STATE b;
2470#endif
2471
2472        {
2473        if ( ! b )
2474                return;
2475
2476        b->yy_n_chars = 0;
2477
2478        /* We always need two end-of-buffer characters.  The first causes
2479         * a transition to the end-of-buffer state.  The second causes
2480         * a jam in that state.
2481         */
2482        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2483        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2484
2485        b->yy_buf_pos = &b->yy_ch_buf[0];
2486
2487        b->yy_at_bol = 1;
2488        b->yy_buffer_status = YY_BUFFER_NEW;
2489
2490        if ( b == yy_current_buffer )
2491                yy_load_buffer_state();
2492        }
2493
2494
2495#ifndef YY_NO_SCAN_BUFFER
2496#ifdef YY_USE_PROTOS
2497YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2498#else
2499YY_BUFFER_STATE yy_scan_buffer( base, size )
2500char *base;
2501VAR yy_size_t size;
2502#endif
2503        {
2504        YY_BUFFER_STATE b;
2505
2506        if ( size < 2 ||
2507             base[size-2] != YY_END_OF_BUFFER_CHAR ||
2508             base[size-1] != YY_END_OF_BUFFER_CHAR )
2509                /* They forgot to leave room for the EOB's. */
2510                return 0;
2511
2512        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2513        if ( ! b )
2514                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2515
2516        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2517        b->yy_buf_pos = b->yy_ch_buf = base;
2518        b->yy_is_our_buffer = 0;
2519        b->yy_input_file = 0;
2520        b->yy_n_chars = b->yy_buf_size;
2521        b->yy_is_interactive = 0;
2522        b->yy_at_bol = 1;
2523        b->yy_fill_buffer = 0;
2524        b->yy_buffer_status = YY_BUFFER_NEW;
2525
2526        yy_switch_to_buffer( b );
2527
2528        return b;
2529        }
2530#endif
2531
2532
2533#ifndef YY_NO_SCAN_STRING
2534#ifdef YY_USE_PROTOS
2535YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2536#else
2537YY_BUFFER_STATE yy_scan_string( yy_str )
2538yyconst char *yy_str;
2539#endif
2540        {
2541        int len;
2542        for ( len = 0; yy_str[len]; ++len )
2543                ;
2544
2545        return yy_scan_bytes( yy_str, len );
2546        }
2547#endif
2548
2549
2550#ifndef YY_NO_SCAN_BYTES
2551#ifdef YY_USE_PROTOS
2552YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2553#else
2554YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2555yyconst char *bytes;
2556VAR int len;
2557#endif
2558        {
2559        YY_BUFFER_STATE b;
2560        char *buf;
2561        yy_size_t n;
2562        int i;
2563
2564        /* Get memory for full buffer, including space for trailing EOB's. */
2565        n = len + 2;
2566        buf = (char *) yy_flex_alloc( n );
2567        if ( ! buf )
2568                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2569
2570        for ( i = 0; i < len; ++i )
2571                buf[i] = bytes[i];
2572
2573        buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2574
2575        b = yy_scan_buffer( buf, n );
2576        if ( ! b )
2577                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2578
2579        /* It's okay to grow etc. this buffer, and we should throw it
2580         * away when we're done.
2581         */
2582        b->yy_is_our_buffer = 1;
2583
2584        return b;
2585        }
2586#endif
2587
2588
2589#ifndef YY_NO_PUSH_STATE
2590#ifdef YY_USE_PROTOS
2591static void yy_push_state( int new_state )
2592#else
2593static void yy_push_state( new_state )
2594int new_state;
2595#endif
2596        {
2597        if ( yy_start_stack_ptr >= yy_start_stack_depth )
2598                {
2599                yy_size_t new_size;
2600
2601                yy_start_stack_depth += YY_START_STACK_INCR;
2602                new_size = yy_start_stack_depth * sizeof( int );
2603
2604                if ( ! yy_start_stack )
2605                        yy_start_stack = (int *) yy_flex_alloc( new_size );
2606
2607                else
2608                        yy_start_stack = (int *) yy_flex_realloc(
2609                                        (void *) yy_start_stack, new_size );
2610
2611                if ( ! yy_start_stack )
2612                        YY_FATAL_ERROR(
2613                        "out of memory expanding start-condition stack" );
2614                }
2615
2616        yy_start_stack[yy_start_stack_ptr++] = YY_START;
2617
2618        BEGIN(new_state);
2619        }
2620#endif
2621
2622
2623#ifndef YY_NO_POP_STATE
2624static void yy_pop_state()
2625        {
2626        if ( --yy_start_stack_ptr < 0 )
2627                YY_FATAL_ERROR( "start-condition stack underflow" );
2628
2629        BEGIN(yy_start_stack[yy_start_stack_ptr]);
2630        }
2631#endif
2632
2633
2634#ifndef YY_NO_TOP_STATE
2635static int yy_top_state()
2636        {
2637        return yy_start_stack[yy_start_stack_ptr - 1];
2638        }
2639#endif
2640
2641#ifndef YY_EXIT_FAILURE
2642#define YY_EXIT_FAILURE 2
2643#endif
2644
2645#ifdef YY_USE_PROTOS
2646static void yy_fatal_error( yyconst char msg[] )
2647#else
2648static void yy_fatal_error( msg )
2649char msg[];
2650#endif
2651        {
2652        (void) fprintf( stderr, "%s\n", msg );
2653        exit( YY_EXIT_FAILURE );
2654        }
2655
2656
2657
2658/* Redefine yyless() so it works in section 3 code. */
2659
2660#undef yyless
2661#define yyless(n) \
2662        do \
2663                { \
2664                /* Undo effects of setting up yytext. */ \
2665                yytext[yyleng] = yy_hold_char; \
2666                yy_c_buf_p = yytext + n; \
2667                yy_hold_char = *yy_c_buf_p; \
2668                *yy_c_buf_p = '\0'; \
2669                yyleng = n; \
2670                } \
2671        while ( 0 )
2672
2673
2674/* Internal utility routines. */
2675
2676#ifndef yytext_ptr
2677#ifdef YY_USE_PROTOS
2678static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2679#else
2680static void yy_flex_strncpy( s1, s2, n )
2681char *s1;
2682yyconst char *s2;
2683VAR int n;
2684#endif
2685        {
2686        register int i;
2687        for ( i = 0; i < n; ++i )
2688                s1[i] = s2[i];
2689        }
2690#endif
2691
2692#ifdef YY_NEED_STRLEN
2693#ifdef YY_USE_PROTOS
2694static int yy_flex_strlen( yyconst char *s )
2695#else
2696static int yy_flex_strlen( s )
2697yyconst char *s;
2698#endif
2699        {
2700        register int n;
2701        for ( n = 0; s[n]; ++n )
2702                ;
2703
2704        return n;
2705        }
2706#endif
2707
2708
2709#ifdef YY_USE_PROTOS
2710static void *yy_flex_alloc( yy_size_t size )
2711#else
2712static void *yy_flex_alloc( size )
2713yy_size_t size;
2714#endif
2715        {
2716        return (void *) malloc( size );
2717        }
2718
2719#ifdef YY_USE_PROTOS
2720static void *yy_flex_realloc( void *ptr, yy_size_t size )
2721#else
2722static void *yy_flex_realloc( ptr, size )
2723void *ptr;
2724VAR yy_size_t size;
2725#endif
2726        {
2727        /* The cast to (char *) in the following accommodates both
2728         * implementations that use char* generic pointers, and those
2729         * that use void* generic pointers.  It works with the latter
2730         * because both ANSI C and C++ allow castless assignment from
2731         * any pointer type to void*, and deal with argument conversions
2732         * as though doing an assignment.
2733         */
2734        return (void *) realloc( (char *) ptr, size );
2735        }
2736
2737#ifdef YY_USE_PROTOS
2738static void yy_flex_free( void *ptr )
2739#else
2740static void yy_flex_free( ptr )
2741void *ptr;
2742#endif
2743        {
2744        free( ptr );
2745        }
2746
2747#if YY_MAIN
2748int main()
2749        {
2750        yylex();
2751        return 0;
2752        }
2753#endif
2754#line 543 "scanner.l"
2755
2756/*
2757        [^*\n]+         ++yylineno; yymore(); /*ACTION_ECHO;* /
2758        [^*\n]*{NL}     ++yylineno; yymore(); /*ACTION_ECHO;* /
2759         .*(\n?) { yylineno++; lvalp->name = yytext; return CODEPART; }
2760*/
2761
2762extern "C" {
2763  int yywrap() {
2764    return 1;
2765  }
2766}
2767
2768int libread(FILE* f, char* buf, int max_size)
2769{ int rc;
2770
2771  offset = ftell(f);
2772  rc  = fread( buf, 1, max_size, f );
2773#if YYLPDEBUG >2
2774  printf("fread: %d of %d\n", rc, max_size);
2775#endif
2776  yylp_buffer_start = buf;
2777  return rc;
2778}
2779
2780void switch_state(int state, int new_state, char *name)
2781{
2782#if DEBUG > 2
2783  printf("====>SWITCH to new state %d/%d l=%d, [%s] at %d\n",
2784         state, new_state, state_level, name, yylineno);
2785#endif
2786  strncpy(old_states[state_level].name, name,
2787          sizeof(old_states[state_level].name));
2788  BEGIN(new_state);
2789}
2790
2791void push_state(int state, int new_state, char *name)
2792{
2793  state_level++;
2794#if DEBUG > 2
2795  printf("====>PUSH to new state %d/%d l=%d, [%s] at %d\n",
2796         state, new_state, state_level, name, yylineno);
2797#endif
2798  if(state_level>=state_max) {
2799    state_max++;
2800    if(old_states == NULL)
2801      old_states = (struct _states *)malloc(sizeof(struct _states));
2802    else {
2803      old_states = (struct _states *)realloc(old_states,
2804                                             state_max*sizeof(struct _states));
2805    }
2806  }
2807  old_states[state_level].state = state;
2808  strncpy(old_states[state_level].name, name,
2809          sizeof(old_states[state_level].name));
2810  BEGIN(new_state);
2811}
2812
2813void pop_state()
2814{
2815#if DEBUG > 2
2816  printf("====>Back to old state %d, l=%d [%s] at %d\n",
2817         old_states[state_level].state,
2818         state_level,
2819         (state_level>0) ? old_states[state_level-1].name : "INITIAL",
2820         yylineno);
2821#endif
2822  if(state_level<0) return;
2823  BEGIN(old_states[state_level].state);
2824  state_level--;
2825  if(state_level<0) state_level = -1;
2826}
2827
2828int return_sect_token(
2829  int passed,
2830  int old_sect,
2831  int new_sect
2832  )
2833{
2834  if(passed) {
2835#if DEBUG
2836    printf("Go to section '%s' (%d)\n", sectname[new_sect], new_sect);
2837#endif
2838    switch(new_sect) {
2839        case 2: return SECT2START;
2840        case 3: return SECT3START;
2841        case 4: return SECT4START;
2842        default: return SECTEND;
2843    }
2844  } else {
2845#if DEBUG
2846    printf("End of section '%s' (%d)\n", sectname[old_sect], old_sect);
2847#endif
2848    switch(old_sect) {
2849        case 2: return SECT2END;
2850        case 3: return SECT3END;
2851        case 4: return SECT4END;
2852        default: return SECTEND;
2853    }
2854  }
2855}
2856
2857void add_action(char *new_text)
2858{
2859  return;
2860  switch(sectnum) {
2861    case 1:
2862      printf("1>%s<#\n", new_text);
2863      break;
2864    case 2:
2865      printf("2>%s<#\n", new_text);
2866      break;
2867    case 3:
2868      printf("3>%s<#\n", new_text);
2869      break;
2870    case 4:
2871      printf("4>%s<#\n", new_text);
2872      break;
2873  }
2874}
Note: See TracBrowser for help on using the repository browser.