source: git/Singular/scanner.cc @ 84a6a7

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