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