1 | #line 2 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c"
|
---|
2 |
|
---|
3 | #line 4 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/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>
|
---|
44 | typedef int8_t flex_int8_t;
|
---|
45 | typedef uint8_t flex_uint8_t;
|
---|
46 | typedef int16_t flex_int16_t;
|
---|
47 | typedef uint16_t flex_uint16_t;
|
---|
48 | typedef int32_t flex_int32_t;
|
---|
49 | typedef uint32_t flex_uint32_t;
|
---|
50 | #else
|
---|
51 | typedef signed char flex_int8_t;
|
---|
52 | typedef short int flex_int16_t;
|
---|
53 | typedef int flex_int32_t;
|
---|
54 | typedef unsigned char flex_uint8_t;
|
---|
55 | typedef unsigned short int flex_uint16_t;
|
---|
56 | typedef 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
|
---|
152 | typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
---|
153 | #endif
|
---|
154 |
|
---|
155 | extern int yyleng;
|
---|
156 |
|
---|
157 | extern 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
|
---|
188 | typedef unsigned int yy_size_t;
|
---|
189 | #endif
|
---|
190 |
|
---|
191 | #ifndef YY_STRUCT_YY_BUFFER_STATE
|
---|
192 | #define YY_STRUCT_YY_BUFFER_STATE
|
---|
193 | struct 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. */
|
---|
257 | static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
|
---|
258 | static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
|
---|
259 | static 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. */
|
---|
277 | static char yy_hold_char;
|
---|
278 | static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
---|
279 | int yyleng;
|
---|
280 |
|
---|
281 | /* Points to current character in buffer. */
|
---|
282 | static char *yy_c_buf_p = (char *) 0;
|
---|
283 | static int yy_init = 0; /* whether we need to initialize */
|
---|
284 | static 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 | */
|
---|
289 | static int yy_did_buffer_switch_on_eof;
|
---|
290 |
|
---|
291 | void yyrestart (FILE *input_file );
|
---|
292 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
|
---|
293 | YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
|
---|
294 | void yy_delete_buffer (YY_BUFFER_STATE b );
|
---|
295 | void yy_flush_buffer (YY_BUFFER_STATE b );
|
---|
296 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
|
---|
297 | void yypop_buffer_state (void );
|
---|
298 |
|
---|
299 | static void yyensure_buffer_stack (void );
|
---|
300 | static void yy_load_buffer_state (void );
|
---|
301 | static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
|
---|
302 |
|
---|
303 | #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
|
---|
304 |
|
---|
305 | YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
|
---|
306 | YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
|
---|
307 | YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
|
---|
308 |
|
---|
309 | void *yyalloc (yy_size_t );
|
---|
310 | void *yyrealloc (void *,yy_size_t );
|
---|
311 | void 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 |
|
---|
342 | typedef unsigned char YY_CHAR;
|
---|
343 |
|
---|
344 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
|
---|
345 |
|
---|
346 | typedef int yy_state_type;
|
---|
347 |
|
---|
348 | extern int yylineno;
|
---|
349 |
|
---|
350 | int yylineno = 1;
|
---|
351 |
|
---|
352 | extern char *yytext;
|
---|
353 | #define yytext_ptr yytext
|
---|
354 |
|
---|
355 | static yy_state_type yy_get_previous_state (void );
|
---|
356 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
|
---|
357 | static int yy_get_next_buffer (void );
|
---|
358 | static 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. */
|
---|
374 | struct yy_trans_info
|
---|
375 | {
|
---|
376 | flex_int32_t yy_verify;
|
---|
377 | flex_int32_t yy_nxt;
|
---|
378 | };
|
---|
379 | static 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 |
|
---|
387 | static 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 |
|
---|
419 | static 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 |
|
---|
426 | static 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 |
|
---|
434 | static 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 |
|
---|
442 | static 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 |
|
---|
454 | static 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 |
|
---|
466 | static yy_state_type yy_last_accepting_state;
|
---|
467 | static char *yy_last_accepting_cpos;
|
---|
468 |
|
---|
469 | extern int yy_flex_debug;
|
---|
470 | int 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
|
---|
479 | char *yytext;
|
---|
480 | #line 1 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
481 | #define YY_NO_INPUT 1
|
---|
482 | /** @todo %option reentrant */
|
---|
483 | #line 33 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
484 | /* $NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $ */
|
---|
485 |
|
---|
486 | /*-
|
---|
487 | * Copyright (c) 1993
|
---|
488 | * The Regents of the University of California. All rights reserved.
|
---|
489 | *
|
---|
490 | * This code is derived from software contributed to Berkeley by
|
---|
491 | * Kenneth Almquist.
|
---|
492 | *
|
---|
493 | * Redistribution and use in source and binary forms, with or without
|
---|
494 | * modification, are permitted provided that the following conditions
|
---|
495 | * are met:
|
---|
496 | * 1. Redistributions of source code must retain the above copyright
|
---|
497 | * notice, this list of conditions and the following disclaimer.
|
---|
498 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
499 | * notice, this list of conditions and the following disclaimer in the
|
---|
500 | * documentation and/or other materials provided with the distribution.
|
---|
501 | * 3. Neither the name of the University nor the names of its contributors
|
---|
502 | * may be used to endorse or promote products derived from this software
|
---|
503 | * without specific prior written permission.
|
---|
504 | *
|
---|
505 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
506 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
507 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
508 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
509 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
510 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
511 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
512 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
513 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
514 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
515 | * SUCH DAMAGE.
|
---|
516 | */
|
---|
517 |
|
---|
518 | #if 0
|
---|
519 | #ifndef lint
|
---|
520 | static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
|
---|
521 | #else
|
---|
522 | __RCSID("$NetBSD: arith_lex.l,v 1.13 2005/03/21 22:37:09 dsl Exp $");
|
---|
523 | #endif /* not lint */
|
---|
524 | #endif
|
---|
525 |
|
---|
526 | #include <stdio.h>
|
---|
527 | #include "arith.h"
|
---|
528 | #include "error.h"
|
---|
529 | #include "expand.h"
|
---|
530 | #include "var.h"
|
---|
531 | #include "shinstance.h"
|
---|
532 |
|
---|
533 | extern int yylval;
|
---|
534 | extern shinstance *arith_psh;
|
---|
535 | extern char *arith_buf, *arith_startbuf;
|
---|
536 | #undef YY_INPUT
|
---|
537 | #define YY_INPUT(buf,result,max) \
|
---|
538 | result = (*buf = *arith_buf++) ? 1 : YY_NULL;
|
---|
539 | #define YY_NO_UNPUT
|
---|
540 |
|
---|
541 | /* Avoid unnecessary libc bits. */
|
---|
542 | #undef ECHO
|
---|
543 | #define ECHO \
|
---|
544 | do {} while (0)
|
---|
545 | #undef stdin
|
---|
546 | #define stdin \
|
---|
547 | NULL
|
---|
548 | #undef stdout
|
---|
549 | #define stdout \
|
---|
550 | NULL
|
---|
551 | #define YY_FATAL_ERROR(msg) \
|
---|
552 | error(arith_psh, "arith: fatal error: %s", msg)
|
---|
553 | #line 554 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c"
|
---|
554 |
|
---|
555 | #define INITIAL 0
|
---|
556 |
|
---|
557 | #ifndef YY_NO_UNISTD_H
|
---|
558 | /* Special case for "unistd.h", since it is non-ANSI. We include it way
|
---|
559 | * down here because we want the user's section 1 to have been scanned first.
|
---|
560 | * The user has a chance to override it with an option.
|
---|
561 | */
|
---|
562 | #include <unistd.h>
|
---|
563 | #endif
|
---|
564 |
|
---|
565 | #ifndef YY_EXTRA_TYPE
|
---|
566 | #define YY_EXTRA_TYPE void *
|
---|
567 | #endif
|
---|
568 |
|
---|
569 | static int yy_init_globals (void );
|
---|
570 |
|
---|
571 | /* Macros after this point can all be overridden by user definitions in
|
---|
572 | * section 1.
|
---|
573 | */
|
---|
574 |
|
---|
575 | #ifndef YY_SKIP_YYWRAP
|
---|
576 | #ifdef __cplusplus
|
---|
577 | extern "C" int yywrap (void );
|
---|
578 | #else
|
---|
579 | extern int yywrap (void );
|
---|
580 | #endif
|
---|
581 | #endif
|
---|
582 |
|
---|
583 | #ifndef yytext_ptr
|
---|
584 | static void yy_flex_strncpy (char *,yyconst char *,int );
|
---|
585 | #endif
|
---|
586 |
|
---|
587 | #ifdef YY_NEED_STRLEN
|
---|
588 | static int yy_flex_strlen (yyconst char * );
|
---|
589 | #endif
|
---|
590 |
|
---|
591 | #ifndef YY_NO_INPUT
|
---|
592 |
|
---|
593 | #ifdef __cplusplus
|
---|
594 | static int yyinput (void );
|
---|
595 | #else
|
---|
596 | static int input (void );
|
---|
597 | #endif
|
---|
598 |
|
---|
599 | #endif
|
---|
600 |
|
---|
601 | /* Amount of stuff to slurp up with each read. */
|
---|
602 | #ifndef YY_READ_BUF_SIZE
|
---|
603 | #define YY_READ_BUF_SIZE 8192
|
---|
604 | #endif
|
---|
605 |
|
---|
606 | /* Copy whatever the last rule matched to the standard output. */
|
---|
607 | #ifndef ECHO
|
---|
608 | /* This used to be an fputs(), but since the string might contain NUL's,
|
---|
609 | * we now use fwrite().
|
---|
610 | */
|
---|
611 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
|
---|
612 | #endif
|
---|
613 |
|
---|
614 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
---|
615 | * is returned in "result".
|
---|
616 | */
|
---|
617 | #ifndef YY_INPUT
|
---|
618 | #define YY_INPUT(buf,result,max_size) \
|
---|
619 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
---|
620 | { \
|
---|
621 | int c = '*'; \
|
---|
622 | size_t n; \
|
---|
623 | for ( n = 0; n < max_size && \
|
---|
624 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
---|
625 | buf[n] = (char) c; \
|
---|
626 | if ( c == '\n' ) \
|
---|
627 | buf[n++] = (char) c; \
|
---|
628 | if ( c == EOF && ferror( yyin ) ) \
|
---|
629 | YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
---|
630 | result = n; \
|
---|
631 | } \
|
---|
632 | else \
|
---|
633 | { \
|
---|
634 | errno=0; \
|
---|
635 | while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
|
---|
636 | { \
|
---|
637 | if( errno != EINTR) \
|
---|
638 | { \
|
---|
639 | YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
---|
640 | break; \
|
---|
641 | } \
|
---|
642 | errno=0; \
|
---|
643 | clearerr(yyin); \
|
---|
644 | } \
|
---|
645 | }\
|
---|
646 | \
|
---|
647 |
|
---|
648 | #endif
|
---|
649 |
|
---|
650 | /* No semi-colon after return; correct usage is to write "yyterminate();" -
|
---|
651 | * we don't want an extra ';' after the "return" because that will cause
|
---|
652 | * some compilers to complain about unreachable statements.
|
---|
653 | */
|
---|
654 | #ifndef yyterminate
|
---|
655 | #define yyterminate() return YY_NULL
|
---|
656 | #endif
|
---|
657 |
|
---|
658 | /* Number of entries by which start-condition stack grows. */
|
---|
659 | #ifndef YY_START_STACK_INCR
|
---|
660 | #define YY_START_STACK_INCR 25
|
---|
661 | #endif
|
---|
662 |
|
---|
663 | /* Report a fatal error. */
|
---|
664 | #ifndef YY_FATAL_ERROR
|
---|
665 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
|
---|
666 | #endif
|
---|
667 |
|
---|
668 | /* end tables serialization structures and prototypes */
|
---|
669 |
|
---|
670 | /* Default declaration of generated scanner - a define so the user can
|
---|
671 | * easily add parameters.
|
---|
672 | */
|
---|
673 | #ifndef YY_DECL
|
---|
674 | #define YY_DECL_IS_OURS 1
|
---|
675 |
|
---|
676 | extern int yylex (void);
|
---|
677 |
|
---|
678 | #define YY_DECL int yylex (void)
|
---|
679 | #endif /* !YY_DECL */
|
---|
680 |
|
---|
681 | /* Code executed at the beginning of each rule, after yytext and yyleng
|
---|
682 | * have been set up.
|
---|
683 | */
|
---|
684 | #ifndef YY_USER_ACTION
|
---|
685 | #define YY_USER_ACTION
|
---|
686 | #endif
|
---|
687 |
|
---|
688 | /* Code executed at the end of each rule. */
|
---|
689 | #ifndef YY_BREAK
|
---|
690 | #define YY_BREAK break;
|
---|
691 | #endif
|
---|
692 |
|
---|
693 | #define YY_RULE_SETUP \
|
---|
694 | YY_USER_ACTION
|
---|
695 |
|
---|
696 | /** The main scanner function which does all the work.
|
---|
697 | */
|
---|
698 | YY_DECL
|
---|
699 | {
|
---|
700 | register yy_state_type yy_current_state;
|
---|
701 | register char *yy_cp, *yy_bp;
|
---|
702 | register int yy_act;
|
---|
703 |
|
---|
704 | #line 104 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
705 |
|
---|
706 | #line 707 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c"
|
---|
707 |
|
---|
708 | if ( !(yy_init) )
|
---|
709 | {
|
---|
710 | (yy_init) = 1;
|
---|
711 |
|
---|
712 | #ifdef YY_USER_INIT
|
---|
713 | YY_USER_INIT;
|
---|
714 | #endif
|
---|
715 |
|
---|
716 | if ( ! (yy_start) )
|
---|
717 | (yy_start) = 1; /* first start state */
|
---|
718 |
|
---|
719 | if ( ! yyin )
|
---|
720 | yyin = stdin;
|
---|
721 |
|
---|
722 | if ( ! yyout )
|
---|
723 | yyout = stdout;
|
---|
724 |
|
---|
725 | if ( ! YY_CURRENT_BUFFER ) {
|
---|
726 | yyensure_buffer_stack ();
|
---|
727 | YY_CURRENT_BUFFER_LVALUE =
|
---|
728 | yy_create_buffer(yyin,YY_BUF_SIZE );
|
---|
729 | }
|
---|
730 |
|
---|
731 | yy_load_buffer_state( );
|
---|
732 | }
|
---|
733 |
|
---|
734 | while ( 1 ) /* loops until end-of-file is reached */
|
---|
735 | {
|
---|
736 | yy_cp = (yy_c_buf_p);
|
---|
737 |
|
---|
738 | /* Support of yytext. */
|
---|
739 | *yy_cp = (yy_hold_char);
|
---|
740 |
|
---|
741 | /* yy_bp points to the position in yy_ch_buf of the start of
|
---|
742 | * the current run.
|
---|
743 | */
|
---|
744 | yy_bp = yy_cp;
|
---|
745 |
|
---|
746 | yy_current_state = (yy_start);
|
---|
747 | yy_match:
|
---|
748 | do
|
---|
749 | {
|
---|
750 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
|
---|
751 | if ( yy_accept[yy_current_state] )
|
---|
752 | {
|
---|
753 | (yy_last_accepting_state) = yy_current_state;
|
---|
754 | (yy_last_accepting_cpos) = yy_cp;
|
---|
755 | }
|
---|
756 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
---|
757 | {
|
---|
758 | yy_current_state = (int) yy_def[yy_current_state];
|
---|
759 | if ( yy_current_state >= 39 )
|
---|
760 | yy_c = yy_meta[(unsigned int) yy_c];
|
---|
761 | }
|
---|
762 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
---|
763 | ++yy_cp;
|
---|
764 | }
|
---|
765 | while ( yy_current_state != 38 );
|
---|
766 | yy_cp = (yy_last_accepting_cpos);
|
---|
767 | yy_current_state = (yy_last_accepting_state);
|
---|
768 |
|
---|
769 | yy_find_action:
|
---|
770 | yy_act = yy_accept[yy_current_state];
|
---|
771 |
|
---|
772 | YY_DO_BEFORE_ACTION;
|
---|
773 |
|
---|
774 | do_action: /* This label is used only to access EOF actions. */
|
---|
775 |
|
---|
776 | switch ( yy_act )
|
---|
777 | { /* beginning of action switch */
|
---|
778 | case 0: /* must back up */
|
---|
779 | /* undo the effects of YY_DO_BEFORE_ACTION */
|
---|
780 | *yy_cp = (yy_hold_char);
|
---|
781 | yy_cp = (yy_last_accepting_cpos);
|
---|
782 | yy_current_state = (yy_last_accepting_state);
|
---|
783 | goto yy_find_action;
|
---|
784 |
|
---|
785 | case 1:
|
---|
786 | /* rule 1 can match eol */
|
---|
787 | YY_RULE_SETUP
|
---|
788 | #line 105 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
789 | { ; }
|
---|
790 | YY_BREAK
|
---|
791 | case 2:
|
---|
792 | YY_RULE_SETUP
|
---|
793 | #line 106 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
794 | { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); }
|
---|
795 | YY_BREAK
|
---|
796 | case 3:
|
---|
797 | YY_RULE_SETUP
|
---|
798 | #line 107 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
799 | { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); }
|
---|
800 | YY_BREAK
|
---|
801 | case 4:
|
---|
802 | YY_RULE_SETUP
|
---|
803 | #line 108 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
804 | { yylval = strtol(yytext, 0, 0); return(ARITH_NUM); }
|
---|
805 | YY_BREAK
|
---|
806 | case 5:
|
---|
807 | YY_RULE_SETUP
|
---|
808 | #line 109 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
809 | { char *v = lookupvar(arith_psh, yytext);
|
---|
810 | if (v) {
|
---|
811 | yylval = strtol(v, &v, 0);
|
---|
812 | if (*v == 0)
|
---|
813 | return ARITH_NUM;
|
---|
814 | }
|
---|
815 | error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf);
|
---|
816 | }
|
---|
817 | YY_BREAK
|
---|
818 | case 6:
|
---|
819 | YY_RULE_SETUP
|
---|
820 | #line 117 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
821 | { return(ARITH_LPAREN); }
|
---|
822 | YY_BREAK
|
---|
823 | case 7:
|
---|
824 | YY_RULE_SETUP
|
---|
825 | #line 118 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
826 | { return(ARITH_RPAREN); }
|
---|
827 | YY_BREAK
|
---|
828 | case 8:
|
---|
829 | YY_RULE_SETUP
|
---|
830 | #line 119 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
831 | { return(ARITH_OR); }
|
---|
832 | YY_BREAK
|
---|
833 | case 9:
|
---|
834 | YY_RULE_SETUP
|
---|
835 | #line 120 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
836 | { return(ARITH_AND); }
|
---|
837 | YY_BREAK
|
---|
838 | case 10:
|
---|
839 | YY_RULE_SETUP
|
---|
840 | #line 121 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
841 | { return(ARITH_BOR); }
|
---|
842 | YY_BREAK
|
---|
843 | case 11:
|
---|
844 | YY_RULE_SETUP
|
---|
845 | #line 122 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
846 | { return(ARITH_BXOR); }
|
---|
847 | YY_BREAK
|
---|
848 | case 12:
|
---|
849 | YY_RULE_SETUP
|
---|
850 | #line 123 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
851 | { return(ARITH_BAND); }
|
---|
852 | YY_BREAK
|
---|
853 | case 13:
|
---|
854 | YY_RULE_SETUP
|
---|
855 | #line 124 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
856 | { return(ARITH_EQ); }
|
---|
857 | YY_BREAK
|
---|
858 | case 14:
|
---|
859 | YY_RULE_SETUP
|
---|
860 | #line 125 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
861 | { return(ARITH_NE); }
|
---|
862 | YY_BREAK
|
---|
863 | case 15:
|
---|
864 | YY_RULE_SETUP
|
---|
865 | #line 126 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
866 | { return(ARITH_GT); }
|
---|
867 | YY_BREAK
|
---|
868 | case 16:
|
---|
869 | YY_RULE_SETUP
|
---|
870 | #line 127 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
871 | { return(ARITH_GE); }
|
---|
872 | YY_BREAK
|
---|
873 | case 17:
|
---|
874 | YY_RULE_SETUP
|
---|
875 | #line 128 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
876 | { return(ARITH_LT); }
|
---|
877 | YY_BREAK
|
---|
878 | case 18:
|
---|
879 | YY_RULE_SETUP
|
---|
880 | #line 129 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
881 | { return(ARITH_LE); }
|
---|
882 | YY_BREAK
|
---|
883 | case 19:
|
---|
884 | YY_RULE_SETUP
|
---|
885 | #line 130 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
886 | { return(ARITH_LSHIFT); }
|
---|
887 | YY_BREAK
|
---|
888 | case 20:
|
---|
889 | YY_RULE_SETUP
|
---|
890 | #line 131 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
891 | { return(ARITH_RSHIFT); }
|
---|
892 | YY_BREAK
|
---|
893 | case 21:
|
---|
894 | YY_RULE_SETUP
|
---|
895 | #line 132 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
896 | { return(ARITH_MUL); }
|
---|
897 | YY_BREAK
|
---|
898 | case 22:
|
---|
899 | YY_RULE_SETUP
|
---|
900 | #line 133 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
901 | { return(ARITH_DIV); }
|
---|
902 | YY_BREAK
|
---|
903 | case 23:
|
---|
904 | YY_RULE_SETUP
|
---|
905 | #line 134 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
906 | { return(ARITH_REM); }
|
---|
907 | YY_BREAK
|
---|
908 | case 24:
|
---|
909 | YY_RULE_SETUP
|
---|
910 | #line 135 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
911 | { return(ARITH_ADD); }
|
---|
912 | YY_BREAK
|
---|
913 | case 25:
|
---|
914 | YY_RULE_SETUP
|
---|
915 | #line 136 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
916 | { return(ARITH_SUB); }
|
---|
917 | YY_BREAK
|
---|
918 | case 26:
|
---|
919 | YY_RULE_SETUP
|
---|
920 | #line 137 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
921 | { return(ARITH_BNOT); }
|
---|
922 | YY_BREAK
|
---|
923 | case 27:
|
---|
924 | YY_RULE_SETUP
|
---|
925 | #line 138 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
926 | { return(ARITH_NOT); }
|
---|
927 | YY_BREAK
|
---|
928 | case 28:
|
---|
929 | YY_RULE_SETUP
|
---|
930 | #line 139 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
931 | { error(arith_psh, "arith: syntax error: \"%s\"", arith_startbuf); }
|
---|
932 | YY_BREAK
|
---|
933 | case 29:
|
---|
934 | YY_RULE_SETUP
|
---|
935 | #line 140 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
936 | ECHO;
|
---|
937 | YY_BREAK
|
---|
938 | #line 939 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/out/darwin.x86/release/obj/kash/arith_lex.c"
|
---|
939 | case YY_STATE_EOF(INITIAL):
|
---|
940 | yyterminate();
|
---|
941 |
|
---|
942 | case YY_END_OF_BUFFER:
|
---|
943 | {
|
---|
944 | /* Amount of text matched not including the EOB char. */
|
---|
945 | int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
|
---|
946 |
|
---|
947 | /* Undo the effects of YY_DO_BEFORE_ACTION. */
|
---|
948 | *yy_cp = (yy_hold_char);
|
---|
949 | YY_RESTORE_YY_MORE_OFFSET
|
---|
950 |
|
---|
951 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
|
---|
952 | {
|
---|
953 | /* We're scanning a new file or input source. It's
|
---|
954 | * possible that this happened because the user
|
---|
955 | * just pointed yyin at a new source and called
|
---|
956 | * yylex(). If so, then we have to assure
|
---|
957 | * consistency between YY_CURRENT_BUFFER and our
|
---|
958 | * globals. Here is the right place to do so, because
|
---|
959 | * this is the first action (other than possibly a
|
---|
960 | * back-up) that will match for the new input source.
|
---|
961 | */
|
---|
962 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
---|
963 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
|
---|
964 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
|
---|
965 | }
|
---|
966 |
|
---|
967 | /* Note that here we test for yy_c_buf_p "<=" to the position
|
---|
968 | * of the first EOB in the buffer, since yy_c_buf_p will
|
---|
969 | * already have been incremented past the NUL character
|
---|
970 | * (since all states make transitions on EOB to the
|
---|
971 | * end-of-buffer state). Contrast this with the test
|
---|
972 | * in input().
|
---|
973 | */
|
---|
974 | if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
|
---|
975 | { /* This was really a NUL. */
|
---|
976 | yy_state_type yy_next_state;
|
---|
977 |
|
---|
978 | (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
|
---|
979 |
|
---|
980 | yy_current_state = yy_get_previous_state( );
|
---|
981 |
|
---|
982 | /* Okay, we're now positioned to make the NUL
|
---|
983 | * transition. We couldn't have
|
---|
984 | * yy_get_previous_state() go ahead and do it
|
---|
985 | * for us because it doesn't know how to deal
|
---|
986 | * with the possibility of jamming (and we don't
|
---|
987 | * want to build jamming into it because then it
|
---|
988 | * will run more slowly).
|
---|
989 | */
|
---|
990 |
|
---|
991 | yy_next_state = yy_try_NUL_trans( yy_current_state );
|
---|
992 |
|
---|
993 | yy_bp = (yytext_ptr) + YY_MORE_ADJ;
|
---|
994 |
|
---|
995 | if ( yy_next_state )
|
---|
996 | {
|
---|
997 | /* Consume the NUL. */
|
---|
998 | yy_cp = ++(yy_c_buf_p);
|
---|
999 | yy_current_state = yy_next_state;
|
---|
1000 | goto yy_match;
|
---|
1001 | }
|
---|
1002 |
|
---|
1003 | else
|
---|
1004 | {
|
---|
1005 | yy_cp = (yy_last_accepting_cpos);
|
---|
1006 | yy_current_state = (yy_last_accepting_state);
|
---|
1007 | goto yy_find_action;
|
---|
1008 | }
|
---|
1009 | }
|
---|
1010 |
|
---|
1011 | else switch ( yy_get_next_buffer( ) )
|
---|
1012 | {
|
---|
1013 | case EOB_ACT_END_OF_FILE:
|
---|
1014 | {
|
---|
1015 | (yy_did_buffer_switch_on_eof) = 0;
|
---|
1016 |
|
---|
1017 | if ( yywrap( ) )
|
---|
1018 | {
|
---|
1019 | /* Note: because we've taken care in
|
---|
1020 | * yy_get_next_buffer() to have set up
|
---|
1021 | * yytext, we can now set up
|
---|
1022 | * yy_c_buf_p so that if some total
|
---|
1023 | * hoser (like flex itself) wants to
|
---|
1024 | * call the scanner after we return the
|
---|
1025 | * YY_NULL, it'll still work - another
|
---|
1026 | * YY_NULL will get returned.
|
---|
1027 | */
|
---|
1028 | (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
|
---|
1029 |
|
---|
1030 | yy_act = YY_STATE_EOF(YY_START);
|
---|
1031 | goto do_action;
|
---|
1032 | }
|
---|
1033 |
|
---|
1034 | else
|
---|
1035 | {
|
---|
1036 | if ( ! (yy_did_buffer_switch_on_eof) )
|
---|
1037 | YY_NEW_FILE;
|
---|
1038 | }
|
---|
1039 | break;
|
---|
1040 | }
|
---|
1041 |
|
---|
1042 | case EOB_ACT_CONTINUE_SCAN:
|
---|
1043 | (yy_c_buf_p) =
|
---|
1044 | (yytext_ptr) + yy_amount_of_matched_text;
|
---|
1045 |
|
---|
1046 | yy_current_state = yy_get_previous_state( );
|
---|
1047 |
|
---|
1048 | yy_cp = (yy_c_buf_p);
|
---|
1049 | yy_bp = (yytext_ptr) + YY_MORE_ADJ;
|
---|
1050 | goto yy_match;
|
---|
1051 |
|
---|
1052 | case EOB_ACT_LAST_MATCH:
|
---|
1053 | (yy_c_buf_p) =
|
---|
1054 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
|
---|
1055 |
|
---|
1056 | yy_current_state = yy_get_previous_state( );
|
---|
1057 |
|
---|
1058 | yy_cp = (yy_c_buf_p);
|
---|
1059 | yy_bp = (yytext_ptr) + YY_MORE_ADJ;
|
---|
1060 | goto yy_find_action;
|
---|
1061 | }
|
---|
1062 | break;
|
---|
1063 | }
|
---|
1064 |
|
---|
1065 | default:
|
---|
1066 | YY_FATAL_ERROR(
|
---|
1067 | "fatal flex scanner internal error--no action found" );
|
---|
1068 | } /* end of action switch */
|
---|
1069 | } /* end of scanning one token */
|
---|
1070 | } /* end of yylex */
|
---|
1071 |
|
---|
1072 | /* yy_get_next_buffer - try to read in a new buffer
|
---|
1073 | *
|
---|
1074 | * Returns a code representing an action:
|
---|
1075 | * EOB_ACT_LAST_MATCH -
|
---|
1076 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
|
---|
1077 | * EOB_ACT_END_OF_FILE - end of file
|
---|
1078 | */
|
---|
1079 | static int yy_get_next_buffer (void)
|
---|
1080 | {
|
---|
1081 | register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
---|
1082 | register char *source = (yytext_ptr);
|
---|
1083 | register int number_to_move, i;
|
---|
1084 | int ret_val;
|
---|
1085 |
|
---|
1086 | if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
|
---|
1087 | YY_FATAL_ERROR(
|
---|
1088 | "fatal flex scanner internal error--end of buffer missed" );
|
---|
1089 |
|
---|
1090 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
|
---|
1091 | { /* Don't try to fill the buffer, so this is an EOF. */
|
---|
1092 | if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
|
---|
1093 | {
|
---|
1094 | /* We matched a single character, the EOB, so
|
---|
1095 | * treat this as a final EOF.
|
---|
1096 | */
|
---|
1097 | return EOB_ACT_END_OF_FILE;
|
---|
1098 | }
|
---|
1099 |
|
---|
1100 | else
|
---|
1101 | {
|
---|
1102 | /* We matched some text prior to the EOB, first
|
---|
1103 | * process it.
|
---|
1104 | */
|
---|
1105 | return EOB_ACT_LAST_MATCH;
|
---|
1106 | }
|
---|
1107 | }
|
---|
1108 |
|
---|
1109 | /* Try to read more data. */
|
---|
1110 |
|
---|
1111 | /* First move last chars to start of buffer. */
|
---|
1112 | number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
|
---|
1113 |
|
---|
1114 | for ( i = 0; i < number_to_move; ++i )
|
---|
1115 | *(dest++) = *(source++);
|
---|
1116 |
|
---|
1117 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
|
---|
1118 | /* don't do the read, it's not guaranteed to return an EOF,
|
---|
1119 | * just force an EOF
|
---|
1120 | */
|
---|
1121 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
|
---|
1122 |
|
---|
1123 | else
|
---|
1124 | {
|
---|
1125 | int num_to_read =
|
---|
1126 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
---|
1127 |
|
---|
1128 | while ( num_to_read <= 0 )
|
---|
1129 | { /* Not enough room in the buffer - grow it. */
|
---|
1130 |
|
---|
1131 | /* just a shorter name for the current buffer */
|
---|
1132 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
---|
1133 |
|
---|
1134 | int yy_c_buf_p_offset =
|
---|
1135 | (int) ((yy_c_buf_p) - b->yy_ch_buf);
|
---|
1136 |
|
---|
1137 | if ( b->yy_is_our_buffer )
|
---|
1138 | {
|
---|
1139 | int new_size = b->yy_buf_size * 2;
|
---|
1140 |
|
---|
1141 | if ( new_size <= 0 )
|
---|
1142 | b->yy_buf_size += b->yy_buf_size / 8;
|
---|
1143 | else
|
---|
1144 | b->yy_buf_size *= 2;
|
---|
1145 |
|
---|
1146 | b->yy_ch_buf = (char *)
|
---|
1147 | /* Include room in for 2 EOB chars. */
|
---|
1148 | yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
|
---|
1149 | }
|
---|
1150 | else
|
---|
1151 | /* Can't grow it, we don't own it. */
|
---|
1152 | b->yy_ch_buf = 0;
|
---|
1153 |
|
---|
1154 | if ( ! b->yy_ch_buf )
|
---|
1155 | YY_FATAL_ERROR(
|
---|
1156 | "fatal error - scanner input buffer overflow" );
|
---|
1157 |
|
---|
1158 | (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
|
---|
1159 |
|
---|
1160 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
|
---|
1161 | number_to_move - 1;
|
---|
1162 |
|
---|
1163 | }
|
---|
1164 |
|
---|
1165 | if ( num_to_read > YY_READ_BUF_SIZE )
|
---|
1166 | num_to_read = YY_READ_BUF_SIZE;
|
---|
1167 |
|
---|
1168 | /* Read in more data. */
|
---|
1169 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
---|
1170 | (yy_n_chars), num_to_read );
|
---|
1171 |
|
---|
1172 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
---|
1173 | }
|
---|
1174 |
|
---|
1175 | if ( (yy_n_chars) == 0 )
|
---|
1176 | {
|
---|
1177 | if ( number_to_move == YY_MORE_ADJ )
|
---|
1178 | {
|
---|
1179 | ret_val = EOB_ACT_END_OF_FILE;
|
---|
1180 | yyrestart(yyin );
|
---|
1181 | }
|
---|
1182 |
|
---|
1183 | else
|
---|
1184 | {
|
---|
1185 | ret_val = EOB_ACT_LAST_MATCH;
|
---|
1186 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
|
---|
1187 | YY_BUFFER_EOF_PENDING;
|
---|
1188 | }
|
---|
1189 | }
|
---|
1190 |
|
---|
1191 | else
|
---|
1192 | ret_val = EOB_ACT_CONTINUE_SCAN;
|
---|
1193 |
|
---|
1194 | (yy_n_chars) += number_to_move;
|
---|
1195 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
|
---|
1196 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
|
---|
1197 |
|
---|
1198 | (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
|
---|
1199 |
|
---|
1200 | return ret_val;
|
---|
1201 | }
|
---|
1202 |
|
---|
1203 | /* yy_get_previous_state - get the state just before the EOB char was reached */
|
---|
1204 |
|
---|
1205 | static yy_state_type yy_get_previous_state (void)
|
---|
1206 | {
|
---|
1207 | register yy_state_type yy_current_state;
|
---|
1208 | register char *yy_cp;
|
---|
1209 |
|
---|
1210 | yy_current_state = (yy_start);
|
---|
1211 |
|
---|
1212 | for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
|
---|
1213 | {
|
---|
1214 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
|
---|
1215 | if ( yy_accept[yy_current_state] )
|
---|
1216 | {
|
---|
1217 | (yy_last_accepting_state) = yy_current_state;
|
---|
1218 | (yy_last_accepting_cpos) = yy_cp;
|
---|
1219 | }
|
---|
1220 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
---|
1221 | {
|
---|
1222 | yy_current_state = (int) yy_def[yy_current_state];
|
---|
1223 | if ( yy_current_state >= 39 )
|
---|
1224 | yy_c = yy_meta[(unsigned int) yy_c];
|
---|
1225 | }
|
---|
1226 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
---|
1227 | }
|
---|
1228 |
|
---|
1229 | return yy_current_state;
|
---|
1230 | }
|
---|
1231 |
|
---|
1232 | /* yy_try_NUL_trans - try to make a transition on the NUL character
|
---|
1233 | *
|
---|
1234 | * synopsis
|
---|
1235 | * next_state = yy_try_NUL_trans( current_state );
|
---|
1236 | */
|
---|
1237 | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
|
---|
1238 | {
|
---|
1239 | register int yy_is_jam;
|
---|
1240 | register char *yy_cp = (yy_c_buf_p);
|
---|
1241 |
|
---|
1242 | register YY_CHAR yy_c = 1;
|
---|
1243 | if ( yy_accept[yy_current_state] )
|
---|
1244 | {
|
---|
1245 | (yy_last_accepting_state) = yy_current_state;
|
---|
1246 | (yy_last_accepting_cpos) = yy_cp;
|
---|
1247 | }
|
---|
1248 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
---|
1249 | {
|
---|
1250 | yy_current_state = (int) yy_def[yy_current_state];
|
---|
1251 | if ( yy_current_state >= 39 )
|
---|
1252 | yy_c = yy_meta[(unsigned int) yy_c];
|
---|
1253 | }
|
---|
1254 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
---|
1255 | yy_is_jam = (yy_current_state == 38);
|
---|
1256 |
|
---|
1257 | return yy_is_jam ? 0 : yy_current_state;
|
---|
1258 | }
|
---|
1259 |
|
---|
1260 | #ifndef YY_NO_INPUT
|
---|
1261 | #ifdef __cplusplus
|
---|
1262 | static int yyinput (void)
|
---|
1263 | #else
|
---|
1264 | static int input (void)
|
---|
1265 | #endif
|
---|
1266 |
|
---|
1267 | {
|
---|
1268 | int c;
|
---|
1269 |
|
---|
1270 | *(yy_c_buf_p) = (yy_hold_char);
|
---|
1271 |
|
---|
1272 | if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
|
---|
1273 | {
|
---|
1274 | /* yy_c_buf_p now points to the character we want to return.
|
---|
1275 | * If this occurs *before* the EOB characters, then it's a
|
---|
1276 | * valid NUL; if not, then we've hit the end of the buffer.
|
---|
1277 | */
|
---|
1278 | if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
|
---|
1279 | /* This was really a NUL. */
|
---|
1280 | *(yy_c_buf_p) = '\0';
|
---|
1281 |
|
---|
1282 | else
|
---|
1283 | { /* need more input */
|
---|
1284 | int offset = (yy_c_buf_p) - (yytext_ptr);
|
---|
1285 | ++(yy_c_buf_p);
|
---|
1286 |
|
---|
1287 | switch ( yy_get_next_buffer( ) )
|
---|
1288 | {
|
---|
1289 | case EOB_ACT_LAST_MATCH:
|
---|
1290 | /* This happens because yy_g_n_b()
|
---|
1291 | * sees that we've accumulated a
|
---|
1292 | * token and flags that we need to
|
---|
1293 | * try matching the token before
|
---|
1294 | * proceeding. But for input(),
|
---|
1295 | * there's no matching to consider.
|
---|
1296 | * So convert the EOB_ACT_LAST_MATCH
|
---|
1297 | * to EOB_ACT_END_OF_FILE.
|
---|
1298 | */
|
---|
1299 |
|
---|
1300 | /* Reset buffer status. */
|
---|
1301 | yyrestart(yyin );
|
---|
1302 |
|
---|
1303 | /*FALLTHROUGH*/
|
---|
1304 |
|
---|
1305 | case EOB_ACT_END_OF_FILE:
|
---|
1306 | {
|
---|
1307 | if ( yywrap( ) )
|
---|
1308 | return 0;
|
---|
1309 |
|
---|
1310 | if ( ! (yy_did_buffer_switch_on_eof) )
|
---|
1311 | YY_NEW_FILE;
|
---|
1312 | #ifdef __cplusplus
|
---|
1313 | return yyinput();
|
---|
1314 | #else
|
---|
1315 | return input();
|
---|
1316 | #endif
|
---|
1317 | }
|
---|
1318 |
|
---|
1319 | case EOB_ACT_CONTINUE_SCAN:
|
---|
1320 | (yy_c_buf_p) = (yytext_ptr) + offset;
|
---|
1321 | break;
|
---|
1322 | }
|
---|
1323 | }
|
---|
1324 | }
|
---|
1325 |
|
---|
1326 | c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
|
---|
1327 | *(yy_c_buf_p) = '\0'; /* preserve yytext */
|
---|
1328 | (yy_hold_char) = *++(yy_c_buf_p);
|
---|
1329 |
|
---|
1330 | return c;
|
---|
1331 | }
|
---|
1332 | #endif /* ifndef YY_NO_INPUT */
|
---|
1333 |
|
---|
1334 | /** Immediately switch to a different input stream.
|
---|
1335 | * @param input_file A readable stream.
|
---|
1336 | *
|
---|
1337 | * @note This function does not reset the start condition to @c INITIAL .
|
---|
1338 | */
|
---|
1339 | void yyrestart (FILE * input_file )
|
---|
1340 | {
|
---|
1341 |
|
---|
1342 | if ( ! YY_CURRENT_BUFFER ){
|
---|
1343 | yyensure_buffer_stack ();
|
---|
1344 | YY_CURRENT_BUFFER_LVALUE =
|
---|
1345 | yy_create_buffer(yyin,YY_BUF_SIZE );
|
---|
1346 | }
|
---|
1347 |
|
---|
1348 | yy_init_buffer(YY_CURRENT_BUFFER,input_file );
|
---|
1349 | yy_load_buffer_state( );
|
---|
1350 | }
|
---|
1351 |
|
---|
1352 | /** Switch to a different input buffer.
|
---|
1353 | * @param new_buffer The new input buffer.
|
---|
1354 | *
|
---|
1355 | */
|
---|
1356 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
|
---|
1357 | {
|
---|
1358 |
|
---|
1359 | /* TODO. We should be able to replace this entire function body
|
---|
1360 | * with
|
---|
1361 | * yypop_buffer_state();
|
---|
1362 | * yypush_buffer_state(new_buffer);
|
---|
1363 | */
|
---|
1364 | yyensure_buffer_stack ();
|
---|
1365 | if ( YY_CURRENT_BUFFER == new_buffer )
|
---|
1366 | return;
|
---|
1367 |
|
---|
1368 | if ( YY_CURRENT_BUFFER )
|
---|
1369 | {
|
---|
1370 | /* Flush out information for old buffer. */
|
---|
1371 | *(yy_c_buf_p) = (yy_hold_char);
|
---|
1372 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
|
---|
1373 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
---|
1374 | }
|
---|
1375 |
|
---|
1376 | YY_CURRENT_BUFFER_LVALUE = new_buffer;
|
---|
1377 | yy_load_buffer_state( );
|
---|
1378 |
|
---|
1379 | /* We don't actually know whether we did this switch during
|
---|
1380 | * EOF (yywrap()) processing, but the only time this flag
|
---|
1381 | * is looked at is after yywrap() is called, so it's safe
|
---|
1382 | * to go ahead and always set it.
|
---|
1383 | */
|
---|
1384 | (yy_did_buffer_switch_on_eof) = 1;
|
---|
1385 | }
|
---|
1386 |
|
---|
1387 | static void yy_load_buffer_state (void)
|
---|
1388 | {
|
---|
1389 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
---|
1390 | (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
|
---|
1391 | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
|
---|
1392 | (yy_hold_char) = *(yy_c_buf_p);
|
---|
1393 | }
|
---|
1394 |
|
---|
1395 | /** Allocate and initialize an input buffer state.
|
---|
1396 | * @param file A readable stream.
|
---|
1397 | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
|
---|
1398 | *
|
---|
1399 | * @return the allocated buffer state.
|
---|
1400 | */
|
---|
1401 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
|
---|
1402 | {
|
---|
1403 | YY_BUFFER_STATE b;
|
---|
1404 |
|
---|
1405 | b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
|
---|
1406 | if ( ! b )
|
---|
1407 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
---|
1408 |
|
---|
1409 | b->yy_buf_size = size;
|
---|
1410 |
|
---|
1411 | /* yy_ch_buf has to be 2 characters longer than the size given because
|
---|
1412 | * we need to put in 2 end-of-buffer characters.
|
---|
1413 | */
|
---|
1414 | b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
|
---|
1415 | if ( ! b->yy_ch_buf )
|
---|
1416 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
---|
1417 |
|
---|
1418 | b->yy_is_our_buffer = 1;
|
---|
1419 |
|
---|
1420 | yy_init_buffer(b,file );
|
---|
1421 |
|
---|
1422 | return b;
|
---|
1423 | }
|
---|
1424 |
|
---|
1425 | /** Destroy the buffer.
|
---|
1426 | * @param b a buffer created with yy_create_buffer()
|
---|
1427 | *
|
---|
1428 | */
|
---|
1429 | void yy_delete_buffer (YY_BUFFER_STATE b )
|
---|
1430 | {
|
---|
1431 |
|
---|
1432 | if ( ! b )
|
---|
1433 | return;
|
---|
1434 |
|
---|
1435 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
|
---|
1436 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
|
---|
1437 |
|
---|
1438 | if ( b->yy_is_our_buffer )
|
---|
1439 | yyfree((void *) b->yy_ch_buf );
|
---|
1440 |
|
---|
1441 | yyfree((void *) b );
|
---|
1442 | }
|
---|
1443 |
|
---|
1444 | /* Initializes or reinitializes a buffer.
|
---|
1445 | * This function is sometimes called more than once on the same buffer,
|
---|
1446 | * such as during a yyrestart() or at EOF.
|
---|
1447 | */
|
---|
1448 | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
|
---|
1449 |
|
---|
1450 | {
|
---|
1451 | int oerrno = errno;
|
---|
1452 |
|
---|
1453 | yy_flush_buffer(b );
|
---|
1454 |
|
---|
1455 | b->yy_input_file = file;
|
---|
1456 | b->yy_fill_buffer = 1;
|
---|
1457 |
|
---|
1458 | /* If b is the current buffer, then yy_init_buffer was _probably_
|
---|
1459 | * called from yyrestart() or through yy_get_next_buffer.
|
---|
1460 | * In that case, we don't want to reset the lineno or column.
|
---|
1461 | */
|
---|
1462 | if (b != YY_CURRENT_BUFFER){
|
---|
1463 | b->yy_bs_lineno = 1;
|
---|
1464 | b->yy_bs_column = 0;
|
---|
1465 | }
|
---|
1466 |
|
---|
1467 | b->yy_is_interactive = 0;
|
---|
1468 |
|
---|
1469 | errno = oerrno;
|
---|
1470 | }
|
---|
1471 |
|
---|
1472 | /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
|
---|
1473 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
|
---|
1474 | *
|
---|
1475 | */
|
---|
1476 | void yy_flush_buffer (YY_BUFFER_STATE b )
|
---|
1477 | {
|
---|
1478 | if ( ! b )
|
---|
1479 | return;
|
---|
1480 |
|
---|
1481 | b->yy_n_chars = 0;
|
---|
1482 |
|
---|
1483 | /* We always need two end-of-buffer characters. The first causes
|
---|
1484 | * a transition to the end-of-buffer state. The second causes
|
---|
1485 | * a jam in that state.
|
---|
1486 | */
|
---|
1487 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
|
---|
1488 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
|
---|
1489 |
|
---|
1490 | b->yy_buf_pos = &b->yy_ch_buf[0];
|
---|
1491 |
|
---|
1492 | b->yy_at_bol = 1;
|
---|
1493 | b->yy_buffer_status = YY_BUFFER_NEW;
|
---|
1494 |
|
---|
1495 | if ( b == YY_CURRENT_BUFFER )
|
---|
1496 | yy_load_buffer_state( );
|
---|
1497 | }
|
---|
1498 |
|
---|
1499 | /** Pushes the new state onto the stack. The new state becomes
|
---|
1500 | * the current state. This function will allocate the stack
|
---|
1501 | * if necessary.
|
---|
1502 | * @param new_buffer The new state.
|
---|
1503 | *
|
---|
1504 | */
|
---|
1505 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
|
---|
1506 | {
|
---|
1507 | if (new_buffer == NULL)
|
---|
1508 | return;
|
---|
1509 |
|
---|
1510 | yyensure_buffer_stack();
|
---|
1511 |
|
---|
1512 | /* This block is copied from yy_switch_to_buffer. */
|
---|
1513 | if ( YY_CURRENT_BUFFER )
|
---|
1514 | {
|
---|
1515 | /* Flush out information for old buffer. */
|
---|
1516 | *(yy_c_buf_p) = (yy_hold_char);
|
---|
1517 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
|
---|
1518 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
---|
1519 | }
|
---|
1520 |
|
---|
1521 | /* Only push if top exists. Otherwise, replace top. */
|
---|
1522 | if (YY_CURRENT_BUFFER)
|
---|
1523 | (yy_buffer_stack_top)++;
|
---|
1524 | YY_CURRENT_BUFFER_LVALUE = new_buffer;
|
---|
1525 |
|
---|
1526 | /* copied from yy_switch_to_buffer. */
|
---|
1527 | yy_load_buffer_state( );
|
---|
1528 | (yy_did_buffer_switch_on_eof) = 1;
|
---|
1529 | }
|
---|
1530 |
|
---|
1531 | /** Removes and deletes the top of the stack, if present.
|
---|
1532 | * The next element becomes the new top.
|
---|
1533 | *
|
---|
1534 | */
|
---|
1535 | void yypop_buffer_state (void)
|
---|
1536 | {
|
---|
1537 | if (!YY_CURRENT_BUFFER)
|
---|
1538 | return;
|
---|
1539 |
|
---|
1540 | yy_delete_buffer(YY_CURRENT_BUFFER );
|
---|
1541 | YY_CURRENT_BUFFER_LVALUE = NULL;
|
---|
1542 | if ((yy_buffer_stack_top) > 0)
|
---|
1543 | --(yy_buffer_stack_top);
|
---|
1544 |
|
---|
1545 | if (YY_CURRENT_BUFFER) {
|
---|
1546 | yy_load_buffer_state( );
|
---|
1547 | (yy_did_buffer_switch_on_eof) = 1;
|
---|
1548 | }
|
---|
1549 | }
|
---|
1550 |
|
---|
1551 | /* Allocates the stack if it does not exist.
|
---|
1552 | * Guarantees space for at least one push.
|
---|
1553 | */
|
---|
1554 | static void yyensure_buffer_stack (void)
|
---|
1555 | {
|
---|
1556 | int num_to_alloc;
|
---|
1557 |
|
---|
1558 | if (!(yy_buffer_stack)) {
|
---|
1559 |
|
---|
1560 | /* First allocation is just for 2 elements, since we don't know if this
|
---|
1561 | * scanner will even need a stack. We use 2 instead of 1 to avoid an
|
---|
1562 | * immediate realloc on the next call.
|
---|
1563 | */
|
---|
1564 | num_to_alloc = 1;
|
---|
1565 | (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
|
---|
1566 | (num_to_alloc * sizeof(struct yy_buffer_state*)
|
---|
1567 | );
|
---|
1568 |
|
---|
1569 | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
|
---|
1570 |
|
---|
1571 | (yy_buffer_stack_max) = num_to_alloc;
|
---|
1572 | (yy_buffer_stack_top) = 0;
|
---|
1573 | return;
|
---|
1574 | }
|
---|
1575 |
|
---|
1576 | if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
|
---|
1577 |
|
---|
1578 | /* Increase the buffer to prepare for a possible push. */
|
---|
1579 | int grow_size = 8 /* arbitrary grow size */;
|
---|
1580 |
|
---|
1581 | num_to_alloc = (yy_buffer_stack_max) + grow_size;
|
---|
1582 | (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
|
---|
1583 | ((yy_buffer_stack),
|
---|
1584 | num_to_alloc * sizeof(struct yy_buffer_state*)
|
---|
1585 | );
|
---|
1586 |
|
---|
1587 | /* zero only the new slots.*/
|
---|
1588 | memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
|
---|
1589 | (yy_buffer_stack_max) = num_to_alloc;
|
---|
1590 | }
|
---|
1591 | }
|
---|
1592 |
|
---|
1593 | #ifndef YY_EXIT_FAILURE
|
---|
1594 | #define YY_EXIT_FAILURE 2
|
---|
1595 | #endif
|
---|
1596 |
|
---|
1597 | static void yy_fatal_error (yyconst char* msg )
|
---|
1598 | {
|
---|
1599 | (void) fprintf( stderr, "%s\n", msg );
|
---|
1600 | exit( YY_EXIT_FAILURE );
|
---|
1601 | }
|
---|
1602 |
|
---|
1603 | /* Redefine yyless() so it works in section 3 code. */
|
---|
1604 |
|
---|
1605 | #undef yyless
|
---|
1606 | #define yyless(n) \
|
---|
1607 | do \
|
---|
1608 | { \
|
---|
1609 | /* Undo effects of setting up yytext. */ \
|
---|
1610 | int yyless_macro_arg = (n); \
|
---|
1611 | YY_LESS_LINENO(yyless_macro_arg);\
|
---|
1612 | yytext[yyleng] = (yy_hold_char); \
|
---|
1613 | (yy_c_buf_p) = yytext + yyless_macro_arg; \
|
---|
1614 | (yy_hold_char) = *(yy_c_buf_p); \
|
---|
1615 | *(yy_c_buf_p) = '\0'; \
|
---|
1616 | yyleng = yyless_macro_arg; \
|
---|
1617 | } \
|
---|
1618 | while ( 0 )
|
---|
1619 |
|
---|
1620 | /* Accessor methods (get/set functions) to struct members. */
|
---|
1621 |
|
---|
1622 | /** Get the current token.
|
---|
1623 | *
|
---|
1624 | */
|
---|
1625 |
|
---|
1626 | static int yy_init_globals (void)
|
---|
1627 | {
|
---|
1628 | /* Initialization is the same as for the non-reentrant scanner.
|
---|
1629 | * This function is called from yylex_destroy(), so don't allocate here.
|
---|
1630 | */
|
---|
1631 |
|
---|
1632 | (yy_buffer_stack) = 0;
|
---|
1633 | (yy_buffer_stack_top) = 0;
|
---|
1634 | (yy_buffer_stack_max) = 0;
|
---|
1635 | (yy_c_buf_p) = (char *) 0;
|
---|
1636 | (yy_init) = 0;
|
---|
1637 | (yy_start) = 0;
|
---|
1638 |
|
---|
1639 | /* Defined in main.c */
|
---|
1640 | #ifdef YY_STDINIT
|
---|
1641 | yyin = stdin;
|
---|
1642 | yyout = stdout;
|
---|
1643 | #else
|
---|
1644 | yyin = (FILE *) 0;
|
---|
1645 | yyout = (FILE *) 0;
|
---|
1646 | #endif
|
---|
1647 |
|
---|
1648 | /* For future reference: Set errno on error, since we are called by
|
---|
1649 | * yylex_init()
|
---|
1650 | */
|
---|
1651 | return 0;
|
---|
1652 | }
|
---|
1653 |
|
---|
1654 | /* yylex_destroy is for both reentrant and non-reentrant scanners. */
|
---|
1655 | int yylex_destroy (void)
|
---|
1656 | {
|
---|
1657 |
|
---|
1658 | /* Pop the buffer stack, destroying each element. */
|
---|
1659 | while(YY_CURRENT_BUFFER){
|
---|
1660 | yy_delete_buffer(YY_CURRENT_BUFFER );
|
---|
1661 | YY_CURRENT_BUFFER_LVALUE = NULL;
|
---|
1662 | yypop_buffer_state();
|
---|
1663 | }
|
---|
1664 |
|
---|
1665 | /* Destroy the stack itself. */
|
---|
1666 | yyfree((yy_buffer_stack) );
|
---|
1667 | (yy_buffer_stack) = NULL;
|
---|
1668 |
|
---|
1669 | /* Reset the globals. This is important in a non-reentrant scanner so the next time
|
---|
1670 | * yylex() is called, initialization will occur. */
|
---|
1671 | yy_init_globals( );
|
---|
1672 |
|
---|
1673 | return 0;
|
---|
1674 | }
|
---|
1675 |
|
---|
1676 | /*
|
---|
1677 | * Internal utility routines.
|
---|
1678 | */
|
---|
1679 |
|
---|
1680 | #ifndef yytext_ptr
|
---|
1681 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
---|
1682 | {
|
---|
1683 | register int i;
|
---|
1684 | for ( i = 0; i < n; ++i )
|
---|
1685 | s1[i] = s2[i];
|
---|
1686 | }
|
---|
1687 | #endif
|
---|
1688 |
|
---|
1689 | #ifdef YY_NEED_STRLEN
|
---|
1690 | static int yy_flex_strlen (yyconst char * s )
|
---|
1691 | {
|
---|
1692 | register int n;
|
---|
1693 | for ( n = 0; s[n]; ++n )
|
---|
1694 | ;
|
---|
1695 |
|
---|
1696 | return n;
|
---|
1697 | }
|
---|
1698 | #endif
|
---|
1699 |
|
---|
1700 | #define YYTABLES_NAME "yytables"
|
---|
1701 |
|
---|
1702 | #line 140 "/Volumes/ScratchHFS/bird/kBuild/svn/trunk/src/kash/arith_lex.l"
|
---|
1703 |
|
---|
1704 |
|
---|
1705 |
|
---|
1706 | void
|
---|
1707 | arith_lex_reset() {
|
---|
1708 | #ifdef YY_NEW_FILE
|
---|
1709 | YY_NEW_FILE;
|
---|
1710 | #endif
|
---|
1711 | }
|
---|
1712 |
|
---|
1713 | void *
|
---|
1714 | yyalloc(yy_size_t cb)
|
---|
1715 | {
|
---|
1716 | return sh_malloc(NULL, cb);
|
---|
1717 | }
|
---|
1718 |
|
---|
1719 | void *
|
---|
1720 | yyrealloc(void *pv,yy_size_t cb)
|
---|
1721 | {
|
---|
1722 | return sh_realloc(NULL, pv, cb);
|
---|
1723 | }
|
---|
1724 |
|
---|
1725 | void
|
---|
1726 | yyfree(void *pv)
|
---|
1727 | {
|
---|
1728 | sh_free(NULL, pv);
|
---|
1729 | }
|
---|
1730 |
|
---|
1731 |
|
---|