Coverage Report

Created: 2023-09-20 06:34

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