source: git/Singular/scanner.cc @ f5a3a23

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