1
#line 2 "autotools_lex.cpp"
3
#line 4 "autotools_lex.cpp"
5
#define YY_INT_ALIGNED short int
7
/* A lexical scanner generated by flex */
10
#define YY_FLEX_MAJOR_VERSION 2
11
#define YY_FLEX_MINOR_VERSION 5
12
#define YY_FLEX_SUBMINOR_VERSION 31
13
#if YY_FLEX_SUBMINOR_VERSION > 0
17
/* First, we deal with platform-specific or compiler-specific issues. */
19
/* begin standard C headers. */
25
/* end standard C headers. */
27
/* flex integer type definitions */
32
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
36
typedef int8_t flex_int8_t;
37
typedef uint8_t flex_uint8_t;
38
typedef int16_t flex_int16_t;
39
typedef uint16_t flex_uint16_t;
40
typedef int32_t flex_int32_t;
41
typedef uint32_t flex_uint32_t;
43
typedef signed char flex_int8_t;
44
typedef short int flex_int16_t;
45
typedef int flex_int32_t;
46
typedef unsigned char flex_uint8_t;
47
typedef unsigned short int flex_uint16_t;
48
typedef unsigned int flex_uint32_t;
51
/* Limits of integral types. */
53
#define INT8_MIN (-128)
56
#define INT16_MIN (-32767-1)
59
#define INT32_MIN (-2147483647-1)
62
#define INT8_MAX (127)
65
#define INT16_MAX (32767)
68
#define INT32_MAX (2147483647)
71
#define UINT8_MAX (255U)
74
#define UINT16_MAX (65535U)
77
#define UINT32_MAX (4294967295U)
80
#endif /* ! FLEXINT_H */
84
/* The "const" storage-class-modifier is valid. */
87
#else /* ! __cplusplus */
94
#endif /* ! __cplusplus */
102
/* Returned upon end-of-file. */
105
/* Promotes a possibly negative, possibly signed char to an unsigned
106
* integer for use as an array index. If the signed char is negative,
107
* we want to instead treat it as an 8-bit unsigned char, hence the
110
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
112
/* Enter a start condition. This macro really ought to take a parameter,
113
* but we do it the disgusting crufty way forced on us by the ()-less
114
* definition of BEGIN.
116
#define BEGIN (yy_start) = 1 + 2 *
118
/* Translate the current start state into a value that can be later handed
119
* to BEGIN to return to the state. The YYSTATE alias is for lex
122
#define YY_START (((yy_start) - 1) / 2)
123
#define YYSTATE YY_START
125
/* Action number for EOF rule of a given start state. */
126
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
128
/* Special action meaning "start processing a new file". */
129
#define YY_NEW_FILE yyrestart(yyin )
131
#define YY_END_OF_BUFFER_CHAR 0
133
/* Size of default input buffer. */
135
#define YY_BUF_SIZE 16384
138
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
139
#define YY_TYPEDEF_YY_BUFFER_STATE
140
typedef struct yy_buffer_state *YY_BUFFER_STATE;
145
extern FILE *yyin, *yyout;
147
#define EOB_ACT_CONTINUE_SCAN 0
148
#define EOB_ACT_END_OF_FILE 1
149
#define EOB_ACT_LAST_MATCH 2
151
#define YY_LESS_LINENO(n)
153
/* Return all but the first "n" matched characters back to the input stream. */
157
/* Undo effects of setting up yytext. */ \
158
int yyless_macro_arg = (n); \
159
YY_LESS_LINENO(yyless_macro_arg);\
160
*yy_cp = (yy_hold_char); \
161
YY_RESTORE_YY_MORE_OFFSET \
162
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
163
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
167
#define unput(c) yyunput( c, (yytext_ptr) )
169
/* The following is because we cannot portably get our hands on size_t
170
* (without autoconf's help, which isn't available because we want
171
* flex-generated scanners to compile on their own).
174
#ifndef YY_TYPEDEF_YY_SIZE_T
175
#define YY_TYPEDEF_YY_SIZE_T
176
typedef unsigned int yy_size_t;
179
#ifndef YY_STRUCT_YY_BUFFER_STATE
180
#define YY_STRUCT_YY_BUFFER_STATE
181
struct yy_buffer_state
185
char *yy_ch_buf; /* input buffer */
186
char *yy_buf_pos; /* current position in input buffer */
188
/* Size of input buffer in bytes, not including room for EOB
191
yy_size_t yy_buf_size;
193
/* Number of characters read into yy_ch_buf, not including EOB
198
/* Whether we "own" the buffer - i.e., we know we created it,
199
* and can realloc() it to grow it, and should free() it to
202
int yy_is_our_buffer;
204
/* Whether this is an "interactive" input source; if so, and
205
* if we're using stdio for input, then we want to use getc()
206
* instead of fread(), to make sure we stop fetching input after
209
int yy_is_interactive;
211
/* Whether we're considered to be at the beginning of a line.
212
* If so, '^' rules will be active on the next match, otherwise
217
int yy_bs_lineno; /**< The line count. */
218
int yy_bs_column; /**< The column count. */
220
/* Whether to try to fill the input buffer when we reach the
225
int yy_buffer_status;
227
#define YY_BUFFER_NEW 0
228
#define YY_BUFFER_NORMAL 1
229
/* When an EOF's been seen but there's still some text to process
230
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
231
* shouldn't try reading from the input source any more. We might
232
* still have a bunch of tokens to match, though, because of
233
* possible backing-up.
235
* When we actually see the EOF, we change the status to "new"
236
* (via yyrestart()), so that the user can continue scanning by
237
* just pointing yyin at a new input file.
239
#define YY_BUFFER_EOF_PENDING 2
242
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
244
/* Stack of input buffers. */
245
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
246
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
247
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
249
/* We provide macros for accessing buffer states in case in the
250
* future we want to put the buffer states in a more general
253
* Returns the top of the stack, or NULL.
255
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
256
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
259
/* Same as previous macro, but useful when we know that the buffer stack is not
260
* NULL or when we need an lvalue. For internal use only.
262
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
264
/* yy_hold_char holds the character lost when yytext is formed. */
265
static char yy_hold_char;
266
static int yy_n_chars; /* number of characters read into yy_ch_buf */
269
/* Points to current character in buffer. */
270
static char *yy_c_buf_p = (char *) 0;
271
static int yy_init = 1; /* whether we need to initialize */
272
static int yy_start = 0; /* start state number */
274
/* Flag which is used to allow yywrap()'s to do buffer switches
275
* instead of setting up a fresh yyin. A bit of a hack ...
277
static int yy_did_buffer_switch_on_eof;
279
void yyrestart (FILE *input_file );
280
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
281
YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
282
void yy_delete_buffer (YY_BUFFER_STATE b );
283
void yy_flush_buffer (YY_BUFFER_STATE b );
284
void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
285
void yypop_buffer_state (void );
287
static void yyensure_buffer_stack (void );
288
static void yy_load_buffer_state (void );
289
static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
291
#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
293
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
294
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
295
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
297
void *yyalloc (yy_size_t );
298
void *yyrealloc (void *,yy_size_t );
299
void yyfree (void * );
301
#define yy_new_buffer yy_create_buffer
303
#define yy_set_interactive(is_interactive) \
305
if ( ! YY_CURRENT_BUFFER ){ \
306
yyensure_buffer_stack (); \
307
YY_CURRENT_BUFFER_LVALUE = \
308
yy_create_buffer(yyin,YY_BUF_SIZE ); \
310
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
313
#define yy_set_bol(at_bol) \
315
if ( ! YY_CURRENT_BUFFER ){\
316
yyensure_buffer_stack (); \
317
YY_CURRENT_BUFFER_LVALUE = \
318
yy_create_buffer(yyin,YY_BUF_SIZE ); \
320
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
323
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
325
/* Begin user sect3 */
328
#define YY_SKIP_YYWRAP
330
typedef unsigned char YY_CHAR;
332
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
334
typedef int yy_state_type;
341
#define yytext_ptr yytext
343
static yy_state_type yy_get_previous_state (void );
344
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
345
static int yy_get_next_buffer (void );
346
static void yy_fatal_error (yyconst char msg[] );
348
/* Done after the current pattern has been matched and before the
349
* corresponding action - sets up yytext.
351
#define YY_DO_BEFORE_ACTION \
352
(yytext_ptr) = yy_bp; \
353
yyleng = (size_t) (yy_cp - yy_bp); \
354
(yy_hold_char) = *yy_cp; \
356
(yy_c_buf_p) = yy_cp;
358
#define YY_NUM_RULES 17
359
#define YY_END_OF_BUFFER 18
360
/* This struct is not used in this scanner,
361
but its presence is necessary. */
364
flex_int32_t yy_verify;
367
static yyconst flex_int16_t yy_accept[64] =
369
0, 0, 8, 8, 0, 0, 0, 0, 18, 17,
370
1, 15, 1, 4, 16, 17, 14, 10, 17, 4,
371
4, 12, 13, 8, 1, 8, 6, 17, 9, 5,
372
1, 1, 1, 4, 4, 16, 11, 0, 2, 4,
373
4, 3, 4, 8, 6, 1, 8, 8, 7, 6,
374
6, 0, 9, 4, 4, 4, 6, 6, 4, 4,
378
static yyconst flex_int32_t yy_ec[256] =
380
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
381
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383
1, 4, 5, 1, 6, 7, 1, 1, 1, 8,
384
9, 10, 11, 1, 12, 13, 14, 15, 15, 15,
385
15, 15, 15, 15, 15, 15, 15, 16, 1, 1,
386
17, 1, 1, 18, 19, 19, 19, 19, 19, 19,
387
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
388
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
389
1, 20, 1, 1, 21, 1, 19, 19, 22, 23,
391
24, 25, 19, 19, 26, 19, 19, 27, 19, 28,
392
19, 19, 19, 19, 29, 19, 30, 19, 19, 19,
393
19, 19, 31, 32, 33, 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
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
402
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410
static yyconst flex_int32_t yy_meta[34] =
412
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
413
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418
static yyconst flex_int16_t yy_base[72] =
420
0, 0, 32, 51, 34, 36, 0, 0, 155, 156,
421
38, 156, 42, 67, 0, 137, 156, 156, 45, 23,
422
31, 156, 156, 133, 63, 38, 98, 134, 133, 0,
423
58, 59, 62, 0, 0, 0, 156, 101, 156, 112,
424
117, 0, 117, 118, 104, 105, 65, 67, 156, 110,
425
113, 127, 126, 110, 106, 104, 117, 124, 104, 93,
426
99, 96, 156, 144, 146, 148, 109, 97, 83, 150,
430
static yyconst flex_int16_t yy_def[72] =
432
63, 1, 64, 64, 65, 65, 66, 66, 63, 63,
433
67, 63, 63, 63, 68, 63, 63, 63, 63, 14,
434
14, 63, 63, 69, 69, 70, 69, 71, 71, 67,
435
67, 67, 63, 14, 14, 68, 63, 63, 63, 14,
436
14, 14, 14, 69, 69, 69, 70, 70, 63, 70,
437
69, 71, 71, 14, 14, 14, 69, 70, 14, 14,
438
14, 14, 0, 63, 63, 63, 63, 63, 63, 63,
442
static yyconst flex_int16_t yy_nxt[190] =
444
10, 11, 12, 13, 14, 15, 14, 10, 10, 14,
445
16, 14, 10, 10, 14, 17, 18, 14, 14, 19,
446
14, 14, 14, 20, 14, 21, 14, 14, 14, 14,
447
22, 10, 23, 25, 12, 25, 10, 26, 10, 31,
448
49, 32, 29, 33, 29, 33, 38, 39, 38, 40,
449
41, 27, 25, 12, 25, 42, 26, 50, 43, 31,
450
32, 32, 32, 33, 46, 33, 46, 49, 47, 49,
451
27, 34, 52, 34, 34, 34, 34, 34, 35, 34,
452
34, 34, 45, 44, 50, 34, 50, 34, 34, 34,
453
34, 34, 34, 34, 34, 34, 34, 36, 34, 51,
455
39, 51, 38, 39, 38, 57, 46, 57, 46, 30,
456
47, 58, 49, 58, 51, 39, 51, 45, 57, 42,
457
57, 62, 61, 45, 45, 58, 49, 58, 42, 50,
458
60, 59, 45, 42, 53, 53, 45, 45, 56, 55,
459
54, 53, 53, 50, 24, 24, 28, 28, 10, 10,
460
48, 48, 45, 37, 63, 9, 63, 63, 63, 63,
461
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
462
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
463
63, 63, 63, 63, 63, 63, 63, 63, 63
466
static yyconst flex_int16_t yy_chk[190] =
468
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471
1, 1, 1, 3, 3, 3, 5, 3, 6, 11,
472
26, 11, 5, 13, 6, 13, 19, 19, 19, 20,
473
20, 3, 4, 4, 4, 21, 4, 26, 21, 31,
474
32, 31, 32, 33, 25, 33, 25, 47, 25, 48,
475
4, 14, 71, 14, 14, 14, 14, 14, 14, 14,
476
14, 14, 25, 69, 47, 14, 48, 14, 14, 14,
477
14, 14, 14, 14, 14, 14, 14, 68, 14, 27,
479
27, 27, 38, 38, 38, 45, 46, 45, 46, 67,
480
46, 50, 50, 50, 51, 51, 51, 27, 57, 62,
481
57, 61, 60, 45, 46, 58, 58, 58, 59, 50,
482
56, 55, 51, 54, 53, 52, 57, 44, 43, 41,
483
40, 29, 28, 58, 64, 64, 65, 65, 66, 66,
484
70, 70, 24, 16, 9, 63, 63, 63, 63, 63,
485
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
486
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
487
63, 63, 63, 63, 63, 63, 63, 63, 63
490
static yy_state_type yy_last_accepting_state;
491
static char *yy_last_accepting_cpos;
493
extern int yy_flex_debug;
494
int yy_flex_debug = 0;
496
/* The intent behind this definition is that it'll catch
497
* any uses of REJECT which flex missed.
499
#define REJECT reject_used_but_not_detected
500
#define yymore() yymore_used_but_not_detected
501
#define YY_MORE_ADJ 0
502
#define YY_RESTORE_YY_MORE_OFFSET
504
#line 1 "autotools.ll"
505
#line 2 "autotools.ll"
506
/***************************************************************************
507
* Copyright (C) 2005 by Alexander Dymo *
508
* adymo@kdevelop.org *
510
* Copyright (c) 2005 by Matt Rogers *
513
* This program is free software; you can redistribute it and/or modify *
514
* it under the terms of the GNU Library General Public License as *
515
* published by the Free Software Foundation; either version 2 of the *
516
* License, or (at your option) any later version. *
518
* This program is distributed in the hope that it will be useful, *
519
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
520
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
521
* GNU General Public License for more details. *
523
* You should have received a copy of the GNU Library General Public *
524
* License along with this program; if not, write to the *
525
* Free Software Foundation, Inc., *
526
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
527
***************************************************************************/
529
#include <autotools_yacc.h>
536
There are 3 types of identifiers recognized by this lexer:
537
-id_simple: examples of such identifiers are qmake variables and scoped variables
538
at the left of the operator in assignments (like "SOURCES" in "SOURCES+=foo.cpp goo.cpp");
539
-id_list: those are "value list identifiers" at the right side in assignments
540
(like "foo.cpp goo.cpp" in "SOURCES+=foo.cpp goo.cpp");
541
-id_args: function arguments recognized as one identifier
542
(example: ""${QMAKE_FILE} is intended only for Windows!""
543
in "!win32-*:!wince-*:error("${QMAKE_FILE} is intended only for Windows!")" statements).
546
To recognize those identifiers two additional start conditions are used: list and funcargs.
548
@note "Not" operator (!) is recognized as a part of an identifier. Linefeeds passed to
549
the parser as NEWLINE tokens to preserve file structure but whitespaces are stripped
550
so no indentation is preserved by this lexer (and parser).
552
To debug this lexer, put the line below into the next flex file section.
558
#line 559 "autotools_lex.cpp"
563
#define conditional 3
565
#ifndef YY_NO_UNISTD_H
566
/* Special case for "unistd.h", since it is non-ANSI. We include it way
567
* down here because we want the user's section 1 to have been scanned first.
568
* The user has a chance to override it with an option.
573
#ifndef YY_EXTRA_TYPE
574
#define YY_EXTRA_TYPE void *
577
/* Macros after this point can all be overridden by user definitions in
581
#ifndef YY_SKIP_YYWRAP
583
extern "C" int yywrap (void );
585
extern int yywrap (void );
589
static void yyunput (int c,char *buf_ptr );
592
static void yy_flex_strncpy (char *,yyconst char *,int );
595
#ifdef YY_NEED_STRLEN
596
static int yy_flex_strlen (yyconst char * );
602
static int yyinput (void );
604
static int input (void );
609
/* Amount of stuff to slurp up with each read. */
610
#ifndef YY_READ_BUF_SIZE
611
#define YY_READ_BUF_SIZE 8192
614
/* Copy whatever the last rule matched to the standard output. */
616
/* This used to be an fputs(), but since the string might contain NUL's,
617
* we now use fwrite().
619
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
622
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
623
* is returned in "result".
626
#define YY_INPUT(buf,result,max_size) \
627
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
631
for ( n = 0; n < max_size && \
632
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
635
buf[n++] = (char) c; \
636
if ( c == EOF && ferror( yyin ) ) \
637
YY_FATAL_ERROR( "input in flex scanner failed" ); \
643
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
645
if( errno != EINTR) \
647
YY_FATAL_ERROR( "input in flex scanner failed" ); \
658
/* No semi-colon after return; correct usage is to write "yyterminate();" -
659
* we don't want an extra ';' after the "return" because that will cause
660
* some compilers to complain about unreachable statements.
663
#define yyterminate() return YY_NULL
666
/* Number of entries by which start-condition stack grows. */
667
#ifndef YY_START_STACK_INCR
668
#define YY_START_STACK_INCR 25
671
/* Report a fatal error. */
672
#ifndef YY_FATAL_ERROR
673
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
676
/* end tables serialization structures and prototypes */
678
/* Default declaration of generated scanner - a define so the user can
679
* easily add parameters.
682
#define YY_DECL_IS_OURS 1
684
extern int yylex (void);
686
#define YY_DECL int yylex (void)
687
#endif /* !YY_DECL */
689
/* Code executed at the beginning of each rule, after yytext and yyleng
692
#ifndef YY_USER_ACTION
693
#define YY_USER_ACTION
696
/* Code executed at the end of each rule. */
698
#define YY_BREAK break;
701
#define YY_RULE_SETUP \
704
/** The main scanner function which does all the work.
708
register yy_state_type yy_current_state;
709
register char *yy_cp, *yy_bp;
712
#line 73 "autotools.ll"
715
#line 716 "autotools_lex.cpp"
726
(yy_start) = 1; /* first start state */
734
if ( ! YY_CURRENT_BUFFER ) {
735
yyensure_buffer_stack ();
736
YY_CURRENT_BUFFER_LVALUE =
737
yy_create_buffer(yyin,YY_BUF_SIZE );
740
yy_load_buffer_state( );
743
while ( 1 ) /* loops until end-of-file is reached */
745
yy_cp = (yy_c_buf_p);
747
/* Support of yytext. */
748
*yy_cp = (yy_hold_char);
750
/* yy_bp points to the position in yy_ch_buf of the start of
755
yy_current_state = (yy_start);
759
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
760
if ( yy_accept[yy_current_state] )
762
(yy_last_accepting_state) = yy_current_state;
763
(yy_last_accepting_cpos) = yy_cp;
765
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
767
yy_current_state = (int) yy_def[yy_current_state];
768
if ( yy_current_state >= 64 )
769
yy_c = yy_meta[(unsigned int) yy_c];
771
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
774
while ( yy_base[yy_current_state] != 156 );
777
yy_act = yy_accept[yy_current_state];
779
{ /* have to back up */
780
yy_cp = (yy_last_accepting_cpos);
781
yy_current_state = (yy_last_accepting_state);
782
yy_act = yy_accept[yy_current_state];
787
do_action: /* This label is used only to access EOF actions. */
790
{ /* beginning of action switch */
791
case 0: /* must back up */
792
/* undo the effects of YY_DO_BEFORE_ACTION */
793
*yy_cp = (yy_hold_char);
794
yy_cp = (yy_last_accepting_cpos);
795
yy_current_state = (yy_last_accepting_state);
800
#line 75 "autotools.ll"
804
/* rule 2 can match eol */
806
#line 76 "autotools.ll"
807
{ BEGIN(list); return CONT; }
811
#line 77 "autotools.ll"
813
yylval.value = yytext;
814
if ( yylval.value == "if" )
817
if ( yylval.value == "else" )
820
if ( yylval.value == "endif" )
821
return ENDIF_KEYWORD;
828
#line 92 "autotools.ll"
829
{ yylval.value = yytext; return (ID_SIMPLE); }
833
#line 94 "autotools.ll"
835
yylval.value = yytext;
841
#line 99 "autotools.ll"
843
yylval.value = yytext;
844
yylval.value = yylval.value.mid(0, yylval.value.findRev("\\"));
851
/* rule 7 can match eol */
853
#line 107 "autotools.ll"
855
yylval.value = yytext;
857
return (LIST_COMMENT);
862
#line 113 "autotools.ll"
864
yylval.value = yytext;
866
return (ID_LIST_SINGLE);
871
#line 119 "autotools.ll"
873
yylval.value = yytext;
874
yylval.value = yylval.value.mid(0, yylval.value.length()-1);
882
#line 127 "autotools.ll"
883
{ BEGIN(list); yylval.value = yytext; return EQ; }
887
#line 128 "autotools.ll"
888
{ BEGIN(list); yylval.value = yytext; return PLUSEQ; }
892
#line 129 "autotools.ll"
897
#line 130 "autotools.ll"
902
#line 131 "autotools.ll"
903
{ BEGIN(list); yylval.value = yytext; return COLON; }
906
/* rule 15 can match eol */
908
#line 132 "autotools.ll"
909
{ BEGIN(INITIAL); return NEWLINE; }
913
#line 133 "autotools.ll"
914
{ yylval.value = yytext; return (COMMENT); }
918
#line 135 "autotools.ll"
921
#line 922 "autotools_lex.cpp"
922
case YY_STATE_EOF(INITIAL):
923
case YY_STATE_EOF(list):
924
case YY_STATE_EOF(funcargs):
925
case YY_STATE_EOF(conditional):
928
case YY_END_OF_BUFFER:
930
/* Amount of text matched not including the EOB char. */
931
int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
933
/* Undo the effects of YY_DO_BEFORE_ACTION. */
934
*yy_cp = (yy_hold_char);
935
YY_RESTORE_YY_MORE_OFFSET
937
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
939
/* We're scanning a new file or input source. It's
940
* possible that this happened because the user
941
* just pointed yyin at a new source and called
942
* yylex(). If so, then we have to assure
943
* consistency between YY_CURRENT_BUFFER and our
944
* globals. Here is the right place to do so, because
945
* this is the first action (other than possibly a
946
* back-up) that will match for the new input source.
948
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
949
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
950
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
953
/* Note that here we test for yy_c_buf_p "<=" to the position
954
* of the first EOB in the buffer, since yy_c_buf_p will
955
* already have been incremented past the NUL character
956
* (since all states make transitions on EOB to the
957
* end-of-buffer state). Contrast this with the test
960
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
961
{ /* This was really a NUL. */
962
yy_state_type yy_next_state;
964
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
966
yy_current_state = yy_get_previous_state( );
968
/* Okay, we're now positioned to make the NUL
969
* transition. We couldn't have
970
* yy_get_previous_state() go ahead and do it
971
* for us because it doesn't know how to deal
972
* with the possibility of jamming (and we don't
973
* want to build jamming into it because then it
974
* will run more slowly).
977
yy_next_state = yy_try_NUL_trans( yy_current_state );
979
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
983
/* Consume the NUL. */
984
yy_cp = ++(yy_c_buf_p);
985
yy_current_state = yy_next_state;
991
yy_cp = (yy_c_buf_p);
996
else switch ( yy_get_next_buffer( ) )
998
case EOB_ACT_END_OF_FILE:
1000
(yy_did_buffer_switch_on_eof) = 0;
1004
/* Note: because we've taken care in
1005
* yy_get_next_buffer() to have set up
1006
* yytext, we can now set up
1007
* yy_c_buf_p so that if some total
1008
* hoser (like flex itself) wants to
1009
* call the scanner after we return the
1010
* YY_NULL, it'll still work - another
1011
* YY_NULL will get returned.
1013
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1015
yy_act = YY_STATE_EOF(YY_START);
1021
if ( ! (yy_did_buffer_switch_on_eof) )
1027
case EOB_ACT_CONTINUE_SCAN:
1029
(yytext_ptr) + yy_amount_of_matched_text;
1031
yy_current_state = yy_get_previous_state( );
1033
yy_cp = (yy_c_buf_p);
1034
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1037
case EOB_ACT_LAST_MATCH:
1039
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1041
yy_current_state = yy_get_previous_state( );
1043
yy_cp = (yy_c_buf_p);
1044
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1045
goto yy_find_action;
1052
"fatal flex scanner internal error--no action found" );
1053
} /* end of action switch */
1054
} /* end of scanning one token */
1055
} /* end of yylex */
1057
/* yy_get_next_buffer - try to read in a new buffer
1059
* Returns a code representing an action:
1060
* EOB_ACT_LAST_MATCH -
1061
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1062
* EOB_ACT_END_OF_FILE - end of file
1064
static int yy_get_next_buffer (void)
1066
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1067
register char *source = (yytext_ptr);
1068
register int number_to_move, i;
1071
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1073
"fatal flex scanner internal error--end of buffer missed" );
1075
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1076
{ /* Don't try to fill the buffer, so this is an EOF. */
1077
if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1079
/* We matched a single character, the EOB, so
1080
* treat this as a final EOF.
1082
return EOB_ACT_END_OF_FILE;
1087
/* We matched some text prior to the EOB, first
1090
return EOB_ACT_LAST_MATCH;
1094
/* Try to read more data. */
1096
/* First move last chars to start of buffer. */
1097
number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1099
for ( i = 0; i < number_to_move; ++i )
1100
*(dest++) = *(source++);
1102
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1103
/* don't do the read, it's not guaranteed to return an EOF,
1106
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1110
size_t num_to_read =
1111
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1113
while ( num_to_read <= 0 )
1114
{ /* Not enough room in the buffer - grow it. */
1116
/* just a shorter name for the current buffer */
1117
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1119
int yy_c_buf_p_offset =
1120
(int) ((yy_c_buf_p) - b->yy_ch_buf);
1122
if ( b->yy_is_our_buffer )
1124
int new_size = b->yy_buf_size * 2;
1126
if ( new_size <= 0 )
1127
b->yy_buf_size += b->yy_buf_size / 8;
1129
b->yy_buf_size *= 2;
1131
b->yy_ch_buf = (char *)
1132
/* Include room in for 2 EOB chars. */
1133
yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1136
/* Can't grow it, we don't own it. */
1139
if ( ! b->yy_ch_buf )
1141
"fatal error - scanner input buffer overflow" );
1143
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1145
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1150
if ( num_to_read > YY_READ_BUF_SIZE )
1151
num_to_read = YY_READ_BUF_SIZE;
1153
/* Read in more data. */
1154
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1155
(yy_n_chars), num_to_read );
1157
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1160
if ( (yy_n_chars) == 0 )
1162
if ( number_to_move == YY_MORE_ADJ )
1164
ret_val = EOB_ACT_END_OF_FILE;
1170
ret_val = EOB_ACT_LAST_MATCH;
1171
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1172
YY_BUFFER_EOF_PENDING;
1177
ret_val = EOB_ACT_CONTINUE_SCAN;
1179
(yy_n_chars) += number_to_move;
1180
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1181
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1183
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1188
/* yy_get_previous_state - get the state just before the EOB char was reached */
1190
static yy_state_type yy_get_previous_state (void)
1192
register yy_state_type yy_current_state;
1193
register char *yy_cp;
1195
yy_current_state = (yy_start);
1197
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1199
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1200
if ( yy_accept[yy_current_state] )
1202
(yy_last_accepting_state) = yy_current_state;
1203
(yy_last_accepting_cpos) = yy_cp;
1205
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1207
yy_current_state = (int) yy_def[yy_current_state];
1208
if ( yy_current_state >= 64 )
1209
yy_c = yy_meta[(unsigned int) yy_c];
1211
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1214
return yy_current_state;
1217
/* yy_try_NUL_trans - try to make a transition on the NUL character
1220
* next_state = yy_try_NUL_trans( current_state );
1222
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1224
register int yy_is_jam;
1225
register char *yy_cp = (yy_c_buf_p);
1227
register YY_CHAR yy_c = 1;
1228
if ( yy_accept[yy_current_state] )
1230
(yy_last_accepting_state) = yy_current_state;
1231
(yy_last_accepting_cpos) = yy_cp;
1233
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1235
yy_current_state = (int) yy_def[yy_current_state];
1236
if ( yy_current_state >= 64 )
1237
yy_c = yy_meta[(unsigned int) yy_c];
1239
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1240
yy_is_jam = (yy_current_state == 63);
1242
return yy_is_jam ? 0 : yy_current_state;
1245
static void yyunput (int c, register char * yy_bp )
1247
register char *yy_cp;
1249
yy_cp = (yy_c_buf_p);
1251
/* undo effects of setting up yytext */
1252
*yy_cp = (yy_hold_char);
1254
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1255
{ /* need to shift things up to make room */
1256
/* +2 for EOB chars. */
1257
register int number_to_move = (yy_n_chars) + 2;
1258
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1259
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1260
register char *source =
1261
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1263
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1264
*--dest = *--source;
1266
yy_cp += (int) (dest - source);
1267
yy_bp += (int) (dest - source);
1268
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1269
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1271
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1272
YY_FATAL_ERROR( "flex scanner push-back overflow" );
1275
*--yy_cp = (char) c;
1277
(yytext_ptr) = yy_bp;
1278
(yy_hold_char) = *yy_cp;
1279
(yy_c_buf_p) = yy_cp;
1284
static int yyinput (void)
1286
static int input (void)
1292
*(yy_c_buf_p) = (yy_hold_char);
1294
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1296
/* yy_c_buf_p now points to the character we want to return.
1297
* If this occurs *before* the EOB characters, then it's a
1298
* valid NUL; if not, then we've hit the end of the buffer.
1300
if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1301
/* This was really a NUL. */
1302
*(yy_c_buf_p) = '\0';
1305
{ /* need more input */
1306
int offset = (yy_c_buf_p) - (yytext_ptr);
1309
switch ( yy_get_next_buffer( ) )
1311
case EOB_ACT_LAST_MATCH:
1312
/* This happens because yy_g_n_b()
1313
* sees that we've accumulated a
1314
* token and flags that we need to
1315
* try matching the token before
1316
* proceeding. But for input(),
1317
* there's no matching to consider.
1318
* So convert the EOB_ACT_LAST_MATCH
1319
* to EOB_ACT_END_OF_FILE.
1322
/* Reset buffer status. */
1327
case EOB_ACT_END_OF_FILE:
1332
if ( ! (yy_did_buffer_switch_on_eof) )
1341
case EOB_ACT_CONTINUE_SCAN:
1342
(yy_c_buf_p) = (yytext_ptr) + offset;
1348
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1349
*(yy_c_buf_p) = '\0'; /* preserve yytext */
1350
(yy_hold_char) = *++(yy_c_buf_p);
1354
#endif /* ifndef YY_NO_INPUT */
1356
/** Immediately switch to a different input stream.
1357
* @param input_file A readable stream.
1359
* @note This function does not reset the start condition to @c INITIAL .
1361
void yyrestart (FILE * input_file )
1364
if ( ! YY_CURRENT_BUFFER ){
1365
yyensure_buffer_stack ();
1366
YY_CURRENT_BUFFER_LVALUE =
1367
yy_create_buffer(yyin,YY_BUF_SIZE );
1370
yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1371
yy_load_buffer_state( );
1374
/** Switch to a different input buffer.
1375
* @param new_buffer The new input buffer.
1378
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1381
/* TODO. We should be able to replace this entire function body
1383
* yypop_buffer_state();
1384
* yypush_buffer_state(new_buffer);
1386
yyensure_buffer_stack ();
1387
if ( YY_CURRENT_BUFFER == new_buffer )
1390
if ( YY_CURRENT_BUFFER )
1392
/* Flush out information for old buffer. */
1393
*(yy_c_buf_p) = (yy_hold_char);
1394
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1395
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1398
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1399
yy_load_buffer_state( );
1401
/* We don't actually know whether we did this switch during
1402
* EOF (yywrap()) processing, but the only time this flag
1403
* is looked at is after yywrap() is called, so it's safe
1404
* to go ahead and always set it.
1406
(yy_did_buffer_switch_on_eof) = 1;
1409
static void yy_load_buffer_state (void)
1411
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1412
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1413
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1414
(yy_hold_char) = *(yy_c_buf_p);
1417
/** Allocate and initialize an input buffer state.
1418
* @param file A readable stream.
1419
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1421
* @return the allocated buffer state.
1423
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1427
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1429
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1431
b->yy_buf_size = size;
1433
/* yy_ch_buf has to be 2 characters longer than the size given because
1434
* we need to put in 2 end-of-buffer characters.
1436
b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1437
if ( ! b->yy_ch_buf )
1438
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1440
b->yy_is_our_buffer = 1;
1442
yy_init_buffer(b,file );
1447
/** Destroy the buffer.
1448
* @param b a buffer created with yy_create_buffer()
1451
void yy_delete_buffer (YY_BUFFER_STATE b )
1457
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1458
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1460
if ( b->yy_is_our_buffer )
1461
yyfree((void *) b->yy_ch_buf );
1463
yyfree((void *) b );
1467
extern int isatty (int );
1468
#endif /* __cplusplus */
1470
/* Initializes or reinitializes a buffer.
1471
* This function is sometimes called more than once on the same buffer,
1472
* such as during a yyrestart() or at EOF.
1474
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1479
yy_flush_buffer(b );
1481
b->yy_input_file = file;
1482
b->yy_fill_buffer = 1;
1484
/* If b is the current buffer, then yy_init_buffer was _probably_
1485
* called from yyrestart() or through yy_get_next_buffer.
1486
* In that case, we don't want to reset the lineno or column.
1488
if (b != YY_CURRENT_BUFFER){
1489
b->yy_bs_lineno = 1;
1490
b->yy_bs_column = 0;
1493
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1498
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1499
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1502
void yy_flush_buffer (YY_BUFFER_STATE b )
1509
/* We always need two end-of-buffer characters. The first causes
1510
* a transition to the end-of-buffer state. The second causes
1511
* a jam in that state.
1513
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1514
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1516
b->yy_buf_pos = &b->yy_ch_buf[0];
1519
b->yy_buffer_status = YY_BUFFER_NEW;
1521
if ( b == YY_CURRENT_BUFFER )
1522
yy_load_buffer_state( );
1525
/** Pushes the new state onto the stack. The new state becomes
1526
* the current state. This function will allocate the stack
1528
* @param new_buffer The new state.
1531
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1533
if (new_buffer == NULL)
1536
yyensure_buffer_stack();
1538
/* This block is copied from yy_switch_to_buffer. */
1539
if ( YY_CURRENT_BUFFER )
1541
/* Flush out information for old buffer. */
1542
*(yy_c_buf_p) = (yy_hold_char);
1543
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1544
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1547
/* Only push if top exists. Otherwise, replace top. */
1548
if (YY_CURRENT_BUFFER)
1549
(yy_buffer_stack_top)++;
1550
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1552
/* copied from yy_switch_to_buffer. */
1553
yy_load_buffer_state( );
1554
(yy_did_buffer_switch_on_eof) = 1;
1557
/** Removes and deletes the top of the stack, if present.
1558
* The next element becomes the new top.
1561
void yypop_buffer_state (void)
1563
if (!YY_CURRENT_BUFFER)
1566
yy_delete_buffer(YY_CURRENT_BUFFER );
1567
YY_CURRENT_BUFFER_LVALUE = NULL;
1568
if ((yy_buffer_stack_top) > 0)
1569
--(yy_buffer_stack_top);
1571
if (YY_CURRENT_BUFFER) {
1572
yy_load_buffer_state( );
1573
(yy_did_buffer_switch_on_eof) = 1;
1577
/* Allocates the stack if it does not exist.
1578
* Guarantees space for at least one push.
1580
static void yyensure_buffer_stack (void)
1584
if (!(yy_buffer_stack)) {
1586
/* First allocation is just for 2 elements, since we don't know if this
1587
* scanner will even need a stack. We use 2 instead of 1 to avoid an
1588
* immediate realloc on the next call.
1591
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1592
(num_to_alloc * sizeof(struct yy_buffer_state*)
1595
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1597
(yy_buffer_stack_max) = num_to_alloc;
1598
(yy_buffer_stack_top) = 0;
1602
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1604
/* Increase the buffer to prepare for a possible push. */
1605
int grow_size = 8 /* arbitrary grow size */;
1607
num_to_alloc = (yy_buffer_stack_max) + grow_size;
1608
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1610
num_to_alloc * sizeof(struct yy_buffer_state*)
1613
/* zero only the new slots.*/
1614
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1615
(yy_buffer_stack_max) = num_to_alloc;
1619
/** Setup the input buffer state to scan directly from a user-specified character buffer.
1620
* @param base the character buffer
1621
* @param size the size in bytes of the character buffer
1623
* @return the newly allocated buffer state object.
1625
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1630
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1631
base[size-1] != YY_END_OF_BUFFER_CHAR )
1632
/* They forgot to leave room for the EOB's. */
1635
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1637
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1639
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1640
b->yy_buf_pos = b->yy_ch_buf = base;
1641
b->yy_is_our_buffer = 0;
1642
b->yy_input_file = 0;
1643
b->yy_n_chars = b->yy_buf_size;
1644
b->yy_is_interactive = 0;
1646
b->yy_fill_buffer = 0;
1647
b->yy_buffer_status = YY_BUFFER_NEW;
1649
yy_switch_to_buffer(b );
1654
/** Setup the input buffer state to scan a string. The next call to yylex() will
1655
* scan from a @e copy of @a str.
1656
* @param str a NUL-terminated string to scan
1658
* @return the newly allocated buffer state object.
1659
* @note If you want to scan bytes that may contain NUL values, then use
1660
* yy_scan_bytes() instead.
1662
YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
1665
return yy_scan_bytes(yy_str,strlen(yy_str) );
1668
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1669
* scan from a @e copy of @a bytes.
1670
* @param bytes the byte buffer to scan
1671
* @param len the number of bytes in the buffer pointed to by @a bytes.
1673
* @return the newly allocated buffer state object.
1675
YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
1682
/* Get memory for full buffer, including space for trailing EOB's. */
1684
buf = (char *) yyalloc(n );
1686
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1688
for ( i = 0; i < len; ++i )
1691
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1693
b = yy_scan_buffer(buf,n );
1695
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1697
/* It's okay to grow etc. this buffer, and we should throw it
1698
* away when we're done.
1700
b->yy_is_our_buffer = 1;
1705
#ifndef YY_EXIT_FAILURE
1706
#define YY_EXIT_FAILURE 2
1709
static void yy_fatal_error (yyconst char* msg )
1711
(void) fprintf( stderr, "%s\n", msg );
1712
exit( YY_EXIT_FAILURE );
1715
/* Redefine yyless() so it works in section 3 code. */
1721
/* Undo effects of setting up yytext. */ \
1722
int yyless_macro_arg = (n); \
1723
YY_LESS_LINENO(yyless_macro_arg);\
1724
yytext[yyleng] = (yy_hold_char); \
1725
(yy_c_buf_p) = yytext + yyless_macro_arg; \
1726
(yy_hold_char) = *(yy_c_buf_p); \
1727
*(yy_c_buf_p) = '\0'; \
1728
yyleng = yyless_macro_arg; \
1732
/* Accessor methods (get/set functions) to struct members. */
1734
/** Get the current line number.
1737
int yyget_lineno (void)
1743
/** Get the input stream.
1746
FILE *yyget_in (void)
1751
/** Get the output stream.
1754
FILE *yyget_out (void)
1759
/** Get the length of the current token.
1762
int yyget_leng (void)
1767
/** Get the current token.
1771
char *yyget_text (void)
1776
/** Set the current line number.
1777
* @param line_number
1780
void yyset_lineno (int line_number )
1783
yylineno = line_number;
1786
/** Set the input stream. This does not discard the current
1788
* @param in_str A readable stream.
1790
* @see yy_switch_to_buffer
1792
void yyset_in (FILE * in_str )
1797
void yyset_out (FILE * out_str )
1802
int yyget_debug (void)
1804
return yy_flex_debug;
1807
void yyset_debug (int bdebug )
1809
yy_flex_debug = bdebug ;
1812
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1813
int yylex_destroy (void)
1816
/* Pop the buffer stack, destroying each element. */
1817
while(YY_CURRENT_BUFFER){
1818
yy_delete_buffer(YY_CURRENT_BUFFER );
1819
YY_CURRENT_BUFFER_LVALUE = NULL;
1820
yypop_buffer_state();
1823
/* Destroy the stack itself. */
1824
yyfree((yy_buffer_stack) );
1825
(yy_buffer_stack) = NULL;
1831
* Internal utility routines.
1835
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1838
for ( i = 0; i < n; ++i )
1843
#ifdef YY_NEED_STRLEN
1844
static int yy_flex_strlen (yyconst char * s )
1847
for ( n = 0; s[n]; ++n )
1854
void *yyalloc (yy_size_t size )
1856
return (void *) malloc( size );
1859
void *yyrealloc (void * ptr, yy_size_t size )
1861
/* The cast to (char *) in the following accommodates both
1862
* implementations that use char* generic pointers, and those
1863
* that use void* generic pointers. It works with the latter
1864
* because both ANSI C and C++ allow castless assignment from
1865
* any pointer type to void*, and deal with argument conversions
1866
* as though doing an assignment.
1868
return (void *) realloc( (char *) ptr, size );
1871
void yyfree (void * ptr )
1873
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1876
#define YYTABLES_NAME "yytables"
1879
#undef YY_FLUSH_BUFFER
1881
#undef yy_new_buffer
1882
#undef yy_set_interactive
1884
#undef YY_DO_BEFORE_ACTION
1886
#ifdef YY_DECL_IS_OURS
1887
#undef YY_DECL_IS_OURS
1890
#line 135 "autotools.ll"