1 #line 1 "asm.c"
2 /*
3 * Copyright (c) 2002, 2004 Tama Communications Corporation
4 *
5 * This file is part of GNU GLOBAL.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 /*
22 * scanner for assembly source code.
23 */
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 #include <stdio.h>
28 #ifdef STDC_HEADERS
29 #include <stdlib.h>
30 #endif
31 #include "global.h"
32 #include "anchor.h"
33 #include "incop.h"
34 #include "common.h"
35 #include "htags.h"
36 #include "../libparser/asm_res.h"
37
38 #define lex_symbol_generation_rule(x) asm_ ## x
39 #include "lexcommon.h"
40
41 #ifdef ECHO
42 #undef ECHO
43 #endif
44 #define ECHO echos(LEXTEXT)
45
46 #define YY_USER_ACTION DEFAULT_YY_USER_ACTION
47
48 static int last_directive;
49
50 #line 50 "asm.c"
51
52 #define YY_INT_ALIGNED short int
53
54 /* A lexical scanner generated by flex */
55
56 #define yy_create_buffer asm__create_buffer
57 #define yy_delete_buffer asm__delete_buffer
58 #define yy_scan_buffer asm__scan_buffer
59 #define yy_scan_string asm__scan_string
60 #define yy_scan_bytes asm__scan_bytes
61 #define yy_init_buffer asm__init_buffer
62 #define yy_flush_buffer asm__flush_buffer
63 #define yy_load_buffer_state asm__load_buffer_state
64 #define yy_switch_to_buffer asm__switch_to_buffer
65 #define yypush_buffer_state asm_push_buffer_state
66 #define yypop_buffer_state asm_pop_buffer_state
67 #define yyensure_buffer_stack asm_ensure_buffer_stack
68 #define yy_flex_debug asm__flex_debug
69 #define yyin asm_in
70 #define yyleng asm_leng
71 #define yylex asm_lex
72 #define yylineno asm_lineno
73 #define yyout asm_out
74 #define yyrestart asm_restart
75 #define yytext asm_text
76 #define yywrap asm_wrap
77 #define yyalloc asm_alloc
78 #define yyrealloc asm_realloc
79 #define yyfree asm_free
80
81 #define FLEX_SCANNER
82 #define YY_FLEX_MAJOR_VERSION 2
83 #define YY_FLEX_MINOR_VERSION 6
84 #define YY_FLEX_SUBMINOR_VERSION 4
85 #if YY_FLEX_SUBMINOR_VERSION > 0
86 #define FLEX_BETA
87 #endif
88
89 #ifdef yy_create_buffer
90 #define asm__create_buffer_ALREADY_DEFINED
91 #else
92 #define yy_create_buffer asm__create_buffer
93 #endif
94
95 #ifdef yy_delete_buffer
96 #define asm__delete_buffer_ALREADY_DEFINED
97 #else
98 #define yy_delete_buffer asm__delete_buffer
99 #endif
100
101 #ifdef yy_scan_buffer
102 #define asm__scan_buffer_ALREADY_DEFINED
103 #else
104 #define yy_scan_buffer asm__scan_buffer
105 #endif
106
107 #ifdef yy_scan_string
108 #define asm__scan_string_ALREADY_DEFINED
109 #else
110 #define yy_scan_string asm__scan_string
111 #endif
112
113 #ifdef yy_scan_bytes
114 #define asm__scan_bytes_ALREADY_DEFINED
115 #else
116 #define yy_scan_bytes asm__scan_bytes
117 #endif
118
119 #ifdef yy_init_buffer
120 #define asm__init_buffer_ALREADY_DEFINED
121 #else
122 #define yy_init_buffer asm__init_buffer
123 #endif
124
125 #ifdef yy_flush_buffer
126 #define asm__flush_buffer_ALREADY_DEFINED
127 #else
128 #define yy_flush_buffer asm__flush_buffer
129 #endif
130
131 #ifdef yy_load_buffer_state
132 #define asm__load_buffer_state_ALREADY_DEFINED
133 #else
134 #define yy_load_buffer_state asm__load_buffer_state
135 #endif
136
137 #ifdef yy_switch_to_buffer
138 #define asm__switch_to_buffer_ALREADY_DEFINED
139 #else
140 #define yy_switch_to_buffer asm__switch_to_buffer
141 #endif
142
143 #ifdef yypush_buffer_state
144 #define asm_push_buffer_state_ALREADY_DEFINED
145 #else
146 #define yypush_buffer_state asm_push_buffer_state
147 #endif
148
149 #ifdef yypop_buffer_state
150 #define asm_pop_buffer_state_ALREADY_DEFINED
151 #else
152 #define yypop_buffer_state asm_pop_buffer_state
153 #endif
154
155 #ifdef yyensure_buffer_stack
156 #define asm_ensure_buffer_stack_ALREADY_DEFINED
157 #else
158 #define yyensure_buffer_stack asm_ensure_buffer_stack
159 #endif
160
161 #ifdef yylex
162 #define asm_lex_ALREADY_DEFINED
163 #else
164 #define yylex asm_lex
165 #endif
166
167 #ifdef yyrestart
168 #define asm_restart_ALREADY_DEFINED
169 #else
170 #define yyrestart asm_restart
171 #endif
172
173 #ifdef yylex_init
174 #define asm_lex_init_ALREADY_DEFINED
175 #else
176 #define yylex_init asm_lex_init
177 #endif
178
179 #ifdef yylex_init_extra
180 #define asm_lex_init_extra_ALREADY_DEFINED
181 #else
182 #define yylex_init_extra asm_lex_init_extra
183 #endif
184
185 #ifdef yylex_destroy
186 #define asm_lex_destroy_ALREADY_DEFINED
187 #else
188 #define yylex_destroy asm_lex_destroy
189 #endif
190
191 #ifdef yyget_debug
192 #define asm_get_debug_ALREADY_DEFINED
193 #else
194 #define yyget_debug asm_get_debug
195 #endif
196
197 #ifdef yyset_debug
198 #define asm_set_debug_ALREADY_DEFINED
199 #else
200 #define yyset_debug asm_set_debug
201 #endif
202
203 #ifdef yyget_extra
204 #define asm_get_extra_ALREADY_DEFINED
205 #else
206 #define yyget_extra asm_get_extra
207 #endif
208
209 #ifdef yyset_extra
210 #define asm_set_extra_ALREADY_DEFINED
211 #else
212 #define yyset_extra asm_set_extra
213 #endif
214
215 #ifdef yyget_in
216 #define asm_get_in_ALREADY_DEFINED
217 #else
218 #define yyget_in asm_get_in
219 #endif
220
221 #ifdef yyset_in
222 #define asm_set_in_ALREADY_DEFINED
223 #else
224 #define yyset_in asm_set_in
225 #endif
226
227 #ifdef yyget_out
228 #define asm_get_out_ALREADY_DEFINED
229 #else
230 #define yyget_out asm_get_out
231 #endif
232
233 #ifdef yyset_out
234 #define asm_set_out_ALREADY_DEFINED
235 #else
236 #define yyset_out asm_set_out
237 #endif
238
239 #ifdef yyget_leng
240 #define asm_get_leng_ALREADY_DEFINED
241 #else
242 #define yyget_leng asm_get_leng
243 #endif
244
245 #ifdef yyget_text
246 #define asm_get_text_ALREADY_DEFINED
247 #else
248 #define yyget_text asm_get_text
249 #endif
250
251 #ifdef yyget_lineno
252 #define asm_get_lineno_ALREADY_DEFINED
253 #else
254 #define yyget_lineno asm_get_lineno
255 #endif
256
257 #ifdef yyset_lineno
258 #define asm_set_lineno_ALREADY_DEFINED
259 #else
260 #define yyset_lineno asm_set_lineno
261 #endif
262
263 #ifdef yywrap
264 #define asm_wrap_ALREADY_DEFINED
265 #else
266 #define yywrap asm_wrap
267 #endif
268
269 #ifdef yyalloc
270 #define asm_alloc_ALREADY_DEFINED
271 #else
272 #define yyalloc asm_alloc
273 #endif
274
275 #ifdef yyrealloc
276 #define asm_realloc_ALREADY_DEFINED
277 #else
278 #define yyrealloc asm_realloc
279 #endif
280
281 #ifdef yyfree
282 #define asm_free_ALREADY_DEFINED
283 #else
284 #define yyfree asm_free
285 #endif
286
287 #ifdef yytext
288 #define asm_text_ALREADY_DEFINED
289 #else
290 #define yytext asm_text
291 #endif
292
293 #ifdef yyleng
294 #define asm_leng_ALREADY_DEFINED
295 #else
296 #define yyleng asm_leng
297 #endif
298
299 #ifdef yyin
300 #define asm_in_ALREADY_DEFINED
301 #else
302 #define yyin asm_in
303 #endif
304
305 #ifdef yyout
306 #define asm_out_ALREADY_DEFINED
307 #else
308 #define yyout asm_out
309 #endif
310
311 #ifdef yy_flex_debug
312 #define asm__flex_debug_ALREADY_DEFINED
313 #else
314 #define yy_flex_debug asm__flex_debug
315 #endif
316
317 #ifdef yylineno
318 #define asm_lineno_ALREADY_DEFINED
319 #else
320 #define yylineno asm_lineno
321 #endif
322
323 /* First, we deal with platform-specific or compiler-specific issues. */
324
325 /* begin standard C headers. */
326 #include <stdio.h>
327 #include <string.h>
328 #include <errno.h>
329 #include <stdlib.h>
330
331 /* end standard C headers. */
332
333 /* flex integer type definitions */
334
335 #ifndef FLEXINT_H
336 #define FLEXINT_H
337
338 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
339
340 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
341
342 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
343 * if you want the limit (max/min) macros for int types.
344 */
345 #ifndef __STDC_LIMIT_MACROS
346 #define __STDC_LIMIT_MACROS 1
347 #endif
348
349 #include <inttypes.h>
350 typedef int8_t flex_int8_t;
351 typedef uint8_t flex_uint8_t;
352 typedef int16_t flex_int16_t;
353 typedef uint16_t flex_uint16_t;
354 typedef int32_t flex_int32_t;
355 typedef uint32_t flex_uint32_t;
356 #else
357 typedef signed char flex_int8_t;
358 typedef short int flex_int16_t;
359 typedef int flex_int32_t;
360 typedef unsigned char flex_uint8_t;
361 typedef unsigned short int flex_uint16_t;
362 typedef unsigned int flex_uint32_t;
363
364 /* Limits of integral types. */
365 #ifndef INT8_MIN
366 #define INT8_MIN (-128)
367 #endif
368 #ifndef INT16_MIN
369 #define INT16_MIN (-32767-1)
370 #endif
371 #ifndef INT32_MIN
372 #define INT32_MIN (-2147483647-1)
373 #endif
374 #ifndef INT8_MAX
375 #define INT8_MAX (127)
376 #endif
377 #ifndef INT16_MAX
378 #define INT16_MAX (32767)
379 #endif
380 #ifndef INT32_MAX
381 #define INT32_MAX (2147483647)
382 #endif
383 #ifndef UINT8_MAX
384 #define UINT8_MAX (255U)
385 #endif
386 #ifndef UINT16_MAX
387 #define UINT16_MAX (65535U)
388 #endif
389 #ifndef UINT32_MAX
390 #define UINT32_MAX (4294967295U)
391 #endif
392
393 #ifndef SIZE_MAX
394 #define SIZE_MAX (~(size_t)0)
395 #endif
396
397 #endif /* ! C99 */
398
399 #endif /* ! FLEXINT_H */
400
401 /* begin standard C++ headers. */
402
403 /* TODO: this is always defined, so inline it */
404 #define yyconst const
405
406 #if defined(__GNUC__) && __GNUC__ >= 3
407 #define yynoreturn __attribute__((__noreturn__))
408 #else
409 #define yynoreturn
410 #endif
411
412 /* Returned upon end-of-file. */
413 #define YY_NULL 0
414
415 /* Promotes a possibly negative, possibly signed char to an
416 * integer in range [0..255] for use as an array index.
417 */
418 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
419
420 /* Enter a start condition. This macro really ought to take a parameter,
421 * but we do it the disgusting crufty way forced on us by the ()-less
422 * definition of BEGIN.
423 */
424 #define BEGIN (yy_start) = 1 + 2 *
425 /* Translate the current start state into a value that can be later handed
426 * to BEGIN to return to the state. The YYSTATE alias is for lex
427 * compatibility.
428 */
429 #define YY_START (((yy_start) - 1) / 2)
430 #define YYSTATE YY_START
431 /* Action number for EOF rule of a given start state. */
432 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
433 /* Special action meaning "start processing a new file". */
434 #define YY_NEW_FILE yyrestart( yyin )
435 #define YY_END_OF_BUFFER_CHAR 0
436
437 /* Size of default input buffer. */
438 #ifndef YY_BUF_SIZE
439 #ifdef __ia64__
440 /* On IA-64, the buffer size is 16k, not 8k.
441 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
442 * Ditto for the __ia64__ case accordingly.
443 */
444 #define YY_BUF_SIZE 32768
445 #else
446 #define YY_BUF_SIZE 16384
447 #endif /* __ia64__ */
448 #endif
449
450 /* The state buf must be large enough to hold one state per character in the main buffer.
451 */
452 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
453
454 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
455 #define YY_TYPEDEF_YY_BUFFER_STATE
456 typedef struct yy_buffer_state *YY_BUFFER_STATE;
457 #endif
458
459 #ifndef YY_TYPEDEF_YY_SIZE_T
460 #define YY_TYPEDEF_YY_SIZE_T
461 typedef size_t yy_size_t;
462 #endif
463
464 extern int yyleng;
465
466 extern FILE *yyin, *yyout;
467
468 #define EOB_ACT_CONTINUE_SCAN 0
469 #define EOB_ACT_END_OF_FILE 1
470 #define EOB_ACT_LAST_MATCH 2
471
472 #define YY_LESS_LINENO(n)
473 #define YY_LINENO_REWIND_TO(ptr)
474
475 /* Return all but the first "n" matched characters back to the input stream. */
476 #define yyless(n) \
477 do \
478 { \
479 /* Undo effects of setting up yytext. */ \
480 int yyless_macro_arg = (n); \
481 YY_LESS_LINENO(yyless_macro_arg);\
482 *yy_cp = (yy_hold_char); \
483 YY_RESTORE_YY_MORE_OFFSET \
484 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
485 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
486 } \
487 while ( 0 )
488 #define unput(c) yyunput( c, (yytext_ptr) )
489
490 #ifndef YY_STRUCT_YY_BUFFER_STATE
491 #define YY_STRUCT_YY_BUFFER_STATE
492 struct yy_buffer_state
493 {
494 FILE *yy_input_file;
495
496 char *yy_ch_buf; /* input buffer */
497 char *yy_buf_pos; /* current position in input buffer */
498
499 /* Size of input buffer in bytes, not including room for EOB
500 * characters.
501 */
502 int yy_buf_size;
503
504 /* Number of characters read into yy_ch_buf, not including EOB
505 * characters.
506 */
507 int yy_n_chars;
508
509 /* Whether we "own" the buffer - i.e., we know we created it,
510 * and can realloc() it to grow it, and should free() it to
511 * delete it.
512 */
513 int yy_is_our_buffer;
514
515 /* Whether this is an "interactive" input source; if so, and
516 * if we're using stdio for input, then we want to use getc()
517 * instead of fread(), to make sure we stop fetching input after
518 * each newline.
519 */
520 int yy_is_interactive;
521
522 /* Whether we're considered to be at the beginning of a line.
523 * If so, '^' rules will be active on the next match, otherwise
524 * not.
525 */
526 int yy_at_bol;
527
528 int yy_bs_lineno; /**< The line count. */
529 int yy_bs_column; /**< The column count. */
530
531 /* Whether to try to fill the input buffer when we reach the
532 * end of it.
533 */
534 int yy_fill_buffer;
535
536 int yy_buffer_status;
537
538 #define YY_BUFFER_NEW 0
539 #define YY_BUFFER_NORMAL 1
540 /* When an EOF's been seen but there's still some text to process
541 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
542 * shouldn't try reading from the input source any more. We might
543 * still have a bunch of tokens to match, though, because of
544 * possible backing-up.
545 *
546 * When we actually see the EOF, we change the status to "new"
547 * (via yyrestart()), so that the user can continue scanning by
548 * just pointing yyin at a new input file.
549 */
550 #define YY_BUFFER_EOF_PENDING 2
551
552 };
553 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
554
555 /* Stack of input buffers. */
556 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
557 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
558 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
559
560 /* We provide macros for accessing buffer states in case in the
561 * future we want to put the buffer states in a more general
562 * "scanner state".
563 *
564 * Returns the top of the stack, or NULL.
565 */
566 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
567 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
568 : NULL)
569 /* Same as previous macro, but useful when we know that the buffer stack is not
570 * NULL or when we need an lvalue. For internal use only.
571 */
572 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
573
574 /* yy_hold_char holds the character lost when yytext is formed. */
575 static char yy_hold_char;
576 static int yy_n_chars; /* number of characters read into yy_ch_buf */
577 int yyleng;
578
579 /* Points to current character in buffer. */
580 static char *yy_c_buf_p = NULL;
581 static int yy_init = 0; /* whether we need to initialize */
582 static int yy_start = 0; /* start state number */
583
584 /* Flag which is used to allow yywrap()'s to do buffer switches
585 * instead of setting up a fresh yyin. A bit of a hack ...
586 */
587 static int yy_did_buffer_switch_on_eof;
588
589 void yyrestart ( FILE *input_file );
590 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
591 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
592 void yy_delete_buffer ( YY_BUFFER_STATE b );
593 void yy_flush_buffer ( YY_BUFFER_STATE b );
594 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
595 void yypop_buffer_state ( void );
596
597 static void yyensure_buffer_stack ( void );
598 static void yy_load_buffer_state ( void );
599 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
600 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
601
602 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
603 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
604 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
605
606 void *yyalloc ( yy_size_t );
607 void *yyrealloc ( void *, yy_size_t );
608 void yyfree ( void * );
609
610 #define yy_new_buffer yy_create_buffer
611 #define yy_set_interactive(is_interactive) \
612 { \
613 if ( ! YY_CURRENT_BUFFER ){ \
614 yyensure_buffer_stack (); \
615 YY_CURRENT_BUFFER_LVALUE = \
616 yy_create_buffer( yyin, YY_BUF_SIZE ); \
617 } \
618 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
619 }
620 #define yy_set_bol(at_bol) \
621 { \
622 if ( ! YY_CURRENT_BUFFER ){\
623 yyensure_buffer_stack (); \
624 YY_CURRENT_BUFFER_LVALUE = \
625 yy_create_buffer( yyin, YY_BUF_SIZE ); \
626 } \
627 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
628 }
629 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
630
631 /* Begin user sect3 */
632
633 #define asm_wrap() (/*CONSTCOND*/1)
634 #define YY_SKIP_YYWRAP
635 typedef flex_uint8_t YY_CHAR;
636
637 FILE *yyin = NULL, *yyout = NULL;
638
639 typedef int yy_state_type;
640
641 extern int yylineno;
642 int yylineno = 1;
643
644 extern char *yytext;
645 #ifdef yytext_ptr
646 #undef yytext_ptr
647 #endif
648 #define yytext_ptr yytext
649
650 static yy_state_type yy_get_previous_state ( void );
651 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
652 static int yy_get_next_buffer ( void );
653 static void yynoreturn yy_fatal_error ( const char* msg );
654
655 /* Done after the current pattern has been matched and before the
656 * corresponding action - sets up yytext.
657 */
658 #define YY_DO_BEFORE_ACTION \
659 (yytext_ptr) = yy_bp; \
660 yyleng = (int) (yy_cp - yy_bp); \
661 (yy_hold_char) = *yy_cp; \
662 *yy_cp = '\0'; \
663 (yy_c_buf_p) = yy_cp;
664 #define YY_NUM_RULES 20
665 #define YY_END_OF_BUFFER 21
666 /* This struct is not used in this scanner,
667 but its presence is necessary. */
668 struct yy_trans_info
669 {
670 flex_int32_t yy_verify;
671 flex_int32_t yy_nxt;
672 };
673 static const flex_int16_t yy_accept[79] =
674 { 0,
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
676 0, 0, 0, 0, 0, 0, 21, 19, 18, 19,
677 6, 9, 19, 19, 19, 15, 16, 17, 19, 14,
678 4, 4, 4, 7, 19, 10, 19, 1, 0, 15,
679 15, 2, 5, 0, 15, 16, 0, 14, 0, 13,
680 13, 3, 8, 11, 0, 15, 13, 13, 13, 0,
681 15, 0, 13, 13, 0, 15, 13, 13, 13, 13,
682 12, 13, 12, 13, 13, 13, 13, 0
683 } ;
684
685 static const YY_CHAR yy_ec[256] =
686 { 0,
687 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
688 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
689 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
690 1, 2, 1, 4, 5, 1, 1, 1, 6, 1,
691 1, 7, 8, 1, 9, 10, 11, 12, 12, 12,
692 12, 12, 12, 12, 12, 12, 12, 1, 1, 1,
693 1, 1, 1, 1, 13, 13, 13, 13, 14, 13,
694 13, 13, 13, 13, 13, 15, 13, 13, 13, 13,
695 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
696 1, 16, 1, 1, 17, 1, 13, 13, 18, 19,
697
698 20, 13, 13, 13, 21, 13, 13, 22, 23, 24,
699 25, 26, 13, 27, 13, 28, 29, 13, 13, 30,
700 13, 13, 31, 1, 31, 1, 1, 13, 13, 13,
701 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
702 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
703 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
704 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
705 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
706 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
707 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
708
709 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
710 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
711 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
712 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
713 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
714 13, 13, 13, 13, 13
715 } ;
716
717 static const YY_CHAR yy_meta[32] =
718 { 0,
719 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
720 1, 3, 4, 4, 4, 1, 4, 4, 4, 4,
721 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
722 1
723 } ;
724
725 static const flex_int16_t yy_base[86] =
726 { 0,
727 0, 1, 17, 0, 46, 47, 48, 49, 52, 53,
728 54, 56, 68, 70, 0, 0, 151, 152, 152, 147,
729 152, 152, 0, 137, 0, 65, 0, 152, 4, 64,
730 152, 137, 144, 152, 143, 152, 142, 152, 132, 77,
731 76, 152, 152, 131, 152, 0, 76, 77, 80, 0,
732 70, 152, 152, 152, 91, 90, 0, 116, 123, 128,
733 127, 97, 113, 115, 124, 123, 107, 93, 80, 88,
734 0, 77, 78, 67, 63, 37, 33, 152, 110, 114,
735 116, 119, 123, 127, 129
736 } ;
737
738 static const flex_int16_t yy_def[86] =
739 { 0,
740 79, 79, 78, 3, 80, 80, 79, 79, 79, 79,
741 79, 79, 79, 79, 3, 3, 78, 78, 78, 78,
742 78, 78, 78, 78, 78, 78, 81, 78, 78, 82,
743 78, 78, 78, 78, 83, 78, 84, 78, 78, 78,
744 78, 78, 78, 78, 78, 81, 78, 82, 82, 85,
745 85, 78, 78, 78, 78, 78, 85, 85, 85, 78,
746 78, 78, 85, 85, 78, 78, 85, 85, 85, 85,
747 85, 85, 85, 85, 85, 85, 85, 0, 78, 78,
748 78, 78, 78, 78, 78
749 } ;
750
751 static const flex_int16_t yy_nxt[184] =
752 { 0,
753 78, 29, 19, 19, 30, 47, 42, 78, 48, 39,
754 43, 40, 78, 78, 78, 20, 20, 18, 18, 19,
755 21, 18, 22, 18, 18, 23, 24, 25, 26, 27,
756 27, 27, 20, 27, 27, 27, 27, 27, 27, 27,
757 27, 27, 27, 27, 27, 27, 27, 28, 19, 19,
758 19, 19, 32, 32, 19, 19, 19, 34, 19, 34,
759 71, 33, 33, 20, 20, 49, 77, 20, 20, 35,
760 19, 35, 19, 36, 44, 36, 40, 47, 49, 45,
761 48, 49, 76, 37, 51, 37, 44, 41, 40, 55,
762 75, 45, 58, 59, 74, 55, 73, 51, 60, 60,
763
764 51, 56, 61, 62, 65, 65, 72, 71, 66, 62,
765 18, 18, 18, 18, 31, 31, 31, 31, 46, 46,
766 50, 70, 50, 53, 53, 53, 53, 54, 54, 54,
767 54, 57, 57, 69, 66, 66, 68, 67, 61, 61,
768 64, 63, 56, 41, 38, 38, 38, 52, 41, 38,
769 78, 17, 78, 78, 78, 78, 78, 78, 78, 78,
770 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
771 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
772 78, 78, 78
773 } ;
774
775 static const flex_int16_t yy_chk[184] =
776 { 0,
777 0, 4, 1, 2, 4, 29, 25, 0, 29, 23,
778 25, 23, 0, 0, 0, 1, 2, 3, 3, 3,
779 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
780 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
781 3, 3, 3, 3, 3, 3, 3, 3, 5, 6,
782 7, 8, 5, 6, 9, 10, 11, 11, 12, 12,
783 77, 5, 6, 7, 8, 30, 76, 9, 10, 11,
784 13, 12, 14, 13, 26, 14, 26, 47, 48, 26,
785 47, 49, 75, 13, 30, 14, 40, 41, 40, 41,
786 74, 40, 51, 51, 73, 41, 72, 48, 55, 55,
787
788 49, 56, 55, 56, 62, 62, 70, 69, 62, 56,
789 79, 79, 79, 79, 80, 80, 80, 80, 81, 81,
790 82, 68, 82, 83, 83, 83, 83, 84, 84, 84,
791 84, 85, 85, 67, 66, 65, 64, 63, 61, 60,
792 59, 58, 44, 39, 37, 35, 33, 32, 24, 20,
793 17, 78, 78, 78, 78, 78, 78, 78, 78, 78,
794 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
795 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
796 78, 78, 78
797 } ;
798
799 static yy_state_type yy_last_accepting_state;
800 static char *yy_last_accepting_cpos;
801
802 extern int yy_flex_debug;
803 int yy_flex_debug = 0;
804
805 /* The intent behind this definition is that it'll catch
806 * any uses of REJECT which flex missed.
807 */
808 #define REJECT reject_used_but_not_detected
809 #define yymore() yymore_used_but_not_detected
810 #define YY_MORE_ADJ 0
811 #define YY_RESTORE_YY_MORE_OFFSET
812 char *yytext;
813 #line 1 "asm.l"
814
815 #line 51 "asm.l"
816 /* Definitions */
817
818 #line 818 "asm.c"
819
820 #define INITIAL 0
821 #define ASM 1
822 #define C_COMMENT 2
823 #define CPP_COMMENT 3
824 #define SHELL_COMMENT 4
825 #define STRING 5
826 #define LITERAL 6
827 #define PREPROCESSOR_LINE 7
828
829 #ifndef YY_NO_UNISTD_H
830 /* Special case for "unistd.h", since it is non-ANSI. We include it way
831 * down here because we want the user's section 1 to have been scanned first.
832 * The user has a chance to override it with an option.
833 */
834 #include <unistd.h>
835 #endif
836
837 #ifndef YY_EXTRA_TYPE
838 #define YY_EXTRA_TYPE void *
839 #endif
840
841 static int yy_init_globals ( void );
842
843 /* Accessor methods to globals.
844 These are made visible to non-reentrant scanners for convenience. */
845
846 int yylex_destroy ( void );
847
848 int yyget_debug ( void );
849
850 void yyset_debug ( int debug_flag );
851
852 YY_EXTRA_TYPE yyget_extra ( void );
853
854 void yyset_extra ( YY_EXTRA_TYPE user_defined );
855
856 FILE *yyget_in ( void );
857
858 void yyset_in ( FILE * _in_str );
859
860 FILE *yyget_out ( void );
861
862 void yyset_out ( FILE * _out_str );
863
864 int yyget_leng ( void );
865
866 char *yyget_text ( void );
867
868 int yyget_lineno ( void );
869
870 void yyset_lineno ( int _line_number );
871
872 /* Macros after this point can all be overridden by user definitions in
873 * section 1.
874 */
875
876 #ifndef YY_SKIP_YYWRAP
877 #ifdef __cplusplus
878 extern "C" int yywrap ( void );
879 #else
880 extern int yywrap ( void );
881 #endif
882 #endif
883
884 #ifndef YY_NO_UNPUT
885
886 static void yyunput ( int c, char *buf_ptr );
887
888 #endif
889
890 #ifndef yytext_ptr
891 static void yy_flex_strncpy ( char *, const char *, int );
892 #endif
893
894 #ifdef YY_NEED_STRLEN
895 static int yy_flex_strlen ( const char * );
896 #endif
897
898 #ifndef YY_NO_INPUT
899 #ifdef __cplusplus
900 static int yyinput ( void );
901 #else
902 static int input ( void );
903 #endif
904
905 #endif
906
907 static int yy_start_stack_ptr = 0;
908 static int yy_start_stack_depth = 0;
909 static int *yy_start_stack = NULL;
910
911 static void yy_push_state ( int _new_state );
912
913 static void yy_pop_state ( void );
914
915 /* Amount of stuff to slurp up with each read. */
916 #ifndef YY_READ_BUF_SIZE
917 #ifdef __ia64__
918 /* On IA-64, the buffer size is 16k, not 8k */
919 #define YY_READ_BUF_SIZE 16384
920 #else
921 #define YY_READ_BUF_SIZE 8192
922 #endif /* __ia64__ */
923 #endif
924
925 /* Copy whatever the last rule matched to the standard output. */
926 #ifndef ECHO
927 /* This used to be an fputs(), but since the string might contain NUL's,
928 * we now use fwrite().
929 */
930 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
931 #endif
932
933 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
934 * is returned in "result".
935 */
936 #ifndef YY_INPUT
937 #define YY_INPUT(buf,result,max_size) \
938 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
939 { \
940 int c = '*'; \
941 int n; \
942 for ( n = 0; n < max_size && \
943 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
944 buf[n] = (char) c; \
945 if ( c == '\n' ) \
946 buf[n++] = (char) c; \
947 if ( c == EOF && ferror( yyin ) ) \
948 YY_FATAL_ERROR( "input in flex scanner failed" ); \
949 result = n; \
950 } \
951 else \
952 { \
953 errno=0; \
954 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
955 { \
956 if( errno != EINTR) \
957 { \
958 YY_FATAL_ERROR( "input in flex scanner failed" ); \
959 break; \
960 } \
961 errno=0; \
962 clearerr(yyin); \
963 } \
964 }\
965 \
966
967 #endif
968
969 /* No semi-colon after return; correct usage is to write "yyterminate();" -
970 * we don't want an extra ';' after the "return" because that will cause
971 * some compilers to complain about unreachable statements.
972 */
973 #ifndef yyterminate
974 #define yyterminate() return YY_NULL
975 #endif
976
977 /* Number of entries by which start-condition stack grows. */
978 #ifndef YY_START_STACK_INCR
979 #define YY_START_STACK_INCR 25
980 #endif
981
982 /* Report a fatal error. */
983 #ifndef YY_FATAL_ERROR
984 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
985 #endif
986
987 /* end tables serialization structures and prototypes */
988
989 /* Default declaration of generated scanner - a define so the user can
990 * easily add parameters.
991 */
992 #ifndef YY_DECL
993 #define YY_DECL_IS_OURS 1
994
995 extern int yylex (void);
996
997 #define YY_DECL int yylex (void)
998 #endif /* !YY_DECL */
999
1000 /* Code executed at the beginning of each rule, after yytext and yyleng
1001 * have been set up.
1002 */
1003 #ifndef YY_USER_ACTION
1004 #define YY_USER_ACTION
1005 #endif
1006
1007 /* Code executed at the end of each rule. */
1008 #ifndef YY_BREAK
1009 #define YY_BREAK /*LINTED*/break;
1010 #endif
1011
1012 #define YY_RULE_SETUP \
1013 if ( yyleng > 0 ) \
1014 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1015 (yytext[yyleng - 1] == '\n'); \
1016 YY_USER_ACTION
1017
1018 /** The main scanner function which does all the work.
1019 */
1020 YY_DECL
1021 {
1022 yy_state_type yy_current_state;
1023 char *yy_cp, *yy_bp;
1024 int yy_act;
1025
1026 if ( !(yy_init) )
1027 {
1028 (yy_init) = 1;
1029
1030 #ifdef YY_USER_INIT
1031 YY_USER_INIT;
1032 #endif
1033
1034 if ( ! (yy_start) )
1035 (yy_start) = 1; /* first start state */
1036
1037 if ( ! yyin )
1038 yyin = stdin;
1039
1040 if ( ! yyout )
1041 yyout = stdout;
1042
1043 if ( ! YY_CURRENT_BUFFER ) {
1044 yyensure_buffer_stack ();
1045 YY_CURRENT_BUFFER_LVALUE =
1046 yy_create_buffer( yyin, YY_BUF_SIZE );
1047 }
1048
1049 yy_load_buffer_state( );
1050 }
1051
1052 {
1053 #line 64 "asm.l"
1054
1055 /* Backslash-newline */
1056 #line 1056 "asm.c"
1057
1058 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1059 {
1060 yy_cp = (yy_c_buf_p);
1061
1062 /* Support of yytext. */
1063 *yy_cp = (yy_hold_char);
1064
1065 /* yy_bp points to the position in yy_ch_buf of the start of
1066 * the current run.
1067 */
1068 yy_bp = yy_cp;
1069
1070 yy_current_state = (yy_start);
1071 yy_current_state += YY_AT_BOL();
1072 yy_match:
1073 do
1074 {
1075 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1076 if ( yy_accept[yy_current_state] )
1077 {
1078 (yy_last_accepting_state) = yy_current_state;
1079 (yy_last_accepting_cpos) = yy_cp;
1080 }
1081 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1082 {
1083 yy_current_state = (int) yy_def[yy_current_state];
1084 if ( yy_current_state >= 79 )
1085 yy_c = yy_meta[yy_c];
1086 }
1087 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1088 ++yy_cp;
1089 }
1090 while ( yy_current_state != 78 );
1091 yy_cp = (yy_last_accepting_cpos);
1092 yy_current_state = (yy_last_accepting_state);
1093
1094 yy_find_action:
1095 yy_act = yy_accept[yy_current_state];
1096
1097 YY_DO_BEFORE_ACTION;
1098
1099 do_action: /* This label is used only to access EOF actions. */
1100
1101 switch ( yy_act )
1102 { /* beginning of action switch */
1103 case 0: /* must back up */
1104 /* undo the effects of YY_DO_BEFORE_ACTION */
1105 *yy_cp = (yy_hold_char);
1106 yy_cp = (yy_last_accepting_cpos);
1107 yy_current_state = (yy_last_accepting_state);
1108 goto yy_find_action;
1109
1110 case 1:
1111 /* rule 1 can match eol */
1112 YY_RULE_SETUP
1113 #line 66 "asm.l"
1114 DEFAULT_BACKSLASH_NEWLINE_ACTION
1115 YY_BREAK
1116 /* Comment */
1117 case 2:
1118 YY_RULE_SETUP
1119 #line 69 "asm.l"
1120 { echos(comment_begin); ECHO; yy_push_state(C_COMMENT); }
1121 YY_BREAK
1122 case 3:
1123 YY_RULE_SETUP
1124 #line 70 "asm.l"
1125 { ECHO; echos(comment_end); yy_pop_state(); }
1126 YY_BREAK
1127 case 4:
1128 YY_RULE_SETUP
1129 #line 71 "asm.l"
1130 { put_char(LEXTEXT[0]); }
1131 YY_BREAK
1132 case YY_STATE_EOF(C_COMMENT):
1133 #line 72 "asm.l"
1134 {
1135 if (wflag)
1136 unexpected_eof(LINENO);
1137 yyterminate();
1138 }
1139 YY_BREAK
1140 case 5:
1141 YY_RULE_SETUP
1142 #line 77 "asm.l"
1143 { echos(comment_begin); ECHO; yy_push_state(CPP_COMMENT); }
1144 YY_BREAK
1145 /* String */
1146 case 6:
1147 YY_RULE_SETUP
1148 #line 80 "asm.l"
1149 { ECHO; yy_push_state(STRING); }
1150 YY_BREAK
1151 case 7:
1152 YY_RULE_SETUP
1153 #line 81 "asm.l"
1154 { ECHO; yy_pop_state(); }
1155 YY_BREAK
1156 case 8:
1157 YY_RULE_SETUP
1158 #line 82 "asm.l"
1159 { put_char(LEXTEXT[0]); put_char(LEXTEXT[1]); }
1160 YY_BREAK
1161 /* Literal */
1162 case 9:
1163 YY_RULE_SETUP
1164 #line 85 "asm.l"
1165 { ECHO; yy_push_state(LITERAL); }
1166 YY_BREAK
1167 case 10:
1168 YY_RULE_SETUP
1169 #line 86 "asm.l"
1170 { ECHO; yy_pop_state(); }
1171 YY_BREAK
1172 case 11:
1173 YY_RULE_SETUP
1174 #line 87 "asm.l"
1175 { put_char(LEXTEXT[0]); put_char(LEXTEXT[1]); }
1176 YY_BREAK
1177 /* Preprocessing directive */
1178 case 12:
1179 YY_RULE_SETUP
1180 #line 90 "asm.l"
1181 {
1182 int c;
1183
1184 put_macro(LEXTEXT);
1185 /*
1186 * #include| <aaa/bbb.h>|
1187 * ~~~~~~~~~~~~~~~~
1188 */
1189 while ((c = input()) && c != EOF && c != '\n' && isspace(c))
1190 echoc(c);
1191 if (c == EOF)
1192 c = '\n';
1193 if (c == '\n') {
1194 unput(c);
1195 } else if (c) {
1196 char path[MAXPATHLEN], *p = path, *lim = p + MAXPATHLEN - 1;
1197 int sep = 0;
1198
1199 if (c == '"')
1200 sep = c;
1201 else if (c == '<')
1202 sep = '>';
1203 put_char(c);
1204
1205 /* pick up path name */
1206 while ((c = input()) && c != EOF && c != '\n' && c != sep)
1207 if (p < lim)
1208 *p++ = c;
1209 *p = '\0';
1210 if (c == EOF)
1211 c = '\n';
1212 if (c == sep) {
1213 struct data *inc;
1214 const char *basename = locatestring(path, "/", MATCH_LAST);
1215
1216 if (basename)
1217 basename++;
1218 else
1219 basename = path;
1220 inc = get_inc(basename);
1221 if (inc)
1222 put_include_anchor(inc, path);
1223 else
1224 echos(path);
1225 put_char(sep);
1226 } else {
1227 echos(path);
1228 if (c)
1229 unput(c);
1230 }
1231 }
1232 }
1233 YY_BREAK
1234 case 13:
1235 YY_RULE_SETUP
1236 #line 142 "asm.l"
1237 {
1238 if ((last_directive = asm_reserved_sharp(LEXTEXT, LEXLENG)) != 0) {
1239 put_macro(LEXTEXT);
1240 yy_push_state(PREPROCESSOR_LINE);
1241 } else {
1242 /*
1243 * Don't warn about unknown directive.
1244 * '#' may be used as the start of a comment.
1245 */
1246 echos(comment_begin);
1247 ECHO;
1248 yy_push_state(SHELL_COMMENT);
1249 }
1250 }
1251 YY_BREAK
1252 /* Null directive */
1253 case 14:
1254 YY_RULE_SETUP
1255 #line 157 "asm.l"
1256 { put_macro(LEXTEXT); }
1257 YY_BREAK
1258 case 15:
1259 YY_RULE_SETUP
1260 #line 159 "asm.l"
1261 ECHO;
1262 YY_BREAK
1263 case 16:
1264 YY_RULE_SETUP
1265 #line 160 "asm.l"
1266 {
1267 if (YY_START == PREPROCESSOR_LINE
1268 && (last_directive == SHARP_IF || last_directive == SHARP_ELIF)
1269 && strcmp(LEXTEXT, "defined") == 0)
1270 put_reserved_word(LEXTEXT);
1271 else {
1272 struct anchor *a = anchor_get(LEXTEXT, LEXLENG, 0, LINENO);
1273 if (a) {
1274 put_anchor(gettag(a), a->type, LINENO);
1275 a->done = 1;
1276 } else if (grtags_is_empty) {
1277 put_anchor_force(LEXTEXT, LEXLENG, LINENO);
1278 } else {
1279 ECHO;
1280 }
1281 }
1282 }
1283 YY_BREAK
1284 case 17:
1285 YY_RULE_SETUP
1286 #line 177 "asm.l"
1287 { put_brace(LEXTEXT); }
1288 YY_BREAK
1289 /* New line */
1290 case 18:
1291 /* rule 18 can match eol */
1292 YY_RULE_SETUP
1293 #line 179 "asm.l"
1294 DEFAULT_END_OF_LINE_ACTION
1295 YY_BREAK
1296 case 19:
1297 YY_RULE_SETUP
1298 #line 180 "asm.l"
1299 { put_char(LEXTEXT[0]); }
1300 YY_BREAK
1301 case 20:
1302 YY_RULE_SETUP
1303 #line 182 "asm.l"
1304 ECHO;
1305 YY_BREAK
1306 #line 1306 "asm.c"
1307 case YY_STATE_EOF(INITIAL):
1308 case YY_STATE_EOF(ASM):
1309 case YY_STATE_EOF(CPP_COMMENT):
1310 case YY_STATE_EOF(SHELL_COMMENT):
1311 case YY_STATE_EOF(STRING):
1312 case YY_STATE_EOF(LITERAL):
1313 case YY_STATE_EOF(PREPROCESSOR_LINE):
1314 yyterminate();
1315
1316 case YY_END_OF_BUFFER:
1317 {
1318 /* Amount of text matched not including the EOB char. */
1319 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1320
1321 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1322 *yy_cp = (yy_hold_char);
1323 YY_RESTORE_YY_MORE_OFFSET
1324
1325 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1326 {
1327 /* We're scanning a new file or input source. It's
1328 * possible that this happened because the user
1329 * just pointed yyin at a new source and called
1330 * yylex(). If so, then we have to assure
1331 * consistency between YY_CURRENT_BUFFER and our
1332 * globals. Here is the right place to do so, because
1333 * this is the first action (other than possibly a
1334 * back-up) that will match for the new input source.
1335 */
1336 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1337 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1338 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1339 }
1340
1341 /* Note that here we test for yy_c_buf_p "<=" to the position
1342 * of the first EOB in the buffer, since yy_c_buf_p will
1343 * already have been incremented past the NUL character
1344 * (since all states make transitions on EOB to the
1345 * end-of-buffer state). Contrast this with the test
1346 * in input().
1347 */
1348 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1349 { /* This was really a NUL. */
1350 yy_state_type yy_next_state;
1351
1352 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1353
1354 yy_current_state = yy_get_previous_state( );
1355
1356 /* Okay, we're now positioned to make the NUL
1357 * transition. We couldn't have
1358 * yy_get_previous_state() go ahead and do it
1359 * for us because it doesn't know how to deal
1360 * with the possibility of jamming (and we don't
1361 * want to build jamming into it because then it
1362 * will run more slowly).
1363 */
1364
1365 yy_next_state = yy_try_NUL_trans( yy_current_state );
1366
1367 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1368
1369 if ( yy_next_state )
1370 {
1371 /* Consume the NUL. */
1372 yy_cp = ++(yy_c_buf_p);
1373 yy_current_state = yy_next_state;
1374 goto yy_match;
1375 }
1376
1377 else
1378 {
1379 yy_cp = (yy_last_accepting_cpos);
1380 yy_current_state = (yy_last_accepting_state);
1381 goto yy_find_action;
1382 }
1383 }
1384
1385 else switch ( yy_get_next_buffer( ) )
1386 {
1387 case EOB_ACT_END_OF_FILE:
1388 {
1389 (yy_did_buffer_switch_on_eof) = 0;
1390
1391 if ( yywrap( ) )
1392 {
1393 /* Note: because we've taken care in
1394 * yy_get_next_buffer() to have set up
1395 * yytext, we can now set up
1396 * yy_c_buf_p so that if some total
1397 * hoser (like flex itself) wants to
1398 * call the scanner after we return the
1399 * YY_NULL, it'll still work - another
1400 * YY_NULL will get returned.
1401 */
1402 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1403
1404 yy_act = YY_STATE_EOF(YY_START);
1405 goto do_action;
1406 }
1407
1408 else
1409 {
1410 if ( ! (yy_did_buffer_switch_on_eof) )
1411 YY_NEW_FILE;
1412 }
1413 break;
1414 }
1415
1416 case EOB_ACT_CONTINUE_SCAN:
1417 (yy_c_buf_p) =
1418 (yytext_ptr) + yy_amount_of_matched_text;
1419
1420 yy_current_state = yy_get_previous_state( );
1421
1422 yy_cp = (yy_c_buf_p);
1423 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1424 goto yy_match;
1425
1426 case EOB_ACT_LAST_MATCH:
1427 (yy_c_buf_p) =
1428 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1429
1430 yy_current_state = yy_get_previous_state( );
1431
1432 yy_cp = (yy_c_buf_p);
1433 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1434 goto yy_find_action;
1435 }
1436 break;
1437 }
1438
1439 default:
1440 YY_FATAL_ERROR(
1441 "fatal flex scanner internal error--no action found" );
1442 } /* end of action switch */
1443 } /* end of scanning one token */
1444 } /* end of user's declarations */
1445 } /* end of yylex */
1446
1447 /* yy_get_next_buffer - try to read in a new buffer
1448 *
1449 * Returns a code representing an action:
1450 * EOB_ACT_LAST_MATCH -
1451 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1452 * EOB_ACT_END_OF_FILE - end of file
1453 */
yy_get_next_buffer(void)1454 static int yy_get_next_buffer (void)
1455 {
1456 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1457 char *source = (yytext_ptr);
1458 int number_to_move, i;
1459 int ret_val;
1460
1461 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1462 YY_FATAL_ERROR(
1463 "fatal flex scanner internal error--end of buffer missed" );
1464
1465 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1466 { /* Don't try to fill the buffer, so this is an EOF. */
1467 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1468 {
1469 /* We matched a single character, the EOB, so
1470 * treat this as a final EOF.
1471 */
1472 return EOB_ACT_END_OF_FILE;
1473 }
1474
1475 else
1476 {
1477 /* We matched some text prior to the EOB, first
1478 * process it.
1479 */
1480 return EOB_ACT_LAST_MATCH;
1481 }
1482 }
1483
1484 /* Try to read more data. */
1485
1486 /* First move last chars to start of buffer. */
1487 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1488
1489 for ( i = 0; i < number_to_move; ++i )
1490 *(dest++) = *(source++);
1491
1492 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1493 /* don't do the read, it's not guaranteed to return an EOF,
1494 * just force an EOF
1495 */
1496 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1497
1498 else
1499 {
1500 int num_to_read =
1501 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1502
1503 while ( num_to_read <= 0 )
1504 { /* Not enough room in the buffer - grow it. */
1505
1506 /* just a shorter name for the current buffer */
1507 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1508
1509 int yy_c_buf_p_offset =
1510 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1511
1512 if ( b->yy_is_our_buffer )
1513 {
1514 int new_size = b->yy_buf_size * 2;
1515
1516 if ( new_size <= 0 )
1517 b->yy_buf_size += b->yy_buf_size / 8;
1518 else
1519 b->yy_buf_size *= 2;
1520
1521 b->yy_ch_buf = (char *)
1522 /* Include room in for 2 EOB chars. */
1523 yyrealloc( (void *) b->yy_ch_buf,
1524 (yy_size_t) (b->yy_buf_size + 2) );
1525 }
1526 else
1527 /* Can't grow it, we don't own it. */
1528 b->yy_ch_buf = NULL;
1529
1530 if ( ! b->yy_ch_buf )
1531 YY_FATAL_ERROR(
1532 "fatal error - scanner input buffer overflow" );
1533
1534 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1535
1536 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1537 number_to_move - 1;
1538
1539 }
1540
1541 if ( num_to_read > YY_READ_BUF_SIZE )
1542 num_to_read = YY_READ_BUF_SIZE;
1543
1544 /* Read in more data. */
1545 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1546 (yy_n_chars), num_to_read );
1547
1548 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1549 }
1550
1551 if ( (yy_n_chars) == 0 )
1552 {
1553 if ( number_to_move == YY_MORE_ADJ )
1554 {
1555 ret_val = EOB_ACT_END_OF_FILE;
1556 yyrestart( yyin );
1557 }
1558
1559 else
1560 {
1561 ret_val = EOB_ACT_LAST_MATCH;
1562 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1563 YY_BUFFER_EOF_PENDING;
1564 }
1565 }
1566
1567 else
1568 ret_val = EOB_ACT_CONTINUE_SCAN;
1569
1570 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1571 /* Extend the array by 50%, plus the number we really need. */
1572 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1573 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1574 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1575 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1576 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1577 /* "- 2" to take care of EOB's */
1578 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1579 }
1580
1581 (yy_n_chars) += number_to_move;
1582 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1583 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1584
1585 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1586
1587 return ret_val;
1588 }
1589
1590 /* yy_get_previous_state - get the state just before the EOB char was reached */
1591
yy_get_previous_state(void)1592 static yy_state_type yy_get_previous_state (void)
1593 {
1594 yy_state_type yy_current_state;
1595 char *yy_cp;
1596
1597 yy_current_state = (yy_start);
1598 yy_current_state += YY_AT_BOL();
1599
1600 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1601 {
1602 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1603 if ( yy_accept[yy_current_state] )
1604 {
1605 (yy_last_accepting_state) = yy_current_state;
1606 (yy_last_accepting_cpos) = yy_cp;
1607 }
1608 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1609 {
1610 yy_current_state = (int) yy_def[yy_current_state];
1611 if ( yy_current_state >= 79 )
1612 yy_c = yy_meta[yy_c];
1613 }
1614 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1615 }
1616
1617 return yy_current_state;
1618 }
1619
1620 /* yy_try_NUL_trans - try to make a transition on the NUL character
1621 *
1622 * synopsis
1623 * next_state = yy_try_NUL_trans( current_state );
1624 */
yy_try_NUL_trans(yy_state_type yy_current_state)1625 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1626 {
1627 int yy_is_jam;
1628 char *yy_cp = (yy_c_buf_p);
1629
1630 YY_CHAR yy_c = 1;
1631 if ( yy_accept[yy_current_state] )
1632 {
1633 (yy_last_accepting_state) = yy_current_state;
1634 (yy_last_accepting_cpos) = yy_cp;
1635 }
1636 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1637 {
1638 yy_current_state = (int) yy_def[yy_current_state];
1639 if ( yy_current_state >= 79 )
1640 yy_c = yy_meta[yy_c];
1641 }
1642 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1643 yy_is_jam = (yy_current_state == 78);
1644
1645 return yy_is_jam ? 0 : yy_current_state;
1646 }
1647
1648 #ifndef YY_NO_UNPUT
1649
yyunput(int c,char * yy_bp)1650 static void yyunput (int c, char * yy_bp )
1651 {
1652 char *yy_cp;
1653
1654 yy_cp = (yy_c_buf_p);
1655
1656 /* undo effects of setting up yytext */
1657 *yy_cp = (yy_hold_char);
1658
1659 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1660 { /* need to shift things up to make room */
1661 /* +2 for EOB chars. */
1662 int number_to_move = (yy_n_chars) + 2;
1663 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1664 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1665 char *source =
1666 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1667
1668 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1669 *--dest = *--source;
1670
1671 yy_cp += (int) (dest - source);
1672 yy_bp += (int) (dest - source);
1673 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1674 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1675
1676 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1677 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1678 }
1679
1680 *--yy_cp = (char) c;
1681
1682 (yytext_ptr) = yy_bp;
1683 (yy_hold_char) = *yy_cp;
1684 (yy_c_buf_p) = yy_cp;
1685 }
1686
1687 #endif
1688
1689 #ifndef YY_NO_INPUT
1690 #ifdef __cplusplus
yyinput(void)1691 static int yyinput (void)
1692 #else
1693 static int input (void)
1694 #endif
1695
1696 {
1697 int c;
1698
1699 *(yy_c_buf_p) = (yy_hold_char);
1700
1701 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1702 {
1703 /* yy_c_buf_p now points to the character we want to return.
1704 * If this occurs *before* the EOB characters, then it's a
1705 * valid NUL; if not, then we've hit the end of the buffer.
1706 */
1707 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1708 /* This was really a NUL. */
1709 *(yy_c_buf_p) = '\0';
1710
1711 else
1712 { /* need more input */
1713 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1714 ++(yy_c_buf_p);
1715
1716 switch ( yy_get_next_buffer( ) )
1717 {
1718 case EOB_ACT_LAST_MATCH:
1719 /* This happens because yy_g_n_b()
1720 * sees that we've accumulated a
1721 * token and flags that we need to
1722 * try matching the token before
1723 * proceeding. But for input(),
1724 * there's no matching to consider.
1725 * So convert the EOB_ACT_LAST_MATCH
1726 * to EOB_ACT_END_OF_FILE.
1727 */
1728
1729 /* Reset buffer status. */
1730 yyrestart( yyin );
1731
1732 /*FALLTHROUGH*/
1733
1734 case EOB_ACT_END_OF_FILE:
1735 {
1736 if ( yywrap( ) )
1737 return 0;
1738
1739 if ( ! (yy_did_buffer_switch_on_eof) )
1740 YY_NEW_FILE;
1741 #ifdef __cplusplus
1742 return yyinput();
1743 #else
1744 return input();
1745 #endif
1746 }
1747
1748 case EOB_ACT_CONTINUE_SCAN:
1749 (yy_c_buf_p) = (yytext_ptr) + offset;
1750 break;
1751 }
1752 }
1753 }
1754
1755 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1756 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1757 (yy_hold_char) = *++(yy_c_buf_p);
1758
1759 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1760
1761 return c;
1762 }
1763 #endif /* ifndef YY_NO_INPUT */
1764
1765 /** Immediately switch to a different input stream.
1766 * @param input_file A readable stream.
1767 *
1768 * @note This function does not reset the start condition to @c INITIAL .
1769 */
yyrestart(FILE * input_file)1770 void yyrestart (FILE * input_file )
1771 {
1772
1773 if ( ! YY_CURRENT_BUFFER ){
1774 yyensure_buffer_stack ();
1775 YY_CURRENT_BUFFER_LVALUE =
1776 yy_create_buffer( yyin, YY_BUF_SIZE );
1777 }
1778
1779 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1780 yy_load_buffer_state( );
1781 }
1782
1783 /** Switch to a different input buffer.
1784 * @param new_buffer The new input buffer.
1785 *
1786 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1787 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1788 {
1789
1790 /* TODO. We should be able to replace this entire function body
1791 * with
1792 * yypop_buffer_state();
1793 * yypush_buffer_state(new_buffer);
1794 */
1795 yyensure_buffer_stack ();
1796 if ( YY_CURRENT_BUFFER == new_buffer )
1797 return;
1798
1799 if ( YY_CURRENT_BUFFER )
1800 {
1801 /* Flush out information for old buffer. */
1802 *(yy_c_buf_p) = (yy_hold_char);
1803 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1804 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1805 }
1806
1807 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1808 yy_load_buffer_state( );
1809
1810 /* We don't actually know whether we did this switch during
1811 * EOF (yywrap()) processing, but the only time this flag
1812 * is looked at is after yywrap() is called, so it's safe
1813 * to go ahead and always set it.
1814 */
1815 (yy_did_buffer_switch_on_eof) = 1;
1816 }
1817
yy_load_buffer_state(void)1818 static void yy_load_buffer_state (void)
1819 {
1820 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1821 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1822 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1823 (yy_hold_char) = *(yy_c_buf_p);
1824 }
1825
1826 /** Allocate and initialize an input buffer state.
1827 * @param file A readable stream.
1828 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1829 *
1830 * @return the allocated buffer state.
1831 */
yy_create_buffer(FILE * file,int size)1832 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1833 {
1834 YY_BUFFER_STATE b;
1835
1836 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1837 if ( ! b )
1838 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1839
1840 b->yy_buf_size = size;
1841
1842 /* yy_ch_buf has to be 2 characters longer than the size given because
1843 * we need to put in 2 end-of-buffer characters.
1844 */
1845 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1846 if ( ! b->yy_ch_buf )
1847 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1848
1849 b->yy_is_our_buffer = 1;
1850
1851 yy_init_buffer( b, file );
1852
1853 return b;
1854 }
1855
1856 /** Destroy the buffer.
1857 * @param b a buffer created with yy_create_buffer()
1858 *
1859 */
yy_delete_buffer(YY_BUFFER_STATE b)1860 void yy_delete_buffer (YY_BUFFER_STATE b )
1861 {
1862
1863 if ( ! b )
1864 return;
1865
1866 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1867 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1868
1869 if ( b->yy_is_our_buffer )
1870 yyfree( (void *) b->yy_ch_buf );
1871
1872 yyfree( (void *) b );
1873 }
1874
1875 /* Initializes or reinitializes a buffer.
1876 * This function is sometimes called more than once on the same buffer,
1877 * such as during a yyrestart() or at EOF.
1878 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1879 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1880
1881 {
1882 int oerrno = errno;
1883
1884 yy_flush_buffer( b );
1885
1886 b->yy_input_file = file;
1887 b->yy_fill_buffer = 1;
1888
1889 /* If b is the current buffer, then yy_init_buffer was _probably_
1890 * called from yyrestart() or through yy_get_next_buffer.
1891 * In that case, we don't want to reset the lineno or column.
1892 */
1893 if (b != YY_CURRENT_BUFFER){
1894 b->yy_bs_lineno = 1;
1895 b->yy_bs_column = 0;
1896 }
1897
1898 b->yy_is_interactive = 0;
1899
1900 errno = oerrno;
1901 }
1902
1903 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1904 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1905 *
1906 */
yy_flush_buffer(YY_BUFFER_STATE b)1907 void yy_flush_buffer (YY_BUFFER_STATE b )
1908 {
1909 if ( ! b )
1910 return;
1911
1912 b->yy_n_chars = 0;
1913
1914 /* We always need two end-of-buffer characters. The first causes
1915 * a transition to the end-of-buffer state. The second causes
1916 * a jam in that state.
1917 */
1918 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1919 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1920
1921 b->yy_buf_pos = &b->yy_ch_buf[0];
1922
1923 b->yy_at_bol = 1;
1924 b->yy_buffer_status = YY_BUFFER_NEW;
1925
1926 if ( b == YY_CURRENT_BUFFER )
1927 yy_load_buffer_state( );
1928 }
1929
1930 /** Pushes the new state onto the stack. The new state becomes
1931 * the current state. This function will allocate the stack
1932 * if necessary.
1933 * @param new_buffer The new state.
1934 *
1935 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)1936 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1937 {
1938 if (new_buffer == NULL)
1939 return;
1940
1941 yyensure_buffer_stack();
1942
1943 /* This block is copied from yy_switch_to_buffer. */
1944 if ( YY_CURRENT_BUFFER )
1945 {
1946 /* Flush out information for old buffer. */
1947 *(yy_c_buf_p) = (yy_hold_char);
1948 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1949 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1950 }
1951
1952 /* Only push if top exists. Otherwise, replace top. */
1953 if (YY_CURRENT_BUFFER)
1954 (yy_buffer_stack_top)++;
1955 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1956
1957 /* copied from yy_switch_to_buffer. */
1958 yy_load_buffer_state( );
1959 (yy_did_buffer_switch_on_eof) = 1;
1960 }
1961
1962 /** Removes and deletes the top of the stack, if present.
1963 * The next element becomes the new top.
1964 *
1965 */
yypop_buffer_state(void)1966 void yypop_buffer_state (void)
1967 {
1968 if (!YY_CURRENT_BUFFER)
1969 return;
1970
1971 yy_delete_buffer(YY_CURRENT_BUFFER );
1972 YY_CURRENT_BUFFER_LVALUE = NULL;
1973 if ((yy_buffer_stack_top) > 0)
1974 --(yy_buffer_stack_top);
1975
1976 if (YY_CURRENT_BUFFER) {
1977 yy_load_buffer_state( );
1978 (yy_did_buffer_switch_on_eof) = 1;
1979 }
1980 }
1981
1982 /* Allocates the stack if it does not exist.
1983 * Guarantees space for at least one push.
1984 */
yyensure_buffer_stack(void)1985 static void yyensure_buffer_stack (void)
1986 {
1987 yy_size_t num_to_alloc;
1988
1989 if (!(yy_buffer_stack)) {
1990
1991 /* First allocation is just for 2 elements, since we don't know if this
1992 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1993 * immediate realloc on the next call.
1994 */
1995 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1996 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1997 (num_to_alloc * sizeof(struct yy_buffer_state*)
1998 );
1999 if ( ! (yy_buffer_stack) )
2000 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2001
2002 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2003
2004 (yy_buffer_stack_max) = num_to_alloc;
2005 (yy_buffer_stack_top) = 0;
2006 return;
2007 }
2008
2009 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2010
2011 /* Increase the buffer to prepare for a possible push. */
2012 yy_size_t grow_size = 8 /* arbitrary grow size */;
2013
2014 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2015 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2016 ((yy_buffer_stack),
2017 num_to_alloc * sizeof(struct yy_buffer_state*)
2018 );
2019 if ( ! (yy_buffer_stack) )
2020 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2021
2022 /* zero only the new slots.*/
2023 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2024 (yy_buffer_stack_max) = num_to_alloc;
2025 }
2026 }
2027
2028 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2029 * @param base the character buffer
2030 * @param size the size in bytes of the character buffer
2031 *
2032 * @return the newly allocated buffer state object.
2033 */
yy_scan_buffer(char * base,yy_size_t size)2034 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2035 {
2036 YY_BUFFER_STATE b;
2037
2038 if ( size < 2 ||
2039 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2040 base[size-1] != YY_END_OF_BUFFER_CHAR )
2041 /* They forgot to leave room for the EOB's. */
2042 return NULL;
2043
2044 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2045 if ( ! b )
2046 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2047
2048 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2049 b->yy_buf_pos = b->yy_ch_buf = base;
2050 b->yy_is_our_buffer = 0;
2051 b->yy_input_file = NULL;
2052 b->yy_n_chars = b->yy_buf_size;
2053 b->yy_is_interactive = 0;
2054 b->yy_at_bol = 1;
2055 b->yy_fill_buffer = 0;
2056 b->yy_buffer_status = YY_BUFFER_NEW;
2057
2058 yy_switch_to_buffer( b );
2059
2060 return b;
2061 }
2062
2063 /** Setup the input buffer state to scan a string. The next call to yylex() will
2064 * scan from a @e copy of @a str.
2065 * @param yystr a NUL-terminated string to scan
2066 *
2067 * @return the newly allocated buffer state object.
2068 * @note If you want to scan bytes that may contain NUL values, then use
2069 * yy_scan_bytes() instead.
2070 */
yy_scan_string(const char * yystr)2071 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2072 {
2073
2074 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2075 }
2076
2077 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2078 * scan from a @e copy of @a bytes.
2079 * @param yybytes the byte buffer to scan
2080 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2081 *
2082 * @return the newly allocated buffer state object.
2083 */
yy_scan_bytes(const char * yybytes,int _yybytes_len)2084 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2085 {
2086 YY_BUFFER_STATE b;
2087 char *buf;
2088 yy_size_t n;
2089 int i;
2090
2091 /* Get memory for full buffer, including space for trailing EOB's. */
2092 n = (yy_size_t) (_yybytes_len + 2);
2093 buf = (char *) yyalloc( n );
2094 if ( ! buf )
2095 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2096
2097 for ( i = 0; i < _yybytes_len; ++i )
2098 buf[i] = yybytes[i];
2099
2100 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2101
2102 b = yy_scan_buffer( buf, n );
2103 if ( ! b )
2104 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2105
2106 /* It's okay to grow etc. this buffer, and we should throw it
2107 * away when we're done.
2108 */
2109 b->yy_is_our_buffer = 1;
2110
2111 return b;
2112 }
2113
yy_push_state(int _new_state)2114 static void yy_push_state (int _new_state )
2115 {
2116 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2117 {
2118 yy_size_t new_size;
2119
2120 (yy_start_stack_depth) += YY_START_STACK_INCR;
2121 new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int );
2122
2123 if ( ! (yy_start_stack) )
2124 (yy_start_stack) = (int *) yyalloc( new_size );
2125
2126 else
2127 (yy_start_stack) = (int *) yyrealloc(
2128 (void *) (yy_start_stack), new_size );
2129
2130 if ( ! (yy_start_stack) )
2131 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2132 }
2133
2134 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
2135
2136 BEGIN(_new_state);
2137 }
2138
yy_pop_state(void)2139 static void yy_pop_state (void)
2140 {
2141 if ( --(yy_start_stack_ptr) < 0 )
2142 YY_FATAL_ERROR( "start-condition stack underflow" );
2143
2144 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2145 }
2146
2147 #ifndef YY_EXIT_FAILURE
2148 #define YY_EXIT_FAILURE 2
2149 #endif
2150
yy_fatal_error(const char * msg)2151 static void yynoreturn yy_fatal_error (const char* msg )
2152 {
2153 fprintf( stderr, "%s\n", msg );
2154 exit( YY_EXIT_FAILURE );
2155 }
2156
2157 /* Redefine yyless() so it works in section 3 code. */
2158
2159 #undef yyless
2160 #define yyless(n) \
2161 do \
2162 { \
2163 /* Undo effects of setting up yytext. */ \
2164 int yyless_macro_arg = (n); \
2165 YY_LESS_LINENO(yyless_macro_arg);\
2166 yytext[yyleng] = (yy_hold_char); \
2167 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2168 (yy_hold_char) = *(yy_c_buf_p); \
2169 *(yy_c_buf_p) = '\0'; \
2170 yyleng = yyless_macro_arg; \
2171 } \
2172 while ( 0 )
2173
2174 /* Accessor methods (get/set functions) to struct members. */
2175
2176 /** Get the current line number.
2177 *
2178 */
yyget_lineno(void)2179 int yyget_lineno (void)
2180 {
2181
2182 return yylineno;
2183 }
2184
2185 /** Get the input stream.
2186 *
2187 */
yyget_in(void)2188 FILE *yyget_in (void)
2189 {
2190 return yyin;
2191 }
2192
2193 /** Get the output stream.
2194 *
2195 */
yyget_out(void)2196 FILE *yyget_out (void)
2197 {
2198 return yyout;
2199 }
2200
2201 /** Get the length of the current token.
2202 *
2203 */
yyget_leng(void)2204 int yyget_leng (void)
2205 {
2206 return yyleng;
2207 }
2208
2209 /** Get the current token.
2210 *
2211 */
2212
yyget_text(void)2213 char *yyget_text (void)
2214 {
2215 return yytext;
2216 }
2217
2218 /** Set the current line number.
2219 * @param _line_number line number
2220 *
2221 */
yyset_lineno(int _line_number)2222 void yyset_lineno (int _line_number )
2223 {
2224
2225 yylineno = _line_number;
2226 }
2227
2228 /** Set the input stream. This does not discard the current
2229 * input buffer.
2230 * @param _in_str A readable stream.
2231 *
2232 * @see yy_switch_to_buffer
2233 */
yyset_in(FILE * _in_str)2234 void yyset_in (FILE * _in_str )
2235 {
2236 yyin = _in_str ;
2237 }
2238
yyset_out(FILE * _out_str)2239 void yyset_out (FILE * _out_str )
2240 {
2241 yyout = _out_str ;
2242 }
2243
yyget_debug(void)2244 int yyget_debug (void)
2245 {
2246 return yy_flex_debug;
2247 }
2248
yyset_debug(int _bdebug)2249 void yyset_debug (int _bdebug )
2250 {
2251 yy_flex_debug = _bdebug ;
2252 }
2253
yy_init_globals(void)2254 static int yy_init_globals (void)
2255 {
2256 /* Initialization is the same as for the non-reentrant scanner.
2257 * This function is called from yylex_destroy(), so don't allocate here.
2258 */
2259
2260 (yy_buffer_stack) = NULL;
2261 (yy_buffer_stack_top) = 0;
2262 (yy_buffer_stack_max) = 0;
2263 (yy_c_buf_p) = NULL;
2264 (yy_init) = 0;
2265 (yy_start) = 0;
2266
2267 (yy_start_stack_ptr) = 0;
2268 (yy_start_stack_depth) = 0;
2269 (yy_start_stack) = NULL;
2270
2271 /* Defined in main.c */
2272 #ifdef YY_STDINIT
2273 yyin = stdin;
2274 yyout = stdout;
2275 #else
2276 yyin = NULL;
2277 yyout = NULL;
2278 #endif
2279
2280 /* For future reference: Set errno on error, since we are called by
2281 * yylex_init()
2282 */
2283 return 0;
2284 }
2285
2286 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)2287 int yylex_destroy (void)
2288 {
2289
2290 /* Pop the buffer stack, destroying each element. */
2291 while(YY_CURRENT_BUFFER){
2292 yy_delete_buffer( YY_CURRENT_BUFFER );
2293 YY_CURRENT_BUFFER_LVALUE = NULL;
2294 yypop_buffer_state();
2295 }
2296
2297 /* Destroy the stack itself. */
2298 yyfree((yy_buffer_stack) );
2299 (yy_buffer_stack) = NULL;
2300
2301 /* Destroy the start condition stack. */
2302 yyfree( (yy_start_stack) );
2303 (yy_start_stack) = NULL;
2304
2305 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2306 * yylex() is called, initialization will occur. */
2307 yy_init_globals( );
2308
2309 return 0;
2310 }
2311
2312 /*
2313 * Internal utility routines.
2314 */
2315
2316 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n)2317 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2318 {
2319
2320 int i;
2321 for ( i = 0; i < n; ++i )
2322 s1[i] = s2[i];
2323 }
2324 #endif
2325
2326 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s)2327 static int yy_flex_strlen (const char * s )
2328 {
2329 int n;
2330 for ( n = 0; s[n]; ++n )
2331 ;
2332
2333 return n;
2334 }
2335 #endif
2336
yyalloc(yy_size_t size)2337 void *yyalloc (yy_size_t size )
2338 {
2339 return malloc(size);
2340 }
2341
yyrealloc(void * ptr,yy_size_t size)2342 void *yyrealloc (void * ptr, yy_size_t size )
2343 {
2344
2345 /* The cast to (char *) in the following accommodates both
2346 * implementations that use char* generic pointers, and those
2347 * that use void* generic pointers. It works with the latter
2348 * because both ANSI C and C++ allow castless assignment from
2349 * any pointer type to void*, and deal with argument conversions
2350 * as though doing an assignment.
2351 */
2352 return realloc(ptr, size);
2353 }
2354
yyfree(void * ptr)2355 void yyfree (void * ptr )
2356 {
2357 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2358 }
2359
2360 #define YYTABLES_NAME "yytables"
2361
2362 #line 182 "asm.l"
2363
2364 void
asm_parser_init(FILE * ip)2365 asm_parser_init(FILE *ip)
2366 {
2367 newline_terminate_string = 1;
2368 DEFAULT_BEGIN_OF_FILE_ACTION
2369 BEGIN ASM;
2370 }
2371
2372