source: git/modules/modgen/scanner.cc @ 341696

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