source: vendor/binutils/2.14/binutils/syslex.c

Last change on this file was 609, checked in by bird, 22 years ago

binutils v2.14 - offical sources.

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