Annotation of embedaddon/strongswan/src/libstrongswan/settings/settings_lexer.c, revision 1.1.1.2
1.1 misho 1: #line 2 "settings/settings_lexer.c"
2:
3: #line 4 "settings/settings_lexer.c"
4:
5: #define YY_INT_ALIGNED short int
6:
7: /* A lexical scanner generated by flex */
8:
9: /* %not-for-header */
10: /* %if-c-only */
11: /* %if-not-reentrant */
12: /* %endif */
13: /* %endif */
14: /* %ok-for-header */
15:
16: #define FLEX_SCANNER
17: #define YY_FLEX_MAJOR_VERSION 2
18: #define YY_FLEX_MINOR_VERSION 6
19: #define YY_FLEX_SUBMINOR_VERSION 4
20: #if YY_FLEX_SUBMINOR_VERSION > 0
21: #define FLEX_BETA
22: #endif
23:
24: /* %if-c++-only */
25: /* %endif */
26:
27: /* %if-c-only */
28: #ifdef yy_create_buffer
29: #define settings_parser__create_buffer_ALREADY_DEFINED
30: #else
31: #define yy_create_buffer settings_parser__create_buffer
32: #endif
33:
34: #ifdef yy_delete_buffer
35: #define settings_parser__delete_buffer_ALREADY_DEFINED
36: #else
37: #define yy_delete_buffer settings_parser__delete_buffer
38: #endif
39:
40: #ifdef yy_scan_buffer
41: #define settings_parser__scan_buffer_ALREADY_DEFINED
42: #else
43: #define yy_scan_buffer settings_parser__scan_buffer
44: #endif
45:
46: #ifdef yy_scan_string
47: #define settings_parser__scan_string_ALREADY_DEFINED
48: #else
49: #define yy_scan_string settings_parser__scan_string
50: #endif
51:
52: #ifdef yy_scan_bytes
53: #define settings_parser__scan_bytes_ALREADY_DEFINED
54: #else
55: #define yy_scan_bytes settings_parser__scan_bytes
56: #endif
57:
58: #ifdef yy_init_buffer
59: #define settings_parser__init_buffer_ALREADY_DEFINED
60: #else
61: #define yy_init_buffer settings_parser__init_buffer
62: #endif
63:
64: #ifdef yy_flush_buffer
65: #define settings_parser__flush_buffer_ALREADY_DEFINED
66: #else
67: #define yy_flush_buffer settings_parser__flush_buffer
68: #endif
69:
70: #ifdef yy_load_buffer_state
71: #define settings_parser__load_buffer_state_ALREADY_DEFINED
72: #else
73: #define yy_load_buffer_state settings_parser__load_buffer_state
74: #endif
75:
76: #ifdef yy_switch_to_buffer
77: #define settings_parser__switch_to_buffer_ALREADY_DEFINED
78: #else
79: #define yy_switch_to_buffer settings_parser__switch_to_buffer
80: #endif
81:
82: #ifdef yypush_buffer_state
83: #define settings_parser_push_buffer_state_ALREADY_DEFINED
84: #else
85: #define yypush_buffer_state settings_parser_push_buffer_state
86: #endif
87:
88: #ifdef yypop_buffer_state
89: #define settings_parser_pop_buffer_state_ALREADY_DEFINED
90: #else
91: #define yypop_buffer_state settings_parser_pop_buffer_state
92: #endif
93:
94: #ifdef yyensure_buffer_stack
95: #define settings_parser_ensure_buffer_stack_ALREADY_DEFINED
96: #else
97: #define yyensure_buffer_stack settings_parser_ensure_buffer_stack
98: #endif
99:
100: #ifdef yylex
101: #define settings_parser_lex_ALREADY_DEFINED
102: #else
103: #define yylex settings_parser_lex
104: #endif
105:
106: #ifdef yyrestart
107: #define settings_parser_restart_ALREADY_DEFINED
108: #else
109: #define yyrestart settings_parser_restart
110: #endif
111:
112: #ifdef yylex_init
113: #define settings_parser_lex_init_ALREADY_DEFINED
114: #else
115: #define yylex_init settings_parser_lex_init
116: #endif
117:
118: #ifdef yylex_init_extra
119: #define settings_parser_lex_init_extra_ALREADY_DEFINED
120: #else
121: #define yylex_init_extra settings_parser_lex_init_extra
122: #endif
123:
124: #ifdef yylex_destroy
125: #define settings_parser_lex_destroy_ALREADY_DEFINED
126: #else
127: #define yylex_destroy settings_parser_lex_destroy
128: #endif
129:
130: #ifdef yyget_debug
131: #define settings_parser_get_debug_ALREADY_DEFINED
132: #else
133: #define yyget_debug settings_parser_get_debug
134: #endif
135:
136: #ifdef yyset_debug
137: #define settings_parser_set_debug_ALREADY_DEFINED
138: #else
139: #define yyset_debug settings_parser_set_debug
140: #endif
141:
142: #ifdef yyget_extra
143: #define settings_parser_get_extra_ALREADY_DEFINED
144: #else
145: #define yyget_extra settings_parser_get_extra
146: #endif
147:
148: #ifdef yyset_extra
149: #define settings_parser_set_extra_ALREADY_DEFINED
150: #else
151: #define yyset_extra settings_parser_set_extra
152: #endif
153:
154: #ifdef yyget_in
155: #define settings_parser_get_in_ALREADY_DEFINED
156: #else
157: #define yyget_in settings_parser_get_in
158: #endif
159:
160: #ifdef yyset_in
161: #define settings_parser_set_in_ALREADY_DEFINED
162: #else
163: #define yyset_in settings_parser_set_in
164: #endif
165:
166: #ifdef yyget_out
167: #define settings_parser_get_out_ALREADY_DEFINED
168: #else
169: #define yyget_out settings_parser_get_out
170: #endif
171:
172: #ifdef yyset_out
173: #define settings_parser_set_out_ALREADY_DEFINED
174: #else
175: #define yyset_out settings_parser_set_out
176: #endif
177:
178: #ifdef yyget_leng
179: #define settings_parser_get_leng_ALREADY_DEFINED
180: #else
181: #define yyget_leng settings_parser_get_leng
182: #endif
183:
184: #ifdef yyget_text
185: #define settings_parser_get_text_ALREADY_DEFINED
186: #else
187: #define yyget_text settings_parser_get_text
188: #endif
189:
190: #ifdef yyget_lineno
191: #define settings_parser_get_lineno_ALREADY_DEFINED
192: #else
193: #define yyget_lineno settings_parser_get_lineno
194: #endif
195:
196: #ifdef yyset_lineno
197: #define settings_parser_set_lineno_ALREADY_DEFINED
198: #else
199: #define yyset_lineno settings_parser_set_lineno
200: #endif
201:
202: #ifdef yyget_column
203: #define settings_parser_get_column_ALREADY_DEFINED
204: #else
205: #define yyget_column settings_parser_get_column
206: #endif
207:
208: #ifdef yyset_column
209: #define settings_parser_set_column_ALREADY_DEFINED
210: #else
211: #define yyset_column settings_parser_set_column
212: #endif
213:
214: #ifdef yywrap
215: #define settings_parser_wrap_ALREADY_DEFINED
216: #else
217: #define yywrap settings_parser_wrap
218: #endif
219:
220: /* %endif */
221:
222: #ifdef yyalloc
223: #define settings_parser_alloc_ALREADY_DEFINED
224: #else
225: #define yyalloc settings_parser_alloc
226: #endif
227:
228: #ifdef yyrealloc
229: #define settings_parser_realloc_ALREADY_DEFINED
230: #else
231: #define yyrealloc settings_parser_realloc
232: #endif
233:
234: #ifdef yyfree
235: #define settings_parser_free_ALREADY_DEFINED
236: #else
237: #define yyfree settings_parser_free
238: #endif
239:
240: /* %if-c-only */
241:
242: /* %endif */
243:
244: /* First, we deal with platform-specific or compiler-specific issues. */
245:
246: /* begin standard C headers. */
247: /* %if-c-only */
248: #include <stdio.h>
249: #include <string.h>
250: #include <errno.h>
251: #include <stdlib.h>
252: /* %endif */
253:
254: /* %if-tables-serialization */
255: /* %endif */
256: /* end standard C headers. */
257:
258: /* %if-c-or-c++ */
259: /* flex integer type definitions */
260:
261: #ifndef FLEXINT_H
262: #define FLEXINT_H
263:
264: /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
265:
266: #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
267:
268: /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
269: * if you want the limit (max/min) macros for int types.
270: */
271: #ifndef __STDC_LIMIT_MACROS
272: #define __STDC_LIMIT_MACROS 1
273: #endif
274:
275: #include <inttypes.h>
276: typedef int8_t flex_int8_t;
277: typedef uint8_t flex_uint8_t;
278: typedef int16_t flex_int16_t;
279: typedef uint16_t flex_uint16_t;
280: typedef int32_t flex_int32_t;
281: typedef uint32_t flex_uint32_t;
282: #else
283: typedef signed char flex_int8_t;
284: typedef short int flex_int16_t;
285: typedef int flex_int32_t;
286: typedef unsigned char flex_uint8_t;
287: typedef unsigned short int flex_uint16_t;
288: typedef unsigned int flex_uint32_t;
289:
290: /* Limits of integral types. */
291: #ifndef INT8_MIN
292: #define INT8_MIN (-128)
293: #endif
294: #ifndef INT16_MIN
295: #define INT16_MIN (-32767-1)
296: #endif
297: #ifndef INT32_MIN
298: #define INT32_MIN (-2147483647-1)
299: #endif
300: #ifndef INT8_MAX
301: #define INT8_MAX (127)
302: #endif
303: #ifndef INT16_MAX
304: #define INT16_MAX (32767)
305: #endif
306: #ifndef INT32_MAX
307: #define INT32_MAX (2147483647)
308: #endif
309: #ifndef UINT8_MAX
310: #define UINT8_MAX (255U)
311: #endif
312: #ifndef UINT16_MAX
313: #define UINT16_MAX (65535U)
314: #endif
315: #ifndef UINT32_MAX
316: #define UINT32_MAX (4294967295U)
317: #endif
318:
319: #ifndef SIZE_MAX
320: #define SIZE_MAX (~(size_t)0)
321: #endif
322:
323: #endif /* ! C99 */
324:
325: #endif /* ! FLEXINT_H */
326:
327: /* %endif */
328:
329: /* begin standard C++ headers. */
330: /* %if-c++-only */
331: /* %endif */
332:
333: /* TODO: this is always defined, so inline it */
334: #define yyconst const
335:
336: #if defined(__GNUC__) && __GNUC__ >= 3
337: #define yynoreturn __attribute__((__noreturn__))
338: #else
339: #define yynoreturn
340: #endif
341:
342: /* %not-for-header */
343: /* Returned upon end-of-file. */
344: #define YY_NULL 0
345: /* %ok-for-header */
346:
347: /* %not-for-header */
348: /* Promotes a possibly negative, possibly signed char to an
349: * integer in range [0..255] for use as an array index.
350: */
351: #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
352: /* %ok-for-header */
353:
354: /* %if-reentrant */
355:
356: /* An opaque pointer. */
357: #ifndef YY_TYPEDEF_YY_SCANNER_T
358: #define YY_TYPEDEF_YY_SCANNER_T
359: typedef void* yyscan_t;
360: #endif
361:
362: /* For convenience, these vars (plus the bison vars far below)
363: are macros in the reentrant scanner. */
364: #define yyin yyg->yyin_r
365: #define yyout yyg->yyout_r
366: #define yyextra yyg->yyextra_r
367: #define yyleng yyg->yyleng_r
368: #define yytext yyg->yytext_r
369: #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
370: #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
371: #define yy_flex_debug yyg->yy_flex_debug_r
372:
373: /* %endif */
374:
375: /* %if-not-reentrant */
376: /* %endif */
377:
378: /* Enter a start condition. This macro really ought to take a parameter,
379: * but we do it the disgusting crufty way forced on us by the ()-less
380: * definition of BEGIN.
381: */
382: #define BEGIN yyg->yy_start = 1 + 2 *
383: /* Translate the current start state into a value that can be later handed
384: * to BEGIN to return to the state. The YYSTATE alias is for lex
385: * compatibility.
386: */
387: #define YY_START ((yyg->yy_start - 1) / 2)
388: #define YYSTATE YY_START
389: /* Action number for EOF rule of a given start state. */
390: #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
391: /* Special action meaning "start processing a new file". */
392: #define YY_NEW_FILE yyrestart( yyin , yyscanner )
393: #define YY_END_OF_BUFFER_CHAR 0
394:
395: /* Size of default input buffer. */
396: #ifndef YY_BUF_SIZE
397: #ifdef __ia64__
398: /* On IA-64, the buffer size is 16k, not 8k.
399: * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
400: * Ditto for the __ia64__ case accordingly.
401: */
402: #define YY_BUF_SIZE 32768
403: #else
404: #define YY_BUF_SIZE 16384
405: #endif /* __ia64__ */
406: #endif
407:
408: /* The state buf must be large enough to hold one state per character in the main buffer.
409: */
410: #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
411:
412: #ifndef YY_TYPEDEF_YY_BUFFER_STATE
413: #define YY_TYPEDEF_YY_BUFFER_STATE
414: typedef struct yy_buffer_state *YY_BUFFER_STATE;
415: #endif
416:
417: #ifndef YY_TYPEDEF_YY_SIZE_T
418: #define YY_TYPEDEF_YY_SIZE_T
419: typedef size_t yy_size_t;
420: #endif
421:
422: /* %if-not-reentrant */
423: /* %endif */
424:
425: /* %if-c-only */
426: /* %if-not-reentrant */
427: /* %endif */
428: /* %endif */
429:
430: #define EOB_ACT_CONTINUE_SCAN 0
431: #define EOB_ACT_END_OF_FILE 1
432: #define EOB_ACT_LAST_MATCH 2
433:
434: /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
435: * access to the local variable yy_act. Since yyless() is a macro, it would break
436: * existing scanners that call yyless() from OUTSIDE yylex.
437: * One obvious solution it to make yy_act a global. I tried that, and saw
438: * a 5% performance hit in a non-yylineno scanner, because yy_act is
439: * normally declared as a register variable-- so it is not worth it.
440: */
441: #define YY_LESS_LINENO(n) \
442: do { \
443: int yyl;\
444: for ( yyl = n; yyl < yyleng; ++yyl )\
445: if ( yytext[yyl] == '\n' )\
446: --yylineno;\
447: }while(0)
448: #define YY_LINENO_REWIND_TO(dst) \
449: do {\
450: const char *p;\
451: for ( p = yy_cp-1; p >= (dst); --p)\
452: if ( *p == '\n' )\
453: --yylineno;\
454: }while(0)
455:
456: /* Return all but the first "n" matched characters back to the input stream. */
457: #define yyless(n) \
458: do \
459: { \
460: /* Undo effects of setting up yytext. */ \
461: int yyless_macro_arg = (n); \
462: YY_LESS_LINENO(yyless_macro_arg);\
463: *yy_cp = yyg->yy_hold_char; \
464: YY_RESTORE_YY_MORE_OFFSET \
465: yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
466: YY_DO_BEFORE_ACTION; /* set up yytext again */ \
467: } \
468: while ( 0 )
469: #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
470:
471: #ifndef YY_STRUCT_YY_BUFFER_STATE
472: #define YY_STRUCT_YY_BUFFER_STATE
473: struct yy_buffer_state
474: {
475: /* %if-c-only */
476: FILE *yy_input_file;
477: /* %endif */
478:
479: /* %if-c++-only */
480: /* %endif */
481:
482: char *yy_ch_buf; /* input buffer */
483: char *yy_buf_pos; /* current position in input buffer */
484:
485: /* Size of input buffer in bytes, not including room for EOB
486: * characters.
487: */
488: int yy_buf_size;
489:
490: /* Number of characters read into yy_ch_buf, not including EOB
491: * characters.
492: */
493: int yy_n_chars;
494:
495: /* Whether we "own" the buffer - i.e., we know we created it,
496: * and can realloc() it to grow it, and should free() it to
497: * delete it.
498: */
499: int yy_is_our_buffer;
500:
501: /* Whether this is an "interactive" input source; if so, and
502: * if we're using stdio for input, then we want to use getc()
503: * instead of fread(), to make sure we stop fetching input after
504: * each newline.
505: */
506: int yy_is_interactive;
507:
508: /* Whether we're considered to be at the beginning of a line.
509: * If so, '^' rules will be active on the next match, otherwise
510: * not.
511: */
512: int yy_at_bol;
513:
514: int yy_bs_lineno; /**< The line count. */
515: int yy_bs_column; /**< The column count. */
516:
517: /* Whether to try to fill the input buffer when we reach the
518: * end of it.
519: */
520: int yy_fill_buffer;
521:
522: int yy_buffer_status;
523:
524: #define YY_BUFFER_NEW 0
525: #define YY_BUFFER_NORMAL 1
526: /* When an EOF's been seen but there's still some text to process
527: * then we mark the buffer as YY_EOF_PENDING, to indicate that we
528: * shouldn't try reading from the input source any more. We might
529: * still have a bunch of tokens to match, though, because of
530: * possible backing-up.
531: *
532: * When we actually see the EOF, we change the status to "new"
533: * (via yyrestart()), so that the user can continue scanning by
534: * just pointing yyin at a new input file.
535: */
536: #define YY_BUFFER_EOF_PENDING 2
537:
538: };
539: #endif /* !YY_STRUCT_YY_BUFFER_STATE */
540:
541: /* %if-c-only Standard (non-C++) definition */
542: /* %not-for-header */
543: /* %if-not-reentrant */
544: /* %endif */
545: /* %ok-for-header */
546:
547: /* %endif */
548:
549: /* We provide macros for accessing buffer states in case in the
550: * future we want to put the buffer states in a more general
551: * "scanner state".
552: *
553: * Returns the top of the stack, or NULL.
554: */
555: #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
556: ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
557: : NULL)
558: /* Same as previous macro, but useful when we know that the buffer stack is not
559: * NULL or when we need an lvalue. For internal use only.
560: */
561: #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
562:
563: /* %if-c-only Standard (non-C++) definition */
564:
565: /* %if-not-reentrant */
566: /* %not-for-header */
567: /* %ok-for-header */
568:
569: /* %endif */
570:
571: void yyrestart ( FILE *input_file , yyscan_t yyscanner );
572: void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
573: YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
574: void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
575: void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
576: void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
577: void yypop_buffer_state ( yyscan_t yyscanner );
578:
579: static void yyensure_buffer_stack ( yyscan_t yyscanner );
580: static void yy_load_buffer_state ( yyscan_t yyscanner );
581: static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
582: #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
583:
584: YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
585: YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
586: YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
587:
588: /* %endif */
589:
590: void *yyalloc ( yy_size_t , yyscan_t yyscanner );
591: void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
592: void yyfree ( void * , yyscan_t yyscanner );
593:
594: #define yy_new_buffer yy_create_buffer
595: #define yy_set_interactive(is_interactive) \
596: { \
597: if ( ! YY_CURRENT_BUFFER ){ \
598: yyensure_buffer_stack (yyscanner); \
599: YY_CURRENT_BUFFER_LVALUE = \
600: yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
601: } \
602: YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
603: }
604: #define yy_set_bol(at_bol) \
605: { \
606: if ( ! YY_CURRENT_BUFFER ){\
607: yyensure_buffer_stack (yyscanner); \
608: YY_CURRENT_BUFFER_LVALUE = \
609: yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
610: } \
611: YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
612: }
613: #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
614:
615: /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
616: /* Begin user sect3 */
617:
618: #define settings_parser_wrap(yyscanner) (/*CONSTCOND*/1)
619: #define YY_SKIP_YYWRAP
620:
621: #define FLEX_DEBUG
622: typedef flex_uint8_t YY_CHAR;
623:
624: typedef int yy_state_type;
625:
626: #define yytext_ptr yytext_r
627:
628: /* %% [1.5] DFA */
629:
630: /* %if-c-only Standard (non-C++) definition */
631:
632: static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
633: static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
634: static int yy_get_next_buffer ( yyscan_t yyscanner );
635: static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
636:
637: /* %endif */
638:
639: /* Done after the current pattern has been matched and before the
640: * corresponding action - sets up yytext.
641: */
642: #define YY_DO_BEFORE_ACTION \
643: yyg->yytext_ptr = yy_bp; \
644: /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
645: yyleng = (int) (yy_cp - yy_bp); \
646: yyg->yy_hold_char = *yy_cp; \
647: *yy_cp = '\0'; \
648: /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
649: yyg->yy_c_buf_p = yy_cp;
650: /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
651: #define YY_NUM_RULES 39
652: #define YY_END_OF_BUFFER 40
653: /* This struct is not used in this scanner,
654: but its presence is necessary. */
655: struct yy_trans_info
656: {
657: flex_int32_t yy_verify;
658: flex_int32_t yy_nxt;
659: };
660: static const flex_int16_t yy_accept[85] =
661: { 0,
662: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
663: 40, 12, 2, 3, 2, 11, 1, 7, 6, 8,
664: 9, 12, 4, 5, 17, 14, 15, 14, 18, 13,
665: 16, 23, 20, 21, 19, 22, 29, 25, 24, 26,
666: 27, 38, 30, 31, 32, 12, 2, 2, 1, 1,
667: 3, 0, 12, 17, 0, 14, 14, 13, 13, 15,
668: 0, 23, 20, 29, 28, 38, 37, 36, 37, 33,
669: 34, 35, 1, 12, 17, 13, 12, 12, 12, 12,
670: 0, 10, 10, 0
671: } ;
672:
673: static const YY_CHAR yy_ec[256] =
674: { 0,
675: 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
676: 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
677: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
678: 1, 5, 1, 6, 7, 1, 1, 1, 1, 1,
679: 1, 1, 1, 8, 1, 9, 1, 1, 1, 1,
680: 1, 1, 1, 1, 1, 1, 1, 10, 1, 1,
681: 11, 1, 1, 1, 1, 1, 1, 1, 1, 1,
682: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
683: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
684: 1, 12, 1, 1, 1, 1, 1, 1, 13, 14,
685:
686: 15, 1, 1, 1, 16, 1, 1, 17, 1, 18,
687: 1, 1, 1, 19, 1, 20, 21, 1, 1, 1,
688: 1, 1, 22, 1, 23, 1, 1, 1, 1, 1,
689: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
690: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
691: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
692: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
693: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
694: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
695: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
696:
697: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
698: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
699: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
700: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
701: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
702: 1, 1, 1, 1, 1
703: } ;
704:
705: static const YY_CHAR yy_meta[24] =
706: { 0,
707: 1, 2, 3, 4, 5, 6, 5, 7, 8, 7,
708: 9, 10, 1, 1, 1, 1, 1, 1, 1, 1,
709: 1, 7, 5
710: } ;
711:
712: static const flex_int16_t yy_base[103] =
713: { 0,
714: 0, 0, 23, 0, 45, 67, 89, 111, 49, 50,
715: 124, 0, 133, 335, 55, 335, 60, 335, 335, 335,
716: 335, 104, 335, 335, 112, 139, 335, 73, 335, 62,
717: 335, 0, 74, 335, 335, 335, 0, 335, 335, 335,
718: 0, 0, 335, 335, 144, 0, 0, 78, 0, 81,
719: 335, 117, 106, 102, 0, 0, 84, 0, 94, 335,
720: 107, 0, 97, 0, 335, 0, 335, 335, 106, 335,
721: 335, 335, 0, 89, 78, 0, 60, 53, 43, 98,
722: 102, 335, 103, 335, 164, 174, 184, 194, 204, 214,
723: 224, 234, 244, 249, 255, 264, 274, 284, 294, 304,
724:
725: 314, 324
726: } ;
727:
728: static const flex_int16_t yy_def[103] =
729: { 0,
730: 84, 1, 84, 3, 85, 85, 86, 86, 87, 87,
731: 84, 88, 84, 84, 84, 84, 89, 84, 84, 84,
732: 84, 88, 84, 84, 90, 84, 84, 84, 84, 91,
733: 84, 92, 84, 84, 84, 84, 93, 84, 84, 84,
734: 94, 95, 84, 84, 96, 88, 13, 84, 97, 89,
735: 84, 98, 88, 90, 99, 26, 84, 100, 91, 84,
736: 101, 92, 84, 93, 84, 95, 84, 84, 84, 84,
737: 84, 84, 97, 88, 99, 100, 88, 88, 88, 88,
738: 102, 84, 102, 0, 84, 84, 84, 84, 84, 84,
739: 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
740:
741: 84, 84
742: } ;
743:
744: static const flex_int16_t yy_nxt[359] =
745: { 0,
746: 12, 13, 14, 15, 13, 16, 17, 18, 19, 20,
747: 21, 12, 12, 12, 12, 22, 12, 12, 12, 12,
748: 12, 23, 24, 25, 26, 27, 28, 26, 29, 30,
749: 31, 29, 29, 29, 25, 25, 25, 25, 25, 25,
750: 25, 25, 25, 25, 29, 29, 33, 34, 35, 33,
751: 36, 34, 43, 43, 44, 44, 48, 80, 48, 48,
752: 45, 45, 51, 52, 60, 61, 79, 34, 33, 34,
753: 35, 33, 36, 34, 57, 63, 57, 57, 63, 48,
754: 78, 48, 48, 51, 52, 57, 55, 57, 57, 34,
755: 38, 38, 39, 38, 40, 38, 60, 61, 63, 81,
756:
757: 41, 63, 81, 83, 83, 77, 83, 83, 68, 60,
758: 55, 38, 38, 38, 39, 38, 40, 38, 74, 51,
759: 55, 53, 41, 84, 84, 84, 84, 84, 84, 84,
760: 84, 84, 84, 38, 47, 84, 48, 47, 84, 49,
761: 56, 84, 57, 56, 84, 58, 68, 69, 84, 84,
762: 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
763: 84, 70, 71, 72, 32, 32, 32, 32, 32, 32,
764: 32, 32, 32, 32, 37, 37, 37, 37, 37, 37,
765: 37, 37, 37, 37, 42, 42, 42, 42, 42, 42,
766: 42, 42, 42, 42, 46, 84, 84, 84, 84, 84,
767:
768: 84, 84, 84, 46, 50, 50, 50, 50, 50, 50,
769: 50, 50, 50, 50, 54, 84, 84, 84, 84, 84,
770: 84, 54, 84, 54, 59, 59, 59, 59, 59, 59,
771: 59, 59, 59, 59, 62, 84, 84, 84, 84, 84,
772: 62, 62, 62, 62, 64, 84, 84, 84, 84, 84,
773: 64, 64, 64, 65, 65, 66, 66, 66, 84, 66,
774: 84, 66, 66, 66, 67, 67, 67, 67, 67, 67,
775: 67, 67, 67, 67, 73, 73, 84, 84, 73, 73,
776: 73, 73, 73, 73, 52, 52, 52, 52, 52, 52,
777: 52, 52, 52, 52, 75, 84, 84, 84, 84, 84,
778:
779: 84, 84, 84, 75, 76, 76, 84, 84, 76, 76,
780: 76, 76, 76, 76, 61, 61, 61, 61, 61, 61,
781: 61, 61, 61, 61, 82, 82, 82, 82, 82, 82,
782: 82, 82, 84, 82, 11, 84, 84, 84, 84, 84,
783: 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
784: 84, 84, 84, 84, 84, 84, 84, 84
785: } ;
786:
787: static const flex_int16_t yy_chk[359] =
788: { 0,
789: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
790: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
791: 1, 1, 1, 3, 3, 3, 3, 3, 3, 3,
792: 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
793: 3, 3, 3, 3, 3, 3, 5, 5, 5, 5,
794: 5, 5, 9, 10, 9, 10, 15, 79, 15, 15,
795: 9, 10, 17, 17, 30, 30, 78, 5, 6, 6,
796: 6, 6, 6, 6, 28, 33, 28, 28, 33, 48,
797: 77, 48, 48, 50, 50, 57, 75, 57, 57, 6,
798: 7, 7, 7, 7, 7, 7, 59, 59, 63, 80,
799:
800: 7, 63, 80, 81, 83, 74, 81, 83, 69, 61,
801: 54, 7, 8, 8, 8, 8, 8, 8, 53, 52,
802: 25, 22, 8, 11, 0, 0, 0, 0, 0, 0,
803: 0, 0, 0, 8, 13, 0, 13, 13, 0, 13,
804: 26, 0, 26, 26, 0, 26, 45, 45, 0, 0,
805: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
806: 0, 45, 45, 45, 85, 85, 85, 85, 85, 85,
807: 85, 85, 85, 85, 86, 86, 86, 86, 86, 86,
808: 86, 86, 86, 86, 87, 87, 87, 87, 87, 87,
809: 87, 87, 87, 87, 88, 0, 0, 0, 0, 0,
810:
811: 0, 0, 0, 88, 89, 89, 89, 89, 89, 89,
812: 89, 89, 89, 89, 90, 0, 0, 0, 0, 0,
813: 0, 90, 0, 90, 91, 91, 91, 91, 91, 91,
814: 91, 91, 91, 91, 92, 0, 0, 0, 0, 0,
815: 92, 92, 92, 92, 93, 0, 0, 0, 0, 0,
816: 93, 93, 93, 94, 94, 95, 95, 95, 0, 95,
817: 0, 95, 95, 95, 96, 96, 96, 96, 96, 96,
818: 96, 96, 96, 96, 97, 97, 0, 0, 97, 97,
819: 97, 97, 97, 97, 98, 98, 98, 98, 98, 98,
820: 98, 98, 98, 98, 99, 0, 0, 0, 0, 0,
821:
822: 0, 0, 0, 99, 100, 100, 0, 0, 100, 100,
823: 100, 100, 100, 100, 101, 101, 101, 101, 101, 101,
824: 101, 101, 101, 101, 102, 102, 102, 102, 102, 102,
825: 102, 102, 0, 102, 84, 84, 84, 84, 84, 84,
826: 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
827: 84, 84, 84, 84, 84, 84, 84, 84
828: } ;
829:
830: /* Table of booleans, true if rule could match eol. */
831: static const flex_int32_t yy_rule_can_match_eol[40] =
832: { 0,
833: 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
834: 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
835: };
836:
837: static const flex_int16_t yy_rule_linenum[39] =
838: { 0,
839: 71, 72, 73, 75, 76, 78, 79, 81, 86, 91,
840: 96, 101, 107, 108, 109, 111, 113, 118, 125, 126,
841: 128, 149, 155, 162, 165, 185, 188, 191, 194, 200,
842: 201, 203, 223, 224, 225, 226, 227, 228
843: } ;
844:
845: /* The intent behind this definition is that it'll catch
846: * any uses of REJECT which flex missed.
847: */
848: #define REJECT reject_used_but_not_detected
849: #define yymore() yymore_used_but_not_detected
850: #define YY_MORE_ADJ 0
851: #define YY_RESTORE_YY_MORE_OFFSET
852: #line 1 "settings/settings_lexer.l"
853: #line 2 "settings/settings_lexer.l"
854: /*
855: * Copyright (C) 2014-2018 Tobias Brunner
856: * HSR Hochschule fuer Technik Rapperswil
857: *
858: * This program is free software; you can redistribute it and/or modify it
859: * under the terms of the GNU General Public License as published by the
860: * Free Software Foundation; either version 2 of the License, or (at your
861: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
862: *
863: * This program is distributed in the hope that it will be useful, but
864: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
865: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
866: * for more details.
867: */
868:
869: #include <utils/parser_helper.h>
870:
871: #include "settings_parser.h"
872:
873: bool settings_parser_open_next_file(parser_helper_t *ctx);
874:
875: static void include_files(parser_helper_t *ctx);
876:
1.1.1.2 ! misho 877: #line 878 "settings/settings_lexer.c"
1.1 misho 878: /* use start conditions stack */
879: /* do not declare unneeded functions */
880: #define YY_NO_INPUT 1
881: /* do not include unistd.h as it might conflict with our scanner states */
882: #define YY_NO_UNISTD_H 1
883: /* due to that disable interactive mode, which requires isatty() */
1.1.1.2 ! misho 884: /* don't use global variables */
1.1 misho 885: /* maintain the line number */
886: /* don't generate a default rule */
887: /* prefix function/variable declarations */
888: /* don't change the name of the output file otherwise autotools has issues */
889: /* type of our extra data */
890: /* state used to scan references */
891:
892: /* state used to scan values */
893:
894: /* state used to scan include file patterns */
895:
896: /* state used to scan quoted strings */
897:
898: /* pattern for section/key names */
1.1.1.2 ! misho 899: #line 900 "settings/settings_lexer.c"
1.1 misho 900:
901: #define INITIAL 0
902: #define ref 1
903: #define val 2
904: #define inc 3
905: #define str 4
906:
907: #ifndef YY_NO_UNISTD_H
908: /* Special case for "unistd.h", since it is non-ANSI. We include it way
909: * down here because we want the user's section 1 to have been scanned first.
910: * The user has a chance to override it with an option.
911: */
912: /* %if-c-only */
913: #include <unistd.h>
914: /* %endif */
915: /* %if-c++-only */
916: /* %endif */
917: #endif
918:
919: #define YY_EXTRA_TYPE parser_helper_t*
920:
921: /* %if-c-only Reentrant structure and macros (non-C++). */
922: /* %if-reentrant */
923:
924: /* Holds the entire state of the reentrant scanner. */
925: struct yyguts_t
926: {
927:
928: /* User-defined. Not touched by flex. */
929: YY_EXTRA_TYPE yyextra_r;
930:
931: /* The rest are the same as the globals declared in the non-reentrant scanner. */
932: FILE *yyin_r, *yyout_r;
933: size_t yy_buffer_stack_top; /**< index of top of stack. */
934: size_t yy_buffer_stack_max; /**< capacity of stack. */
935: YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
936: char yy_hold_char;
937: int yy_n_chars;
938: int yyleng_r;
939: char *yy_c_buf_p;
940: int yy_init;
941: int yy_start;
942: int yy_did_buffer_switch_on_eof;
943: int yy_start_stack_ptr;
944: int yy_start_stack_depth;
945: int *yy_start_stack;
946: yy_state_type yy_last_accepting_state;
947: char* yy_last_accepting_cpos;
948:
949: int yylineno_r;
950: int yy_flex_debug_r;
951:
952: char *yytext_r;
953: int yy_more_flag;
954: int yy_more_len;
955:
956: }; /* end struct yyguts_t */
957:
958: /* %if-c-only */
959:
960: static int yy_init_globals ( yyscan_t yyscanner );
961:
962: /* %endif */
963:
964: /* %if-reentrant */
965:
966: int yylex_init (yyscan_t* scanner);
967:
968: int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
969:
970: /* %endif */
971:
972: /* %endif End reentrant structures and macros. */
973:
974: /* Accessor methods to globals.
975: These are made visible to non-reentrant scanners for convenience. */
976:
977: int yylex_destroy ( yyscan_t yyscanner );
978:
979: int yyget_debug ( yyscan_t yyscanner );
980:
981: void yyset_debug ( int debug_flag , yyscan_t yyscanner );
982:
983: YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
984:
985: void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
986:
987: FILE *yyget_in ( yyscan_t yyscanner );
988:
989: void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
990:
991: FILE *yyget_out ( yyscan_t yyscanner );
992:
993: void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
994:
995: int yyget_leng ( yyscan_t yyscanner );
996:
997: char *yyget_text ( yyscan_t yyscanner );
998:
999: int yyget_lineno ( yyscan_t yyscanner );
1000:
1001: void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1002:
1003: int yyget_column ( yyscan_t yyscanner );
1004:
1005: void yyset_column ( int _column_no , yyscan_t yyscanner );
1006:
1007: /* %if-bison-bridge */
1008: /* %endif */
1009:
1010: /* Macros after this point can all be overridden by user definitions in
1011: * section 1.
1012: */
1013:
1014: #ifndef YY_SKIP_YYWRAP
1015: #ifdef __cplusplus
1016: extern "C" int yywrap ( yyscan_t yyscanner );
1017: #else
1018: extern int yywrap ( yyscan_t yyscanner );
1019: #endif
1020: #endif
1021:
1022: /* %not-for-header */
1023: #ifndef YY_NO_UNPUT
1024:
1025: static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
1026:
1027: #endif
1028: /* %ok-for-header */
1029:
1030: /* %endif */
1031:
1032: #ifndef yytext_ptr
1033: static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1034: #endif
1035:
1036: #ifdef YY_NEED_STRLEN
1037: static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1038: #endif
1039:
1040: #ifndef YY_NO_INPUT
1041: /* %if-c-only Standard (non-C++) definition */
1042: /* %not-for-header */
1043: #ifdef __cplusplus
1044: static int yyinput ( yyscan_t yyscanner );
1045: #else
1046: static int input ( yyscan_t yyscanner );
1047: #endif
1048: /* %ok-for-header */
1049:
1050: /* %endif */
1051: #endif
1052:
1053: /* %if-c-only */
1054:
1055: static void yy_push_state ( int _new_state , yyscan_t yyscanner);
1056:
1057: static void yy_pop_state ( yyscan_t yyscanner );
1058:
1059: static int yy_top_state ( yyscan_t yyscanner );
1060:
1061: /* %endif */
1062:
1063: /* Amount of stuff to slurp up with each read. */
1064: #ifndef YY_READ_BUF_SIZE
1065: #ifdef __ia64__
1066: /* On IA-64, the buffer size is 16k, not 8k */
1067: #define YY_READ_BUF_SIZE 16384
1068: #else
1069: #define YY_READ_BUF_SIZE 8192
1070: #endif /* __ia64__ */
1071: #endif
1072:
1073: /* Copy whatever the last rule matched to the standard output. */
1074: #ifndef ECHO
1075: /* %if-c-only Standard (non-C++) definition */
1076: /* This used to be an fputs(), but since the string might contain NUL's,
1077: * we now use fwrite().
1078: */
1079: #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1080: /* %endif */
1081: /* %if-c++-only C++ definition */
1082: /* %endif */
1083: #endif
1084:
1085: /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1086: * is returned in "result".
1087: */
1088: #ifndef YY_INPUT
1089: #define YY_INPUT(buf,result,max_size) \
1090: /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1091: if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1092: { \
1093: int c = '*'; \
1094: int n; \
1095: for ( n = 0; n < max_size && \
1096: (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1097: buf[n] = (char) c; \
1098: if ( c == '\n' ) \
1099: buf[n++] = (char) c; \
1100: if ( c == EOF && ferror( yyin ) ) \
1101: YY_FATAL_ERROR( "input in flex scanner failed" ); \
1102: result = n; \
1103: } \
1104: else \
1105: { \
1106: errno=0; \
1107: while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1108: { \
1109: if( errno != EINTR) \
1110: { \
1111: YY_FATAL_ERROR( "input in flex scanner failed" ); \
1112: break; \
1113: } \
1114: errno=0; \
1115: clearerr(yyin); \
1116: } \
1117: }\
1118: \
1119: /* %if-c++-only C++ definition \ */\
1120: /* %endif */
1121:
1122: #endif
1123:
1124: /* No semi-colon after return; correct usage is to write "yyterminate();" -
1125: * we don't want an extra ';' after the "return" because that will cause
1126: * some compilers to complain about unreachable statements.
1127: */
1128: #ifndef yyterminate
1129: #define yyterminate() return YY_NULL
1130: #endif
1131:
1132: /* Number of entries by which start-condition stack grows. */
1133: #ifndef YY_START_STACK_INCR
1134: #define YY_START_STACK_INCR 25
1135: #endif
1136:
1137: /* Report a fatal error. */
1138: #ifndef YY_FATAL_ERROR
1139: /* %if-c-only */
1140: #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1141: /* %endif */
1142: /* %if-c++-only */
1143: /* %endif */
1144: #endif
1145:
1146: /* %if-tables-serialization structures and prototypes */
1147: /* %not-for-header */
1148: /* %ok-for-header */
1149:
1150: /* %not-for-header */
1151: /* %tables-yydmap generated elements */
1152: /* %endif */
1153: /* end tables serialization structures and prototypes */
1154:
1155: /* %ok-for-header */
1156:
1157: /* Default declaration of generated scanner - a define so the user can
1158: * easily add parameters.
1159: */
1160: #ifndef YY_DECL
1161: #define YY_DECL_IS_OURS 1
1162: /* %if-c-only Standard (non-C++) definition */
1163:
1.1.1.2 ! misho 1164: extern int yylex (yyscan_t yyscanner);
1.1 misho 1165:
1.1.1.2 ! misho 1166: #define YY_DECL int yylex (yyscan_t yyscanner)
1.1 misho 1167: /* %endif */
1168: /* %if-c++-only C++ definition */
1169: /* %endif */
1170: #endif /* !YY_DECL */
1171:
1172: /* Code executed at the beginning of each rule, after yytext and yyleng
1173: * have been set up.
1174: */
1175: #ifndef YY_USER_ACTION
1176: #define YY_USER_ACTION
1177: #endif
1178:
1179: /* Code executed at the end of each rule. */
1180: #ifndef YY_BREAK
1181: #define YY_BREAK /*LINTED*/break;
1182: #endif
1183:
1184: /* %% [6.0] YY_RULE_SETUP definition goes here */
1185: #define YY_RULE_SETUP \
1186: YY_USER_ACTION
1187:
1188: /* %not-for-header */
1189: /** The main scanner function which does all the work.
1190: */
1191: YY_DECL
1192: {
1193: yy_state_type yy_current_state;
1194: char *yy_cp, *yy_bp;
1195: int yy_act;
1196: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1197:
1198: if ( !yyg->yy_init )
1199: {
1200: yyg->yy_init = 1;
1201:
1202: #ifdef YY_USER_INIT
1203: YY_USER_INIT;
1204: #endif
1205:
1206: if ( ! yyg->yy_start )
1207: yyg->yy_start = 1; /* first start state */
1208:
1209: if ( ! yyin )
1210: /* %if-c-only */
1211: yyin = stdin;
1212: /* %endif */
1213: /* %if-c++-only */
1214: /* %endif */
1215:
1216: if ( ! yyout )
1217: /* %if-c-only */
1218: yyout = stdout;
1219: /* %endif */
1220: /* %if-c++-only */
1221: /* %endif */
1222:
1223: if ( ! YY_CURRENT_BUFFER ) {
1224: yyensure_buffer_stack (yyscanner);
1225: YY_CURRENT_BUFFER_LVALUE =
1226: yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1227: }
1228:
1229: yy_load_buffer_state( yyscanner );
1230: }
1231:
1232: {
1233: /* %% [7.0] user's declarations go here */
1234: #line 69 "settings/settings_lexer.l"
1235:
1236:
1.1.1.2 ! misho 1237: #line 1238 "settings/settings_lexer.c"
1.1 misho 1238:
1239: while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1240: {
1241: /* %% [8.0] yymore()-related code goes here */
1242: yy_cp = yyg->yy_c_buf_p;
1243:
1244: /* Support of yytext. */
1245: *yy_cp = yyg->yy_hold_char;
1246:
1247: /* yy_bp points to the position in yy_ch_buf of the start of
1248: * the current run.
1249: */
1250: yy_bp = yy_cp;
1251:
1252: /* %% [9.0] code to set up and find next match goes here */
1253: yy_current_state = yyg->yy_start;
1254: yy_match:
1255: do
1256: {
1257: YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1258: if ( yy_accept[yy_current_state] )
1259: {
1260: yyg->yy_last_accepting_state = yy_current_state;
1261: yyg->yy_last_accepting_cpos = yy_cp;
1262: }
1263: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1264: {
1265: yy_current_state = (int) yy_def[yy_current_state];
1266: if ( yy_current_state >= 85 )
1267: yy_c = yy_meta[yy_c];
1268: }
1269: yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1270: ++yy_cp;
1271: }
1272: while ( yy_current_state != 84 );
1273: yy_cp = yyg->yy_last_accepting_cpos;
1274: yy_current_state = yyg->yy_last_accepting_state;
1275:
1276: yy_find_action:
1277: /* %% [10.0] code to find the action number goes here */
1278: yy_act = yy_accept[yy_current_state];
1279:
1280: YY_DO_BEFORE_ACTION;
1281:
1282: /* %% [11.0] code for yylineno update goes here */
1283:
1284: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1285: {
1286: int yyl;
1287: for ( yyl = 0; yyl < yyleng; ++yyl )
1288: if ( yytext[yyl] == '\n' )
1289:
1290: do{ yylineno++;
1291: yycolumn=0;
1292: }while(0)
1293: ;
1294: }
1295:
1296: do_action: /* This label is used only to access EOF actions. */
1297:
1298: /* %% [12.0] debug code goes here */
1299: if ( yy_flex_debug )
1300: {
1301: if ( yy_act == 0 )
1302: fprintf( stderr, "--scanner backing up\n" );
1303: else if ( yy_act < 39 )
1304: fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1305: (long)yy_rule_linenum[yy_act], yytext );
1306: else if ( yy_act == 39 )
1307: fprintf( stderr, "--accepting default rule (\"%s\")\n",
1308: yytext );
1309: else if ( yy_act == 40 )
1310: fprintf( stderr, "--(end of buffer or a NUL)\n" );
1311: else
1312: fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1313: }
1314:
1315: switch ( yy_act )
1316: { /* beginning of action switch */
1317: /* %% [13.0] actions go here */
1318: case 0: /* must back up */
1319: /* undo the effects of YY_DO_BEFORE_ACTION */
1320: *yy_cp = yyg->yy_hold_char;
1321: yy_cp = yyg->yy_last_accepting_cpos;
1322: yy_current_state = yyg->yy_last_accepting_state;
1323: goto yy_find_action;
1324:
1325: case 1:
1326: YY_RULE_SETUP
1327: #line 71 "settings/settings_lexer.l"
1328: /* eat comments */
1329: YY_BREAK
1330: case 2:
1331: YY_RULE_SETUP
1332: #line 72 "settings/settings_lexer.l"
1333: /* eat whitespace */
1334: YY_BREAK
1335: case 3:
1336: /* rule 3 can match eol */
1337: YY_RULE_SETUP
1338: #line 73 "settings/settings_lexer.l"
1339: /* eat newlines and comments at the end of a line */
1340: YY_BREAK
1341: case 4:
1342: #line 76 "settings/settings_lexer.l"
1343: case 5:
1344: YY_RULE_SETUP
1345: #line 76 "settings/settings_lexer.l"
1346: return yytext[0];
1347: YY_BREAK
1348: case 6:
1349: YY_RULE_SETUP
1350: #line 78 "settings/settings_lexer.l"
1351: return DOT;
1352: YY_BREAK
1353: case 7:
1354: YY_RULE_SETUP
1355: #line 79 "settings/settings_lexer.l"
1356: return COMMA;
1357: YY_BREAK
1358: case 8:
1359: YY_RULE_SETUP
1360: #line 81 "settings/settings_lexer.l"
1361: {
1362: yy_push_state(ref, yyscanner);
1363: return COLON;
1364: }
1365: YY_BREAK
1366: case 9:
1367: YY_RULE_SETUP
1368: #line 86 "settings/settings_lexer.l"
1369: {
1370: yy_push_state(val, yyscanner);
1371: return yytext[0];
1372: }
1373: YY_BREAK
1374: case 10:
1375: /* rule 10 can match eol */
1376: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
1377: YY_LINENO_REWIND_TO(yy_cp - 1);
1378: yyg->yy_c_buf_p = yy_cp -= 1;
1379: YY_DO_BEFORE_ACTION; /* set up yytext again */
1380: YY_RULE_SETUP
1381: #line 91 "settings/settings_lexer.l"
1382: {
1383: yyextra->string_init(yyextra);
1384: yy_push_state(inc, yyscanner);
1385: }
1386: YY_BREAK
1387: case 11:
1388: YY_RULE_SETUP
1389: #line 96 "settings/settings_lexer.l"
1390: {
1391: PARSER_DBG1(yyextra, "unexpected string detected");
1392: return STRING_ERROR;
1393: }
1394: YY_BREAK
1395: case 12:
1396: YY_RULE_SETUP
1397: #line 101 "settings/settings_lexer.l"
1398: {
1399: yylval->s = strdup(yytext);
1400: return NAME;
1401: }
1402: YY_BREAK
1403:
1404: case 13:
1405: YY_RULE_SETUP
1406: #line 107 "settings/settings_lexer.l"
1407: /* eat comments */
1408: YY_BREAK
1409: case 14:
1410: YY_RULE_SETUP
1411: #line 108 "settings/settings_lexer.l"
1412: /* eat whitespace */
1413: YY_BREAK
1414: case 15:
1415: /* rule 15 can match eol */
1416: YY_RULE_SETUP
1417: #line 109 "settings/settings_lexer.l"
1418: /* eat newlines and comments at the end of a line */
1419: YY_BREAK
1420: case 16:
1421: YY_RULE_SETUP
1422: #line 111 "settings/settings_lexer.l"
1423: return COMMA;
1424: YY_BREAK
1425: case 17:
1426: YY_RULE_SETUP
1427: #line 113 "settings/settings_lexer.l"
1428: {
1429: yylval->s = strdup(yytext);
1430: return NAME;
1431: }
1432: YY_BREAK
1433: case 18:
1434: YY_RULE_SETUP
1435: #line 118 "settings/settings_lexer.l"
1436: {
1437: unput(yytext[0]);
1438: yy_pop_state(yyscanner);
1439: }
1440: YY_BREAK
1441:
1442:
1443: case 19:
1444: YY_RULE_SETUP
1445: #line 125 "settings/settings_lexer.l"
1446: /* just ignore these */
1447: YY_BREAK
1448: case 20:
1449: YY_RULE_SETUP
1450: #line 126 "settings/settings_lexer.l"
1451:
1452: YY_BREAK
1453: case YY_STATE_EOF(val):
1454: #line 127 "settings/settings_lexer.l"
1455: case 21:
1456: /* rule 21 can match eol */
1457: YY_RULE_SETUP
1458: #line 128 "settings/settings_lexer.l"
1459: {
1460: if (*yytext)
1461: {
1462: switch (yytext[0])
1463: {
1464: case '\n':
1465: /* put the newline back to fix the line numbers */
1466: unput('\n');
1467: yy_set_bol(0);
1468: break;
1469: case '#':
1470: case '}':
1471: /* these are parsed outside of this start condition */
1472: unput(yytext[0]);
1473: break;
1474: }
1475: }
1476: yy_pop_state(yyscanner);
1477: return NEWLINE;
1478: }
1479: YY_BREAK
1480: case 22:
1481: YY_RULE_SETUP
1482: #line 149 "settings/settings_lexer.l"
1483: {
1484: yyextra->string_init(yyextra);
1485: yy_push_state(str, yyscanner);
1486: }
1487: YY_BREAK
1488: /* same as above, but allow more characters */
1489: case 23:
1490: YY_RULE_SETUP
1491: #line 155 "settings/settings_lexer.l"
1492: {
1493: yylval->s = strdup(yytext);
1494: return NAME;
1495: }
1496: YY_BREAK
1497:
1498:
1499: case 24:
1500: YY_RULE_SETUP
1501: #line 162 "settings/settings_lexer.l"
1502: /* just ignore these */
1503: YY_BREAK
1504: /* we allow all characters except #, } and spaces, they can be escaped */
1505: case YY_STATE_EOF(inc):
1506: #line 164 "settings/settings_lexer.l"
1507: case 25:
1508: /* rule 25 can match eol */
1509: YY_RULE_SETUP
1510: #line 165 "settings/settings_lexer.l"
1511: {
1512: if (*yytext)
1513: {
1514: switch (yytext[0])
1515: {
1516: case '\n':
1517: /* put the newline back to fix the line numbers */
1518: unput('\n');
1519: yy_set_bol(0);
1520: break;
1521: case '#':
1522: case '}':
1523: /* these are parsed outside of this start condition */
1524: unput(yytext[0]);
1525: break;
1526: }
1527: }
1528: include_files(yyextra);
1529: yy_pop_state(yyscanner);
1530: }
1531: YY_BREAK
1532: case 26:
1533: YY_RULE_SETUP
1534: #line 185 "settings/settings_lexer.l"
1535: { /* string include */
1536: yy_push_state(str, yyscanner);
1537: }
1538: YY_BREAK
1539: case 27:
1540: YY_RULE_SETUP
1541: #line 188 "settings/settings_lexer.l"
1542: {
1543: yyextra->string_add(yyextra, yytext);
1544: }
1545: YY_BREAK
1546: case 28:
1547: YY_RULE_SETUP
1548: #line 191 "settings/settings_lexer.l"
1549: {
1550: yyextra->string_add(yyextra, yytext+1);
1551: }
1552: YY_BREAK
1553: case 29:
1554: YY_RULE_SETUP
1555: #line 194 "settings/settings_lexer.l"
1556: {
1557: yyextra->string_add(yyextra, yytext);
1558: }
1559: YY_BREAK
1560:
1561:
1562: case 30:
1563: YY_RULE_SETUP
1564: #line 200 "settings/settings_lexer.l"
1565: /* just ignore these */
1566: YY_BREAK
1567: case 31:
1568: #line 202 "settings/settings_lexer.l"
1569: YY_RULE_SETUP
1570: case YY_STATE_EOF(str):
1571: #line 202 "settings/settings_lexer.l"
1572: case 32:
1573: YY_RULE_SETUP
1574: #line 203 "settings/settings_lexer.l"
1575: {
1576: if (!streq(yytext, "\""))
1577: {
1578: PARSER_DBG1(yyextra, "unterminated string detected");
1579: return STRING_ERROR;
1580: }
1581: if (yy_top_state(yyscanner) == inc)
1582: { /* string include */
1583: include_files(yyextra);
1584: yy_pop_state(yyscanner);
1585: yy_pop_state(yyscanner);
1586: }
1587: else
1588: {
1589: yy_pop_state(yyscanner);
1590: yylval->s = yyextra->string_get(yyextra);
1591: return STRING;
1592: }
1593: }
1594: YY_BREAK
1595: case 33:
1596: YY_RULE_SETUP
1597: #line 223 "settings/settings_lexer.l"
1598: yyextra->string_add(yyextra, "\n");
1599: YY_BREAK
1600: case 34:
1601: YY_RULE_SETUP
1602: #line 224 "settings/settings_lexer.l"
1603: yyextra->string_add(yyextra, "\r");
1604: YY_BREAK
1605: case 35:
1606: YY_RULE_SETUP
1607: #line 225 "settings/settings_lexer.l"
1608: yyextra->string_add(yyextra, "\t");
1609: YY_BREAK
1610: case 36:
1611: /* rule 36 can match eol */
1612: YY_RULE_SETUP
1613: #line 226 "settings/settings_lexer.l"
1614: /* merge lines that end with escaped EOL characters */
1615: YY_BREAK
1616: case 37:
1617: YY_RULE_SETUP
1618: #line 227 "settings/settings_lexer.l"
1619: yyextra->string_add(yyextra, yytext+1);
1620: YY_BREAK
1621: case 38:
1622: /* rule 38 can match eol */
1623: YY_RULE_SETUP
1624: #line 228 "settings/settings_lexer.l"
1625: {
1626: yyextra->string_add(yyextra, yytext);
1627: }
1628: YY_BREAK
1629:
1630: case YY_STATE_EOF(INITIAL):
1631: case YY_STATE_EOF(ref):
1632: #line 233 "settings/settings_lexer.l"
1633: {
1634: settings_parser_pop_buffer_state(yyscanner);
1635: if (!settings_parser_open_next_file(yyextra) && !YY_CURRENT_BUFFER)
1636: {
1637: yyterminate();
1638: }
1639: }
1640: YY_BREAK
1641: case 39:
1642: YY_RULE_SETUP
1643: #line 241 "settings/settings_lexer.l"
1644: YY_FATAL_ERROR( "flex scanner jammed" );
1645: YY_BREAK
1.1.1.2 ! misho 1646: #line 1647 "settings/settings_lexer.c"
1.1 misho 1647:
1648: case YY_END_OF_BUFFER:
1649: {
1650: /* Amount of text matched not including the EOB char. */
1651: int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1652:
1653: /* Undo the effects of YY_DO_BEFORE_ACTION. */
1654: *yy_cp = yyg->yy_hold_char;
1655: YY_RESTORE_YY_MORE_OFFSET
1656:
1657: if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1658: {
1659: /* We're scanning a new file or input source. It's
1660: * possible that this happened because the user
1661: * just pointed yyin at a new source and called
1662: * yylex(). If so, then we have to assure
1663: * consistency between YY_CURRENT_BUFFER and our
1664: * globals. Here is the right place to do so, because
1665: * this is the first action (other than possibly a
1666: * back-up) that will match for the new input source.
1667: */
1668: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1669: /* %if-c-only */
1670: YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1671: /* %endif */
1672: /* %if-c++-only */
1673: /* %endif */
1674: YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1675: }
1676:
1677: /* Note that here we test for yy_c_buf_p "<=" to the position
1678: * of the first EOB in the buffer, since yy_c_buf_p will
1679: * already have been incremented past the NUL character
1680: * (since all states make transitions on EOB to the
1681: * end-of-buffer state). Contrast this with the test
1682: * in input().
1683: */
1684: if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1685: { /* This was really a NUL. */
1686: yy_state_type yy_next_state;
1687:
1688: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1689:
1690: yy_current_state = yy_get_previous_state( yyscanner );
1691:
1692: /* Okay, we're now positioned to make the NUL
1693: * transition. We couldn't have
1694: * yy_get_previous_state() go ahead and do it
1695: * for us because it doesn't know how to deal
1696: * with the possibility of jamming (and we don't
1697: * want to build jamming into it because then it
1698: * will run more slowly).
1699: */
1700:
1701: yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1702:
1703: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1704:
1705: if ( yy_next_state )
1706: {
1707: /* Consume the NUL. */
1708: yy_cp = ++yyg->yy_c_buf_p;
1709: yy_current_state = yy_next_state;
1710: goto yy_match;
1711: }
1712:
1713: else
1714: {
1715: /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1716: yy_cp = yyg->yy_last_accepting_cpos;
1717: yy_current_state = yyg->yy_last_accepting_state;
1718: goto yy_find_action;
1719: }
1720: }
1721:
1722: else switch ( yy_get_next_buffer( yyscanner ) )
1723: {
1724: case EOB_ACT_END_OF_FILE:
1725: {
1726: yyg->yy_did_buffer_switch_on_eof = 0;
1727:
1728: if ( yywrap( yyscanner ) )
1729: {
1730: /* Note: because we've taken care in
1731: * yy_get_next_buffer() to have set up
1732: * yytext, we can now set up
1733: * yy_c_buf_p so that if some total
1734: * hoser (like flex itself) wants to
1735: * call the scanner after we return the
1736: * YY_NULL, it'll still work - another
1737: * YY_NULL will get returned.
1738: */
1739: yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1740:
1741: yy_act = YY_STATE_EOF(YY_START);
1742: goto do_action;
1743: }
1744:
1745: else
1746: {
1747: if ( ! yyg->yy_did_buffer_switch_on_eof )
1748: YY_NEW_FILE;
1749: }
1750: break;
1751: }
1752:
1753: case EOB_ACT_CONTINUE_SCAN:
1754: yyg->yy_c_buf_p =
1755: yyg->yytext_ptr + yy_amount_of_matched_text;
1756:
1757: yy_current_state = yy_get_previous_state( yyscanner );
1758:
1759: yy_cp = yyg->yy_c_buf_p;
1760: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1761: goto yy_match;
1762:
1763: case EOB_ACT_LAST_MATCH:
1764: yyg->yy_c_buf_p =
1765: &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1766:
1767: yy_current_state = yy_get_previous_state( yyscanner );
1768:
1769: yy_cp = yyg->yy_c_buf_p;
1770: yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1771: goto yy_find_action;
1772: }
1773: break;
1774: }
1775:
1776: default:
1777: YY_FATAL_ERROR(
1778: "fatal flex scanner internal error--no action found" );
1779: } /* end of action switch */
1780: } /* end of scanning one token */
1781: } /* end of user's declarations */
1782: } /* end of yylex */
1783: /* %ok-for-header */
1784:
1785: /* %if-c++-only */
1786: /* %not-for-header */
1787: /* %ok-for-header */
1788:
1789: /* %endif */
1790:
1791: /* yy_get_next_buffer - try to read in a new buffer
1792: *
1793: * Returns a code representing an action:
1794: * EOB_ACT_LAST_MATCH -
1795: * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1796: * EOB_ACT_END_OF_FILE - end of file
1797: */
1798: /* %if-c-only */
1799: static int yy_get_next_buffer (yyscan_t yyscanner)
1800: /* %endif */
1801: /* %if-c++-only */
1802: /* %endif */
1803: {
1804: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1805: char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1806: char *source = yyg->yytext_ptr;
1807: int number_to_move, i;
1808: int ret_val;
1809:
1810: if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1811: YY_FATAL_ERROR(
1812: "fatal flex scanner internal error--end of buffer missed" );
1813:
1814: if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1815: { /* Don't try to fill the buffer, so this is an EOF. */
1816: if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1817: {
1818: /* We matched a single character, the EOB, so
1819: * treat this as a final EOF.
1820: */
1821: return EOB_ACT_END_OF_FILE;
1822: }
1823:
1824: else
1825: {
1826: /* We matched some text prior to the EOB, first
1827: * process it.
1828: */
1829: return EOB_ACT_LAST_MATCH;
1830: }
1831: }
1832:
1833: /* Try to read more data. */
1834:
1835: /* First move last chars to start of buffer. */
1836: number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1837:
1838: for ( i = 0; i < number_to_move; ++i )
1839: *(dest++) = *(source++);
1840:
1841: if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1842: /* don't do the read, it's not guaranteed to return an EOF,
1843: * just force an EOF
1844: */
1845: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1846:
1847: else
1848: {
1849: int num_to_read =
1850: YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1851:
1852: while ( num_to_read <= 0 )
1853: { /* Not enough room in the buffer - grow it. */
1854:
1855: /* just a shorter name for the current buffer */
1856: YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1857:
1858: int yy_c_buf_p_offset =
1859: (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1860:
1861: if ( b->yy_is_our_buffer )
1862: {
1863: int new_size = b->yy_buf_size * 2;
1864:
1865: if ( new_size <= 0 )
1866: b->yy_buf_size += b->yy_buf_size / 8;
1867: else
1868: b->yy_buf_size *= 2;
1869:
1870: b->yy_ch_buf = (char *)
1871: /* Include room in for 2 EOB chars. */
1872: yyrealloc( (void *) b->yy_ch_buf,
1873: (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1874: }
1875: else
1876: /* Can't grow it, we don't own it. */
1877: b->yy_ch_buf = NULL;
1878:
1879: if ( ! b->yy_ch_buf )
1880: YY_FATAL_ERROR(
1881: "fatal error - scanner input buffer overflow" );
1882:
1883: yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1884:
1885: num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1886: number_to_move - 1;
1887:
1888: }
1889:
1890: if ( num_to_read > YY_READ_BUF_SIZE )
1891: num_to_read = YY_READ_BUF_SIZE;
1892:
1893: /* Read in more data. */
1894: YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1895: yyg->yy_n_chars, num_to_read );
1896:
1897: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1898: }
1899:
1900: if ( yyg->yy_n_chars == 0 )
1901: {
1902: if ( number_to_move == YY_MORE_ADJ )
1903: {
1904: ret_val = EOB_ACT_END_OF_FILE;
1905: yyrestart( yyin , yyscanner);
1906: }
1907:
1908: else
1909: {
1910: ret_val = EOB_ACT_LAST_MATCH;
1911: YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1912: YY_BUFFER_EOF_PENDING;
1913: }
1914: }
1915:
1916: else
1917: ret_val = EOB_ACT_CONTINUE_SCAN;
1918:
1919: if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1920: /* Extend the array by 50%, plus the number we really need. */
1921: int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1922: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1923: (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1924: if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1925: YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1926: /* "- 2" to take care of EOB's */
1927: YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1928: }
1929:
1930: yyg->yy_n_chars += number_to_move;
1931: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1932: YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1933:
1934: yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1935:
1936: return ret_val;
1937: }
1938:
1939: /* yy_get_previous_state - get the state just before the EOB char was reached */
1940:
1941: /* %if-c-only */
1942: /* %not-for-header */
1943: static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1944: /* %endif */
1945: /* %if-c++-only */
1946: /* %endif */
1947: {
1948: yy_state_type yy_current_state;
1949: char *yy_cp;
1950: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1951:
1952: /* %% [15.0] code to get the start state into yy_current_state goes here */
1953: yy_current_state = yyg->yy_start;
1954:
1955: for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1956: {
1957: /* %% [16.0] code to find the next state goes here */
1958: YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1959: if ( yy_accept[yy_current_state] )
1960: {
1961: yyg->yy_last_accepting_state = yy_current_state;
1962: yyg->yy_last_accepting_cpos = yy_cp;
1963: }
1964: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1965: {
1966: yy_current_state = (int) yy_def[yy_current_state];
1967: if ( yy_current_state >= 85 )
1968: yy_c = yy_meta[yy_c];
1969: }
1970: yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1971: }
1972:
1973: return yy_current_state;
1974: }
1975:
1976: /* yy_try_NUL_trans - try to make a transition on the NUL character
1977: *
1978: * synopsis
1979: * next_state = yy_try_NUL_trans( current_state );
1980: */
1981: /* %if-c-only */
1982: static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1983: /* %endif */
1984: /* %if-c++-only */
1985: /* %endif */
1986: {
1987: int yy_is_jam;
1988: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1989: /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1990: char *yy_cp = yyg->yy_c_buf_p;
1991:
1992: YY_CHAR yy_c = 1;
1993: if ( yy_accept[yy_current_state] )
1994: {
1995: yyg->yy_last_accepting_state = yy_current_state;
1996: yyg->yy_last_accepting_cpos = yy_cp;
1997: }
1998: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1999: {
2000: yy_current_state = (int) yy_def[yy_current_state];
2001: if ( yy_current_state >= 85 )
2002: yy_c = yy_meta[yy_c];
2003: }
2004: yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2005: yy_is_jam = (yy_current_state == 84);
2006:
2007: (void)yyg;
2008: return yy_is_jam ? 0 : yy_current_state;
2009: }
2010:
2011: #ifndef YY_NO_UNPUT
2012: /* %if-c-only */
2013:
2014: static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
2015: /* %endif */
2016: /* %if-c++-only */
2017: /* %endif */
2018: {
2019: char *yy_cp;
2020: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2021:
2022: yy_cp = yyg->yy_c_buf_p;
2023:
2024: /* undo effects of setting up yytext */
2025: *yy_cp = yyg->yy_hold_char;
2026:
2027: if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2028: { /* need to shift things up to make room */
2029: /* +2 for EOB chars. */
2030: int number_to_move = yyg->yy_n_chars + 2;
2031: char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2032: YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2033: char *source =
2034: &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2035:
2036: while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2037: *--dest = *--source;
2038:
2039: yy_cp += (int) (dest - source);
2040: yy_bp += (int) (dest - source);
2041: YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2042: yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2043:
2044: if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2045: YY_FATAL_ERROR( "flex scanner push-back overflow" );
2046: }
2047:
2048: *--yy_cp = (char) c;
2049:
2050: /* %% [18.0] update yylineno here */
2051:
2052: if ( c == '\n' ){
2053: --yylineno;
2054: }
2055:
2056: yyg->yytext_ptr = yy_bp;
2057: yyg->yy_hold_char = *yy_cp;
2058: yyg->yy_c_buf_p = yy_cp;
2059: }
2060: /* %if-c-only */
2061:
2062: /* %endif */
2063: #endif
2064:
2065: /* %if-c-only */
2066: #ifndef YY_NO_INPUT
2067: #ifdef __cplusplus
2068: static int yyinput (yyscan_t yyscanner)
2069: #else
2070: static int input (yyscan_t yyscanner)
2071: #endif
2072:
2073: /* %endif */
2074: /* %if-c++-only */
2075: /* %endif */
2076: {
2077: int c;
2078: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2079:
2080: *yyg->yy_c_buf_p = yyg->yy_hold_char;
2081:
2082: if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2083: {
2084: /* yy_c_buf_p now points to the character we want to return.
2085: * If this occurs *before* the EOB characters, then it's a
2086: * valid NUL; if not, then we've hit the end of the buffer.
2087: */
2088: if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2089: /* This was really a NUL. */
2090: *yyg->yy_c_buf_p = '\0';
2091:
2092: else
2093: { /* need more input */
2094: int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2095: ++yyg->yy_c_buf_p;
2096:
2097: switch ( yy_get_next_buffer( yyscanner ) )
2098: {
2099: case EOB_ACT_LAST_MATCH:
2100: /* This happens because yy_g_n_b()
2101: * sees that we've accumulated a
2102: * token and flags that we need to
2103: * try matching the token before
2104: * proceeding. But for input(),
2105: * there's no matching to consider.
2106: * So convert the EOB_ACT_LAST_MATCH
2107: * to EOB_ACT_END_OF_FILE.
2108: */
2109:
2110: /* Reset buffer status. */
2111: yyrestart( yyin , yyscanner);
2112:
2113: /*FALLTHROUGH*/
2114:
2115: case EOB_ACT_END_OF_FILE:
2116: {
2117: if ( yywrap( yyscanner ) )
2118: return 0;
2119:
2120: if ( ! yyg->yy_did_buffer_switch_on_eof )
2121: YY_NEW_FILE;
2122: #ifdef __cplusplus
2123: return yyinput(yyscanner);
2124: #else
2125: return input(yyscanner);
2126: #endif
2127: }
2128:
2129: case EOB_ACT_CONTINUE_SCAN:
2130: yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2131: break;
2132: }
2133: }
2134: }
2135:
2136: c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2137: *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2138: yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2139:
2140: /* %% [19.0] update BOL and yylineno */
2141: if ( c == '\n' )
2142:
2143: do{ yylineno++;
2144: yycolumn=0;
2145: }while(0)
2146: ;
2147:
2148: return c;
2149: }
2150: /* %if-c-only */
2151: #endif /* ifndef YY_NO_INPUT */
2152: /* %endif */
2153:
2154: /** Immediately switch to a different input stream.
2155: * @param input_file A readable stream.
2156: * @param yyscanner The scanner object.
2157: * @note This function does not reset the start condition to @c INITIAL .
2158: */
2159: /* %if-c-only */
2160: void yyrestart (FILE * input_file , yyscan_t yyscanner)
2161: /* %endif */
2162: /* %if-c++-only */
2163: /* %endif */
2164: {
2165: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2166:
2167: if ( ! YY_CURRENT_BUFFER ){
2168: yyensure_buffer_stack (yyscanner);
2169: YY_CURRENT_BUFFER_LVALUE =
2170: yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2171: }
2172:
2173: yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2174: yy_load_buffer_state( yyscanner );
2175: }
2176:
2177: /* %if-c++-only */
2178: /* %endif */
2179:
2180: /** Switch to a different input buffer.
2181: * @param new_buffer The new input buffer.
2182: * @param yyscanner The scanner object.
2183: */
2184: /* %if-c-only */
2185: void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2186: /* %endif */
2187: /* %if-c++-only */
2188: /* %endif */
2189: {
2190: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2191:
2192: /* TODO. We should be able to replace this entire function body
2193: * with
2194: * yypop_buffer_state();
2195: * yypush_buffer_state(new_buffer);
2196: */
2197: yyensure_buffer_stack (yyscanner);
2198: if ( YY_CURRENT_BUFFER == new_buffer )
2199: return;
2200:
2201: if ( YY_CURRENT_BUFFER )
2202: {
2203: /* Flush out information for old buffer. */
2204: *yyg->yy_c_buf_p = yyg->yy_hold_char;
2205: YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2206: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2207: }
2208:
2209: YY_CURRENT_BUFFER_LVALUE = new_buffer;
2210: yy_load_buffer_state( yyscanner );
2211:
2212: /* We don't actually know whether we did this switch during
2213: * EOF (yywrap()) processing, but the only time this flag
2214: * is looked at is after yywrap() is called, so it's safe
2215: * to go ahead and always set it.
2216: */
2217: yyg->yy_did_buffer_switch_on_eof = 1;
2218: }
2219:
2220: /* %if-c-only */
2221: static void yy_load_buffer_state (yyscan_t yyscanner)
2222: /* %endif */
2223: /* %if-c++-only */
2224: /* %endif */
2225: {
2226: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2227: yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2228: yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2229: /* %if-c-only */
2230: yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2231: /* %endif */
2232: /* %if-c++-only */
2233: /* %endif */
2234: yyg->yy_hold_char = *yyg->yy_c_buf_p;
2235: }
2236:
2237: /** Allocate and initialize an input buffer state.
2238: * @param file A readable stream.
2239: * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2240: * @param yyscanner The scanner object.
2241: * @return the allocated buffer state.
2242: */
2243: /* %if-c-only */
2244: YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2245: /* %endif */
2246: /* %if-c++-only */
2247: /* %endif */
2248: {
2249: YY_BUFFER_STATE b;
2250:
2251: b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2252: if ( ! b )
2253: YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2254:
2255: b->yy_buf_size = size;
2256:
2257: /* yy_ch_buf has to be 2 characters longer than the size given because
2258: * we need to put in 2 end-of-buffer characters.
2259: */
2260: b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2261: if ( ! b->yy_ch_buf )
2262: YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2263:
2264: b->yy_is_our_buffer = 1;
2265:
2266: yy_init_buffer( b, file , yyscanner);
2267:
2268: return b;
2269: }
2270:
2271: /* %if-c++-only */
2272: /* %endif */
2273:
2274: /** Destroy the buffer.
2275: * @param b a buffer created with yy_create_buffer()
2276: * @param yyscanner The scanner object.
2277: */
2278: /* %if-c-only */
2279: void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2280: /* %endif */
2281: /* %if-c++-only */
2282: /* %endif */
2283: {
2284: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2285:
2286: if ( ! b )
2287: return;
2288:
2289: if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2290: YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2291:
2292: if ( b->yy_is_our_buffer )
2293: yyfree( (void *) b->yy_ch_buf , yyscanner );
2294:
2295: yyfree( (void *) b , yyscanner );
2296: }
2297:
2298: /* Initializes or reinitializes a buffer.
2299: * This function is sometimes called more than once on the same buffer,
2300: * such as during a yyrestart() or at EOF.
2301: */
2302: /* %if-c-only */
2303: static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2304: /* %endif */
2305: /* %if-c++-only */
2306: /* %endif */
2307:
2308: {
2309: int oerrno = errno;
2310: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2311:
2312: yy_flush_buffer( b , yyscanner);
2313:
2314: /* %if-c-only */
2315: b->yy_input_file = file;
2316: /* %endif */
2317: /* %if-c++-only */
2318: /* %endif */
2319: b->yy_fill_buffer = 1;
2320:
2321: /* If b is the current buffer, then yy_init_buffer was _probably_
2322: * called from yyrestart() or through yy_get_next_buffer.
2323: * In that case, we don't want to reset the lineno or column.
2324: */
2325: if (b != YY_CURRENT_BUFFER){
2326: b->yy_bs_lineno = 1;
2327: b->yy_bs_column = 0;
2328: }
2329:
2330: /* %if-c-only */
2331:
2332: b->yy_is_interactive = 0;
2333:
2334: /* %endif */
2335: /* %if-c++-only */
2336: /* %endif */
2337: errno = oerrno;
2338: }
2339:
2340: /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2341: * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2342: * @param yyscanner The scanner object.
2343: */
2344: /* %if-c-only */
2345: void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2346: /* %endif */
2347: /* %if-c++-only */
2348: /* %endif */
2349: {
2350: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2351: if ( ! b )
2352: return;
2353:
2354: b->yy_n_chars = 0;
2355:
2356: /* We always need two end-of-buffer characters. The first causes
2357: * a transition to the end-of-buffer state. The second causes
2358: * a jam in that state.
2359: */
2360: b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2361: b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2362:
2363: b->yy_buf_pos = &b->yy_ch_buf[0];
2364:
2365: b->yy_at_bol = 1;
2366: b->yy_buffer_status = YY_BUFFER_NEW;
2367:
2368: if ( b == YY_CURRENT_BUFFER )
2369: yy_load_buffer_state( yyscanner );
2370: }
2371:
2372: /* %if-c-or-c++ */
2373: /** Pushes the new state onto the stack. The new state becomes
2374: * the current state. This function will allocate the stack
2375: * if necessary.
2376: * @param new_buffer The new state.
2377: * @param yyscanner The scanner object.
2378: */
2379: /* %if-c-only */
2380: void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2381: /* %endif */
2382: /* %if-c++-only */
2383: /* %endif */
2384: {
2385: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2386: if (new_buffer == NULL)
2387: return;
2388:
2389: yyensure_buffer_stack(yyscanner);
2390:
2391: /* This block is copied from yy_switch_to_buffer. */
2392: if ( YY_CURRENT_BUFFER )
2393: {
2394: /* Flush out information for old buffer. */
2395: *yyg->yy_c_buf_p = yyg->yy_hold_char;
2396: YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2397: YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2398: }
2399:
2400: /* Only push if top exists. Otherwise, replace top. */
2401: if (YY_CURRENT_BUFFER)
2402: yyg->yy_buffer_stack_top++;
2403: YY_CURRENT_BUFFER_LVALUE = new_buffer;
2404:
2405: /* copied from yy_switch_to_buffer. */
2406: yy_load_buffer_state( yyscanner );
2407: yyg->yy_did_buffer_switch_on_eof = 1;
2408: }
2409: /* %endif */
2410:
2411: /* %if-c-or-c++ */
2412: /** Removes and deletes the top of the stack, if present.
2413: * The next element becomes the new top.
2414: * @param yyscanner The scanner object.
2415: */
2416: /* %if-c-only */
2417: void yypop_buffer_state (yyscan_t yyscanner)
2418: /* %endif */
2419: /* %if-c++-only */
2420: /* %endif */
2421: {
2422: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2423: if (!YY_CURRENT_BUFFER)
2424: return;
2425:
2426: yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2427: YY_CURRENT_BUFFER_LVALUE = NULL;
2428: if (yyg->yy_buffer_stack_top > 0)
2429: --yyg->yy_buffer_stack_top;
2430:
2431: if (YY_CURRENT_BUFFER) {
2432: yy_load_buffer_state( yyscanner );
2433: yyg->yy_did_buffer_switch_on_eof = 1;
2434: }
2435: }
2436: /* %endif */
2437:
2438: /* %if-c-or-c++ */
2439: /* Allocates the stack if it does not exist.
2440: * Guarantees space for at least one push.
2441: */
2442: /* %if-c-only */
2443: static void yyensure_buffer_stack (yyscan_t yyscanner)
2444: /* %endif */
2445: /* %if-c++-only */
2446: /* %endif */
2447: {
2448: yy_size_t num_to_alloc;
2449: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2450:
2451: if (!yyg->yy_buffer_stack) {
2452:
2453: /* First allocation is just for 2 elements, since we don't know if this
2454: * scanner will even need a stack. We use 2 instead of 1 to avoid an
2455: * immediate realloc on the next call.
2456: */
2457: num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2458: yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2459: (num_to_alloc * sizeof(struct yy_buffer_state*)
2460: , yyscanner);
2461: if ( ! yyg->yy_buffer_stack )
2462: YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2463:
2464: memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2465:
2466: yyg->yy_buffer_stack_max = num_to_alloc;
2467: yyg->yy_buffer_stack_top = 0;
2468: return;
2469: }
2470:
2471: if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2472:
2473: /* Increase the buffer to prepare for a possible push. */
2474: yy_size_t grow_size = 8 /* arbitrary grow size */;
2475:
2476: num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2477: yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2478: (yyg->yy_buffer_stack,
2479: num_to_alloc * sizeof(struct yy_buffer_state*)
2480: , yyscanner);
2481: if ( ! yyg->yy_buffer_stack )
2482: YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2483:
2484: /* zero only the new slots.*/
2485: memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2486: yyg->yy_buffer_stack_max = num_to_alloc;
2487: }
2488: }
2489: /* %endif */
2490:
2491: /* %if-c-only */
2492: /** Setup the input buffer state to scan directly from a user-specified character buffer.
2493: * @param base the character buffer
2494: * @param size the size in bytes of the character buffer
2495: * @param yyscanner The scanner object.
2496: * @return the newly allocated buffer state object.
2497: */
2498: YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2499: {
2500: YY_BUFFER_STATE b;
2501:
2502: if ( size < 2 ||
2503: base[size-2] != YY_END_OF_BUFFER_CHAR ||
2504: base[size-1] != YY_END_OF_BUFFER_CHAR )
2505: /* They forgot to leave room for the EOB's. */
2506: return NULL;
2507:
2508: b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2509: if ( ! b )
2510: YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2511:
2512: b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2513: b->yy_buf_pos = b->yy_ch_buf = base;
2514: b->yy_is_our_buffer = 0;
2515: b->yy_input_file = NULL;
2516: b->yy_n_chars = b->yy_buf_size;
2517: b->yy_is_interactive = 0;
2518: b->yy_at_bol = 1;
2519: b->yy_fill_buffer = 0;
2520: b->yy_buffer_status = YY_BUFFER_NEW;
2521:
2522: yy_switch_to_buffer( b , yyscanner );
2523:
2524: return b;
2525: }
2526: /* %endif */
2527:
2528: /* %if-c-only */
2529: /** Setup the input buffer state to scan a string. The next call to yylex() will
2530: * scan from a @e copy of @a str.
2531: * @param yystr a NUL-terminated string to scan
2532: * @param yyscanner The scanner object.
2533: * @return the newly allocated buffer state object.
2534: * @note If you want to scan bytes that may contain NUL values, then use
2535: * yy_scan_bytes() instead.
2536: */
2537: YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2538: {
2539:
2540: return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2541: }
2542: /* %endif */
2543:
2544: /* %if-c-only */
2545: /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2546: * scan from a @e copy of @a bytes.
2547: * @param yybytes the byte buffer to scan
2548: * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2549: * @param yyscanner The scanner object.
2550: * @return the newly allocated buffer state object.
2551: */
2552: YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2553: {
2554: YY_BUFFER_STATE b;
2555: char *buf;
2556: yy_size_t n;
2557: int i;
2558:
2559: /* Get memory for full buffer, including space for trailing EOB's. */
2560: n = (yy_size_t) (_yybytes_len + 2);
2561: buf = (char *) yyalloc( n , yyscanner );
2562: if ( ! buf )
2563: YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2564:
2565: for ( i = 0; i < _yybytes_len; ++i )
2566: buf[i] = yybytes[i];
2567:
2568: buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2569:
2570: b = yy_scan_buffer( buf, n , yyscanner);
2571: if ( ! b )
2572: YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2573:
2574: /* It's okay to grow etc. this buffer, and we should throw it
2575: * away when we're done.
2576: */
2577: b->yy_is_our_buffer = 1;
2578:
2579: return b;
2580: }
2581: /* %endif */
2582:
2583: /* %if-c-only */
2584: static void yy_push_state (int _new_state , yyscan_t yyscanner)
2585: /* %endif */
2586: /* %if-c++-only */
2587: /* %endif */
2588: {
2589: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2590: if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
2591: {
2592: yy_size_t new_size;
2593:
2594: yyg->yy_start_stack_depth += YY_START_STACK_INCR;
2595: new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int );
2596:
2597: if ( ! yyg->yy_start_stack )
2598: yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner );
2599:
2600: else
2601: yyg->yy_start_stack = (int *) yyrealloc(
2602: (void *) yyg->yy_start_stack, new_size , yyscanner );
2603:
2604: if ( ! yyg->yy_start_stack )
2605: YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2606: }
2607:
2608: yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
2609:
2610: BEGIN(_new_state);
2611: }
2612:
2613: /* %if-c-only */
2614: static void yy_pop_state (yyscan_t yyscanner)
2615: /* %endif */
2616: /* %if-c++-only */
2617: /* %endif */
2618: {
2619: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2620: if ( --yyg->yy_start_stack_ptr < 0 )
2621: YY_FATAL_ERROR( "start-condition stack underflow" );
2622:
2623: BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
2624: }
2625:
2626: /* %if-c-only */
2627: static int yy_top_state (yyscan_t yyscanner)
2628: /* %endif */
2629: /* %if-c++-only */
2630: /* %endif */
2631: {
2632: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2633: return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
2634: }
2635:
2636: #ifndef YY_EXIT_FAILURE
2637: #define YY_EXIT_FAILURE 2
2638: #endif
2639:
2640: /* %if-c-only */
2641: static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2642: {
2643: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2644: (void)yyg;
2645: fprintf( stderr, "%s\n", msg );
2646: exit( YY_EXIT_FAILURE );
2647: }
2648: /* %endif */
2649: /* %if-c++-only */
2650: /* %endif */
2651:
2652: /* Redefine yyless() so it works in section 3 code. */
2653:
2654: #undef yyless
2655: #define yyless(n) \
2656: do \
2657: { \
2658: /* Undo effects of setting up yytext. */ \
2659: int yyless_macro_arg = (n); \
2660: YY_LESS_LINENO(yyless_macro_arg);\
2661: yytext[yyleng] = yyg->yy_hold_char; \
2662: yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2663: yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2664: *yyg->yy_c_buf_p = '\0'; \
2665: yyleng = yyless_macro_arg; \
2666: } \
2667: while ( 0 )
2668:
2669: /* Accessor methods (get/set functions) to struct members. */
2670:
2671: /* %if-c-only */
2672: /* %if-reentrant */
2673:
2674: /** Get the user-defined data for this scanner.
2675: * @param yyscanner The scanner object.
2676: */
2677: YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
2678: {
2679: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2680: return yyextra;
2681: }
2682:
2683: /* %endif */
2684:
2685: /** Get the current line number.
2686: * @param yyscanner The scanner object.
2687: */
2688: int yyget_lineno (yyscan_t yyscanner)
2689: {
2690: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2691:
2692: if (! YY_CURRENT_BUFFER)
2693: return 0;
2694:
2695: return yylineno;
2696: }
2697:
2698: /** Get the current column number.
2699: * @param yyscanner The scanner object.
2700: */
2701: int yyget_column (yyscan_t yyscanner)
2702: {
2703: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2704:
2705: if (! YY_CURRENT_BUFFER)
2706: return 0;
2707:
2708: return yycolumn;
2709: }
2710:
2711: /** Get the input stream.
2712: * @param yyscanner The scanner object.
2713: */
2714: FILE *yyget_in (yyscan_t yyscanner)
2715: {
2716: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2717: return yyin;
2718: }
2719:
2720: /** Get the output stream.
2721: * @param yyscanner The scanner object.
2722: */
2723: FILE *yyget_out (yyscan_t yyscanner)
2724: {
2725: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2726: return yyout;
2727: }
2728:
2729: /** Get the length of the current token.
2730: * @param yyscanner The scanner object.
2731: */
2732: int yyget_leng (yyscan_t yyscanner)
2733: {
2734: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2735: return yyleng;
2736: }
2737:
2738: /** Get the current token.
2739: * @param yyscanner The scanner object.
2740: */
2741:
2742: char *yyget_text (yyscan_t yyscanner)
2743: {
2744: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2745: return yytext;
2746: }
2747:
2748: /* %if-reentrant */
2749:
2750: /** Set the user-defined data. This data is never touched by the scanner.
2751: * @param user_defined The data to be associated with this scanner.
2752: * @param yyscanner The scanner object.
2753: */
2754: void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2755: {
2756: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2757: yyextra = user_defined ;
2758: }
2759:
2760: /* %endif */
2761:
2762: /** Set the current line number.
2763: * @param _line_number line number
2764: * @param yyscanner The scanner object.
2765: */
2766: void yyset_lineno (int _line_number , yyscan_t yyscanner)
2767: {
2768: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2769:
2770: /* lineno is only valid if an input buffer exists. */
2771: if (! YY_CURRENT_BUFFER )
2772: YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2773:
2774: yylineno = _line_number;
2775: }
2776:
2777: /** Set the current column.
2778: * @param _column_no column number
2779: * @param yyscanner The scanner object.
2780: */
2781: void yyset_column (int _column_no , yyscan_t yyscanner)
2782: {
2783: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2784:
2785: /* column is only valid if an input buffer exists. */
2786: if (! YY_CURRENT_BUFFER )
2787: YY_FATAL_ERROR( "yyset_column called with no buffer" );
2788:
2789: yycolumn = _column_no;
2790: }
2791:
2792: /** Set the input stream. This does not discard the current
2793: * input buffer.
2794: * @param _in_str A readable stream.
2795: * @param yyscanner The scanner object.
2796: * @see yy_switch_to_buffer
2797: */
2798: void yyset_in (FILE * _in_str , yyscan_t yyscanner)
2799: {
2800: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2801: yyin = _in_str ;
2802: }
2803:
2804: void yyset_out (FILE * _out_str , yyscan_t yyscanner)
2805: {
2806: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2807: yyout = _out_str ;
2808: }
2809:
2810: int yyget_debug (yyscan_t yyscanner)
2811: {
2812: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2813: return yy_flex_debug;
2814: }
2815:
2816: void yyset_debug (int _bdebug , yyscan_t yyscanner)
2817: {
2818: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2819: yy_flex_debug = _bdebug ;
2820: }
2821:
2822: /* %endif */
2823:
2824: /* %if-reentrant */
2825: /* Accessor methods for yylval and yylloc */
2826:
2827: /* %if-bison-bridge */
2828: /* %endif */
2829:
2830: /* User-visible API */
2831:
2832: /* yylex_init is special because it creates the scanner itself, so it is
2833: * the ONLY reentrant function that doesn't take the scanner as the last argument.
2834: * That's why we explicitly handle the declaration, instead of using our macros.
2835: */
2836: int yylex_init(yyscan_t* ptr_yy_globals)
2837: {
2838: if (ptr_yy_globals == NULL){
2839: errno = EINVAL;
2840: return 1;
2841: }
2842:
2843: *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2844:
2845: if (*ptr_yy_globals == NULL){
2846: errno = ENOMEM;
2847: return 1;
2848: }
2849:
2850: /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2851: memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2852:
2853: return yy_init_globals ( *ptr_yy_globals );
2854: }
2855:
2856: /* yylex_init_extra has the same functionality as yylex_init, but follows the
2857: * convention of taking the scanner as the last argument. Note however, that
2858: * this is a *pointer* to a scanner, as it will be allocated by this call (and
2859: * is the reason, too, why this function also must handle its own declaration).
2860: * The user defined value in the first argument will be available to yyalloc in
2861: * the yyextra field.
2862: */
2863: int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2864: {
2865: struct yyguts_t dummy_yyguts;
2866:
2867: yyset_extra (yy_user_defined, &dummy_yyguts);
2868:
2869: if (ptr_yy_globals == NULL){
2870: errno = EINVAL;
2871: return 1;
2872: }
2873:
2874: *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2875:
2876: if (*ptr_yy_globals == NULL){
2877: errno = ENOMEM;
2878: return 1;
2879: }
2880:
2881: /* By setting to 0xAA, we expose bugs in
2882: yy_init_globals. Leave at 0x00 for releases. */
2883: memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2884:
2885: yyset_extra (yy_user_defined, *ptr_yy_globals);
2886:
2887: return yy_init_globals ( *ptr_yy_globals );
2888: }
2889:
2890: /* %endif if-c-only */
2891:
2892: /* %if-c-only */
2893: static int yy_init_globals (yyscan_t yyscanner)
2894: {
2895: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2896: /* Initialization is the same as for the non-reentrant scanner.
2897: * This function is called from yylex_destroy(), so don't allocate here.
2898: */
2899:
2900: yyg->yy_buffer_stack = NULL;
2901: yyg->yy_buffer_stack_top = 0;
2902: yyg->yy_buffer_stack_max = 0;
2903: yyg->yy_c_buf_p = NULL;
2904: yyg->yy_init = 0;
2905: yyg->yy_start = 0;
2906:
2907: yyg->yy_start_stack_ptr = 0;
2908: yyg->yy_start_stack_depth = 0;
2909: yyg->yy_start_stack = NULL;
2910:
2911: /* Defined in main.c */
2912: #ifdef YY_STDINIT
2913: yyin = stdin;
2914: yyout = stdout;
2915: #else
2916: yyin = NULL;
2917: yyout = NULL;
2918: #endif
2919:
2920: /* For future reference: Set errno on error, since we are called by
2921: * yylex_init()
2922: */
2923: return 0;
2924: }
2925: /* %endif */
2926:
2927: /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2928: /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2929: int yylex_destroy (yyscan_t yyscanner)
2930: {
2931: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2932:
2933: /* Pop the buffer stack, destroying each element. */
2934: while(YY_CURRENT_BUFFER){
2935: yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2936: YY_CURRENT_BUFFER_LVALUE = NULL;
2937: yypop_buffer_state(yyscanner);
2938: }
2939:
2940: /* Destroy the stack itself. */
2941: yyfree(yyg->yy_buffer_stack , yyscanner);
2942: yyg->yy_buffer_stack = NULL;
2943:
2944: /* Destroy the start condition stack. */
2945: yyfree( yyg->yy_start_stack , yyscanner );
2946: yyg->yy_start_stack = NULL;
2947:
2948: /* Reset the globals. This is important in a non-reentrant scanner so the next time
2949: * yylex() is called, initialization will occur. */
2950: yy_init_globals( yyscanner);
2951:
2952: /* %if-reentrant */
2953: /* Destroy the main struct (reentrant only). */
2954: yyfree ( yyscanner , yyscanner );
2955: yyscanner = NULL;
2956: /* %endif */
2957: return 0;
2958: }
2959: /* %endif */
2960:
2961: /*
2962: * Internal utility routines.
2963: */
2964:
2965: #ifndef yytext_ptr
2966: static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2967: {
2968: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2969: (void)yyg;
2970:
2971: int i;
2972: for ( i = 0; i < n; ++i )
2973: s1[i] = s2[i];
2974: }
2975: #endif
2976:
2977: #ifdef YY_NEED_STRLEN
2978: static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2979: {
2980: int n;
2981: for ( n = 0; s[n]; ++n )
2982: ;
2983:
2984: return n;
2985: }
2986: #endif
2987:
2988: void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2989: {
2990: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2991: (void)yyg;
2992: return malloc(size);
2993: }
2994:
2995: void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2996: {
2997: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2998: (void)yyg;
2999:
3000: /* The cast to (char *) in the following accommodates both
3001: * implementations that use char* generic pointers, and those
3002: * that use void* generic pointers. It works with the latter
3003: * because both ANSI C and C++ allow castless assignment from
3004: * any pointer type to void*, and deal with argument conversions
3005: * as though doing an assignment.
3006: */
3007: return realloc(ptr, size);
3008: }
3009:
3010: void yyfree (void * ptr , yyscan_t yyscanner)
3011: {
3012: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3013: (void)yyg;
3014: free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3015: }
3016:
3017: /* %if-tables-serialization definitions */
3018: /* %define-yytables The name for this specific scanner's tables. */
3019: #define YYTABLES_NAME "yytables"
3020: /* %endif */
3021:
3022: /* %ok-for-header */
3023:
3024: #line 241 "settings/settings_lexer.l"
3025:
3026:
3027: /**
3028: * Open the next file, if any is queued and readable, otherwise returns FALSE.
3029: */
3030: bool settings_parser_open_next_file(parser_helper_t *ctx)
3031: {
3032: FILE *file;
3033:
3034: file = ctx->file_next(ctx);
3035: if (!file)
3036: {
3037: return FALSE;
3038: }
3039:
3040: settings_parser_set_in(file, ctx->scanner);
3041: settings_parser_push_buffer_state(
3042: settings_parser__create_buffer(file, YY_BUF_SIZE,
3043: ctx->scanner), ctx->scanner);
3044: return TRUE;
3045: }
3046:
3047: /**
3048: * Assumes that the file pattern to include is currently stored as string on
3049: * the helper object.
3050: */
3051: static void include_files(parser_helper_t *ctx)
3052: {
3053: char *pattern = ctx->string_get(ctx);
3054:
3055: ctx->file_include(ctx, pattern);
3056: free(pattern);
3057:
3058: settings_parser_open_next_file(ctx);
3059: }
3060:
3061: /**
3062: * Load the given string to be parsed next
3063: */
3064: void settings_parser_load_string(parser_helper_t *ctx, const char *content)
3065: {
3066: settings_parser__scan_string(content, ctx->scanner);
3067: }
3068:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>