VirtualBox

source: kBuild/trunk/src/kash/generated/arith_lex.c@ 2308

Last change on this file since 2308 was 1233, checked in by bird, 17 years ago

keywords.

  • Property svn:keywords set to Id
File size: 48.4 KB
Line 
1#line 2 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"
2
3#line 4 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 5
12#define YY_FLEX_SUBMINOR_VERSION 33
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
16
17/* First, we deal with platform-specific or compiler-specific issues. */
18
19/* begin standard C headers. */
20#include <stdio.h>
21#include <string.h>
22#include <errno.h>
23#include <stdlib.h>
24
25/* end standard C headers. */
26
27/* flex integer type definitions */
28
29#ifndef FLEXINT_H
30#define FLEXINT_H
31
32/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34#if __STDC_VERSION__ >= 199901L
35
36/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39#ifndef __STDC_LIMIT_MACROS
40#define __STDC_LIMIT_MACROS 1
41#endif
42
43#include <inttypes.h>
44typedef int8_t flex_int8_t;
45typedef uint8_t flex_uint8_t;
46typedef int16_t flex_int16_t;
47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;
50#else
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
57#endif /* ! C99 */
58
59/* Limits of integral types. */
60#ifndef INT8_MIN
61#define INT8_MIN (-128)
62#endif
63#ifndef INT16_MIN
64#define INT16_MIN (-32767-1)
65#endif
66#ifndef INT32_MIN
67#define INT32_MIN (-2147483647-1)
68#endif
69#ifndef INT8_MAX
70#define INT8_MAX (127)
71#endif
72#ifndef INT16_MAX
73#define INT16_MAX (32767)
74#endif
75#ifndef INT32_MAX
76#define INT32_MAX (2147483647)
77#endif
78#ifndef UINT8_MAX
79#define UINT8_MAX (255U)
80#endif
81#ifndef UINT16_MAX
82#define UINT16_MAX (65535U)
83#endif
84#ifndef UINT32_MAX
85#define UINT32_MAX (4294967295U)
86#endif
87
88#endif /* ! FLEXINT_H */
89
90#ifdef __cplusplus
91
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
97#if __STDC__
98
99#define YY_USE_CONST
100
101#endif /* __STDC__ */
102#endif /* ! __cplusplus */
103
104#ifdef YY_USE_CONST
105#define yyconst const
106#else
107#define yyconst
108#endif
109
110/* Returned upon end-of-file. */
111#define YY_NULL 0
112
113/* Promotes a possibly negative, possibly signed char to an unsigned
114 * integer for use as an array index. If the signed char is negative,
115 * we want to instead treat it as an 8-bit unsigned char, hence the
116 * double cast.
117 */
118#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119
120/* Enter a start condition. This macro really ought to take a parameter,
121 * but we do it the disgusting crufty way forced on us by the ()-less
122 * definition of BEGIN.
123 */
124#define BEGIN (yy_start) = 1 + 2 *
125
126/* Translate the current start state into a value that can be later handed
127 * to BEGIN to return to the state. The YYSTATE alias is for lex
128 * compatibility.
129 */
130#define YY_START (((yy_start) - 1) / 2)
131#define YYSTATE YY_START
132
133/* Action number for EOF rule of a given start state. */
134#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135
136/* Special action meaning "start processing a new file". */
137#define YY_NEW_FILE yyrestart(yyin )
138
139#define YY_END_OF_BUFFER_CHAR 0
140
141/* Size of default input buffer. */
142#ifndef YY_BUF_SIZE
143#define YY_BUF_SIZE 16384
144#endif
145
146/* The state buf must be large enough to hold one state per character in the main buffer.
147 */
148#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149
150#ifndef YY_TYPEDEF_YY_BUFFER_STATE
151#define YY_TYPEDEF_YY_BUFFER_STATE
152typedef struct yy_buffer_state *YY_BUFFER_STATE;
153#endif
154
155extern int yyleng;
156
157extern FILE *yyin, *yyout;
158
159#define EOB_ACT_CONTINUE_SCAN 0
160#define EOB_ACT_END_OF_FILE 1
161#define EOB_ACT_LAST_MATCH 2
162
163 #define YY_LESS_LINENO(n)
164
165/* Return all but the first "n" matched characters back to the input stream. */
166#define yyless(n) \
167 do \
168 { \
169 /* Undo effects of setting up yytext. */ \
170 int yyless_macro_arg = (n); \
171 YY_LESS_LINENO(yyless_macro_arg);\
172 *yy_cp = (yy_hold_char); \
173 YY_RESTORE_YY_MORE_OFFSET \
174 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
175 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
176 } \
177 while ( 0 )
178
179#define unput(c) yyunput( c, (yytext_ptr) )
180
181/* The following is because we cannot portably get our hands on size_t
182 * (without autoconf's help, which isn't available because we want
183 * flex-generated scanners to compile on their own).
184 */
185
186#ifndef YY_TYPEDEF_YY_SIZE_T
187#define YY_TYPEDEF_YY_SIZE_T
188typedef unsigned int yy_size_t;
189#endif
190
191#ifndef YY_STRUCT_YY_BUFFER_STATE
192#define YY_STRUCT_YY_BUFFER_STATE
193struct yy_buffer_state
194 {
195 FILE *yy_input_file;
196
197 char *yy_ch_buf; /* input buffer */
198 char *yy_buf_pos; /* current position in input buffer */
199
200 /* Size of input buffer in bytes, not including room for EOB
201 * characters.
202 */
203 yy_size_t yy_buf_size;
204
205 /* Number of characters read into yy_ch_buf, not including EOB
206 * characters.
207 */
208 int yy_n_chars;
209
210 /* Whether we "own" the buffer - i.e., we know we created it,
211 * and can realloc() it to grow it, and should free() it to
212 * delete it.
213 */
214 int yy_is_our_buffer;
215
216 /* Whether this is an "interactive" input source; if so, and
217 * if we're using stdio for input, then we want to use getc()
218 * instead of fread(), to make sure we stop fetching input after
219 * each newline.
220 */
221 int yy_is_interactive;
222
223 /* Whether we're considered to be at the beginning of a line.
224 * If so, '^' rules will be active on the next match, otherwise
225 * not.
226 */
227 int yy_at_bol;
228
229 int yy_bs_lineno; /**< The line count. */
230 int yy_bs_column; /**< The column count. */
231
232 /* Whether to try to fill the input buffer when we reach the
233 * end of it.
234 */
235 int yy_fill_buffer;
236
237 int yy_buffer_status;
238
239#define YY_BUFFER_NEW 0
240#define YY_BUFFER_NORMAL 1
241 /* When an EOF's been seen but there's still some text to process
242 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
243 * shouldn't try reading from the input source any more. We might
244 * still have a bunch of tokens to match, though, because of
245 * possible backing-up.
246 *
247 * When we actually see the EOF, we change the status to "new"
248 * (via yyrestart()), so that the user can continue scanning by
249 * just pointing yyin at a new input file.
250 */
251#define YY_BUFFER_EOF_PENDING 2
252
253 };
254#endif /* !YY_STRUCT_YY_BUFFER_STATE */
255
256/* Stack of input buffers. */
257static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
258static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
259static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
260
261/* We provide macros for accessing buffer states in case in the
262 * future we want to put the buffer states in a more general
263 * "scanner state".
264 *
265 * Returns the top of the stack, or NULL.
266 */
267#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
268 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
269 : NULL)
270
271/* Same as previous macro, but useful when we know that the buffer stack is not
272 * NULL or when we need an lvalue. For internal use only.
273 */
274#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275
276/* yy_hold_char holds the character lost when yytext is formed. */
277static char yy_hold_char;
278static int yy_n_chars; /* number of characters read into yy_ch_buf */
279int yyleng;
280
281/* Points to current character in buffer. */
282static char *yy_c_buf_p = (char *) 0;
283static int yy_init = 0; /* whether we need to initialize */
284static int yy_start = 0; /* start state number */
285
286/* Flag which is used to allow yywrap()'s to do buffer switches
287 * instead of setting up a fresh yyin. A bit of a hack ...
288 */
289static int yy_did_buffer_switch_on_eof;
290
291void yyrestart (FILE *input_file );
292void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
293YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
294void yy_delete_buffer (YY_BUFFER_STATE b );
295void yy_flush_buffer (YY_BUFFER_STATE b );
296void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
297void yypop_buffer_state (void );
298
299static void yyensure_buffer_stack (void );
300static void yy_load_buffer_state (void );
301static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
302
303#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
304
305YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
306YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
307YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
308
309void *yyalloc (yy_size_t );
310void *yyrealloc (void *,yy_size_t );
311void yyfree (void * );
312
313#define yy_new_buffer yy_create_buffer
314
315#define yy_set_interactive(is_interactive) \
316 { \
317 if ( ! YY_CURRENT_BUFFER ){ \
318 yyensure_buffer_stack (); \
319 YY_CURRENT_BUFFER_LVALUE = \
320 yy_create_buffer(yyin,YY_BUF_SIZE ); \
321 } \
322 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
323 }
324
325#define yy_set_bol(at_bol) \
326 { \
327 if ( ! YY_CURRENT_BUFFER ){\
328 yyensure_buffer_stack (); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 yy_create_buffer(yyin,YY_BUF_SIZE ); \
331 } \
332 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
333 }
334
335#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336
337/* Begin user sect3 */
338
339#define yywrap(n) 1
340#define YY_SKIP_YYWRAP
341
342typedef unsigned char YY_CHAR;
343
344FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
345
346typedef int yy_state_type;
347
348extern int yylineno;
349
350int yylineno = 1;
351
352extern char *yytext;
353#define yytext_ptr yytext
354
355static yy_state_type yy_get_previous_state (void );
356static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
357static int yy_get_next_buffer (void );
358static void yy_fatal_error (yyconst char msg[] );
359
360/* Done after the current pattern has been matched and before the
361 * corresponding action - sets up yytext.
362 */
363#define YY_DO_BEFORE_ACTION \
364 (yytext_ptr) = yy_bp; \
365 yyleng = (size_t) (yy_cp - yy_bp); \
366 (yy_hold_char) = *yy_cp; \
367 *yy_cp = '\0'; \
368 (yy_c_buf_p) = yy_cp;
369
370#define YY_NUM_RULES 29
371#define YY_END_OF_BUFFER 30
372/* This struct is not used in this scanner,
373 but its presence is necessary. */
374struct yy_trans_info
375 {
376 flex_int32_t yy_verify;
377 flex_int32_t yy_nxt;
378 };
379static yyconst flex_int16_t yy_accept[39] =
380 { 0,
381 0, 0, 30, 28, 1, 1, 27, 23, 12, 6,
382 7, 21, 24, 25, 22, 3, 4, 17, 28, 15,
383 5, 11, 10, 26, 14, 9, 3, 0, 4, 19,
384 18, 13, 16, 20, 5, 8, 2, 0
385 } ;
386
387static yyconst flex_int32_t yy_ec[256] =
388 { 0,
389 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 2, 4, 1, 1, 1, 5, 6, 1, 7,
393 8, 9, 10, 1, 11, 1, 12, 13, 14, 14,
394 14, 14, 14, 14, 14, 15, 15, 1, 1, 16,
395 17, 18, 1, 1, 19, 19, 19, 19, 19, 19,
396 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
397 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
398 1, 1, 1, 21, 20, 1, 19, 19, 19, 19,
399
400 19, 19, 20, 20, 20, 20, 20, 20, 20, 20,
401 20, 20, 20, 20, 20, 20, 20, 20, 20, 22,
402 20, 20, 1, 23, 1, 24, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1
417 } ;
418
419static yyconst flex_int32_t yy_meta[25] =
420 { 0,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 2, 2, 2, 1, 1, 1, 2, 3,
423 1, 3, 1, 1
424 } ;
425
426static yyconst flex_int16_t yy_base[41] =
427 { 0,
428 0, 0, 47, 48, 48, 48, 29, 48, 39, 48,
429 48, 48, 48, 48, 48, 12, 14, 14, 27, 15,
430 0, 48, 20, 48, 48, 48, 22, 0, 24, 48,
431 48, 48, 48, 48, 0, 48, 0, 48, 38, 40
432 } ;
433
434static yyconst flex_int16_t yy_def[41] =
435 { 0,
436 38, 1, 38, 38, 38, 38, 38, 38, 38, 38,
437 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
438 39, 38, 38, 38, 38, 38, 38, 40, 38, 38,
439 38, 38, 38, 38, 39, 38, 40, 0, 38, 38
440 } ;
441
442static yyconst flex_int16_t yy_nxt[73] =
443 { 0,
444 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
445 14, 15, 16, 17, 17, 18, 19, 20, 21, 21,
446 22, 21, 23, 24, 27, 27, 29, 29, 29, 30,
447 31, 33, 34, 28, 27, 27, 29, 29, 29, 35,
448 35, 37, 36, 32, 26, 25, 38, 3, 38, 38,
449 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
450 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
451 38, 38
452 } ;
453
454static yyconst flex_int16_t yy_chk[73] =
455 { 0,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 1, 1, 16, 16, 17, 17, 17, 18,
459 18, 20, 20, 16, 27, 27, 29, 29, 29, 39,
460 39, 40, 23, 19, 9, 7, 3, 38, 38, 38,
461 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
462 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
463 38, 38
464 } ;
465
466static yy_state_type yy_last_accepting_state;
467static char *yy_last_accepting_cpos;
468
469extern int yy_flex_debug;
470int yy_flex_debug = 0;
471
472/* The intent behind this definition is that it'll catch
473 * any uses of REJECT which flex missed.
474 */
475#define REJECT reject_used_but_not_detected
476#define yymore() yymore_used_but_not_detected
477#define YY_MORE_ADJ 0
478#define YY_RESTORE_YY_MORE_OFFSET
479char *yytext;
480#line 1 "arith_lex.l"
481#line 3 "arith_lex.l"
482/* $NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $ */
483
484/*-
485 * Copyright (c) 1993
486 * The Regents of the University of California. All rights reserved.
487 *
488 * This code is derived from software contributed to Berkeley by
489 * Kenneth Almquist.
490 *
491 * Redistribution and use in source and binary forms, with or without
492 * modification, are permitted provided that the following conditions
493 * are met:
494 * 1. Redistributions of source code must retain the above copyright
495 * notice, this list of conditions and the following disclaimer.
496 * 2. Redistributions in binary form must reproduce the above copyright
497 * notice, this list of conditions and the following disclaimer in the
498 * documentation and/or other materials provided with the distribution.
499 * 3. Neither the name of the University nor the names of its contributors
500 * may be used to endorse or promote products derived from this software
501 * without specific prior written permission.
502 *
503 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
504 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
505 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
506 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
507 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
508 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
509 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
510 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
511 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
512 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
513 * SUCH DAMAGE.
514 */
515
516#if 0
517#ifndef lint
518static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
519#else
520__RCSID("$NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $");
521#endif /* not lint */
522#endif
523
524#include "arith.h"
525#include "error.h"
526#include "expand.h"
527#include "var.h"
528#include "shinstance.h"
529
530extern int yylval;
531extern shinstance *arith_psh;
532extern char *arith_buf, *arith_startbuf;
533#undef YY_INPUT
534#define YY_INPUT(buf,result,max) \
535 result = (*buf = *arith_buf++) ? 1 : YY_NULL;
536#define YY_NO_UNPUT
537#line 538 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"
538
539#define INITIAL 0
540
541#ifndef YY_NO_UNISTD_H
542/* Special case for "unistd.h", since it is non-ANSI. We include it way
543 * down here because we want the user's section 1 to have been scanned first.
544 * The user has a chance to override it with an option.
545 */
546#include <unistd.h>
547#endif
548
549#ifndef YY_EXTRA_TYPE
550#define YY_EXTRA_TYPE void *
551#endif
552
553static int yy_init_globals (void );
554
555/* Macros after this point can all be overridden by user definitions in
556 * section 1.
557 */
558
559#ifndef YY_SKIP_YYWRAP
560#ifdef __cplusplus
561extern "C" int yywrap (void );
562#else
563extern int yywrap (void );
564#endif
565#endif
566
567 static void yyunput (int c,char *buf_ptr );
568
569#ifndef yytext_ptr
570static void yy_flex_strncpy (char *,yyconst char *,int );
571#endif
572
573#ifdef YY_NEED_STRLEN
574static int yy_flex_strlen (yyconst char * );
575#endif
576
577#ifndef YY_NO_INPUT
578
579#ifdef __cplusplus
580static int yyinput (void );
581#else
582static int input (void );
583#endif
584
585#endif
586
587/* Amount of stuff to slurp up with each read. */
588#ifndef YY_READ_BUF_SIZE
589#define YY_READ_BUF_SIZE 8192
590#endif
591
592/* Copy whatever the last rule matched to the standard output. */
593#ifndef ECHO
594/* This used to be an fputs(), but since the string might contain NUL's,
595 * we now use fwrite().
596 */
597#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
598#endif
599
600/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
601 * is returned in "result".
602 */
603#ifndef YY_INPUT
604#define YY_INPUT(buf,result,max_size) \
605 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
606 { \
607 int c = '*'; \
608 size_t n; \
609 for ( n = 0; n < max_size && \
610 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
611 buf[n] = (char) c; \
612 if ( c == '\n' ) \
613 buf[n++] = (char) c; \
614 if ( c == EOF && ferror( yyin ) ) \
615 YY_FATAL_ERROR( "input in flex scanner failed" ); \
616 result = n; \
617 } \
618 else \
619 { \
620 errno=0; \
621 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
622 { \
623 if( errno != EINTR) \
624 { \
625 YY_FATAL_ERROR( "input in flex scanner failed" ); \
626 break; \
627 } \
628 errno=0; \
629 clearerr(yyin); \
630 } \
631 }\
632\
633
634#endif
635
636/* No semi-colon after return; correct usage is to write "yyterminate();" -
637 * we don't want an extra ';' after the "return" because that will cause
638 * some compilers to complain about unreachable statements.
639 */
640#ifndef yyterminate
641#define yyterminate() return YY_NULL
642#endif
643
644/* Number of entries by which start-condition stack grows. */
645#ifndef YY_START_STACK_INCR
646#define YY_START_STACK_INCR 25
647#endif
648
649/* Report a fatal error. */
650#ifndef YY_FATAL_ERROR
651#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
652#endif
653
654/* end tables serialization structures and prototypes */
655
656/* Default declaration of generated scanner - a define so the user can
657 * easily add parameters.
658 */
659#ifndef YY_DECL
660#define YY_DECL_IS_OURS 1
661
662extern int yylex (void);
663
664#define YY_DECL int yylex (void)
665#endif /* !YY_DECL */
666
667/* Code executed at the beginning of each rule, after yytext and yyleng
668 * have been set up.
669 */
670#ifndef YY_USER_ACTION
671#define YY_USER_ACTION
672#endif
673
674/* Code executed at the end of each rule. */
675#ifndef YY_BREAK
676#define YY_BREAK break;
677#endif
678
679#define YY_RULE_SETUP \
680 YY_USER_ACTION
681
682/** The main scanner function which does all the work.
683 */
684YY_DECL
685{
686 register yy_state_type yy_current_state;
687 register char *yy_cp, *yy_bp;
688 register int yy_act;
689
690#line 60 "arith_lex.l"
691
692#line 693 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"
693
694 if ( !(yy_init) )
695 {
696 (yy_init) = 1;
697
698#ifdef YY_USER_INIT
699 YY_USER_INIT;
700#endif
701
702 if ( ! (yy_start) )
703 (yy_start) = 1; /* first start state */
704
705 if ( ! yyin )
706 yyin = stdin;
707
708 if ( ! yyout )
709 yyout = stdout;
710
711 if ( ! YY_CURRENT_BUFFER ) {
712 yyensure_buffer_stack ();
713 YY_CURRENT_BUFFER_LVALUE =
714 yy_create_buffer(yyin,YY_BUF_SIZE );
715 }
716
717 yy_load_buffer_state( );
718 }
719
720 while ( 1 ) /* loops until end-of-file is reached */
721 {
722 yy_cp = (yy_c_buf_p);
723
724 /* Support of yytext. */
725 *yy_cp = (yy_hold_char);
726
727 /* yy_bp points to the position in yy_ch_buf of the start of
728 * the current run.
729 */
730 yy_bp = yy_cp;
731
732 yy_current_state = (yy_start);
733yy_match:
734 do
735 {
736 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
737 if ( yy_accept[yy_current_state] )
738 {
739 (yy_last_accepting_state) = yy_current_state;
740 (yy_last_accepting_cpos) = yy_cp;
741 }
742 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
743 {
744 yy_current_state = (int) yy_def[yy_current_state];
745 if ( yy_current_state >= 39 )
746 yy_c = yy_meta[(unsigned int) yy_c];
747 }
748 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
749 ++yy_cp;
750 }
751 while ( yy_base[yy_current_state] != 48 );
752
753yy_find_action:
754 yy_act = yy_accept[yy_current_state];
755 if ( yy_act == 0 )
756 { /* have to back up */
757 yy_cp = (yy_last_accepting_cpos);
758 yy_current_state = (yy_last_accepting_state);
759 yy_act = yy_accept[yy_current_state];
760 }
761
762 YY_DO_BEFORE_ACTION;
763
764do_action: /* This label is used only to access EOF actions. */
765
766 switch ( yy_act )
767 { /* beginning of action switch */
768 case 0: /* must back up */
769 /* undo the effects of YY_DO_BEFORE_ACTION */
770 *yy_cp = (yy_hold_char);
771 yy_cp = (yy_last_accepting_cpos);
772 yy_current_state = (yy_last_accepting_state);
773 goto yy_find_action;
774
775case 1:
776/* rule 1 can match eol */
777YY_RULE_SETUP
778#line 61 "arith_lex.l"
779{ ; }
780 YY_BREAK
781case 2:
782YY_RULE_SETUP
783#line 62 "arith_lex.l"
784{ yylval = strtol(yytext, 0, 0); return(ARITH_NUM); }
785 YY_BREAK
786case 3:
787YY_RULE_SETUP
788#line 63 "arith_lex.l"
789{ yylval = strtol(yytext, 0, 0); return(ARITH_NUM); }
790 YY_BREAK
791case 4:
792YY_RULE_SETUP
793#line 64 "arith_lex.l"
794{ yylval = strtol(yytext, 0, 0); return(ARITH_NUM); }
795 YY_BREAK
796case 5:
797YY_RULE_SETUP
798#line 65 "arith_lex.l"
799{ char *v = lookupvar(arith_psh, yytext);
800 if (v) {
801 yylval = strtol(v, &v, 0);
802 if (*v == 0)
803 return ARITH_NUM;
804 }
805 error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf);
806 }
807 YY_BREAK
808case 6:
809YY_RULE_SETUP
810#line 73 "arith_lex.l"
811{ return(ARITH_LPAREN); }
812 YY_BREAK
813case 7:
814YY_RULE_SETUP
815#line 74 "arith_lex.l"
816{ return(ARITH_RPAREN); }
817 YY_BREAK
818case 8:
819YY_RULE_SETUP
820#line 75 "arith_lex.l"
821{ return(ARITH_OR); }
822 YY_BREAK
823case 9:
824YY_RULE_SETUP
825#line 76 "arith_lex.l"
826{ return(ARITH_AND); }
827 YY_BREAK
828case 10:
829YY_RULE_SETUP
830#line 77 "arith_lex.l"
831{ return(ARITH_BOR); }
832 YY_BREAK
833case 11:
834YY_RULE_SETUP
835#line 78 "arith_lex.l"
836{ return(ARITH_BXOR); }
837 YY_BREAK
838case 12:
839YY_RULE_SETUP
840#line 79 "arith_lex.l"
841{ return(ARITH_BAND); }
842 YY_BREAK
843case 13:
844YY_RULE_SETUP
845#line 80 "arith_lex.l"
846{ return(ARITH_EQ); }
847 YY_BREAK
848case 14:
849YY_RULE_SETUP
850#line 81 "arith_lex.l"
851{ return(ARITH_NE); }
852 YY_BREAK
853case 15:
854YY_RULE_SETUP
855#line 82 "arith_lex.l"
856{ return(ARITH_GT); }
857 YY_BREAK
858case 16:
859YY_RULE_SETUP
860#line 83 "arith_lex.l"
861{ return(ARITH_GE); }
862 YY_BREAK
863case 17:
864YY_RULE_SETUP
865#line 84 "arith_lex.l"
866{ return(ARITH_LT); }
867 YY_BREAK
868case 18:
869YY_RULE_SETUP
870#line 85 "arith_lex.l"
871{ return(ARITH_LE); }
872 YY_BREAK
873case 19:
874YY_RULE_SETUP
875#line 86 "arith_lex.l"
876{ return(ARITH_LSHIFT); }
877 YY_BREAK
878case 20:
879YY_RULE_SETUP
880#line 87 "arith_lex.l"
881{ return(ARITH_RSHIFT); }
882 YY_BREAK
883case 21:
884YY_RULE_SETUP
885#line 88 "arith_lex.l"
886{ return(ARITH_MUL); }
887 YY_BREAK
888case 22:
889YY_RULE_SETUP
890#line 89 "arith_lex.l"
891{ return(ARITH_DIV); }
892 YY_BREAK
893case 23:
894YY_RULE_SETUP
895#line 90 "arith_lex.l"
896{ return(ARITH_REM); }
897 YY_BREAK
898case 24:
899YY_RULE_SETUP
900#line 91 "arith_lex.l"
901{ return(ARITH_ADD); }
902 YY_BREAK
903case 25:
904YY_RULE_SETUP
905#line 92 "arith_lex.l"
906{ return(ARITH_SUB); }
907 YY_BREAK
908case 26:
909YY_RULE_SETUP
910#line 93 "arith_lex.l"
911{ return(ARITH_BNOT); }
912 YY_BREAK
913case 27:
914YY_RULE_SETUP
915#line 94 "arith_lex.l"
916{ return(ARITH_NOT); }
917 YY_BREAK
918case 28:
919YY_RULE_SETUP
920#line 95 "arith_lex.l"
921{ error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf); }
922 YY_BREAK
923case 29:
924YY_RULE_SETUP
925#line 96 "arith_lex.l"
926ECHO;
927 YY_BREAK
928#line 929 "/home/bird/vax/gdrive/coding/kbuild/svn/trunk/out/linux.x86/release/obj/src/kash/arith_lex.c"
929case YY_STATE_EOF(INITIAL):
930 yyterminate();
931
932 case YY_END_OF_BUFFER:
933 {
934 /* Amount of text matched not including the EOB char. */
935 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
936
937 /* Undo the effects of YY_DO_BEFORE_ACTION. */
938 *yy_cp = (yy_hold_char);
939 YY_RESTORE_YY_MORE_OFFSET
940
941 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
942 {
943 /* We're scanning a new file or input source. It's
944 * possible that this happened because the user
945 * just pointed yyin at a new source and called
946 * yylex(). If so, then we have to assure
947 * consistency between YY_CURRENT_BUFFER and our
948 * globals. Here is the right place to do so, because
949 * this is the first action (other than possibly a
950 * back-up) that will match for the new input source.
951 */
952 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
953 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
954 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
955 }
956
957 /* Note that here we test for yy_c_buf_p "<=" to the position
958 * of the first EOB in the buffer, since yy_c_buf_p will
959 * already have been incremented past the NUL character
960 * (since all states make transitions on EOB to the
961 * end-of-buffer state). Contrast this with the test
962 * in input().
963 */
964 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
965 { /* This was really a NUL. */
966 yy_state_type yy_next_state;
967
968 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
969
970 yy_current_state = yy_get_previous_state( );
971
972 /* Okay, we're now positioned to make the NUL
973 * transition. We couldn't have
974 * yy_get_previous_state() go ahead and do it
975 * for us because it doesn't know how to deal
976 * with the possibility of jamming (and we don't
977 * want to build jamming into it because then it
978 * will run more slowly).
979 */
980
981 yy_next_state = yy_try_NUL_trans( yy_current_state );
982
983 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
984
985 if ( yy_next_state )
986 {
987 /* Consume the NUL. */
988 yy_cp = ++(yy_c_buf_p);
989 yy_current_state = yy_next_state;
990 goto yy_match;
991 }
992
993 else
994 {
995 yy_cp = (yy_c_buf_p);
996 goto yy_find_action;
997 }
998 }
999
1000 else switch ( yy_get_next_buffer( ) )
1001 {
1002 case EOB_ACT_END_OF_FILE:
1003 {
1004 (yy_did_buffer_switch_on_eof) = 0;
1005
1006 if ( yywrap( ) )
1007 {
1008 /* Note: because we've taken care in
1009 * yy_get_next_buffer() to have set up
1010 * yytext, we can now set up
1011 * yy_c_buf_p so that if some total
1012 * hoser (like flex itself) wants to
1013 * call the scanner after we return the
1014 * YY_NULL, it'll still work - another
1015 * YY_NULL will get returned.
1016 */
1017 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1018
1019 yy_act = YY_STATE_EOF(YY_START);
1020 goto do_action;
1021 }
1022
1023 else
1024 {
1025 if ( ! (yy_did_buffer_switch_on_eof) )
1026 YY_NEW_FILE;
1027 }
1028 break;
1029 }
1030
1031 case EOB_ACT_CONTINUE_SCAN:
1032 (yy_c_buf_p) =
1033 (yytext_ptr) + yy_amount_of_matched_text;
1034
1035 yy_current_state = yy_get_previous_state( );
1036
1037 yy_cp = (yy_c_buf_p);
1038 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1039 goto yy_match;
1040
1041 case EOB_ACT_LAST_MATCH:
1042 (yy_c_buf_p) =
1043 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1044
1045 yy_current_state = yy_get_previous_state( );
1046
1047 yy_cp = (yy_c_buf_p);
1048 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1049 goto yy_find_action;
1050 }
1051 break;
1052 }
1053
1054 default:
1055 YY_FATAL_ERROR(
1056 "fatal flex scanner internal error--no action found" );
1057 } /* end of action switch */
1058 } /* end of scanning one token */
1059} /* end of yylex */
1060
1061/* yy_get_next_buffer - try to read in a new buffer
1062 *
1063 * Returns a code representing an action:
1064 * EOB_ACT_LAST_MATCH -
1065 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1066 * EOB_ACT_END_OF_FILE - end of file
1067 */
1068static int yy_get_next_buffer (void)
1069{
1070 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1071 register char *source = (yytext_ptr);
1072 register int number_to_move, i;
1073 int ret_val;
1074
1075 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1076 YY_FATAL_ERROR(
1077 "fatal flex scanner internal error--end of buffer missed" );
1078
1079 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1080 { /* Don't try to fill the buffer, so this is an EOF. */
1081 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1082 {
1083 /* We matched a single character, the EOB, so
1084 * treat this as a final EOF.
1085 */
1086 return EOB_ACT_END_OF_FILE;
1087 }
1088
1089 else
1090 {
1091 /* We matched some text prior to the EOB, first
1092 * process it.
1093 */
1094 return EOB_ACT_LAST_MATCH;
1095 }
1096 }
1097
1098 /* Try to read more data. */
1099
1100 /* First move last chars to start of buffer. */
1101 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1102
1103 for ( i = 0; i < number_to_move; ++i )
1104 *(dest++) = *(source++);
1105
1106 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1107 /* don't do the read, it's not guaranteed to return an EOF,
1108 * just force an EOF
1109 */
1110 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1111
1112 else
1113 {
1114 int num_to_read =
1115 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1116
1117 while ( num_to_read <= 0 )
1118 { /* Not enough room in the buffer - grow it. */
1119
1120 /* just a shorter name for the current buffer */
1121 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1122
1123 int yy_c_buf_p_offset =
1124 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1125
1126 if ( b->yy_is_our_buffer )
1127 {
1128 int new_size = b->yy_buf_size * 2;
1129
1130 if ( new_size <= 0 )
1131 b->yy_buf_size += b->yy_buf_size / 8;
1132 else
1133 b->yy_buf_size *= 2;
1134
1135 b->yy_ch_buf = (char *)
1136 /* Include room in for 2 EOB chars. */
1137 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1138 }
1139 else
1140 /* Can't grow it, we don't own it. */
1141 b->yy_ch_buf = 0;
1142
1143 if ( ! b->yy_ch_buf )
1144 YY_FATAL_ERROR(
1145 "fatal error - scanner input buffer overflow" );
1146
1147 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1148
1149 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1150 number_to_move - 1;
1151
1152 }
1153
1154 if ( num_to_read > YY_READ_BUF_SIZE )
1155 num_to_read = YY_READ_BUF_SIZE;
1156
1157 /* Read in more data. */
1158 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1159 (yy_n_chars), num_to_read );
1160
1161 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1162 }
1163
1164 if ( (yy_n_chars) == 0 )
1165 {
1166 if ( number_to_move == YY_MORE_ADJ )
1167 {
1168 ret_val = EOB_ACT_END_OF_FILE;
1169 yyrestart(yyin );
1170 }
1171
1172 else
1173 {
1174 ret_val = EOB_ACT_LAST_MATCH;
1175 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1176 YY_BUFFER_EOF_PENDING;
1177 }
1178 }
1179
1180 else
1181 ret_val = EOB_ACT_CONTINUE_SCAN;
1182
1183 (yy_n_chars) += number_to_move;
1184 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1185 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1186
1187 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1188
1189 return ret_val;
1190}
1191
1192/* yy_get_previous_state - get the state just before the EOB char was reached */
1193
1194 static yy_state_type yy_get_previous_state (void)
1195{
1196 register yy_state_type yy_current_state;
1197 register char *yy_cp;
1198
1199 yy_current_state = (yy_start);
1200
1201 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1202 {
1203 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1204 if ( yy_accept[yy_current_state] )
1205 {
1206 (yy_last_accepting_state) = yy_current_state;
1207 (yy_last_accepting_cpos) = yy_cp;
1208 }
1209 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1210 {
1211 yy_current_state = (int) yy_def[yy_current_state];
1212 if ( yy_current_state >= 39 )
1213 yy_c = yy_meta[(unsigned int) yy_c];
1214 }
1215 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1216 }
1217
1218 return yy_current_state;
1219}
1220
1221/* yy_try_NUL_trans - try to make a transition on the NUL character
1222 *
1223 * synopsis
1224 * next_state = yy_try_NUL_trans( current_state );
1225 */
1226 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1227{
1228 register int yy_is_jam;
1229 register char *yy_cp = (yy_c_buf_p);
1230
1231 register YY_CHAR yy_c = 1;
1232 if ( yy_accept[yy_current_state] )
1233 {
1234 (yy_last_accepting_state) = yy_current_state;
1235 (yy_last_accepting_cpos) = yy_cp;
1236 }
1237 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1238 {
1239 yy_current_state = (int) yy_def[yy_current_state];
1240 if ( yy_current_state >= 39 )
1241 yy_c = yy_meta[(unsigned int) yy_c];
1242 }
1243 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1244 yy_is_jam = (yy_current_state == 38);
1245
1246 return yy_is_jam ? 0 : yy_current_state;
1247}
1248
1249 static void yyunput (int c, register char * yy_bp )
1250{
1251 register char *yy_cp;
1252
1253 yy_cp = (yy_c_buf_p);
1254
1255 /* undo effects of setting up yytext */
1256 *yy_cp = (yy_hold_char);
1257
1258 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1259 { /* need to shift things up to make room */
1260 /* +2 for EOB chars. */
1261 register int number_to_move = (yy_n_chars) + 2;
1262 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1263 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1264 register char *source =
1265 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1266
1267 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1268 *--dest = *--source;
1269
1270 yy_cp += (int) (dest - source);
1271 yy_bp += (int) (dest - source);
1272 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1273 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1274
1275 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1276 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1277 }
1278
1279 *--yy_cp = (char) c;
1280
1281 (yytext_ptr) = yy_bp;
1282 (yy_hold_char) = *yy_cp;
1283 (yy_c_buf_p) = yy_cp;
1284}
1285
1286#ifndef YY_NO_INPUT
1287#ifdef __cplusplus
1288 static int yyinput (void)
1289#else
1290 static int input (void)
1291#endif
1292
1293{
1294 int c;
1295
1296 *(yy_c_buf_p) = (yy_hold_char);
1297
1298 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1299 {
1300 /* yy_c_buf_p now points to the character we want to return.
1301 * If this occurs *before* the EOB characters, then it's a
1302 * valid NUL; if not, then we've hit the end of the buffer.
1303 */
1304 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1305 /* This was really a NUL. */
1306 *(yy_c_buf_p) = '\0';
1307
1308 else
1309 { /* need more input */
1310 int offset = (yy_c_buf_p) - (yytext_ptr);
1311 ++(yy_c_buf_p);
1312
1313 switch ( yy_get_next_buffer( ) )
1314 {
1315 case EOB_ACT_LAST_MATCH:
1316 /* This happens because yy_g_n_b()
1317 * sees that we've accumulated a
1318 * token and flags that we need to
1319 * try matching the token before
1320 * proceeding. But for input(),
1321 * there's no matching to consider.
1322 * So convert the EOB_ACT_LAST_MATCH
1323 * to EOB_ACT_END_OF_FILE.
1324 */
1325
1326 /* Reset buffer status. */
1327 yyrestart(yyin );
1328
1329 /*FALLTHROUGH*/
1330
1331 case EOB_ACT_END_OF_FILE:
1332 {
1333 if ( yywrap( ) )
1334 return EOF;
1335
1336 if ( ! (yy_did_buffer_switch_on_eof) )
1337 YY_NEW_FILE;
1338#ifdef __cplusplus
1339 return yyinput();
1340#else
1341 return input();
1342#endif
1343 }
1344
1345 case EOB_ACT_CONTINUE_SCAN:
1346 (yy_c_buf_p) = (yytext_ptr) + offset;
1347 break;
1348 }
1349 }
1350 }
1351
1352 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1353 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1354 (yy_hold_char) = *++(yy_c_buf_p);
1355
1356 return c;
1357}
1358#endif /* ifndef YY_NO_INPUT */
1359
1360/** Immediately switch to a different input stream.
1361 * @param input_file A readable stream.
1362 *
1363 * @note This function does not reset the start condition to @c INITIAL .
1364 */
1365 void yyrestart (FILE * input_file )
1366{
1367
1368 if ( ! YY_CURRENT_BUFFER ){
1369 yyensure_buffer_stack ();
1370 YY_CURRENT_BUFFER_LVALUE =
1371 yy_create_buffer(yyin,YY_BUF_SIZE );
1372 }
1373
1374 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1375 yy_load_buffer_state( );
1376}
1377
1378/** Switch to a different input buffer.
1379 * @param new_buffer The new input buffer.
1380 *
1381 */
1382 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1383{
1384
1385 /* TODO. We should be able to replace this entire function body
1386 * with
1387 * yypop_buffer_state();
1388 * yypush_buffer_state(new_buffer);
1389 */
1390 yyensure_buffer_stack ();
1391 if ( YY_CURRENT_BUFFER == new_buffer )
1392 return;
1393
1394 if ( YY_CURRENT_BUFFER )
1395 {
1396 /* Flush out information for old buffer. */
1397 *(yy_c_buf_p) = (yy_hold_char);
1398 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1399 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1400 }
1401
1402 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1403 yy_load_buffer_state( );
1404
1405 /* We don't actually know whether we did this switch during
1406 * EOF (yywrap()) processing, but the only time this flag
1407 * is looked at is after yywrap() is called, so it's safe
1408 * to go ahead and always set it.
1409 */
1410 (yy_did_buffer_switch_on_eof) = 1;
1411}
1412
1413static void yy_load_buffer_state (void)
1414{
1415 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1416 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1417 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1418 (yy_hold_char) = *(yy_c_buf_p);
1419}
1420
1421/** Allocate and initialize an input buffer state.
1422 * @param file A readable stream.
1423 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1424 *
1425 * @return the allocated buffer state.
1426 */
1427 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1428{
1429 YY_BUFFER_STATE b;
1430
1431 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1432 if ( ! b )
1433 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1434
1435 b->yy_buf_size = size;
1436
1437 /* yy_ch_buf has to be 2 characters longer than the size given because
1438 * we need to put in 2 end-of-buffer characters.
1439 */
1440 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1441 if ( ! b->yy_ch_buf )
1442 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1443
1444 b->yy_is_our_buffer = 1;
1445
1446 yy_init_buffer(b,file );
1447
1448 return b;
1449}
1450
1451/** Destroy the buffer.
1452 * @param b a buffer created with yy_create_buffer()
1453 *
1454 */
1455 void yy_delete_buffer (YY_BUFFER_STATE b )
1456{
1457
1458 if ( ! b )
1459 return;
1460
1461 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1462 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1463
1464 if ( b->yy_is_our_buffer )
1465 yyfree((void *) b->yy_ch_buf );
1466
1467 yyfree((void *) b );
1468}
1469
1470#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
1471#ifdef __cplusplus
1472extern "C" {
1473#endif
1474#ifdef __THROW /* this is a gnuism */
1475extern int isatty (int ) __THROW;
1476#else
1477extern int isatty (int );
1478#endif
1479#ifdef __cplusplus
1480}
1481#endif
1482#endif
1483
1484/* Initializes or reinitializes a buffer.
1485 * This function is sometimes called more than once on the same buffer,
1486 * such as during a yyrestart() or at EOF.
1487 */
1488 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1489
1490{
1491 int oerrno = errno;
1492
1493 yy_flush_buffer(b );
1494
1495 b->yy_input_file = file;
1496 b->yy_fill_buffer = 1;
1497
1498 /* If b is the current buffer, then yy_init_buffer was _probably_
1499 * called from yyrestart() or through yy_get_next_buffer.
1500 * In that case, we don't want to reset the lineno or column.
1501 */
1502 if (b != YY_CURRENT_BUFFER){
1503 b->yy_bs_lineno = 1;
1504 b->yy_bs_column = 0;
1505 }
1506
1507 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1508
1509 errno = oerrno;
1510}
1511
1512/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1513 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1514 *
1515 */
1516 void yy_flush_buffer (YY_BUFFER_STATE b )
1517{
1518 if ( ! b )
1519 return;
1520
1521 b->yy_n_chars = 0;
1522
1523 /* We always need two end-of-buffer characters. The first causes
1524 * a transition to the end-of-buffer state. The second causes
1525 * a jam in that state.
1526 */
1527 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1528 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1529
1530 b->yy_buf_pos = &b->yy_ch_buf[0];
1531
1532 b->yy_at_bol = 1;
1533 b->yy_buffer_status = YY_BUFFER_NEW;
1534
1535 if ( b == YY_CURRENT_BUFFER )
1536 yy_load_buffer_state( );
1537}
1538
1539/** Pushes the new state onto the stack. The new state becomes
1540 * the current state. This function will allocate the stack
1541 * if necessary.
1542 * @param new_buffer The new state.
1543 *
1544 */
1545void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1546{
1547 if (new_buffer == NULL)
1548 return;
1549
1550 yyensure_buffer_stack();
1551
1552 /* This block is copied from yy_switch_to_buffer. */
1553 if ( YY_CURRENT_BUFFER )
1554 {
1555 /* Flush out information for old buffer. */
1556 *(yy_c_buf_p) = (yy_hold_char);
1557 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1558 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1559 }
1560
1561 /* Only push if top exists. Otherwise, replace top. */
1562 if (YY_CURRENT_BUFFER)
1563 (yy_buffer_stack_top)++;
1564 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1565
1566 /* copied from yy_switch_to_buffer. */
1567 yy_load_buffer_state( );
1568 (yy_did_buffer_switch_on_eof) = 1;
1569}
1570
1571/** Removes and deletes the top of the stack, if present.
1572 * The next element becomes the new top.
1573 *
1574 */
1575void yypop_buffer_state (void)
1576{
1577 if (!YY_CURRENT_BUFFER)
1578 return;
1579
1580 yy_delete_buffer(YY_CURRENT_BUFFER );
1581 YY_CURRENT_BUFFER_LVALUE = NULL;
1582 if ((yy_buffer_stack_top) > 0)
1583 --(yy_buffer_stack_top);
1584
1585 if (YY_CURRENT_BUFFER) {
1586 yy_load_buffer_state( );
1587 (yy_did_buffer_switch_on_eof) = 1;
1588 }
1589}
1590
1591/* Allocates the stack if it does not exist.
1592 * Guarantees space for at least one push.
1593 */
1594static void yyensure_buffer_stack (void)
1595{
1596 int num_to_alloc;
1597
1598 if (!(yy_buffer_stack)) {
1599
1600 /* First allocation is just for 2 elements, since we don't know if this
1601 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1602 * immediate realloc on the next call.
1603 */
1604 num_to_alloc = 1;
1605 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1606 (num_to_alloc * sizeof(struct yy_buffer_state*)
1607 );
1608
1609 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1610
1611 (yy_buffer_stack_max) = num_to_alloc;
1612 (yy_buffer_stack_top) = 0;
1613 return;
1614 }
1615
1616 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1617
1618 /* Increase the buffer to prepare for a possible push. */
1619 int grow_size = 8 /* arbitrary grow size */;
1620
1621 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1622 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1623 ((yy_buffer_stack),
1624 num_to_alloc * sizeof(struct yy_buffer_state*)
1625 );
1626
1627 /* zero only the new slots.*/
1628 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1629 (yy_buffer_stack_max) = num_to_alloc;
1630 }
1631}
1632
1633/** Setup the input buffer state to scan directly from a user-specified character buffer.
1634 * @param base the character buffer
1635 * @param size the size in bytes of the character buffer
1636 *
1637 * @return the newly allocated buffer state object.
1638 */
1639YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1640{
1641 YY_BUFFER_STATE b;
1642
1643 if ( size < 2 ||
1644 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1645 base[size-1] != YY_END_OF_BUFFER_CHAR )
1646 /* They forgot to leave room for the EOB's. */
1647 return 0;
1648
1649 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1650 if ( ! b )
1651 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1652
1653 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1654 b->yy_buf_pos = b->yy_ch_buf = base;
1655 b->yy_is_our_buffer = 0;
1656 b->yy_input_file = 0;
1657 b->yy_n_chars = b->yy_buf_size;
1658 b->yy_is_interactive = 0;
1659 b->yy_at_bol = 1;
1660 b->yy_fill_buffer = 0;
1661 b->yy_buffer_status = YY_BUFFER_NEW;
1662
1663 yy_switch_to_buffer(b );
1664
1665 return b;
1666}
1667
1668/** Setup the input buffer state to scan a string. The next call to yylex() will
1669 * scan from a @e copy of @a str.
1670 * @param str a NUL-terminated string to scan
1671 *
1672 * @return the newly allocated buffer state object.
1673 * @note If you want to scan bytes that may contain NUL values, then use
1674 * yy_scan_bytes() instead.
1675 */
1676YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1677{
1678
1679 return yy_scan_bytes(yystr,strlen(yystr) );
1680}
1681
1682/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1683 * scan from a @e copy of @a bytes.
1684 * @param bytes the byte buffer to scan
1685 * @param len the number of bytes in the buffer pointed to by @a bytes.
1686 *
1687 * @return the newly allocated buffer state object.
1688 */
1689YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1690{
1691 YY_BUFFER_STATE b;
1692 char *buf;
1693 yy_size_t n;
1694 int i;
1695
1696 /* Get memory for full buffer, including space for trailing EOB's. */
1697 n = _yybytes_len + 2;
1698 buf = (char *) yyalloc(n );
1699 if ( ! buf )
1700 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1701
1702 for ( i = 0; i < _yybytes_len; ++i )
1703 buf[i] = yybytes[i];
1704
1705 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1706
1707 b = yy_scan_buffer(buf,n );
1708 if ( ! b )
1709 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1710
1711 /* It's okay to grow etc. this buffer, and we should throw it
1712 * away when we're done.
1713 */
1714 b->yy_is_our_buffer = 1;
1715
1716 return b;
1717}
1718
1719#ifndef YY_EXIT_FAILURE
1720#define YY_EXIT_FAILURE 2
1721#endif
1722
1723static void yy_fatal_error (yyconst char* msg )
1724{
1725 (void) fprintf( stderr, "%s\n", msg );
1726 exit( YY_EXIT_FAILURE );
1727}
1728
1729/* Redefine yyless() so it works in section 3 code. */
1730
1731#undef yyless
1732#define yyless(n) \
1733 do \
1734 { \
1735 /* Undo effects of setting up yytext. */ \
1736 int yyless_macro_arg = (n); \
1737 YY_LESS_LINENO(yyless_macro_arg);\
1738 yytext[yyleng] = (yy_hold_char); \
1739 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1740 (yy_hold_char) = *(yy_c_buf_p); \
1741 *(yy_c_buf_p) = '\0'; \
1742 yyleng = yyless_macro_arg; \
1743 } \
1744 while ( 0 )
1745
1746/* Accessor methods (get/set functions) to struct members. */
1747
1748/** Get the current line number.
1749 *
1750 */
1751int yyget_lineno (void)
1752{
1753
1754 return yylineno;
1755}
1756
1757/** Get the input stream.
1758 *
1759 */
1760FILE *yyget_in (void)
1761{
1762 return yyin;
1763}
1764
1765/** Get the output stream.
1766 *
1767 */
1768FILE *yyget_out (void)
1769{
1770 return yyout;
1771}
1772
1773/** Get the length of the current token.
1774 *
1775 */
1776int yyget_leng (void)
1777{
1778 return yyleng;
1779}
1780
1781/** Get the current token.
1782 *
1783 */
1784
1785char *yyget_text (void)
1786{
1787 return yytext;
1788}
1789
1790/** Set the current line number.
1791 * @param line_number
1792 *
1793 */
1794void yyset_lineno (int line_number )
1795{
1796
1797 yylineno = line_number;
1798}
1799
1800/** Set the input stream. This does not discard the current
1801 * input buffer.
1802 * @param in_str A readable stream.
1803 *
1804 * @see yy_switch_to_buffer
1805 */
1806void yyset_in (FILE * in_str )
1807{
1808 yyin = in_str ;
1809}
1810
1811void yyset_out (FILE * out_str )
1812{
1813 yyout = out_str ;
1814}
1815
1816int yyget_debug (void)
1817{
1818 return yy_flex_debug;
1819}
1820
1821void yyset_debug (int bdebug )
1822{
1823 yy_flex_debug = bdebug ;
1824}
1825
1826static int yy_init_globals (void)
1827{
1828 /* Initialization is the same as for the non-reentrant scanner.
1829 * This function is called from yylex_destroy(), so don't allocate here.
1830 */
1831
1832 (yy_buffer_stack) = 0;
1833 (yy_buffer_stack_top) = 0;
1834 (yy_buffer_stack_max) = 0;
1835 (yy_c_buf_p) = (char *) 0;
1836 (yy_init) = 0;
1837 (yy_start) = 0;
1838
1839/* Defined in main.c */
1840#ifdef YY_STDINIT
1841 yyin = stdin;
1842 yyout = stdout;
1843#else
1844 yyin = (FILE *) 0;
1845 yyout = (FILE *) 0;
1846#endif
1847
1848 /* For future reference: Set errno on error, since we are called by
1849 * yylex_init()
1850 */
1851 return 0;
1852}
1853
1854/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1855int yylex_destroy (void)
1856{
1857
1858 /* Pop the buffer stack, destroying each element. */
1859 while(YY_CURRENT_BUFFER){
1860 yy_delete_buffer(YY_CURRENT_BUFFER );
1861 YY_CURRENT_BUFFER_LVALUE = NULL;
1862 yypop_buffer_state();
1863 }
1864
1865 /* Destroy the stack itself. */
1866 yyfree((yy_buffer_stack) );
1867 (yy_buffer_stack) = NULL;
1868
1869 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1870 * yylex() is called, initialization will occur. */
1871 yy_init_globals( );
1872
1873 return 0;
1874}
1875
1876/*
1877 * Internal utility routines.
1878 */
1879
1880#ifndef yytext_ptr
1881static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1882{
1883 register int i;
1884 for ( i = 0; i < n; ++i )
1885 s1[i] = s2[i];
1886}
1887#endif
1888
1889#ifdef YY_NEED_STRLEN
1890static int yy_flex_strlen (yyconst char * s )
1891{
1892 register int n;
1893 for ( n = 0; s[n]; ++n )
1894 ;
1895
1896 return n;
1897}
1898#endif
1899
1900void *yyalloc (yy_size_t size )
1901{
1902 return (void *) malloc( size );
1903}
1904
1905void *yyrealloc (void * ptr, yy_size_t size )
1906{
1907 /* The cast to (char *) in the following accommodates both
1908 * implementations that use char* generic pointers, and those
1909 * that use void* generic pointers. It works with the latter
1910 * because both ANSI C and C++ allow castless assignment from
1911 * any pointer type to void*, and deal with argument conversions
1912 * as though doing an assignment.
1913 */
1914 return (void *) realloc( (char *) ptr, size );
1915}
1916
1917void yyfree (void * ptr )
1918{
1919 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1920}
1921
1922#define YYTABLES_NAME "yytables"
1923
1924#line 96 "arith_lex.l"
1925
1926
1927
1928void
1929arith_lex_reset() {
1930#ifdef YY_NEW_FILE
1931 YY_NEW_FILE;
1932#endif
1933}
1934
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette