Kea 2.5.8
d2_lexer.cc
Go to the documentation of this file.
1#line 1 "d2_lexer.cc"
2
3#line 3 "d2_lexer.cc"
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#define yy_create_buffer d2_parser__create_buffer
13#define yy_delete_buffer d2_parser__delete_buffer
14#define yy_scan_buffer d2_parser__scan_buffer
15#define yy_scan_string d2_parser__scan_string
16#define yy_scan_bytes d2_parser__scan_bytes
17#define yy_init_buffer d2_parser__init_buffer
18#define yy_flush_buffer d2_parser__flush_buffer
19#define yy_load_buffer_state d2_parser__load_buffer_state
20#define yy_switch_to_buffer d2_parser__switch_to_buffer
21#define yypush_buffer_state d2_parser_push_buffer_state
22#define yypop_buffer_state d2_parser_pop_buffer_state
23#define yyensure_buffer_stack d2_parser_ensure_buffer_stack
24#define yy_flex_debug d2_parser__flex_debug
25#define yyin d2_parser_in
26#define yyleng d2_parser_leng
27#define yylex d2_parser_lex
28#define yylineno d2_parser_lineno
29#define yyout d2_parser_out
30#define yyrestart d2_parser_restart
31#define yytext d2_parser_text
32#define yywrap d2_parser_wrap
33#define yyalloc d2_parser_alloc
34#define yyrealloc d2_parser_realloc
35#define yyfree d2_parser_free
36
37/* %endif */
38/* %endif */
39/* %ok-for-header */
40
41#define FLEX_SCANNER
42#define YY_FLEX_MAJOR_VERSION 2
43#define YY_FLEX_MINOR_VERSION 6
44#define YY_FLEX_SUBMINOR_VERSION 4
45#if YY_FLEX_SUBMINOR_VERSION > 0
46#define FLEX_BETA
47#endif
48
49/* %if-c++-only */
50/* %endif */
51
52/* %if-c-only */
53#ifdef yy_create_buffer
54#define d2_parser__create_buffer_ALREADY_DEFINED
55#else
56#define yy_create_buffer d2_parser__create_buffer
57#endif
58
59#ifdef yy_delete_buffer
60#define d2_parser__delete_buffer_ALREADY_DEFINED
61#else
62#define yy_delete_buffer d2_parser__delete_buffer
63#endif
64
65#ifdef yy_scan_buffer
66#define d2_parser__scan_buffer_ALREADY_DEFINED
67#else
68#define yy_scan_buffer d2_parser__scan_buffer
69#endif
70
71#ifdef yy_scan_string
72#define d2_parser__scan_string_ALREADY_DEFINED
73#else
74#define yy_scan_string d2_parser__scan_string
75#endif
76
77#ifdef yy_scan_bytes
78#define d2_parser__scan_bytes_ALREADY_DEFINED
79#else
80#define yy_scan_bytes d2_parser__scan_bytes
81#endif
82
83#ifdef yy_init_buffer
84#define d2_parser__init_buffer_ALREADY_DEFINED
85#else
86#define yy_init_buffer d2_parser__init_buffer
87#endif
88
89#ifdef yy_flush_buffer
90#define d2_parser__flush_buffer_ALREADY_DEFINED
91#else
92#define yy_flush_buffer d2_parser__flush_buffer
93#endif
94
95#ifdef yy_load_buffer_state
96#define d2_parser__load_buffer_state_ALREADY_DEFINED
97#else
98#define yy_load_buffer_state d2_parser__load_buffer_state
99#endif
100
101#ifdef yy_switch_to_buffer
102#define d2_parser__switch_to_buffer_ALREADY_DEFINED
103#else
104#define yy_switch_to_buffer d2_parser__switch_to_buffer
105#endif
106
107#ifdef yypush_buffer_state
108#define d2_parser_push_buffer_state_ALREADY_DEFINED
109#else
110#define yypush_buffer_state d2_parser_push_buffer_state
111#endif
112
113#ifdef yypop_buffer_state
114#define d2_parser_pop_buffer_state_ALREADY_DEFINED
115#else
116#define yypop_buffer_state d2_parser_pop_buffer_state
117#endif
118
119#ifdef yyensure_buffer_stack
120#define d2_parser_ensure_buffer_stack_ALREADY_DEFINED
121#else
122#define yyensure_buffer_stack d2_parser_ensure_buffer_stack
123#endif
124
125#ifdef yylex
126#define d2_parser_lex_ALREADY_DEFINED
127#else
128#define yylex d2_parser_lex
129#endif
130
131#ifdef yyrestart
132#define d2_parser_restart_ALREADY_DEFINED
133#else
134#define yyrestart d2_parser_restart
135#endif
136
137#ifdef yylex_init
138#define d2_parser_lex_init_ALREADY_DEFINED
139#else
140#define yylex_init d2_parser_lex_init
141#endif
142
143#ifdef yylex_init_extra
144#define d2_parser_lex_init_extra_ALREADY_DEFINED
145#else
146#define yylex_init_extra d2_parser_lex_init_extra
147#endif
148
149#ifdef yylex_destroy
150#define d2_parser_lex_destroy_ALREADY_DEFINED
151#else
152#define yylex_destroy d2_parser_lex_destroy
153#endif
154
155#ifdef yyget_debug
156#define d2_parser_get_debug_ALREADY_DEFINED
157#else
158#define yyget_debug d2_parser_get_debug
159#endif
160
161#ifdef yyset_debug
162#define d2_parser_set_debug_ALREADY_DEFINED
163#else
164#define yyset_debug d2_parser_set_debug
165#endif
166
167#ifdef yyget_extra
168#define d2_parser_get_extra_ALREADY_DEFINED
169#else
170#define yyget_extra d2_parser_get_extra
171#endif
172
173#ifdef yyset_extra
174#define d2_parser_set_extra_ALREADY_DEFINED
175#else
176#define yyset_extra d2_parser_set_extra
177#endif
178
179#ifdef yyget_in
180#define d2_parser_get_in_ALREADY_DEFINED
181#else
182#define yyget_in d2_parser_get_in
183#endif
184
185#ifdef yyset_in
186#define d2_parser_set_in_ALREADY_DEFINED
187#else
188#define yyset_in d2_parser_set_in
189#endif
190
191#ifdef yyget_out
192#define d2_parser_get_out_ALREADY_DEFINED
193#else
194#define yyget_out d2_parser_get_out
195#endif
196
197#ifdef yyset_out
198#define d2_parser_set_out_ALREADY_DEFINED
199#else
200#define yyset_out d2_parser_set_out
201#endif
202
203#ifdef yyget_leng
204#define d2_parser_get_leng_ALREADY_DEFINED
205#else
206#define yyget_leng d2_parser_get_leng
207#endif
208
209#ifdef yyget_text
210#define d2_parser_get_text_ALREADY_DEFINED
211#else
212#define yyget_text d2_parser_get_text
213#endif
214
215#ifdef yyget_lineno
216#define d2_parser_get_lineno_ALREADY_DEFINED
217#else
218#define yyget_lineno d2_parser_get_lineno
219#endif
220
221#ifdef yyset_lineno
222#define d2_parser_set_lineno_ALREADY_DEFINED
223#else
224#define yyset_lineno d2_parser_set_lineno
225#endif
226
227#ifdef yywrap
228#define d2_parser_wrap_ALREADY_DEFINED
229#else
230#define yywrap d2_parser_wrap
231#endif
232
233/* %endif */
234
235#ifdef yyalloc
236#define d2_parser_alloc_ALREADY_DEFINED
237#else
238#define yyalloc d2_parser_alloc
239#endif
240
241#ifdef yyrealloc
242#define d2_parser_realloc_ALREADY_DEFINED
243#else
244#define yyrealloc d2_parser_realloc
245#endif
246
247#ifdef yyfree
248#define d2_parser_free_ALREADY_DEFINED
249#else
250#define yyfree d2_parser_free
251#endif
252
253/* %if-c-only */
254
255#ifdef yytext
256#define d2_parser_text_ALREADY_DEFINED
257#else
258#define yytext d2_parser_text
259#endif
260
261#ifdef yyleng
262#define d2_parser_leng_ALREADY_DEFINED
263#else
264#define yyleng d2_parser_leng
265#endif
266
267#ifdef yyin
268#define d2_parser_in_ALREADY_DEFINED
269#else
270#define yyin d2_parser_in
271#endif
272
273#ifdef yyout
274#define d2_parser_out_ALREADY_DEFINED
275#else
276#define yyout d2_parser_out
277#endif
278
279#ifdef yy_flex_debug
280#define d2_parser__flex_debug_ALREADY_DEFINED
281#else
282#define yy_flex_debug d2_parser__flex_debug
283#endif
284
285#ifdef yylineno
286#define d2_parser_lineno_ALREADY_DEFINED
287#else
288#define yylineno d2_parser_lineno
289#endif
290
291/* %endif */
292
293/* First, we deal with platform-specific or compiler-specific issues. */
294
295/* begin standard C headers. */
296/* %if-c-only */
297#include <stdio.h>
298#include <string.h>
299#include <errno.h>
300#include <stdlib.h>
301/* %endif */
302
303/* %if-tables-serialization */
304/* %endif */
305/* end standard C headers. */
306
307/* %if-c-or-c++ */
308/* flex integer type definitions */
309
310#ifndef FLEXINT_H
311#define FLEXINT_H
312
313/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
314
315#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
316
317/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
318 * if you want the limit (max/min) macros for int types.
319 */
320#ifndef __STDC_LIMIT_MACROS
321#define __STDC_LIMIT_MACROS 1
322#endif
323
324#include <inttypes.h>
325typedef int8_t flex_int8_t;
326typedef uint8_t flex_uint8_t;
327typedef int16_t flex_int16_t;
328typedef uint16_t flex_uint16_t;
329typedef int32_t flex_int32_t;
330typedef uint32_t flex_uint32_t;
331#else
332typedef signed char flex_int8_t;
333typedef short int flex_int16_t;
334typedef int flex_int32_t;
335typedef unsigned char flex_uint8_t;
336typedef unsigned short int flex_uint16_t;
337typedef unsigned int flex_uint32_t;
338
339/* Limits of integral types. */
340#ifndef INT8_MIN
341#define INT8_MIN (-128)
342#endif
343#ifndef INT16_MIN
344#define INT16_MIN (-32767-1)
345#endif
346#ifndef INT32_MIN
347#define INT32_MIN (-2147483647-1)
348#endif
349#ifndef INT8_MAX
350#define INT8_MAX (127)
351#endif
352#ifndef INT16_MAX
353#define INT16_MAX (32767)
354#endif
355#ifndef INT32_MAX
356#define INT32_MAX (2147483647)
357#endif
358#ifndef UINT8_MAX
359#define UINT8_MAX (255U)
360#endif
361#ifndef UINT16_MAX
362#define UINT16_MAX (65535U)
363#endif
364#ifndef UINT32_MAX
365#define UINT32_MAX (4294967295U)
366#endif
367
368#ifndef SIZE_MAX
369#define SIZE_MAX (~(size_t)0)
370#endif
371
372#endif /* ! C99 */
373
374#endif /* ! FLEXINT_H */
375
376/* %endif */
377
378/* begin standard C++ headers. */
379/* %if-c++-only */
380/* %endif */
381
382/* TODO: this is always defined, so inline it */
383#define yyconst const
384
385#if defined(__GNUC__) && __GNUC__ >= 3
386#define yynoreturn __attribute__((__noreturn__))
387#else
388#define yynoreturn
389#endif
390
391/* %not-for-header */
392/* Returned upon end-of-file. */
393#define YY_NULL 0
394/* %ok-for-header */
395
396/* %not-for-header */
397/* Promotes a possibly negative, possibly signed char to an
398 * integer in range [0..255] for use as an array index.
399 */
400#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
401/* %ok-for-header */
402
403/* %if-reentrant */
404/* %endif */
405
406/* %if-not-reentrant */
407
408/* %endif */
409
410/* Enter a start condition. This macro really ought to take a parameter,
411 * but we do it the disgusting crufty way forced on us by the ()-less
412 * definition of BEGIN.
413 */
414#define BEGIN (yy_start) = 1 + 2 *
415/* Translate the current start state into a value that can be later handed
416 * to BEGIN to return to the state. The YYSTATE alias is for lex
417 * compatibility.
418 */
419#define YY_START (((yy_start) - 1) / 2)
420#define YYSTATE YY_START
421/* Action number for EOF rule of a given start state. */
422#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
423/* Special action meaning "start processing a new file". */
424#define YY_NEW_FILE yyrestart( yyin )
425#define YY_END_OF_BUFFER_CHAR 0
426
427/* Size of default input buffer. */
428#ifndef YY_BUF_SIZE
429#ifdef __ia64__
430/* On IA-64, the buffer size is 16k, not 8k.
431 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
432 * Ditto for the __ia64__ case accordingly.
433 */
434#define YY_BUF_SIZE 32768
435#else
436#define YY_BUF_SIZE 16384
437#endif /* __ia64__ */
438#endif
439
440/* The state buf must be large enough to hold one state per character in the main buffer.
441 */
442#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
443
444#ifndef YY_TYPEDEF_YY_BUFFER_STATE
445#define YY_TYPEDEF_YY_BUFFER_STATE
447#endif
448
449#ifndef YY_TYPEDEF_YY_SIZE_T
450#define YY_TYPEDEF_YY_SIZE_T
451typedef size_t yy_size_t;
452#endif
453
454/* %if-not-reentrant */
455extern int yyleng;
456/* %endif */
457
458/* %if-c-only */
459/* %if-not-reentrant */
460extern FILE *yyin, *yyout;
461/* %endif */
462/* %endif */
463
464#define EOB_ACT_CONTINUE_SCAN 0
465#define EOB_ACT_END_OF_FILE 1
466#define EOB_ACT_LAST_MATCH 2
467
468 #define YY_LESS_LINENO(n)
469 #define YY_LINENO_REWIND_TO(ptr)
470
471/* Return all but the first "n" matched characters back to the input stream. */
472#define yyless(n) \
473 do \
474 { \
475 /* Undo effects of setting up yytext. */ \
476 int yyless_macro_arg = (n); \
477 YY_LESS_LINENO(yyless_macro_arg);\
478 *yy_cp = (yy_hold_char); \
479 YY_RESTORE_YY_MORE_OFFSET \
480 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
481 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
482 } \
483 while ( 0 )
484#define unput(c) yyunput( c, (yytext_ptr) )
485
486#ifndef YY_STRUCT_YY_BUFFER_STATE
487#define YY_STRUCT_YY_BUFFER_STATE
488struct yy_buffer_state
489 {
490/* %if-c-only */
491 FILE *yy_input_file;
492/* %endif */
493
494/* %if-c++-only */
495/* %endif */
496
497 char *yy_ch_buf; /* input buffer */
498 char *yy_buf_pos; /* current position in input buffer */
499
500 /* Size of input buffer in bytes, not including room for EOB
501 * characters.
502 */
503 int yy_buf_size;
504
505 /* Number of characters read into yy_ch_buf, not including EOB
506 * characters.
507 */
508 int yy_n_chars;
509
510 /* Whether we "own" the buffer - i.e., we know we created it,
511 * and can realloc() it to grow it, and should free() it to
512 * delete it.
513 */
515
516 /* Whether this is an "interactive" input source; if so, and
517 * if we're using stdio for input, then we want to use getc()
518 * instead of fread(), to make sure we stop fetching input after
519 * each newline.
520 */
522
523 /* Whether we're considered to be at the beginning of a line.
524 * If so, '^' rules will be active on the next match, otherwise
525 * not.
526 */
527 int yy_at_bol;
528
529 int yy_bs_lineno;
530 int yy_bs_column;
532 /* Whether to try to fill the input buffer when we reach the
533 * end of it.
534 */
535 int yy_fill_buffer;
536
538
539#define YY_BUFFER_NEW 0
540#define YY_BUFFER_NORMAL 1
541 /* When an EOF's been seen but there's still some text to process
542 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
543 * shouldn't try reading from the input source any more. We might
544 * still have a bunch of tokens to match, though, because of
545 * possible backing-up.
546 *
547 * When we actually see the EOF, we change the status to "new"
548 * (via yyrestart()), so that the user can continue scanning by
549 * just pointing yyin at a new input file.
550 */
551#define YY_BUFFER_EOF_PENDING 2
552
553 };
554#endif /* !YY_STRUCT_YY_BUFFER_STATE */
555
556/* %if-c-only Standard (non-C++) definition */
557/* %not-for-header */
558/* %if-not-reentrant */
559
560/* Stack of input buffers. */
561static size_t yy_buffer_stack_top = 0;
562static size_t yy_buffer_stack_max = 0;
563static YY_BUFFER_STATE * yy_buffer_stack = NULL;
564/* %endif */
565/* %ok-for-header */
566
567/* %endif */
568
569/* We provide macros for accessing buffer states in case in the
570 * future we want to put the buffer states in a more general
571 * "scanner state".
572 *
573 * Returns the top of the stack, or NULL.
574 */
575#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
576 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
577 : NULL)
578/* Same as previous macro, but useful when we know that the buffer stack is not
579 * NULL or when we need an lvalue. For internal use only.
580 */
581#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
582
583/* %if-c-only Standard (non-C++) definition */
584
585/* %if-not-reentrant */
586/* %not-for-header */
587/* yy_hold_char holds the character lost when yytext is formed. */
588static char yy_hold_char;
589static int yy_n_chars; /* number of characters read into yy_ch_buf */
591
592/* Points to current character in buffer. */
593static char *yy_c_buf_p = NULL;
594static int yy_init = 0; /* whether we need to initialize */
595static int yy_start = 0; /* start state number */
596
597/* Flag which is used to allow yywrap()'s to do buffer switches
598 * instead of setting up a fresh yyin. A bit of a hack ...
599 */
600static int yy_did_buffer_switch_on_eof;
601/* %ok-for-header */
602
603/* %endif */
604
605void yyrestart ( FILE *input_file );
606void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
607YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
610void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
611void yypop_buffer_state ( void );
612
613static void yyensure_buffer_stack ( void );
614static void yy_load_buffer_state ( void );
615static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
616#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
617
618YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
619YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
620YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
621
622/* %endif */
623
624void *yyalloc ( yy_size_t );
625void *yyrealloc ( void *, yy_size_t );
626void yyfree ( void * );
627
628#define yy_new_buffer yy_create_buffer
629#define yy_set_interactive(is_interactive) \
630 { \
631 if ( ! YY_CURRENT_BUFFER ){ \
632 yyensure_buffer_stack (); \
633 YY_CURRENT_BUFFER_LVALUE = \
634 yy_create_buffer( yyin, YY_BUF_SIZE ); \
635 } \
636 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
637 }
638#define yy_set_bol(at_bol) \
639 { \
640 if ( ! YY_CURRENT_BUFFER ){\
641 yyensure_buffer_stack (); \
642 YY_CURRENT_BUFFER_LVALUE = \
643 yy_create_buffer( yyin, YY_BUF_SIZE ); \
644 } \
645 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
646 }
647#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
648
649/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
650/* Begin user sect3 */
651
652#define d2_parser_wrap() (/*CONSTCOND*/1)
653#define YY_SKIP_YYWRAP
654
655#define FLEX_DEBUG
657
658FILE *yyin = NULL, *yyout = NULL;
659
660typedef int yy_state_type;
661
662extern int yylineno;
663int yylineno = 1;
664
665extern char *yytext;
666#ifdef yytext_ptr
667#undef yytext_ptr
668#endif
669#define yytext_ptr yytext
670
671/* %% [1.5] DFA */
672
673/* %if-c-only Standard (non-C++) definition */
674
675static yy_state_type yy_get_previous_state ( void );
676static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
677static int yy_get_next_buffer ( void );
678static void yynoreturn yy_fatal_error ( const char* msg );
679
680/* %endif */
681
682/* Done after the current pattern has been matched and before the
683 * corresponding action - sets up yytext.
684 */
685#define YY_DO_BEFORE_ACTION \
686 (yytext_ptr) = yy_bp; \
687/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
688 yyleng = (int) (yy_cp - yy_bp); \
689 (yy_hold_char) = *yy_cp; \
690 *yy_cp = '\0'; \
691/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
692 (yy_c_buf_p) = yy_cp;
693/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
694#define YY_NUM_RULES 69
695#define YY_END_OF_BUFFER 70
696/* This struct is not used in this scanner,
697 but its presence is necessary. */
698struct yy_trans_info
699 {
702 };
703static const flex_int16_t yy_accept[434] =
704 { 0,
705 62, 62, 0, 0, 0, 0, 0, 0, 0, 0,
706 70, 68, 10, 11, 68, 1, 62, 59, 62, 62,
707 68, 61, 60, 68, 68, 68, 68, 68, 55, 56,
708 68, 68, 68, 57, 58, 5, 5, 5, 68, 68,
709 68, 10, 11, 0, 0, 50, 0, 0, 0, 0,
710 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
711 0, 0, 0, 0, 0, 0, 0, 1, 62, 62,
712 0, 61, 62, 3, 2, 6, 0, 62, 0, 0,
713 0, 0, 0, 0, 4, 0, 0, 9, 0, 51,
714 0, 0, 0, 0, 0, 0, 53, 0, 0, 0,
715
716 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
717 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
718 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
719 8, 0, 0, 0, 0, 0, 52, 54, 0, 0,
720 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
721 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
722 0, 0, 0, 0, 0, 0, 0, 0, 67, 65,
723 0, 64, 63, 0, 0, 0, 19, 18, 0, 0,
724 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
725 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
726
727 0, 0, 0, 0, 0, 0, 0, 0, 66, 63,
728 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
729 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
730 0, 47, 0, 0, 0, 0, 0, 14, 0, 0,
731 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
732 0, 0, 0, 43, 0, 0, 0, 0, 0, 0,
733 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
734 0, 0, 0, 0, 7, 0, 0, 0, 0, 0,
735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
736 0, 45, 0, 0, 42, 0, 0, 0, 0, 0,
737
738 32, 0, 0, 0, 0, 0, 0, 22, 0, 0,
739 0, 0, 0, 0, 0, 0, 0, 0, 38, 39,
740 44, 0, 0, 0, 0, 0, 46, 0, 0, 0,
741 0, 0, 0, 12, 0, 0, 0, 0, 0, 0,
742 0, 0, 28, 0, 26, 0, 0, 0, 0, 0,
743 0, 49, 0, 0, 0, 0, 30, 0, 0, 0,
744 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
745 0, 0, 0, 29, 0, 0, 0, 48, 0, 0,
746 0, 0, 0, 13, 17, 0, 0, 0, 37, 0,
747 0, 0, 0, 0, 0, 31, 0, 27, 0, 0,
748
749 0, 0, 0, 0, 35, 34, 0, 0, 25, 0,
750 23, 0, 16, 0, 0, 24, 21, 0, 0, 0,
751 0, 0, 33, 0, 0, 41, 40, 0, 36, 0,
752 0, 15, 0
753 } ;
754
755static const YY_CHAR yy_ec[256] =
756 { 0,
757 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
758 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
759 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
760 1, 4, 5, 6, 7, 5, 5, 5, 5, 5,
761 5, 8, 9, 10, 11, 12, 13, 14, 14, 14,
762 14, 14, 14, 14, 14, 14, 14, 15, 5, 16,
763 5, 17, 18, 5, 19, 20, 21, 22, 23, 24,
764 5, 5, 5, 25, 5, 26, 5, 27, 28, 29,
765 5, 30, 31, 32, 33, 5, 5, 5, 5, 5,
766 34, 35, 36, 5, 37, 5, 38, 39, 40, 41,
767
768 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
769 52, 53, 5, 54, 55, 56, 57, 58, 59, 60,
770 61, 62, 63, 5, 64, 5, 5, 5, 5, 5,
771 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
772 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
773 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
774 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
775 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
776 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
777 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
778
779 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
780 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
781 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
782 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
783 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
784 5, 5, 5, 5, 5
785 } ;
786
787static const YY_CHAR yy_meta[65] =
788 { 0,
789 1, 1, 2, 1, 1, 3, 1, 1, 1, 1,
790 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
791 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
792 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
793 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
794 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
795 1, 1, 1, 1
796 } ;
797
798static const flex_int16_t yy_base[442] =
799 { 0,
800 0, 63, 17, 27, 35, 42, 46, 51, 80, 89,
801 686, 687, 24, 682, 127, 0, 180, 687, 181, 66,
802 9, 184, 687, 666, 101, 21, 14, 31, 687, 687,
803 22, 61, 66, 687, 687, 687, 98, 670, 631, 0,
804 664, 99, 677, 27, 205, 687, 634, 166, 83, 177,
805 228, 629, 625, 159, 64, 624, 622, 632, 65, 635,
806 84, 615, 164, 629, 16, 185, 187, 0, 194, 252,
807 259, 260, 197, 687, 0, 687, 656, 655, 186, 198,
808 232, 243, 250, 244, 687, 628, 661, 687, 209, 687,
809 274, 626, 253, 257, 259, 659, 0, 326, 620, 163,
810
811 612, 623, 617, 605, 602, 604, 177, 646, 595, 616,
812 610, 593, 602, 597, 594, 177, 595, 590, 238, 607,
813 600, 603, 0, 259, 267, 277, 260, 269, 280, 595,
814 687, 590, 270, 636, 635, 634, 687, 687, 356, 587,
815 588, 581, 581, 578, 592, 622, 577, 572, 582, 573,
816 590, 616, 572, 581, 249, 582, 612, 569, 583, 564,
817 563, 576, 563, 574, 567, 570, 559, 285, 687, 687,
818 297, 687, 687, 555, 589, 604, 687, 687, 386, 555,
819 566, 553, 595, 561, 549, 548, 557, 563, 545, 548,
820 557, 546, 558, 553, 548, 551, 586, 280, 534, 540,
821
822 547, 582, 533, 544, 531, 542, 572, 571, 687, 687,
823 540, 539, 687, 416, 533, 527, 525, 535, 526, 518,
824 531, 566, 517, 559, 531, 527, 529, 512, 511, 502,
825 509, 687, 510, 507, 504, 517, 504, 687, 502, 500,
826 509, 498, 505, 512, 509, 499, 493, 492, 498, 494,
827 503, 533, 489, 687, 501, 492, 490, 485, 488, 476,
828 481, 493, 528, 479, 480, 300, 475, 479, 487, 522,
829 471, 515, 483, 472, 687, 468, 477, 515, 509, 469,
830 460, 478, 458, 504, 468, 471, 470, 469, 504, 503,
831 502, 687, 457, 450, 687, 453, 452, 461, 496, 490,
832
833 687, 439, 273, 438, 447, 491, 446, 687, 440, 456,
834 451, 446, 449, 449, 450, 482, 432, 480, 687, 687,
835 687, 447, 432, 430, 429, 427, 687, 435, 461, 415,
836 391, 396, 394, 687, 443, 396, 401, 397, 389, 390,
837 402, 388, 687, 386, 687, 378, 393, 376, 375, 368,
838 381, 687, 371, 367, 413, 376, 687, 377, 365, 409,
839 359, 287, 362, 374, 405, 398, 351, 356, 355, 387,
840 341, 349, 348, 687, 329, 340, 332, 687, 380, 329,
841 378, 328, 328, 687, 687, 332, 322, 321, 687, 317,
842 365, 357, 306, 319, 354, 687, 313, 687, 352, 311,
843
844 350, 304, 303, 347, 687, 687, 346, 295, 687, 294,
845 687, 301, 687, 286, 283, 687, 687, 330, 293, 279,
846 320, 243, 687, 167, 119, 687, 687, 64, 687, 53,
847 2, 687, 687, 459, 462, 465, 0, 468, 471, 474,
848 477
849 } ;
850
851static const flex_int16_t yy_def[442] =
852 { 0,
853 434, 434, 435, 435, 434, 434, 434, 434, 434, 434,
854 433, 433, 433, 433, 433, 436, 433, 433, 433, 433,
855 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
856 433, 433, 433, 433, 433, 433, 433, 433, 433, 437,
857 433, 433, 433, 438, 15, 433, 45, 45, 45, 45,
858 439, 45, 45, 45, 45, 45, 45, 45, 45, 45,
859 45, 45, 45, 45, 45, 45, 45, 436, 433, 433,
860 433, 433, 433, 433, 440, 433, 433, 433, 433, 433,
861 433, 433, 433, 433, 433, 433, 437, 433, 438, 433,
862 433, 45, 45, 45, 45, 441, 45, 439, 45, 45,
863
864 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
865 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
866 45, 45, 440, 433, 433, 433, 433, 433, 433, 433,
867 433, 45, 45, 45, 45, 441, 433, 433, 98, 45,
868 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
869 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
870 45, 45, 45, 45, 45, 45, 45, 433, 433, 433,
871 433, 433, 433, 433, 45, 45, 433, 433, 98, 45,
872 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
873 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
874
875 45, 45, 45, 45, 45, 45, 45, 45, 433, 433,
876 433, 45, 433, 98, 45, 45, 45, 45, 45, 45,
877 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
878 45, 433, 45, 45, 45, 45, 45, 433, 45, 45,
879 45, 45, 45, 45, 433, 45, 45, 45, 45, 45,
880 45, 45, 45, 433, 45, 45, 45, 45, 45, 45,
881 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
882 45, 45, 45, 45, 433, 45, 45, 45, 45, 45,
883 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
884 45, 433, 45, 45, 433, 45, 45, 45, 45, 45,
885
886 433, 45, 45, 45, 45, 45, 45, 433, 45, 45,
887 45, 45, 45, 45, 45, 45, 45, 45, 433, 433,
888 433, 45, 45, 45, 45, 45, 433, 45, 45, 45,
889 45, 45, 45, 433, 45, 45, 45, 45, 45, 45,
890 45, 45, 433, 45, 433, 45, 45, 45, 45, 45,
891 45, 433, 45, 45, 45, 45, 433, 45, 45, 45,
892 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
893 45, 45, 45, 433, 45, 45, 45, 433, 45, 45,
894 45, 45, 45, 433, 433, 45, 45, 45, 433, 45,
895 45, 45, 45, 45, 45, 433, 45, 433, 45, 45,
896
897 45, 45, 45, 45, 433, 433, 45, 45, 433, 45,
898 433, 45, 433, 45, 45, 433, 433, 45, 45, 45,
899 45, 45, 433, 45, 45, 433, 433, 45, 433, 45,
900 45, 433, 0, 433, 433, 433, 433, 433, 433, 433,
901 433
902 } ;
903
904static const flex_int16_t yy_nxt[752] =
905 { 0,
906 87, 13, 14, 13, 433, 15, 16, 432, 17, 18,
907 19, 20, 21, 22, 23, 24, 74, 433, 37, 14,
908 37, 75, 25, 26, 38, 42, 27, 42, 37, 14,
909 37, 28, 90, 29, 38, 30, 13, 14, 13, 79,
910 79, 25, 31, 13, 14, 13, 80, 13, 14, 13,
911 32, 40, 13, 14, 13, 33, 40, 119, 79, 82,
912 81, 91, 34, 35, 13, 14, 13, 120, 15, 16,
913 80, 17, 18, 19, 20, 21, 22, 23, 24, 73,
914 39, 13, 14, 13, 81, 25, 26, 39, 71, 27,
915 13, 14, 13, 80, 28, 81, 29, 41, 30, 42,
916
917 42, 42, 42, 94, 25, 31, 41, 71, 431, 77,
918 110, 77, 105, 32, 78, 106, 111, 83, 33, 84,
919 430, 113, 94, 114, 429, 34, 35, 44, 44, 44,
920 45, 45, 46, 45, 45, 45, 45, 45, 45, 45,
921 45, 45, 45, 45, 45, 45, 45, 45, 47, 45,
922 45, 48, 45, 45, 45, 45, 45, 45, 49, 50,
923 45, 51, 45, 45, 52, 45, 53, 54, 45, 55,
924 45, 56, 57, 48, 58, 59, 60, 61, 62, 63,
925 64, 65, 66, 67, 45, 45, 45, 45, 45, 45,
926 45, 69, 69, 70, 72, 69, 93, 72, 95, 101,
927
928 102, 116, 71, 71, 103, 94, 71, 73, 95, 104,
929 73, 124, 141, 142, 90, 117, 71, 95, 428, 71,
930 93, 71, 71, 125, 94, 71, 45, 95, 149, 45,
931 159, 150, 160, 97, 124, 71, 45, 45, 71, 121,
932 45, 122, 45, 91, 45, 45, 125, 45, 427, 45,
933 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
934 45, 45, 45, 69, 126, 70, 45, 77, 124, 77,
935 45, 69, 78, 72, 71, 125, 126, 163, 45, 89,
936 133, 45, 71, 45, 98, 134, 89, 135, 126, 168,
937 168, 127, 169, 71, 169, 164, 176, 380, 128, 170,
938
939 129, 71, 170, 195, 133, 295, 196, 209, 89, 134,
940 296, 135, 89, 168, 171, 169, 89, 172, 170, 209,
941 176, 173, 233, 330, 89, 426, 209, 89, 331, 89,
942 89, 138, 234, 425, 424, 423, 297, 422, 210, 139,
943 421, 381, 420, 419, 139, 139, 139, 139, 139, 139,
944 418, 417, 416, 415, 414, 413, 412, 411, 410, 409,
945 408, 407, 406, 139, 139, 139, 139, 139, 139, 179,
946 405, 404, 403, 402, 179, 179, 179, 179, 179, 179,
947 401, 400, 399, 398, 397, 396, 395, 394, 393, 392,
948 391, 390, 389, 179, 179, 179, 179, 179, 179, 214,
949
950 388, 387, 386, 385, 214, 214, 214, 214, 214, 214,
951 384, 383, 382, 379, 378, 377, 376, 375, 374, 373,
952 372, 371, 370, 214, 214, 214, 214, 214, 214, 45,
953 369, 368, 367, 366, 45, 45, 45, 45, 45, 45,
954 365, 364, 363, 362, 361, 360, 359, 358, 357, 356,
955 355, 354, 353, 45, 45, 45, 45, 45, 45, 12,
956 12, 12, 36, 36, 36, 68, 352, 68, 89, 89,
957 89, 96, 96, 96, 123, 351, 123, 136, 136, 136,
958 350, 349, 348, 347, 346, 345, 344, 343, 342, 341,
959 340, 339, 338, 337, 336, 335, 334, 333, 332, 329,
960
961 328, 327, 326, 325, 324, 323, 322, 321, 320, 319,
962 318, 317, 316, 315, 314, 313, 312, 311, 310, 309,
963 308, 307, 306, 305, 304, 303, 302, 301, 300, 299,
964 298, 294, 293, 292, 291, 290, 289, 288, 287, 286,
965 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
966 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
967 265, 264, 263, 262, 261, 260, 259, 258, 257, 256,
968 255, 254, 253, 252, 251, 250, 249, 248, 247, 246,
969 245, 244, 243, 242, 241, 240, 239, 238, 237, 236,
970 235, 232, 231, 230, 229, 228, 227, 226, 225, 224,
971
972 223, 222, 221, 220, 219, 218, 217, 216, 215, 213,
973 212, 211, 208, 207, 206, 205, 204, 203, 202, 201,
974 200, 199, 198, 197, 194, 193, 192, 191, 190, 189,
975 188, 187, 186, 185, 184, 183, 182, 181, 180, 137,
976 178, 177, 175, 174, 167, 166, 165, 162, 161, 158,
977 157, 156, 155, 154, 153, 152, 151, 148, 147, 146,
978 145, 144, 143, 140, 137, 132, 131, 130, 78, 78,
979 118, 115, 112, 109, 108, 107, 100, 99, 92, 43,
980 88, 86, 85, 76, 43, 433, 11, 433, 433, 433,
981 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
982
983 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
984 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
985 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
986 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
987 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
988 433
989 } ;
990
991static const flex_int16_t yy_chk[752] =
992 { 0,
993 437, 1, 1, 1, 0, 1, 1, 431, 1, 1,
994 1, 1, 1, 1, 1, 1, 21, 0, 3, 3,
995 3, 21, 1, 1, 3, 13, 1, 13, 4, 4,
996 4, 1, 44, 1, 4, 1, 5, 5, 5, 26,
997 31, 1, 1, 6, 6, 6, 27, 7, 7, 7,
998 1, 7, 8, 8, 8, 1, 8, 65, 26, 31,
999 28, 44, 1, 1, 2, 2, 2, 65, 2, 2,
1000 27, 2, 2, 2, 2, 2, 2, 2, 2, 20,
1001 5, 9, 9, 9, 28, 2, 2, 6, 20, 2,
1002 10, 10, 10, 32, 2, 33, 2, 9, 2, 37,
1003
1004 42, 37, 42, 49, 2, 2, 10, 20, 430, 25,
1005 59, 25, 55, 2, 25, 55, 59, 32, 2, 33,
1006 428, 61, 49, 61, 425, 2, 2, 15, 15, 15,
1007 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1008 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1009 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1010 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1011 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1012 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1013 15, 17, 19, 17, 19, 22, 48, 22, 50, 54,
1014
1015 54, 63, 17, 19, 54, 66, 22, 69, 67, 54,
1016 73, 79, 100, 100, 89, 63, 69, 50, 424, 73,
1017 48, 17, 19, 80, 66, 22, 45, 67, 107, 45,
1018 116, 107, 116, 51, 79, 69, 45, 45, 73, 66,
1019 51, 67, 45, 89, 45, 45, 80, 45, 422, 45,
1020 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
1021 45, 45, 51, 70, 81, 70, 51, 71, 82, 71,
1022 51, 72, 71, 72, 70, 83, 84, 119, 51, 91,
1023 93, 51, 72, 51, 51, 94, 91, 95, 81, 124,
1024 127, 82, 125, 70, 128, 119, 133, 362, 83, 126,
1025
1026 84, 72, 129, 155, 93, 266, 155, 168, 91, 94,
1027 266, 95, 91, 124, 127, 125, 91, 128, 126, 171,
1028 133, 129, 198, 303, 91, 421, 168, 91, 303, 91,
1029 91, 98, 198, 420, 419, 418, 266, 415, 171, 98,
1030 414, 362, 412, 410, 98, 98, 98, 98, 98, 98,
1031 408, 407, 404, 403, 402, 401, 400, 399, 397, 395,
1032 394, 393, 392, 98, 98, 98, 98, 98, 98, 139,
1033 391, 390, 388, 387, 139, 139, 139, 139, 139, 139,
1034 386, 383, 382, 381, 380, 379, 377, 376, 375, 373,
1035 372, 371, 370, 139, 139, 139, 139, 139, 139, 179,
1036
1037 369, 368, 367, 366, 179, 179, 179, 179, 179, 179,
1038 365, 364, 363, 361, 360, 359, 358, 356, 355, 354,
1039 353, 351, 350, 179, 179, 179, 179, 179, 179, 214,
1040 349, 348, 347, 346, 214, 214, 214, 214, 214, 214,
1041 344, 342, 341, 340, 339, 338, 337, 336, 335, 333,
1042 332, 331, 330, 214, 214, 214, 214, 214, 214, 434,
1043 434, 434, 435, 435, 435, 436, 329, 436, 438, 438,
1044 438, 439, 439, 439, 440, 328, 440, 441, 441, 441,
1045 326, 325, 324, 323, 322, 318, 317, 316, 315, 314,
1046 313, 312, 311, 310, 309, 307, 306, 305, 304, 302,
1047
1048 300, 299, 298, 297, 296, 294, 293, 291, 290, 289,
1049 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
1050 278, 277, 276, 274, 273, 272, 271, 270, 269, 268,
1051 267, 265, 264, 263, 262, 261, 260, 259, 258, 257,
1052 256, 255, 253, 252, 251, 250, 249, 248, 247, 246,
1053 245, 244, 243, 242, 241, 240, 239, 237, 236, 235,
1054 234, 233, 231, 230, 229, 228, 227, 226, 225, 224,
1055 223, 222, 221, 220, 219, 218, 217, 216, 215, 212,
1056 211, 208, 207, 206, 205, 204, 203, 202, 201, 200,
1057 199, 197, 196, 195, 194, 193, 192, 191, 190, 189,
1058
1059 188, 187, 186, 185, 184, 183, 182, 181, 180, 176,
1060 175, 174, 167, 166, 165, 164, 163, 162, 161, 160,
1061 159, 158, 157, 156, 154, 153, 152, 151, 150, 149,
1062 148, 147, 146, 145, 144, 143, 142, 141, 140, 136,
1063 135, 134, 132, 130, 122, 121, 120, 118, 117, 115,
1064 114, 113, 112, 111, 110, 109, 108, 106, 105, 104,
1065 103, 102, 101, 99, 96, 92, 87, 86, 78, 77,
1066 64, 62, 60, 58, 57, 56, 53, 52, 47, 43,
1067 41, 39, 38, 24, 14, 11, 433, 433, 433, 433,
1068 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
1069
1070 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
1071 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
1072 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
1073 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
1074 433, 433, 433, 433, 433, 433, 433, 433, 433, 433,
1075 433
1076 } ;
1077
1078static yy_state_type yy_last_accepting_state;
1079static char *yy_last_accepting_cpos;
1080
1081extern int yy_flex_debug;
1083
1084static const flex_int16_t yy_rule_linenum[69] =
1085 { 0,
1086 137, 139, 141, 146, 147, 152, 153, 154, 166, 169,
1087 174, 180, 189, 200, 211, 220, 229, 238, 248, 258,
1088 268, 285, 302, 311, 320, 330, 342, 352, 363, 372,
1089 382, 392, 402, 411, 420, 429, 438, 447, 456, 465,
1090 474, 483, 492, 501, 510, 519, 528, 541, 550, 559,
1091 660, 676, 725, 733, 748, 749, 750, 751, 752, 753,
1092 755, 773, 786, 791, 795, 797, 799, 801
1093 } ;
1094
1095/* The intent behind this definition is that it'll catch
1096 * any uses of REJECT which flex missed.
1097 */
1098#define REJECT reject_used_but_not_detected
1099#define yymore() yymore_used_but_not_detected
1100#define YY_MORE_ADJ 0
1101#define YY_RESTORE_YY_MORE_OFFSET
1103#line 1 "d2_lexer.ll"
1104/* Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
1105
1106 This Source Code Form is subject to the terms of the Mozilla Public
1107 License, v. 2.0. If a copy of the MPL was not distributed with this
1108 file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1109#line 8 "d2_lexer.ll"
1110
1111/* Generated files do not make clang static analyser so happy */
1112#ifndef __clang_analyzer__
1113
1114#include <cctype>
1115#include <cerrno>
1116#include <climits>
1117#include <cstdint>
1118#include <cstdlib>
1119#include <string>
1120#include <d2/parser_context.h>
1121#include <asiolink/io_address.h>
1122#include <boost/lexical_cast.hpp>
1123#include <exceptions/exceptions.h>
1124
1125/* Please avoid C++ style comments (// ... eol) as they break flex 2.6.2 */
1126
1127/* Work around an incompatibility in flex (at least versions
1128 2.5.31 through 2.5.33): it generates code that does
1129 not conform to C89. See Debian bug 333231
1130 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
1131# undef yywrap
1132# define yywrap() 1
1133
1134namespace {
1135
1136bool start_token_flag = false;
1137
1138isc::d2::D2ParserContext::ParserType start_token_value;
1139unsigned int comment_start_line = 0;
1140
1141};
1142
1143/* To avoid the call to exit... oops! */
1144#define YY_FATAL_ERROR(msg) isc::d2::D2ParserContext::fatal(msg)
1145#line 1145 "d2_lexer.cc"
1146/* noyywrap disables automatic rewinding for the next file to parse. Since we
1147 always parse only a single string, there's no need to do any wraps. And
1148 using yywrap requires linking with -lfl, which provides the default yywrap
1149 implementation that always returns 1 anyway. */
1150/* nounput simplifies the lexer, by removing support for putting a character
1151 back into the input stream. We never use such capability anyway. */
1152/* batch means that we'll never use the generated lexer interactively. */
1153/* avoid to get static global variables to remain with C++. */
1154/* in last resort %option reentrant */
1155/* Enables debug mode. To see the debug messages, one needs to also set
1156 yy_flex_debug to 1, then the debug messages will be printed on stderr. */
1157/* I have no idea what this option does, except it was specified in the bison
1158 examples and Postgres folks added it to remove gcc 4.3 warnings. Let's
1159 be on the safe side and keep it. */
1160#define YY_NO_INPUT 1
1161
1162/* These are not token expressions yet, just convenience expressions that
1163 can be used during actual token definitions. Note some can match
1164 incorrect inputs (e.g., IP addresses) which must be checked. */
1165/* for errors */
1166#line 94 "d2_lexer.ll"
1167/* This code run each time a pattern is matched. It updates the location
1168 by moving it ahead by yyleng bytes. yyleng specifies the length of the
1169 currently matched token. */
1170#define YY_USER_ACTION driver.loc_.columns(yyleng);
1171#line 1171 "d2_lexer.cc"
1172#line 1172 "d2_lexer.cc"
1173
1174#define INITIAL 0
1175#define COMMENT 1
1176#define DIR_ENTER 2
1177#define DIR_INCLUDE 3
1178#define DIR_EXIT 4
1179
1180#ifndef YY_NO_UNISTD_H
1181/* Special case for "unistd.h", since it is non-ANSI. We include it way
1182 * down here because we want the user's section 1 to have been scanned first.
1183 * The user has a chance to override it with an option.
1184 */
1185/* %if-c-only */
1186#include <unistd.h>
1187/* %endif */
1188/* %if-c++-only */
1189/* %endif */
1190#endif
1191
1192#ifndef YY_EXTRA_TYPE
1193#define YY_EXTRA_TYPE void *
1194#endif
1195
1196/* %if-c-only Reentrant structure and macros (non-C++). */
1197/* %if-reentrant */
1198/* %if-c-only */
1199
1200static int yy_init_globals ( void );
1201
1202/* %endif */
1203/* %if-reentrant */
1204/* %endif */
1205/* %endif End reentrant structures and macros. */
1206
1207/* Accessor methods to globals.
1208 These are made visible to non-reentrant scanners for convenience. */
1209
1210int yylex_destroy ( void );
1211
1212int yyget_debug ( void );
1213
1214void yyset_debug ( int debug_flag );
1215
1216YY_EXTRA_TYPE yyget_extra ( void );
1217
1218void yyset_extra ( YY_EXTRA_TYPE user_defined );
1219
1220FILE *yyget_in ( void );
1221
1222void yyset_in ( FILE * _in_str );
1223
1224FILE *yyget_out ( void );
1225
1226void yyset_out ( FILE * _out_str );
1227
1228 int yyget_leng ( void );
1229
1230char *yyget_text ( void );
1231
1232int yyget_lineno ( void );
1233
1234void yyset_lineno ( int _line_number );
1235
1236/* %if-bison-bridge */
1237/* %endif */
1238
1239/* Macros after this point can all be overridden by user definitions in
1240 * section 1.
1241 */
1242
1243#ifndef YY_SKIP_YYWRAP
1244#ifdef __cplusplus
1245extern "C" int yywrap ( void );
1246#else
1247extern int yywrap ( void );
1248#endif
1249#endif
1250
1251/* %not-for-header */
1252#ifndef YY_NO_UNPUT
1253
1254#endif
1255/* %ok-for-header */
1256
1257/* %endif */
1258
1259#ifndef yytext_ptr
1260static void yy_flex_strncpy ( char *, const char *, int );
1261#endif
1262
1263#ifdef YY_NEED_STRLEN
1264static int yy_flex_strlen ( const char * );
1265#endif
1266
1267#ifndef YY_NO_INPUT
1268/* %if-c-only Standard (non-C++) definition */
1269/* %not-for-header */
1270#ifdef __cplusplus
1271static int yyinput ( void );
1272#else
1273static int input ( void );
1274#endif
1275/* %ok-for-header */
1276
1277/* %endif */
1278#endif
1279
1280/* %if-c-only */
1281
1282/* %endif */
1283
1284/* Amount of stuff to slurp up with each read. */
1285#ifndef YY_READ_BUF_SIZE
1286#ifdef __ia64__
1287/* On IA-64, the buffer size is 16k, not 8k */
1288#define YY_READ_BUF_SIZE 16384
1289#else
1290#define YY_READ_BUF_SIZE 8192
1291#endif /* __ia64__ */
1292#endif
1293
1294/* Copy whatever the last rule matched to the standard output. */
1295#ifndef ECHO
1296/* %if-c-only Standard (non-C++) definition */
1297/* This used to be an fputs(), but since the string might contain NUL's,
1298 * we now use fwrite().
1299 */
1300#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1301/* %endif */
1302/* %if-c++-only C++ definition */
1303/* %endif */
1304#endif
1305
1306/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1307 * is returned in "result".
1308 */
1309#ifndef YY_INPUT
1310#define YY_INPUT(buf,result,max_size) \
1311/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1312 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1313 { \
1314 int c = '*'; \
1315 int n; \
1316 for ( n = 0; n < max_size && \
1317 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1318 buf[n] = (char) c; \
1319 if ( c == '\n' ) \
1320 buf[n++] = (char) c; \
1321 if ( c == EOF && ferror( yyin ) ) \
1322 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1323 result = n; \
1324 } \
1325 else \
1326 { \
1327 errno=0; \
1328 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1329 { \
1330 if( errno != EINTR) \
1331 { \
1332 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1333 break; \
1334 } \
1335 errno=0; \
1336 clearerr(yyin); \
1337 } \
1338 }\
1339\
1340/* %if-c++-only C++ definition \ */\
1341/* %endif */
1342
1343#endif
1344
1345/* No semi-colon after return; correct usage is to write "yyterminate();" -
1346 * we don't want an extra ';' after the "return" because that will cause
1347 * some compilers to complain about unreachable statements.
1348 */
1349#ifndef yyterminate
1350#define yyterminate() return YY_NULL
1351#endif
1352
1353/* Number of entries by which start-condition stack grows. */
1354#ifndef YY_START_STACK_INCR
1355#define YY_START_STACK_INCR 25
1356#endif
1357
1358/* Report a fatal error. */
1359#ifndef YY_FATAL_ERROR
1360/* %if-c-only */
1361#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1362/* %endif */
1363/* %if-c++-only */
1364/* %endif */
1365#endif
1366
1367/* %if-tables-serialization structures and prototypes */
1368/* %not-for-header */
1369/* %ok-for-header */
1370
1371/* %not-for-header */
1372/* %tables-yydmap generated elements */
1373/* %endif */
1374/* end tables serialization structures and prototypes */
1375
1376/* %ok-for-header */
1377
1378/* Default declaration of generated scanner - a define so the user can
1379 * easily add parameters.
1380 */
1381#ifndef YY_DECL
1382#define YY_DECL_IS_OURS 1
1383/* %if-c-only Standard (non-C++) definition */
1384
1385extern int yylex (void);
1386
1387#define YY_DECL int yylex (void)
1388/* %endif */
1389/* %if-c++-only C++ definition */
1390/* %endif */
1391#endif /* !YY_DECL */
1392
1393/* Code executed at the beginning of each rule, after yytext and yyleng
1394 * have been set up.
1395 */
1396#ifndef YY_USER_ACTION
1397#define YY_USER_ACTION
1398#endif
1399
1400/* Code executed at the end of each rule. */
1401#ifndef YY_BREAK
1402#define YY_BREAK /*LINTED*/break;
1403#endif
1404
1405/* %% [6.0] YY_RULE_SETUP definition goes here */
1406#define YY_RULE_SETUP \
1407 YY_USER_ACTION
1408
1409/* %not-for-header */
1413{
1414 yy_state_type yy_current_state;
1415 char *yy_cp, *yy_bp;
1417
1418 if ( !(yy_init) )
1419 {
1420 (yy_init) = 1;
1421
1422#ifdef YY_USER_INIT
1423 YY_USER_INIT;
1424#endif
1425
1426 if ( ! (yy_start) )
1427 (yy_start) = 1; /* first start state */
1428
1429 if ( ! yyin )
1430/* %if-c-only */
1431 yyin = stdin;
1432/* %endif */
1433/* %if-c++-only */
1434/* %endif */
1435
1436 if ( ! yyout )
1437/* %if-c-only */
1438 yyout = stdout;
1439/* %endif */
1440/* %if-c++-only */
1441/* %endif */
1442
1443 if ( ! YY_CURRENT_BUFFER ) {
1447 }
1448
1450 }
1451
1452 {
1453/* %% [7.0] user's declarations go here */
1454#line 100 "d2_lexer.ll"
1455
1456
1457
1458#line 104 "d2_lexer.ll"
1459 /* This part of the code is copied over to the verbatim to the top
1460 of the generated yylex function. Explanation:
1461 http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html */
1462
1463 /* Code run each time yylex is called. */
1464 driver.loc_.step();
1465
1466 if (start_token_flag) {
1467 start_token_flag = false;
1468 switch (start_token_value) {
1470 default:
1471 return isc::d2::D2Parser::make_TOPLEVEL_JSON(driver.loc_);
1475 return isc::d2::D2Parser::make_SUB_DHCPDDNS(driver.loc_);
1477 return isc::d2::D2Parser::make_SUB_TSIG_KEY(driver.loc_);
1479 return isc::d2::D2Parser::make_SUB_TSIG_KEYS(driver.loc_);
1481 return isc::d2::D2Parser::make_SUB_DDNS_DOMAIN(driver.loc_);
1483 return isc::d2::D2Parser::make_SUB_DDNS_DOMAINS(driver.loc_);
1485 return isc::d2::D2Parser::make_SUB_DNS_SERVER(driver.loc_);
1488 }
1489 }
1490
1491
1492#line 1492 "d2_lexer.cc"
1493
1494 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1495 {
1496/* %% [8.0] yymore()-related code goes here */
1497 yy_cp = (yy_c_buf_p);
1498
1499 /* Support of yytext. */
1500 *yy_cp = (yy_hold_char);
1501
1502 /* yy_bp points to the position in yy_ch_buf of the start of
1503 * the current run.
1504 */
1505 yy_bp = yy_cp;
1506
1507/* %% [9.0] code to set up and find next match goes here */
1508 yy_current_state = (yy_start);
1509yy_match:
1510 do
1511 {
1512 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1513 if ( yy_accept[yy_current_state] )
1514 {
1515 (yy_last_accepting_state) = yy_current_state;
1516 (yy_last_accepting_cpos) = yy_cp;
1517 }
1518 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1519 {
1520 yy_current_state = (int) yy_def[yy_current_state];
1521 if ( yy_current_state >= 434 )
1522 yy_c = yy_meta[yy_c];
1523 }
1524 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1525 ++yy_cp;
1526 }
1527 while ( yy_current_state != 433 );
1528 yy_cp = (yy_last_accepting_cpos);
1529 yy_current_state = (yy_last_accepting_state);
1530
1531yy_find_action:
1532/* %% [10.0] code to find the action number goes here */
1533 yy_act = yy_accept[yy_current_state];
1534
1536
1537/* %% [11.0] code for yylineno update goes here */
1538
1539do_action: /* This label is used only to access EOF actions. */
1540
1541/* %% [12.0] debug code goes here */
1542 if ( yy_flex_debug )
1543 {
1544 if ( yy_act == 0 )
1545 fprintf( stderr, "--scanner backing up\n" );
1546 else if ( yy_act < 69 )
1547 fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1548 (long)yy_rule_linenum[yy_act], yytext );
1549 else if ( yy_act == 69 )
1550 fprintf( stderr, "--accepting default rule (\"%s\")\n",
1551 yytext );
1552 else if ( yy_act == 70 )
1553 fprintf( stderr, "--(end of buffer or a NUL)\n" );
1554 else
1555 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1556 }
1557
1558 switch ( yy_act )
1559 { /* beginning of action switch */
1560/* %% [13.0] actions go here */
1561 case 0: /* must back up */
1562 /* undo the effects of YY_DO_BEFORE_ACTION */
1563 *yy_cp = (yy_hold_char);
1564 yy_cp = (yy_last_accepting_cpos);
1565 yy_current_state = (yy_last_accepting_state);
1566 goto yy_find_action;
1567
1568case 1:
1570#line 137 "d2_lexer.ll"
1571;
1572 YY_BREAK
1573case 2:
1575#line 139 "d2_lexer.ll"
1576;
1577 YY_BREAK
1578case 3:
1580#line 141 "d2_lexer.ll"
1581{
1582 BEGIN(COMMENT);
1583 comment_start_line = driver.loc_.end.line;;
1584}
1585 YY_BREAK
1586case 4:
1588#line 146 "d2_lexer.ll"
1589BEGIN(INITIAL);
1590 YY_BREAK
1591case 5:
1593#line 147 "d2_lexer.ll"
1594;
1595 YY_BREAK
1596case YY_STATE_EOF(COMMENT):
1597#line 148 "d2_lexer.ll"
1598{
1599 isc_throw(D2ParseError, "Comment not closed. (/* in line " << comment_start_line);
1600}
1601 YY_BREAK
1602case 6:
1604#line 152 "d2_lexer.ll"
1606 YY_BREAK
1607case 7:
1609#line 153 "d2_lexer.ll"
1611 YY_BREAK
1612case 8:
1614#line 154 "d2_lexer.ll"
1615{
1616 /* Include directive. */
1617
1618 /* Extract the filename. */
1619 std::string tmp(yytext+1);
1620 tmp.resize(tmp.size() - 1);
1621
1622 driver.includeFile(tmp);
1623}
1624 YY_BREAK
1628#line 163 "d2_lexer.ll"
1629{
1630 isc_throw(D2ParseError, "Directive not closed.");
1631}
1632 YY_BREAK
1633case 9:
1635#line 166 "d2_lexer.ll"
1636BEGIN(INITIAL);
1637 YY_BREAK
1638case 10:
1640#line 169 "d2_lexer.ll"
1641{
1642 /* Ok, we found a with space. Let's ignore it and update loc variable. */
1643 driver.loc_.step();
1644}
1645 YY_BREAK
1646case 11:
1647/* rule 11 can match eol */
1649#line 174 "d2_lexer.ll"
1650{
1651 /* Newline found. Let's update the location and continue. */
1652 driver.loc_.lines(yyleng);
1653 driver.loc_.step();
1654}
1655 YY_BREAK
1656case 12:
1658#line 180 "d2_lexer.ll"
1659{
1660 switch(driver.ctx_) {
1662 return isc::d2::D2Parser::make_DHCPDDNS(driver.loc_);
1663 default:
1664 return isc::d2::D2Parser::make_STRING("DhcpDdns", driver.loc_);
1665 }
1666}
1667 YY_BREAK
1668case 13:
1670#line 189 "d2_lexer.ll"
1671{
1672 switch(driver.ctx_) {
1676 return isc::d2::D2Parser::make_IP_ADDRESS(driver.loc_);
1677 default:
1678 return isc::d2::D2Parser::make_STRING("ip-address", driver.loc_);
1679 }
1680}
1681 YY_BREAK
1682case 14:
1684#line 200 "d2_lexer.ll"
1685{
1686 switch(driver.ctx_) {
1690 return isc::d2::D2Parser::make_PORT(driver.loc_);
1691 default:
1692 return isc::d2::D2Parser::make_STRING("port", driver.loc_);
1693 }
1694}
1695 YY_BREAK
1696case 15:
1698#line 211 "d2_lexer.ll"
1699{
1700 switch(driver.ctx_) {
1703 default:
1704 return isc::d2::D2Parser::make_STRING("dns-server-timeout", driver.loc_);
1705 }
1706}
1707 YY_BREAK
1708case 16:
1710#line 220 "d2_lexer.ll"
1711{
1712 switch(driver.ctx_) {
1714 return isc::d2::D2Parser::make_NCR_PROTOCOL(driver.loc_);
1715 default:
1716 return isc::d2::D2Parser::make_STRING("ncr-protocol", driver.loc_);
1717 }
1718}
1719 YY_BREAK
1720case 17:
1722#line 229 "d2_lexer.ll"
1723{
1724 switch(driver.ctx_) {
1726 return isc::d2::D2Parser::make_NCR_FORMAT(driver.loc_);
1727 default:
1728 return isc::d2::D2Parser::make_STRING("ncr-format", driver.loc_);
1729 }
1730}
1731 YY_BREAK
1732case 18:
1734#line 238 "d2_lexer.ll"
1735{
1736 /* dhcp-ddns value keywords are case insensitive */
1737 if (driver.ctx_ == isc::d2::D2ParserContext::NCR_PROTOCOL) {
1738 return isc::d2::D2Parser::make_UDP(driver.loc_);
1739 }
1740 std::string tmp(yytext+1);
1741 tmp.resize(tmp.size() - 1);
1742 return isc::d2::D2Parser::make_STRING(tmp, driver.loc_);
1743}
1744 YY_BREAK
1745case 19:
1747#line 248 "d2_lexer.ll"
1748{
1749 /* dhcp-ddns value keywords are case insensitive */
1750 if (driver.ctx_ == isc::d2::D2ParserContext::NCR_PROTOCOL) {
1751 return isc::d2::D2Parser::make_TCP(driver.loc_);
1752 }
1753 std::string tmp(yytext+1);
1754 tmp.resize(tmp.size() - 1);
1755 return isc::d2::D2Parser::make_STRING(tmp, driver.loc_);
1756}
1757 YY_BREAK
1758case 20:
1760#line 258 "d2_lexer.ll"
1761{
1762 /* dhcp-ddns value keywords are case insensitive */
1763 if (driver.ctx_ == isc::d2::D2ParserContext::NCR_FORMAT) {
1764 return isc::d2::D2Parser::make_JSON(driver.loc_);
1765 }
1766 std::string tmp(yytext+1);
1767 tmp.resize(tmp.size() - 1);
1768 return isc::d2::D2Parser::make_STRING(tmp, driver.loc_);
1769}
1770 YY_BREAK
1771case 21:
1773#line 268 "d2_lexer.ll"
1774{
1775 switch(driver.ctx_) {
1785 return isc::d2::D2Parser::make_USER_CONTEXT(driver.loc_);
1786 default:
1787 return isc::d2::D2Parser::make_STRING("user-context", driver.loc_);
1788 }
1789}
1790 YY_BREAK
1791case 22:
1793#line 285 "d2_lexer.ll"
1794{
1795 switch(driver.ctx_) {
1805 return isc::d2::D2Parser::make_COMMENT(driver.loc_);
1806 default:
1807 return isc::d2::D2Parser::make_STRING("comment", driver.loc_);
1808 }
1809}
1810 YY_BREAK
1811case 23:
1813#line 302 "d2_lexer.ll"
1814{
1815 switch(driver.ctx_) {
1817 return isc::d2::D2Parser::make_FORWARD_DDNS(driver.loc_);
1818 default:
1819 return isc::d2::D2Parser::make_STRING("forward-ddns", driver.loc_);
1820 }
1821}
1822 YY_BREAK
1823case 24:
1825#line 311 "d2_lexer.ll"
1826{
1827 switch(driver.ctx_) {
1829 return isc::d2::D2Parser::make_REVERSE_DDNS(driver.loc_);
1830 default:
1831 return isc::d2::D2Parser::make_STRING("reverse-ddns", driver.loc_);
1832 }
1833}
1834 YY_BREAK
1835case 25:
1837#line 320 "d2_lexer.ll"
1838{
1839 switch(driver.ctx_) {
1842 return isc::d2::D2Parser::make_DDNS_DOMAINS(driver.loc_);
1843 default:
1844 return isc::d2::D2Parser::make_STRING("ddns-domains", driver.loc_);
1845 }
1846}
1847 YY_BREAK
1848case 26:
1850#line 330 "d2_lexer.ll"
1851{
1852 switch(driver.ctx_) {
1857 return isc::d2::D2Parser::make_KEY_NAME(driver.loc_);
1858 default:
1859 return isc::d2::D2Parser::make_STRING("key-name", driver.loc_);
1860 }
1861}
1862 YY_BREAK
1863case 27:
1865#line 342 "d2_lexer.ll"
1866{
1867 switch(driver.ctx_) {
1870 return isc::d2::D2Parser::make_DNS_SERVERS(driver.loc_);
1871 default:
1872 return isc::d2::D2Parser::make_STRING("dns-servers", driver.loc_);
1873 }
1874}
1875 YY_BREAK
1876case 28:
1878#line 352 "d2_lexer.ll"
1879{
1880 switch(driver.ctx_) {
1883 return isc::d2::D2Parser::make_HOSTNAME(driver.loc_);
1884 default:
1885 return isc::d2::D2Parser::make_STRING("hostname", driver.loc_);
1886 }
1887}
1888 YY_BREAK
1889case 29:
1891#line 363 "d2_lexer.ll"
1892{
1893 switch(driver.ctx_) {
1895 return isc::d2::D2Parser::make_TSIG_KEYS(driver.loc_);
1896 default:
1897 return isc::d2::D2Parser::make_STRING("tsig-keys", driver.loc_);
1898 }
1899}
1900 YY_BREAK
1901case 30:
1903#line 372 "d2_lexer.ll"
1904{
1905 switch(driver.ctx_) {
1908 return isc::d2::D2Parser::make_ALGORITHM(driver.loc_);
1909 default:
1910 return isc::d2::D2Parser::make_STRING("algorithm", driver.loc_);
1911 }
1912}
1913 YY_BREAK
1914case 31:
1916#line 382 "d2_lexer.ll"
1917{
1918 switch(driver.ctx_) {
1921 return isc::d2::D2Parser::make_DIGEST_BITS(driver.loc_);
1922 default:
1923 return isc::d2::D2Parser::make_STRING("digest-bits", driver.loc_);
1924 }
1925}
1926 YY_BREAK
1927case 32:
1929#line 392 "d2_lexer.ll"
1930{
1931 switch(driver.ctx_) {
1934 return isc::d2::D2Parser::make_SECRET(driver.loc_);
1935 default:
1936 return isc::d2::D2Parser::make_STRING("secret", driver.loc_);
1937 }
1938}
1939 YY_BREAK
1940case 33:
1942#line 402 "d2_lexer.ll"
1943{
1944 switch(driver.ctx_) {
1946 return isc::d2::D2Parser::make_CONTROL_SOCKET(driver.loc_);
1947 default:
1948 return isc::d2::D2Parser::make_STRING("control-socket", driver.loc_);
1949 }
1950}
1951 YY_BREAK
1952case 34:
1954#line 411 "d2_lexer.ll"
1955{
1956 switch(driver.ctx_) {
1958 return isc::d2::D2Parser::make_SOCKET_TYPE(driver.loc_);
1959 default:
1960 return isc::d2::D2Parser::make_STRING("socket-type", driver.loc_);
1961 }
1962}
1963 YY_BREAK
1964case 35:
1966#line 420 "d2_lexer.ll"
1967{
1968 switch(driver.ctx_) {
1970 return isc::d2::D2Parser::make_SOCKET_NAME(driver.loc_);
1971 default:
1972 return isc::d2::D2Parser::make_STRING("socket-name", driver.loc_);
1973 }
1974}
1975 YY_BREAK
1976case 36:
1978#line 429 "d2_lexer.ll"
1979{
1980 switch(driver.ctx_) {
1982 return isc::d2::D2Parser::make_HOOKS_LIBRARIES(driver.loc_);
1983 default:
1984 return isc::d2::D2Parser::make_STRING("hooks-libraries", driver.loc_);
1985 }
1986}
1987 YY_BREAK
1988case 37:
1990#line 438 "d2_lexer.ll"
1991{
1992 switch(driver.ctx_) {
1994 return isc::d2::D2Parser::make_PARAMETERS(driver.loc_);
1995 default:
1996 return isc::d2::D2Parser::make_STRING("parameters", driver.loc_);
1997 }
1998}
1999 YY_BREAK
2000case 38:
2002#line 447 "d2_lexer.ll"
2003{
2004 switch(driver.ctx_) {
2006 return isc::d2::D2Parser::make_LIBRARY(driver.loc_);
2007 default:
2008 return isc::d2::D2Parser::make_STRING("library", driver.loc_);
2009 }
2010}
2011 YY_BREAK
2012case 39:
2014#line 456 "d2_lexer.ll"
2015{
2016 switch(driver.ctx_) {
2018 return isc::d2::D2Parser::make_LOGGERS(driver.loc_);
2019 default:
2020 return isc::d2::D2Parser::make_STRING("loggers", driver.loc_);
2021 }
2022}
2023 YY_BREAK
2024case 40:
2026#line 465 "d2_lexer.ll"
2027{
2028 switch(driver.ctx_) {
2030 return isc::d2::D2Parser::make_OUTPUT_OPTIONS(driver.loc_);
2031 default:
2032 return isc::d2::D2Parser::make_STRING("output_options", driver.loc_);
2033 }
2034}
2035 YY_BREAK
2036case 41:
2038#line 474 "d2_lexer.ll"
2039{
2040 switch(driver.ctx_) {
2042 return isc::d2::D2Parser::make_OUTPUT_OPTIONS(driver.loc_);
2043 default:
2044 return isc::d2::D2Parser::make_STRING("output-options", driver.loc_);
2045 }
2046}
2047 YY_BREAK
2048case 42:
2050#line 483 "d2_lexer.ll"
2051{
2052 switch(driver.ctx_) {
2054 return isc::d2::D2Parser::make_OUTPUT(driver.loc_);
2055 default:
2056 return isc::d2::D2Parser::make_STRING("output", driver.loc_);
2057 }
2058}
2059 YY_BREAK
2060case 43:
2062#line 492 "d2_lexer.ll"
2063{
2064 switch(driver.ctx_) {
2066 return isc::d2::D2Parser::make_FLUSH(driver.loc_);
2067 default:
2068 return isc::d2::D2Parser::make_STRING("flush", driver.loc_);
2069 }
2070}
2071 YY_BREAK
2072case 44:
2074#line 501 "d2_lexer.ll"
2075{
2076 switch(driver.ctx_) {
2078 return isc::d2::D2Parser::make_MAXSIZE(driver.loc_);
2079 default:
2080 return isc::d2::D2Parser::make_STRING("maxsize", driver.loc_);
2081 }
2082}
2083 YY_BREAK
2084case 45:
2086#line 510 "d2_lexer.ll"
2087{
2088 switch(driver.ctx_) {
2090 return isc::d2::D2Parser::make_MAXVER(driver.loc_);
2091 default:
2092 return isc::d2::D2Parser::make_STRING("maxver", driver.loc_);
2093 }
2094}
2095 YY_BREAK
2096case 46:
2098#line 519 "d2_lexer.ll"
2099{
2100 switch(driver.ctx_) {
2102 return isc::d2::D2Parser::make_PATTERN(driver.loc_);
2103 default:
2104 return isc::d2::D2Parser::make_STRING("pattern", driver.loc_);
2105 }
2106}
2107 YY_BREAK
2108case 47:
2110#line 528 "d2_lexer.ll"
2111{
2112 switch(driver.ctx_) {
2118 return isc::d2::D2Parser::make_NAME(driver.loc_);
2119 default:
2120 return isc::d2::D2Parser::make_STRING("name", driver.loc_);
2121 }
2122}
2123 YY_BREAK
2124case 48:
2126#line 541 "d2_lexer.ll"
2127{
2128 switch(driver.ctx_) {
2130 return isc::d2::D2Parser::make_DEBUGLEVEL(driver.loc_);
2131 default:
2132 return isc::d2::D2Parser::make_STRING("debuglevel", driver.loc_);
2133 }
2134}
2135 YY_BREAK
2136case 49:
2138#line 550 "d2_lexer.ll"
2139{
2140 switch(driver.ctx_) {
2142 return isc::d2::D2Parser::make_SEVERITY(driver.loc_);
2143 default:
2144 return isc::d2::D2Parser::make_STRING("severity", driver.loc_);
2145 }
2146}
2147 YY_BREAK
2148case 50:
2150#line 559 "d2_lexer.ll"
2151{
2152 /* A string has been matched. It contains the actual string and single quotes.
2153 We need to get those quotes out of the way and just use its content, e.g.
2154 for 'foo' we should get foo */
2155 std::string raw(yytext+1);
2156 size_t len = raw.size() - 1;
2157 raw.resize(len);
2158 std::string decoded;
2159 decoded.reserve(len);
2160 for (size_t pos = 0; pos < len; ++pos) {
2161 int b = 0;
2162 char c = raw[pos];
2163 switch (c) {
2164 case '"':
2165 /* impossible condition */
2166 driver.error(driver.loc_, "Bad quote in \"" + raw + "\"");
2167 break;
2168 case '\\':
2169 ++pos;
2170 if (pos >= len) {
2171 /* impossible condition */
2172 driver.error(driver.loc_, "Overflow escape in \"" + raw + "\"");
2173 }
2174 c = raw[pos];
2175 switch (c) {
2176 case '"':
2177 case '\\':
2178 case '/':
2179 decoded.push_back(c);
2180 break;
2181 case 'b':
2182 decoded.push_back('\b');
2183 break;
2184 case 'f':
2185 decoded.push_back('\f');
2186 break;
2187 case 'n':
2188 decoded.push_back('\n');
2189 break;
2190 case 'r':
2191 decoded.push_back('\r');
2192 break;
2193 case 't':
2194 decoded.push_back('\t');
2195 break;
2196 case 'u':
2197 /* support only \u0000 to \u00ff */
2198 ++pos;
2199 if (pos + 4 > len) {
2200 /* impossible condition */
2201 driver.error(driver.loc_,
2202 "Overflow unicode escape in \"" + raw + "\"");
2203 }
2204 if ((raw[pos] != '0') || (raw[pos + 1] != '0')) {
2205 driver.error(driver.loc_,
2206 "Unsupported unicode escape in \"" + raw + "\"",
2207 pos + 1);
2208 }
2209 pos += 2;
2210 c = raw[pos];
2211 if ((c >= '0') && (c <= '9')) {
2212 b = (c - '0') << 4;
2213 } else if ((c >= 'A') && (c <= 'F')) {
2214 b = (c - 'A' + 10) << 4;
2215 } else if ((c >= 'a') && (c <= 'f')) {
2216 b = (c - 'a' + 10) << 4;
2217 } else {
2218 /* impossible condition */
2219 driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\"");
2220 }
2221 pos++;
2222 c = raw[pos];
2223 if ((c >= '0') && (c <= '9')) {
2224 b |= c - '0';
2225 } else if ((c >= 'A') && (c <= 'F')) {
2226 b |= c - 'A' + 10;
2227 } else if ((c >= 'a') && (c <= 'f')) {
2228 b |= c - 'a' + 10;
2229 } else {
2230 /* impossible condition */
2231 driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\"");
2232 }
2233 decoded.push_back(static_cast<char>(b & 0xff));
2234 break;
2235 default:
2236 /* impossible condition */
2237 driver.error(driver.loc_, "Bad escape in \"" + raw + "\"");
2238 }
2239 break;
2240 default:
2241 if ((c >= 0) && (c < 0x20)) {
2242 /* impossible condition */
2243 driver.error(driver.loc_, "Invalid control in \"" + raw + "\"");
2244 }
2245 decoded.push_back(c);
2246 }
2247 }
2248
2249 return isc::d2::D2Parser::make_STRING(decoded, driver.loc_);
2250}
2251 YY_BREAK
2252case 51:
2253/* rule 51 can match eol */
2255#line 660 "d2_lexer.ll"
2256{
2257 /* Bad string with a forbidden control character inside */
2258 std::string raw(yytext+1);
2259 size_t len = raw.size() - 1;
2260 size_t pos = 0;
2261 for (; pos < len; ++pos) {
2262 char c = raw[pos];
2263 if ((c >= 0) && (c < 0x20)) {
2264 break;
2265 }
2266 }
2267 driver.error(driver.loc_,
2268 "Invalid control in " + std::string(yytext),
2269 pos + 1);
2270}
2271 YY_BREAK
2272case 52:
2273/* rule 52 can match eol */
2275#line 676 "d2_lexer.ll"
2276{
2277 /* Bad string with a bad escape inside */
2278 std::string raw(yytext+1);
2279 size_t len = raw.size() - 1;
2280 size_t pos = 0;
2281 bool found = false;
2282 for (; pos < len; ++pos) {
2283 if (found) {
2284 break;
2285 }
2286 char c = raw[pos];
2287 if (c == '\\') {
2288 ++pos;
2289 c = raw[pos];
2290 switch (c) {
2291 case '"':
2292 case '\\':
2293 case '/':
2294 case 'b':
2295 case 'f':
2296 case 'n':
2297 case 'r':
2298 case 't':
2299 break;
2300 case 'u':
2301 if ((pos + 4 > len) ||
2302 !std::isxdigit(raw[pos + 1]) ||
2303 !std::isxdigit(raw[pos + 2]) ||
2304 !std::isxdigit(raw[pos + 3]) ||
2305 !std::isxdigit(raw[pos + 4])) {
2306 found = true;
2307 }
2308 break;
2309 default:
2310 found = true;
2311 break;
2312 }
2313 }
2314 }
2315 /* The rule stops on the first " including on \" so add ... in this case */
2316 std::string trailer = "";
2317 if (raw[len - 1] == '\\') {
2318 trailer = "...";
2319 }
2320 driver.error(driver.loc_,
2321 "Bad escape in " + std::string(yytext) + trailer,
2322 pos);
2323}
2324 YY_BREAK
2325case 53:
2327#line 725 "d2_lexer.ll"
2328{
2329 /* Bad string with an open escape at the end */
2330 std::string raw(yytext+1);
2331 driver.error(driver.loc_,
2332 "Overflow escape in " + std::string(yytext),
2333 raw.size() + 1);
2334}
2335 YY_BREAK
2336case 54:
2338#line 733 "d2_lexer.ll"
2339{
2340 /* Bad string with an open unicode escape at the end */
2341 std::string raw(yytext+1);
2342 size_t pos = raw.size() - 1;
2343 for (; pos > 0; --pos) {
2344 char c = raw[pos];
2345 if (c == 'u') {
2346 break;
2347 }
2348 }
2349 driver.error(driver.loc_,
2350 "Overflow unicode escape in " + std::string(yytext),
2351 pos + 1);
2352}
2353 YY_BREAK
2354case 55:
2356#line 748 "d2_lexer.ll"
2357{ return isc::d2::D2Parser::make_LSQUARE_BRACKET(driver.loc_); }
2358 YY_BREAK
2359case 56:
2361#line 749 "d2_lexer.ll"
2362{ return isc::d2::D2Parser::make_RSQUARE_BRACKET(driver.loc_); }
2363 YY_BREAK
2364case 57:
2366#line 750 "d2_lexer.ll"
2367{ return isc::d2::D2Parser::make_LCURLY_BRACKET(driver.loc_); }
2368 YY_BREAK
2369case 58:
2371#line 751 "d2_lexer.ll"
2372{ return isc::d2::D2Parser::make_RCURLY_BRACKET(driver.loc_); }
2373 YY_BREAK
2374case 59:
2376#line 752 "d2_lexer.ll"
2377{ return isc::d2::D2Parser::make_COMMA(driver.loc_); }
2378 YY_BREAK
2379case 60:
2381#line 753 "d2_lexer.ll"
2382{ return isc::d2::D2Parser::make_COLON(driver.loc_); }
2383 YY_BREAK
2384case 61:
2386#line 755 "d2_lexer.ll"
2387{
2388 /* An integer was found. */
2389 std::string tmp(yytext);
2390 int64_t integer = 0;
2391 try {
2392 /* In substring we want to use negative values (e.g. -1).
2393 In enterprise-id we need to use values up to 0xffffffff.
2394 To cover both of those use cases, we need at least
2395 int64_t. */
2396 integer = boost::lexical_cast<int64_t>(tmp);
2397 } catch (const boost::bad_lexical_cast &) {
2398 driver.error(driver.loc_, "Failed to convert " + tmp + " to an integer.");
2399 }
2400
2401 /* The parser needs the string form as double conversion is no lossless */
2402 return isc::d2::D2Parser::make_INTEGER(integer, driver.loc_);
2403}
2404 YY_BREAK
2405case 62:
2407#line 773 "d2_lexer.ll"
2408{
2409 /* A floating point was found. */
2410 std::string tmp(yytext);
2411 double fp = 0.0;
2412 try {
2413 fp = boost::lexical_cast<double>(tmp);
2414 } catch (const boost::bad_lexical_cast &) {
2415 driver.error(driver.loc_, "Failed to convert " + tmp + " to a floating point.");
2416 }
2417
2418 return isc::d2::D2Parser::make_FLOAT(fp, driver.loc_);
2419}
2420 YY_BREAK
2421case 63:
2423#line 786 "d2_lexer.ll"
2424{
2425 string tmp(yytext);
2426 return isc::d2::D2Parser::make_BOOLEAN(tmp == "true", driver.loc_);
2427}
2428 YY_BREAK
2429case 64:
2431#line 791 "d2_lexer.ll"
2432{
2433 return isc::d2::D2Parser::make_NULL_TYPE(driver.loc_);
2434}
2435 YY_BREAK
2436case 65:
2438#line 795 "d2_lexer.ll"
2439driver.error (driver.loc_, "JSON true reserved keyword is lower case only");
2440 YY_BREAK
2441case 66:
2443#line 797 "d2_lexer.ll"
2444driver.error (driver.loc_, "JSON false reserved keyword is lower case only");
2445 YY_BREAK
2446case 67:
2448#line 799 "d2_lexer.ll"
2449driver.error (driver.loc_, "JSON null reserved keyword is lower case only");
2450 YY_BREAK
2451case 68:
2453#line 801 "d2_lexer.ll"
2454driver.error (driver.loc_, "Invalid character: " + std::string(yytext));
2455 YY_BREAK
2456case YY_STATE_EOF(INITIAL):
2457#line 803 "d2_lexer.ll"
2458{
2459 if (driver.states_.empty()) {
2460 return isc::d2::D2Parser::make_END(driver.loc_);
2461 }
2462 driver.loc_ = driver.locs_.back();
2463 driver.locs_.pop_back();
2464 driver.file_ = driver.files_.back();
2465 driver.files_.pop_back();
2466 if (driver.sfile_) {
2467 fclose(driver.sfile_);
2468 driver.sfile_ = 0;
2469 }
2470 if (!driver.sfiles_.empty()) {
2471 driver.sfile_ = driver.sfiles_.back();
2472 driver.sfiles_.pop_back();
2473 }
2474 d2_parser__delete_buffer(YY_CURRENT_BUFFER);
2475 d2_parser__switch_to_buffer(driver.states_.back());
2476 driver.states_.pop_back();
2477
2478 BEGIN(DIR_EXIT);
2479}
2480 YY_BREAK
2481case 69:
2483#line 826 "d2_lexer.ll"
2484ECHO;
2485 YY_BREAK
2486#line 2486 "d2_lexer.cc"
2487
2488 case YY_END_OF_BUFFER:
2489 {
2490 /* Amount of text matched not including the EOB char. */
2491 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2492
2493 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2494 *yy_cp = (yy_hold_char);
2496
2497 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2498 {
2499 /* We're scanning a new file or input source. It's
2500 * possible that this happened because the user
2501 * just pointed yyin at a new source and called
2502 * yylex(). If so, then we have to assure
2503 * consistency between YY_CURRENT_BUFFER and our
2504 * globals. Here is the right place to do so, because
2505 * this is the first action (other than possibly a
2506 * back-up) that will match for the new input source.
2507 */
2508 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2509/* %if-c-only */
2510 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2511/* %endif */
2512/* %if-c++-only */
2513/* %endif */
2514 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2515 }
2516
2517 /* Note that here we test for yy_c_buf_p "<=" to the position
2518 * of the first EOB in the buffer, since yy_c_buf_p will
2519 * already have been incremented past the NUL character
2520 * (since all states make transitions on EOB to the
2521 * end-of-buffer state). Contrast this with the test
2522 * in input().
2523 */
2524 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2525 { /* This was really a NUL. */
2526 yy_state_type yy_next_state;
2527
2528 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2529
2530 yy_current_state = yy_get_previous_state( );
2531
2532 /* Okay, we're now positioned to make the NUL
2533 * transition. We couldn't have
2534 * yy_get_previous_state() go ahead and do it
2535 * for us because it doesn't know how to deal
2536 * with the possibility of jamming (and we don't
2537 * want to build jamming into it because then it
2538 * will run more slowly).
2539 */
2540
2541 yy_next_state = yy_try_NUL_trans( yy_current_state );
2542
2544
2545 if ( yy_next_state )
2546 {
2547 /* Consume the NUL. */
2548 yy_cp = ++(yy_c_buf_p);
2549 yy_current_state = yy_next_state;
2550 goto yy_match;
2551 }
2552
2553 else
2554 {
2555/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
2556 yy_cp = (yy_last_accepting_cpos);
2557 yy_current_state = (yy_last_accepting_state);
2558 goto yy_find_action;
2559 }
2560 }
2561
2562 else switch ( yy_get_next_buffer( ) )
2563 {
2565 {
2566 (yy_did_buffer_switch_on_eof) = 0;
2567
2568 if ( yywrap( ) )
2569 {
2570 /* Note: because we've taken care in
2571 * yy_get_next_buffer() to have set up
2572 * yytext, we can now set up
2573 * yy_c_buf_p so that if some total
2574 * hoser (like flex itself) wants to
2575 * call the scanner after we return the
2576 * YY_NULL, it'll still work - another
2577 * YY_NULL will get returned.
2578 */
2579 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2580
2582 goto do_action;
2583 }
2584
2585 else
2586 {
2587 if ( ! (yy_did_buffer_switch_on_eof) )
2589 }
2590 break;
2591 }
2592
2594 (yy_c_buf_p) =
2595 (yytext_ptr) + yy_amount_of_matched_text;
2596
2597 yy_current_state = yy_get_previous_state( );
2598
2599 yy_cp = (yy_c_buf_p);
2601 goto yy_match;
2602
2603 case EOB_ACT_LAST_MATCH:
2604 (yy_c_buf_p) =
2605 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2606
2607 yy_current_state = yy_get_previous_state( );
2608
2609 yy_cp = (yy_c_buf_p);
2611 goto yy_find_action;
2612 }
2613 break;
2614 }
2615
2616 default:
2618 "fatal flex scanner internal error--no action found" );
2619 } /* end of action switch */
2620 } /* end of scanning one token */
2621 } /* end of user's declarations */
2622} /* end of yylex */
2623/* %ok-for-header */
2624
2625/* %if-c++-only */
2626/* %not-for-header */
2627/* %ok-for-header */
2628
2629/* %endif */
2630
2631/* yy_get_next_buffer - try to read in a new buffer
2632 *
2633 * Returns a code representing an action:
2634 * EOB_ACT_LAST_MATCH -
2635 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2636 * EOB_ACT_END_OF_FILE - end of file
2637 */
2638/* %if-c-only */
2639static int yy_get_next_buffer (void)
2640/* %endif */
2641/* %if-c++-only */
2642/* %endif */
2643{
2644 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2645 char *source = (yytext_ptr);
2646 int number_to_move, i;
2647 int ret_val;
2648
2649 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2651 "fatal flex scanner internal error--end of buffer missed" );
2652
2653 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2654 { /* Don't try to fill the buffer, so this is an EOF. */
2655 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2656 {
2657 /* We matched a single character, the EOB, so
2658 * treat this as a final EOF.
2659 */
2660 return EOB_ACT_END_OF_FILE;
2661 }
2662
2663 else
2664 {
2665 /* We matched some text prior to the EOB, first
2666 * process it.
2667 */
2668 return EOB_ACT_LAST_MATCH;
2669 }
2670 }
2671
2672 /* Try to read more data. */
2673
2674 /* First move last chars to start of buffer. */
2675 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
2676
2677 for ( i = 0; i < number_to_move; ++i )
2678 *(dest++) = *(source++);
2679
2680 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2681 /* don't do the read, it's not guaranteed to return an EOF,
2682 * just force an EOF
2683 */
2684 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2685
2686 else
2687 {
2688 int num_to_read =
2689 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2690
2691 while ( num_to_read <= 0 )
2692 { /* Not enough room in the buffer - grow it. */
2693
2694 /* just a shorter name for the current buffer */
2696
2697 int yy_c_buf_p_offset =
2698 (int) ((yy_c_buf_p) - b->yy_ch_buf);
2699
2700 if ( b->yy_is_our_buffer )
2701 {
2702 int new_size = b->yy_buf_size * 2;
2703
2704 if ( new_size <= 0 )
2705 b->yy_buf_size += b->yy_buf_size / 8;
2706 else
2707 b->yy_buf_size *= 2;
2708
2709 b->yy_ch_buf = (char *)
2710 /* Include room in for 2 EOB chars. */
2711 yyrealloc( (void *) b->yy_ch_buf,
2712 (yy_size_t) (b->yy_buf_size + 2) );
2713 }
2714 else
2715 /* Can't grow it, we don't own it. */
2716 b->yy_ch_buf = NULL;
2717
2718 if ( ! b->yy_ch_buf )
2720 "fatal error - scanner input buffer overflow" );
2721
2722 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2723
2724 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2725 number_to_move - 1;
2726
2727 }
2728
2729 if ( num_to_read > YY_READ_BUF_SIZE )
2730 num_to_read = YY_READ_BUF_SIZE;
2731
2732 /* Read in more data. */
2733 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2734 (yy_n_chars), num_to_read );
2735
2736 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2737 }
2738
2739 if ( (yy_n_chars) == 0 )
2740 {
2741 if ( number_to_move == YY_MORE_ADJ )
2742 {
2743 ret_val = EOB_ACT_END_OF_FILE;
2744 yyrestart( yyin );
2745 }
2746
2747 else
2748 {
2749 ret_val = EOB_ACT_LAST_MATCH;
2750 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2752 }
2753 }
2754
2755 else
2756 ret_val = EOB_ACT_CONTINUE_SCAN;
2757
2758 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2759 /* Extend the array by 50%, plus the number we really need. */
2760 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2761 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2762 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
2763 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2764 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2765 /* "- 2" to take care of EOB's */
2766 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2767 }
2768
2769 (yy_n_chars) += number_to_move;
2770 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2771 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2772
2773 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2774
2775 return ret_val;
2776}
2777
2778/* yy_get_previous_state - get the state just before the EOB char was reached */
2779
2780/* %if-c-only */
2781/* %not-for-header */
2782 static yy_state_type yy_get_previous_state (void)
2783/* %endif */
2784/* %if-c++-only */
2785/* %endif */
2786{
2787 yy_state_type yy_current_state;
2788 char *yy_cp;
2789
2790/* %% [15.0] code to get the start state into yy_current_state goes here */
2791 yy_current_state = (yy_start);
2792
2793 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2794 {
2795/* %% [16.0] code to find the next state goes here */
2796 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2797 if ( yy_accept[yy_current_state] )
2798 {
2799 (yy_last_accepting_state) = yy_current_state;
2800 (yy_last_accepting_cpos) = yy_cp;
2801 }
2802 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2803 {
2804 yy_current_state = (int) yy_def[yy_current_state];
2805 if ( yy_current_state >= 434 )
2806 yy_c = yy_meta[yy_c];
2807 }
2808 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2809 }
2810
2811 return yy_current_state;
2812}
2813
2814/* yy_try_NUL_trans - try to make a transition on the NUL character
2815 *
2816 * synopsis
2817 * next_state = yy_try_NUL_trans( current_state );
2818 */
2819/* %if-c-only */
2820 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2821/* %endif */
2822/* %if-c++-only */
2823/* %endif */
2824{
2825 int yy_is_jam;
2826 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2827 char *yy_cp = (yy_c_buf_p);
2828
2829 YY_CHAR yy_c = 1;
2830 if ( yy_accept[yy_current_state] )
2831 {
2832 (yy_last_accepting_state) = yy_current_state;
2833 (yy_last_accepting_cpos) = yy_cp;
2834 }
2835 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2836 {
2837 yy_current_state = (int) yy_def[yy_current_state];
2838 if ( yy_current_state >= 434 )
2839 yy_c = yy_meta[yy_c];
2840 }
2841 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2842 yy_is_jam = (yy_current_state == 433);
2843
2844 return yy_is_jam ? 0 : yy_current_state;
2845}
2846
2847#ifndef YY_NO_UNPUT
2848/* %if-c-only */
2849
2850/* %endif */
2851#endif
2852
2853/* %if-c-only */
2854#ifndef YY_NO_INPUT
2855#ifdef __cplusplus
2856 static int yyinput (void)
2857#else
2858 static int input (void)
2859#endif
2860
2861/* %endif */
2862/* %if-c++-only */
2863/* %endif */
2864{
2865 int c;
2866
2867 *(yy_c_buf_p) = (yy_hold_char);
2868
2869 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2870 {
2871 /* yy_c_buf_p now points to the character we want to return.
2872 * If this occurs *before* the EOB characters, then it's a
2873 * valid NUL; if not, then we've hit the end of the buffer.
2874 */
2875 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2876 /* This was really a NUL. */
2877 *(yy_c_buf_p) = '\0';
2878
2879 else
2880 { /* need more input */
2881 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2882 ++(yy_c_buf_p);
2883
2884 switch ( yy_get_next_buffer( ) )
2885 {
2886 case EOB_ACT_LAST_MATCH:
2887 /* This happens because yy_g_n_b()
2888 * sees that we've accumulated a
2889 * token and flags that we need to
2890 * try matching the token before
2891 * proceeding. But for input(),
2892 * there's no matching to consider.
2893 * So convert the EOB_ACT_LAST_MATCH
2894 * to EOB_ACT_END_OF_FILE.
2895 */
2896
2897 /* Reset buffer status. */
2898 yyrestart( yyin );
2899
2900 /*FALLTHROUGH*/
2901
2903 {
2904 if ( yywrap( ) )
2905 return 0;
2906
2907 if ( ! (yy_did_buffer_switch_on_eof) )
2909#ifdef __cplusplus
2910 return yyinput();
2911#else
2912 return input();
2913#endif
2914 }
2915
2917 (yy_c_buf_p) = (yytext_ptr) + offset;
2918 break;
2919 }
2920 }
2921 }
2922
2923 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2924 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2925 (yy_hold_char) = *++(yy_c_buf_p);
2926
2927/* %% [19.0] update BOL and yylineno */
2928
2929 return c;
2930}
2931/* %if-c-only */
2932#endif /* ifndef YY_NO_INPUT */
2933/* %endif */
2934
2940/* %if-c-only */
2941 void yyrestart (FILE * input_file )
2942/* %endif */
2943/* %if-c++-only */
2944/* %endif */
2945{
2946
2947 if ( ! YY_CURRENT_BUFFER ){
2951 }
2952
2953 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2955}
2956
2957/* %if-c++-only */
2958/* %endif */
2959
2964/* %if-c-only */
2966/* %endif */
2967/* %if-c++-only */
2968/* %endif */
2969{
2970
2971 /* TODO. We should be able to replace this entire function body
2972 * with
2973 * yypop_buffer_state();
2974 * yypush_buffer_state(new_buffer);
2975 */
2977 if ( YY_CURRENT_BUFFER == new_buffer )
2978 return;
2979
2980 if ( YY_CURRENT_BUFFER )
2981 {
2982 /* Flush out information for old buffer. */
2983 *(yy_c_buf_p) = (yy_hold_char);
2984 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2985 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2986 }
2987
2988 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2990
2991 /* We don't actually know whether we did this switch during
2992 * EOF (yywrap()) processing, but the only time this flag
2993 * is looked at is after yywrap() is called, so it's safe
2994 * to go ahead and always set it.
2995 */
2996 (yy_did_buffer_switch_on_eof) = 1;
2997}
2998
2999/* %if-c-only */
3000static void yy_load_buffer_state (void)
3001/* %endif */
3002/* %if-c++-only */
3003/* %endif */
3004{
3005 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3006 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3007/* %if-c-only */
3008 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3009/* %endif */
3010/* %if-c++-only */
3011/* %endif */
3012 (yy_hold_char) = *(yy_c_buf_p);
3013}
3014
3021/* %if-c-only */
3022 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
3023/* %endif */
3024/* %if-c++-only */
3025/* %endif */
3026{
3028
3029 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
3030 if ( ! b )
3031 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3032
3033 b->yy_buf_size = size;
3034
3035 /* yy_ch_buf has to be 2 characters longer than the size given because
3036 * we need to put in 2 end-of-buffer characters.
3037 */
3038 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
3039 if ( ! b->yy_ch_buf )
3040 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3041
3042 b->yy_is_our_buffer = 1;
3043
3044 yy_init_buffer( b, file );
3045
3046 return b;
3047}
3048
3049/* %if-c++-only */
3050/* %endif */
3051
3056/* %if-c-only */
3058/* %endif */
3059/* %if-c++-only */
3060/* %endif */
3061{
3062
3063 if ( ! b )
3064 return;
3065
3066 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3068
3069 if ( b->yy_is_our_buffer )
3070 yyfree( (void *) b->yy_ch_buf );
3071
3072 yyfree( (void *) b );
3073}
3074
3075/* Initializes or reinitializes a buffer.
3076 * This function is sometimes called more than once on the same buffer,
3077 * such as during a yyrestart() or at EOF.
3078 */
3079/* %if-c-only */
3080 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
3081/* %endif */
3082/* %if-c++-only */
3083/* %endif */
3084
3085{
3086 int oerrno = errno;
3087
3088 yy_flush_buffer( b );
3089
3090/* %if-c-only */
3091 b->yy_input_file = file;
3092/* %endif */
3093/* %if-c++-only */
3094/* %endif */
3095 b->yy_fill_buffer = 1;
3096
3097 /* If b is the current buffer, then yy_init_buffer was _probably_
3098 * called from yyrestart() or through yy_get_next_buffer.
3099 * In that case, we don't want to reset the lineno or column.
3100 */
3101 if (b != YY_CURRENT_BUFFER){
3102 b->yy_bs_lineno = 1;
3103 b->yy_bs_column = 0;
3104 }
3105
3106/* %if-c-only */
3107
3108 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3109
3110/* %endif */
3111/* %if-c++-only */
3112/* %endif */
3113 errno = oerrno;
3114}
3115
3120/* %if-c-only */
3122/* %endif */
3123/* %if-c++-only */
3124/* %endif */
3125{
3126 if ( ! b )
3127 return;
3128
3129 b->yy_n_chars = 0;
3130
3131 /* We always need two end-of-buffer characters. The first causes
3132 * a transition to the end-of-buffer state. The second causes
3133 * a jam in that state.
3134 */
3137
3138 b->yy_buf_pos = &b->yy_ch_buf[0];
3139
3140 b->yy_at_bol = 1;
3142
3143 if ( b == YY_CURRENT_BUFFER )
3145}
3146
3147/* %if-c-or-c++ */
3154/* %if-c-only */
3156/* %endif */
3157/* %if-c++-only */
3158/* %endif */
3159{
3160 if (new_buffer == NULL)
3161 return;
3162
3164
3165 /* This block is copied from yy_switch_to_buffer. */
3166 if ( YY_CURRENT_BUFFER )
3167 {
3168 /* Flush out information for old buffer. */
3169 *(yy_c_buf_p) = (yy_hold_char);
3170 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3171 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3172 }
3173
3174 /* Only push if top exists. Otherwise, replace top. */
3176 (yy_buffer_stack_top)++;
3177 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3178
3179 /* copied from yy_switch_to_buffer. */
3181 (yy_did_buffer_switch_on_eof) = 1;
3182}
3183/* %endif */
3184
3185/* %if-c-or-c++ */
3190/* %if-c-only */
3191void yypop_buffer_state (void)
3192/* %endif */
3193/* %if-c++-only */
3194/* %endif */
3195{
3196 if (!YY_CURRENT_BUFFER)
3197 return;
3198
3201 if ((yy_buffer_stack_top) > 0)
3202 --(yy_buffer_stack_top);
3203
3204 if (YY_CURRENT_BUFFER) {
3206 (yy_did_buffer_switch_on_eof) = 1;
3207 }
3208}
3209/* %endif */
3210
3211/* %if-c-or-c++ */
3212/* Allocates the stack if it does not exist.
3213 * Guarantees space for at least one push.
3214 */
3215/* %if-c-only */
3216static void yyensure_buffer_stack (void)
3217/* %endif */
3218/* %if-c++-only */
3219/* %endif */
3220{
3221 yy_size_t num_to_alloc;
3222
3223 if (!(yy_buffer_stack)) {
3224
3225 /* First allocation is just for 2 elements, since we don't know if this
3226 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3227 * immediate realloc on the next call.
3228 */
3229 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
3230 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
3231 (num_to_alloc * sizeof(struct yy_buffer_state*)
3232 );
3233 if ( ! (yy_buffer_stack) )
3234 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3235
3236 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3237
3238 (yy_buffer_stack_max) = num_to_alloc;
3239 (yy_buffer_stack_top) = 0;
3240 return;
3241 }
3242
3243 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3244
3245 /* Increase the buffer to prepare for a possible push. */
3246 yy_size_t grow_size = 8 /* arbitrary grow size */;
3247
3248 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3249 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
3250 ((yy_buffer_stack),
3251 num_to_alloc * sizeof(struct yy_buffer_state*)
3252 );
3253 if ( ! (yy_buffer_stack) )
3254 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3255
3256 /* zero only the new slots.*/
3257 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3258 (yy_buffer_stack_max) = num_to_alloc;
3259 }
3260}
3261/* %endif */
3262
3263/* %if-c-only */
3271{
3273
3274 if ( size < 2 ||
3275 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3276 base[size-1] != YY_END_OF_BUFFER_CHAR )
3277 /* They forgot to leave room for the EOB's. */
3278 return NULL;
3279
3280 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
3281 if ( ! b )
3282 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3283
3284 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
3285 b->yy_buf_pos = b->yy_ch_buf = base;
3286 b->yy_is_our_buffer = 0;
3287 b->yy_input_file = NULL;
3288 b->yy_n_chars = b->yy_buf_size;
3289 b->yy_is_interactive = 0;
3290 b->yy_at_bol = 1;
3291 b->yy_fill_buffer = 0;
3293
3295
3296 return b;
3297}
3298/* %endif */
3299
3300/* %if-c-only */
3309YY_BUFFER_STATE yy_scan_string (const char * yystr )
3310{
3311
3312 return yy_scan_bytes( yystr, (int) strlen(yystr) );
3313}
3314/* %endif */
3315
3316/* %if-c-only */
3324YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
3325{
3327 char *buf;
3328 yy_size_t n;
3329 int i;
3330
3331 /* Get memory for full buffer, including space for trailing EOB's. */
3332 n = (yy_size_t) (_yybytes_len + 2);
3333 buf = (char *) yyalloc( n );
3334 if ( ! buf )
3335 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3336
3337 for ( i = 0; i < _yybytes_len; ++i )
3338 buf[i] = yybytes[i];
3339
3340 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3341
3342 b = yy_scan_buffer( buf, n );
3343 if ( ! b )
3344 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3345
3346 /* It's okay to grow etc. this buffer, and we should throw it
3347 * away when we're done.
3348 */
3349 b->yy_is_our_buffer = 1;
3350
3351 return b;
3352}
3353/* %endif */
3354
3355#ifndef YY_EXIT_FAILURE
3356#define YY_EXIT_FAILURE 2
3357#endif
3358
3359/* %if-c-only */
3360static void yynoreturn yy_fatal_error (const char* msg )
3361{
3362 fprintf( stderr, "%s\n", msg );
3363 exit( YY_EXIT_FAILURE );
3364}
3365/* %endif */
3366/* %if-c++-only */
3367/* %endif */
3368
3369/* Redefine yyless() so it works in section 3 code. */
3370
3371#undef yyless
3372#define yyless(n) \
3373 do \
3374 { \
3375 /* Undo effects of setting up yytext. */ \
3376 int yyless_macro_arg = (n); \
3377 YY_LESS_LINENO(yyless_macro_arg);\
3378 yytext[yyleng] = (yy_hold_char); \
3379 (yy_c_buf_p) = yytext + yyless_macro_arg; \
3380 (yy_hold_char) = *(yy_c_buf_p); \
3381 *(yy_c_buf_p) = '\0'; \
3382 yyleng = yyless_macro_arg; \
3383 } \
3384 while ( 0 )
3385
3386/* Accessor methods (get/set functions) to struct members. */
3387
3388/* %if-c-only */
3389/* %if-reentrant */
3390/* %endif */
3391
3395int yyget_lineno (void)
3396{
3397
3398 return yylineno;
3399}
3400
3404FILE *yyget_in (void)
3405{
3406 return yyin;
3407}
3408
3412FILE *yyget_out (void)
3413{
3414 return yyout;
3415}
3416
3420int yyget_leng (void)
3421{
3422 return yyleng;
3423}
3424
3429char *yyget_text (void)
3430{
3431 return yytext;
3432}
3433
3434/* %if-reentrant */
3435/* %endif */
3436
3441void yyset_lineno (int _line_number )
3442{
3443
3444 yylineno = _line_number;
3445}
3446
3453void yyset_in (FILE * _in_str )
3454{
3455 yyin = _in_str ;
3456}
3457
3458void yyset_out (FILE * _out_str )
3459{
3460 yyout = _out_str ;
3461}
3462
3463int yyget_debug (void)
3464{
3465 return yy_flex_debug;
3466}
3467
3468void yyset_debug (int _bdebug )
3469{
3470 yy_flex_debug = _bdebug ;
3471}
3472
3473/* %endif */
3474
3475/* %if-reentrant */
3476/* %if-bison-bridge */
3477/* %endif */
3478/* %endif if-c-only */
3479
3480/* %if-c-only */
3481static int yy_init_globals (void)
3482{
3483 /* Initialization is the same as for the non-reentrant scanner.
3484 * This function is called from yylex_destroy(), so don't allocate here.
3485 */
3486
3487 (yy_buffer_stack) = NULL;
3488 (yy_buffer_stack_top) = 0;
3489 (yy_buffer_stack_max) = 0;
3490 (yy_c_buf_p) = NULL;
3491 (yy_init) = 0;
3492 (yy_start) = 0;
3493
3494/* Defined in main.c */
3495#ifdef YY_STDINIT
3496 yyin = stdin;
3497 yyout = stdout;
3498#else
3499 yyin = NULL;
3500 yyout = NULL;
3501#endif
3502
3503 /* For future reference: Set errno on error, since we are called by
3504 * yylex_init()
3505 */
3506 return 0;
3507}
3508/* %endif */
3509
3510/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
3511/* yylex_destroy is for both reentrant and non-reentrant scanners. */
3512int yylex_destroy (void)
3513{
3514
3515 /* Pop the buffer stack, destroying each element. */
3516 while(YY_CURRENT_BUFFER){
3520 }
3521
3522 /* Destroy the stack itself. */
3523 yyfree((yy_buffer_stack) );
3524 (yy_buffer_stack) = NULL;
3525
3526 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3527 * yylex() is called, initialization will occur. */
3528 yy_init_globals( );
3529
3530/* %if-reentrant */
3531/* %endif */
3532 return 0;
3533}
3534/* %endif */
3535
3536/*
3537 * Internal utility routines.
3538 */
3539
3540#ifndef yytext_ptr
3541static void yy_flex_strncpy (char* s1, const char * s2, int n )
3542{
3543
3544 int i;
3545 for ( i = 0; i < n; ++i )
3546 s1[i] = s2[i];
3547}
3548#endif
3549
3550#ifdef YY_NEED_STRLEN
3551static int yy_flex_strlen (const char * s )
3552{
3553 int n;
3554 for ( n = 0; s[n]; ++n )
3555 ;
3556
3557 return n;
3558}
3559#endif
3560
3561void *yyalloc (yy_size_t size )
3562{
3563 return malloc(size);
3564}
3565
3566void *yyrealloc (void * ptr, yy_size_t size )
3567{
3568
3569 /* The cast to (char *) in the following accommodates both
3570 * implementations that use char* generic pointers, and those
3571 * that use void* generic pointers. It works with the latter
3572 * because both ANSI C and C++ allow castless assignment from
3573 * any pointer type to void*, and deal with argument conversions
3574 * as though doing an assignment.
3575 */
3576 return realloc(ptr, size);
3577}
3578
3579void yyfree (void * ptr )
3580{
3581 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3582}
3583
3584/* %if-tables-serialization definitions */
3585/* %define-yytables The name for this specific scanner's tables. */
3586#define YYTABLES_NAME "yytables"
3587/* %endif */
3588
3589/* %ok-for-header */
3590
3591#line 826 "d2_lexer.ll"
3592
3593
3594using namespace isc::dhcp;
3595
3596void
3597D2ParserContext::scanStringBegin(const std::string& str, ParserType parser_type)
3598{
3599 start_token_flag = true;
3600 start_token_value = parser_type;
3601
3602 file_ = "<string>";
3603 sfile_ = 0;
3604 loc_.initialize(&file_);
3605 yy_flex_debug = trace_scanning_;
3606 YY_BUFFER_STATE buffer;
3607 buffer = d2_parser__scan_bytes(str.c_str(), str.size());
3608 if (!buffer) {
3609 fatal("cannot scan string");
3610 /* fatal() throws an exception so this can't be reached */
3611 }
3612}
3613
3614void
3616 const std::string& filename,
3617 ParserType parser_type)
3618{
3619 start_token_flag = true;
3620 start_token_value = parser_type;
3621
3622 file_ = filename;
3623 sfile_ = f;
3624 loc_.initialize(&file_);
3625 yy_flex_debug = trace_scanning_;
3626 YY_BUFFER_STATE buffer;
3627
3628 /* See d2_lexer.cc header for available definitions */
3629 buffer = d2_parser__create_buffer(f, 65536 /*buffer size*/);
3630 if (!buffer) {
3631 fatal("cannot scan file " + filename);
3632 }
3633 d2_parser__switch_to_buffer(buffer);
3634}
3635
3636void
3638 if (sfile_)
3639 fclose(sfile_);
3640 sfile_ = 0;
3641 static_cast<void>(d2_parser_lex_destroy());
3642 /* Close files */
3643 while (!sfiles_.empty()) {
3644 FILE* f = sfiles_.back();
3645 if (f) {
3646 fclose(f);
3647 }
3648 sfiles_.pop_back();
3649 }
3650 /* Delete states */
3651 while (!states_.empty()) {
3652 d2_parser__delete_buffer(states_.back());
3653 states_.pop_back();
3654 }
3655}
3656
3657void
3658D2ParserContext::includeFile(const std::string& filename) {
3659 if (states_.size() > 10) {
3660 fatal("Too many nested include.");
3661 }
3662
3663 FILE* f = fopen(filename.c_str(), "r");
3664 if (!f) {
3665 fatal("Can't open include file " + filename);
3666 }
3667 if (sfile_) {
3668 sfiles_.push_back(sfile_);
3669 }
3670 sfile_ = f;
3671 states_.push_back(YY_CURRENT_BUFFER);
3672 YY_BUFFER_STATE buffer;
3673 buffer = d2_parser__create_buffer(f, 65536 /*buffer size*/);
3674 if (!buffer) {
3675 fatal( "Can't scan include file " + filename);
3676 }
3677 d2_parser__switch_to_buffer(buffer);
3678 files_.push_back(file_);
3679 file_ = filename;
3680 locs_.push_back(loc_);
3681 loc_.initialize(&file_);
3682
3683 BEGIN(INITIAL);
3684}
3685
3686namespace {
3688class Dummy {
3689 /* cppcheck-suppress unusedPrivateFunction */
3690 void dummy() { yy_fatal_error("Fix me: how to disable its definition?"); }
3691};
3692}
3693#endif /* !__clang_analyzer__ */
3694
unsigned char flex_uint8_t
Definition: agent_lexer.cc:335
short int flex_int16_t
Definition: agent_lexer.cc:333
#define yy_flex_debug
Definition: agent_lexer.cc:24
int flex_int32_t
Definition: agent_lexer.cc:334
int yy_state_type
Definition: agent_lexer.cc:660
#define YY_CURRENT_BUFFER
Definition: agent_lexer.cc:575
#define INITIAL
#define BEGIN
Definition: agent_lexer.cc:414
flex_uint8_t YY_CHAR
Definition: agent_lexer.cc:656
size_t yy_size_t
Definition: agent_lexer.cc:451
Evaluation error exception raised when trying to parse.
ParserType
Defines currently supported scopes.
@ PARSER_TSIG_KEY
Used for parsing a list of TSIG Keys.
@ PARSER_DDNS_DOMAINS
Used for parsing content of a DNS Server.
@ PARSER_DDNS_DOMAIN
Used for parsing a list a DDNS Domains.
@ PARSER_DNS_SERVER
Used for parsing a list of DNS servers.
@ PARSER_SUB_DHCPDDNS
Used for parsing content of a TSIG key.
@ PARSER_JSON
This parser will parse the content as generic JSON.
@ PARSER_TSIG_KEYS
Used for parsing content of a DDNS Domain.
@ PARSER_DHCPDDNS
Used for parsing content of DhcpDdns.
isc::d2::location loc_
Location of the current token.
std::string file_
File name.
void includeFile(const std::string &filename)
Divert input to an include file.
Definition: d2_lexer.cc:3658
@ DDNS_DOMAIN
Used while parsing a list of ddns-domains.
@ DNS_SERVERS
Used while parsing content of a control-socket.
@ DDNS_DOMAINS
Used while parsing content of a dns-server.
@ NCR_FORMAT
Used while parsing DhcpDdns/ncr-format.
@ NCR_PROTOCOL
Used while parsing DhcpDdns/ncr-protocol.
@ DHCPDDNS
Used while parsing content of a tsig-key.
@ OUTPUT_OPTIONS
Used while parsing DhcpDdns/loggers/output-options structures.
@ FORWARD_DDNS
Used while parsing content of DhcpDdns/reverse-ddns.
@ TSIG_KEY
Used while parsing a list of tsig-keys.
@ REVERSE_DDNS
Used while parsing content of a ddns-domain.
@ LOGGERS
Used while parsing DhcpDdns/loggers structures.
@ HOOKS_LIBRARIES
Used while parsing DhcpDdns/hooks-libraries.
@ TSIG_KEYS
Used while parsing content of DhcpDdns/tsig-keys/algorithm.
@ CONFIG
Used while parsing content of DhcpDdns.
@ DNS_SERVER
Used while parsing content of list of dns-servers.
std::vector< FILE * > sfiles_
sFile (aka FILE) stack
FILE * sfile_
sFile (aka FILE)
void scanStringBegin(const std::string &str, ParserType type)
Method called before scanning starts on a string.
Definition: d2_lexer.cc:3597
void scanFileBegin(FILE *f, const std::string &filename, ParserType type)
Method called before scanning starts on a file.
Definition: d2_lexer.cc:3615
std::vector< isc::d2::location > locs_
Location stack.
std::vector< struct yy_buffer_state * > states_
Lexer state stack.
std::vector< std::string > files_
File name stack.
void scanEnd()
Method called after the last tokens are scanned.
Definition: d2_lexer.cc:3637
static symbol_type make_COMMENT(const location_type &l)
Definition: d2_parser.h:1489
static symbol_type make_STRING(const std::string &v, const location_type &l)
Definition: d2_parser.h:2044
static symbol_type make_SUB_DDNS_DOMAIN(const location_type &l)
Definition: d2_parser.h:1969
static symbol_type make_SUB_HOOKS_LIBRARY(const location_type &l)
Definition: d2_parser.h:2029
static symbol_type make_LOGGERS(const location_type &l)
Definition: d2_parser.h:1744
static symbol_type make_KEY_NAME(const location_type &l)
Definition: d2_parser.h:1549
static symbol_type make_PARAMETERS(const location_type &l)
Definition: d2_parser.h:1729
static symbol_type make_SUB_TSIG_KEYS(const location_type &l)
Definition: d2_parser.h:1954
static symbol_type make_FORWARD_DDNS(const location_type &l)
Definition: d2_parser.h:1504
static symbol_type make_TOPLEVEL_DHCPDDNS(const location_type &l)
Definition: d2_parser.h:1909
static symbol_type make_SOCKET_TYPE(const location_type &l)
Definition: d2_parser.h:1669
static symbol_type make_SUB_DDNS_DOMAINS(const location_type &l)
Definition: d2_parser.h:1984
static symbol_type make_TCP(const location_type &l)
Definition: d2_parser.h:1429
static symbol_type make_NAME(const location_type &l)
Definition: d2_parser.h:1759
static symbol_type make_MAXSIZE(const location_type &l)
Definition: d2_parser.h:1849
static symbol_type make_OUTPUT_OPTIONS(const location_type &l)
Definition: d2_parser.h:1774
static symbol_type make_LSQUARE_BRACKET(const location_type &l)
Definition: d2_parser.h:1264
static symbol_type make_DEBUGLEVEL(const location_type &l)
Definition: d2_parser.h:1804
static symbol_type make_LCURLY_BRACKET(const location_type &l)
Definition: d2_parser.h:1294
static symbol_type make_DIGEST_BITS(const location_type &l)
Definition: d2_parser.h:1624
static symbol_type make_TOPLEVEL_JSON(const location_type &l)
Definition: d2_parser.h:1894
static symbol_type make_SOCKET_NAME(const location_type &l)
Definition: d2_parser.h:1684
static symbol_type make_DNS_SERVER_TIMEOUT(const location_type &l)
Definition: d2_parser.h:1384
static symbol_type make_NULL_TYPE(const location_type &l)
Definition: d2_parser.h:1324
static symbol_type make_LIBRARY(const location_type &l)
Definition: d2_parser.h:1714
static symbol_type make_UDP(const location_type &l)
Definition: d2_parser.h:1414
static symbol_type make_HOOKS_LIBRARIES(const location_type &l)
Definition: d2_parser.h:1699
static symbol_type make_COLON(const location_type &l)
Definition: d2_parser.h:1249
static symbol_type make_COMMA(const location_type &l)
Definition: d2_parser.h:1234
static symbol_type make_SECRET(const location_type &l)
Definition: d2_parser.h:1639
static symbol_type make_SUB_TSIG_KEY(const location_type &l)
Definition: d2_parser.h:1939
static symbol_type make_RCURLY_BRACKET(const location_type &l)
Definition: d2_parser.h:1309
static symbol_type make_OUTPUT(const location_type &l)
Definition: d2_parser.h:1789
static symbol_type make_SUB_DHCPDDNS(const location_type &l)
Definition: d2_parser.h:1924
static symbol_type make_INTEGER(const int64_t &v, const location_type &l)
Definition: d2_parser.h:2059
static symbol_type make_DHCPDDNS(const location_type &l)
Definition: d2_parser.h:1339
static symbol_type make_SUB_DNS_SERVER(const location_type &l)
Definition: d2_parser.h:1999
static symbol_type make_MAXVER(const location_type &l)
Definition: d2_parser.h:1864
static symbol_type make_DDNS_DOMAINS(const location_type &l)
Definition: d2_parser.h:1534
static symbol_type make_SEVERITY(const location_type &l)
Definition: d2_parser.h:1819
static symbol_type make_RSQUARE_BRACKET(const location_type &l)
Definition: d2_parser.h:1279
static symbol_type make_HOSTNAME(const location_type &l)
Definition: d2_parser.h:1579
static symbol_type make_USER_CONTEXT(const location_type &l)
Definition: d2_parser.h:1474
static symbol_type make_FLUSH(const location_type &l)
Definition: d2_parser.h:1834
static symbol_type make_REVERSE_DDNS(const location_type &l)
Definition: d2_parser.h:1519
static symbol_type make_PATTERN(const location_type &l)
Definition: d2_parser.h:1879
static symbol_type make_ALGORITHM(const location_type &l)
Definition: d2_parser.h:1609
static symbol_type make_IP_ADDRESS(const location_type &l)
Definition: d2_parser.h:1354
static symbol_type make_PORT(const location_type &l)
Definition: d2_parser.h:1369
static symbol_type make_FLOAT(const double &v, const location_type &l)
Definition: d2_parser.h:2074
static symbol_type make_BOOLEAN(const bool &v, const location_type &l)
Definition: d2_parser.h:2089
static symbol_type make_JSON(const location_type &l)
Definition: d2_parser.h:1459
static symbol_type make_END(const location_type &l)
Definition: d2_parser.h:1189
static symbol_type make_CONTROL_SOCKET(const location_type &l)
Definition: d2_parser.h:1654
static symbol_type make_NCR_PROTOCOL(const location_type &l)
Definition: d2_parser.h:1399
static symbol_type make_DNS_SERVERS(const location_type &l)
Definition: d2_parser.h:1564
static symbol_type make_TSIG_KEYS(const location_type &l)
Definition: d2_parser.h:1594
static symbol_type make_NCR_FORMAT(const location_type &l)
Definition: d2_parser.h:1444
#define yy_load_buffer_state
Definition: d2_lexer.cc:19
#define YY_NEW_FILE
Definition: d2_lexer.cc:424
#define yyset_extra
Definition: d2_lexer.cc:176
#define yytext
Definition: d2_lexer.cc:31
unsigned char flex_uint8_t
Definition: d2_lexer.cc:335
#define yyset_lineno
Definition: d2_lexer.cc:224
#define COMMENT
Definition: d2_lexer.cc:1175
#define yyrestart
Definition: d2_lexer.cc:30
#define yyset_debug
Definition: d2_lexer.cc:164
#define YY_EXTRA_TYPE
Definition: d2_lexer.cc:1193
#define DIR_INCLUDE
Definition: d2_lexer.cc:1177
short int flex_int16_t
Definition: d2_lexer.cc:333
#define yy_flex_debug
Definition: d2_lexer.cc:24
unsigned int flex_uint32_t
Definition: d2_lexer.cc:337
#define yy_scan_bytes
Definition: d2_lexer.cc:16
#define YY_BREAK
Definition: d2_lexer.cc:1402
#define yynoreturn
Definition: d2_lexer.cc:388
#define yyget_debug
Definition: d2_lexer.cc:158
int yy_act
Definition: d2_lexer.cc:1416
#define yypush_buffer_state
Definition: d2_lexer.cc:21
#define yyget_in
Get the input stream.
Definition: d2_lexer.cc:182
struct yy_buffer_state * YY_BUFFER_STATE
Definition: d2_lexer.cc:446
#define yyfree
Definition: d2_lexer.cc:35
#define yyout
Definition: d2_lexer.cc:29
#define YY_BUFFER_NEW
Definition: d2_lexer.cc:539
#define yylex
Definition: d2_lexer.cc:27
#define YY_RESTORE_YY_MORE_OFFSET
Definition: d2_lexer.cc:1101
#define yyget_leng
Get the length of the current token.
Definition: d2_lexer.cc:206
#define yywrap
Definition: d2_lexer.cc:1132
#define yyget_out
Get the output stream.
Definition: d2_lexer.cc:194
#define YY_BUFFER_NORMAL
Definition: d2_lexer.cc:540
char * yy_cp
Definition: d2_lexer.cc:1415
#define yyensure_buffer_stack
Definition: d2_lexer.cc:23
#define yy_scan_buffer
Definition: d2_lexer.cc:14
#define YY_MORE_ADJ
Definition: d2_lexer.cc:1100
#define YY_RULE_SETUP
Definition: d2_lexer.cc:1406
#define yy_scan_string
Definition: d2_lexer.cc:15
#define DIR_EXIT
Definition: d2_lexer.cc:1178
#define yytext_ptr
Definition: d2_lexer.cc:669
signed char flex_int8_t
Definition: d2_lexer.cc:332
#define EOB_ACT_END_OF_FILE
Definition: d2_lexer.cc:465
#define yyalloc
Definition: d2_lexer.cc:33
#define YY_CURRENT_BUFFER_LVALUE
Definition: d2_lexer.cc:581
int flex_int32_t
Definition: d2_lexer.cc:334
#define yylex_destroy
Definition: d2_lexer.cc:152
#define YY_START
Definition: d2_lexer.cc:419
#define yyget_text
Get the current token.
Definition: d2_lexer.cc:212
#define yy_switch_to_buffer
Definition: d2_lexer.cc:20
int yy_state_type
Definition: d2_lexer.cc:660
#define YY_CURRENT_BUFFER
Definition: d2_lexer.cc:575
#define yy_init_buffer
Definition: d2_lexer.cc:17
#define INITIAL
Definition: d2_lexer.cc:1174
#define yyget_extra
Definition: d2_lexer.cc:170
char * yy_bp
Definition: d2_lexer.cc:1415
#define yyin
Definition: d2_lexer.cc:25
#define YY_READ_BUF_SIZE
Definition: d2_lexer.cc:1290
#define YY_INPUT(buf, result, max_size)
Definition: d2_lexer.cc:1310
#define ECHO
Definition: d2_lexer.cc:1300
#define yy_flush_buffer
Definition: d2_lexer.cc:18
#define yyrealloc
Definition: d2_lexer.cc:34
#define YY_END_OF_BUFFER
Definition: d2_lexer.cc:695
#define YY_STATE_EOF(state)
Definition: d2_lexer.cc:422
#define BEGIN
Definition: d2_lexer.cc:414
#define YY_END_OF_BUFFER_CHAR
Definition: d2_lexer.cc:425
#define YY_FATAL_ERROR(msg)
Definition: d2_lexer.cc:1144
unsigned short int flex_uint16_t
Definition: d2_lexer.cc:336
#define yypop_buffer_state
Removes and deletes the top of the stack, if present.
Definition: d2_lexer.cc:22
#define yy_create_buffer
Definition: d2_lexer.cc:12
flex_uint8_t YY_CHAR
Definition: d2_lexer.cc:656
#define YY_DO_BEFORE_ACTION
Definition: d2_lexer.cc:685
#define yy_delete_buffer
Definition: d2_lexer.cc:13
#define EOB_ACT_LAST_MATCH
Definition: d2_lexer.cc:466
size_t yy_size_t
Definition: d2_lexer.cc:451
#define YY_BUFFER_EOF_PENDING
Definition: d2_lexer.cc:551
#define yylineno
Definition: d2_lexer.cc:28
#define yyset_out
Definition: d2_lexer.cc:200
#define EOB_ACT_CONTINUE_SCAN
Definition: d2_lexer.cc:464
#define yyget_lineno
Get the current line number.
Definition: d2_lexer.cc:218
#define YY_DECL
Definition: d2_lexer.cc:1387
#define YY_BUF_SIZE
Definition: d2_lexer.cc:436
#define YY_EXIT_FAILURE
Definition: d2_lexer.cc:3356
#define YY_SC_TO_UI(c)
Definition: d2_lexer.cc:400
#define DIR_ENTER
Definition: d2_lexer.cc:1176
#define yyleng
Definition: d2_lexer.cc:26
#define yyset_in
Definition: d2_lexer.cc:188
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
@ fatal
Definition: db_log.h:117
int yy_bs_column
The column count.
Definition: agent_lexer.cc:530
FILE * yy_input_file
Definition: agent_lexer.cc:491
int yy_bs_lineno
The line count.
Definition: agent_lexer.cc:529
flex_int32_t yy_verify
Definition: agent_lexer.cc:700
flex_int32_t yy_nxt
Definition: agent_lexer.cc:701