Kea 1.5.0
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 64
695#define YY_END_OF_BUFFER 65
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[388] =
704 { 0,
705 57, 57, 0, 0, 0, 0, 0, 0, 0, 0,
706 65, 63, 10, 11, 63, 1, 57, 54, 57, 57,
707 63, 56, 55, 63, 63, 63, 63, 63, 50, 51,
708 63, 63, 63, 52, 53, 5, 5, 5, 63, 63,
709 63, 10, 11, 0, 0, 46, 0, 0, 0, 0,
710 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
711 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
712 57, 57, 0, 56, 57, 3, 2, 6, 0, 57,
713 0, 0, 0, 0, 0, 0, 4, 0, 0, 9,
714 0, 47, 0, 0, 0, 0, 0, 0, 0, 0,
715
716 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
717 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
718 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
719 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,
720 48, 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, 62, 60, 0, 59, 58,
723 0, 0, 0, 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, 61, 58, 0, 0, 0, 0, 0, 0,
728 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
729 0, 0, 0, 0, 0, 0, 0, 40, 0, 0,
730 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
731 43, 44, 0, 0, 0, 0, 0, 0, 0, 0,
732 37, 0, 0, 0, 0, 0, 0, 0, 0, 0,
733 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
734 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
735 0, 0, 39, 0, 0, 36, 0, 0, 32, 0,
736 0, 0, 0, 0, 33, 0, 22, 0, 0, 0,
737
738 0, 0, 0, 0, 0, 34, 38, 0, 0, 0,
739 0, 0, 0, 0, 0, 12, 0, 0, 0, 0,
740 0, 0, 28, 0, 26, 0, 0, 0, 0, 42,
741 0, 0, 0, 30, 0, 0, 0, 0, 0, 0,
742 0, 0, 0, 0, 29, 0, 0, 0, 41, 0,
743 0, 0, 0, 13, 17, 0, 0, 0, 0, 0,
744 0, 31, 0, 27, 0, 0, 0, 0, 0, 0,
745 25, 0, 23, 16, 0, 24, 21, 45, 0, 0,
746 0, 35, 0, 0, 0, 15, 0
747 } ;
748
749static const YY_CHAR yy_ec[256] =
750 { 0,
751 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
752 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
753 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
754 1, 4, 5, 6, 7, 5, 5, 5, 5, 5,
755 5, 8, 9, 10, 11, 12, 13, 14, 14, 14,
756 14, 15, 14, 16, 14, 14, 14, 17, 5, 18,
757 5, 19, 20, 5, 21, 22, 23, 24, 25, 26,
758 5, 5, 5, 27, 5, 28, 5, 29, 30, 31,
759 5, 32, 33, 34, 35, 5, 5, 5, 5, 5,
760 36, 37, 38, 5, 39, 5, 40, 41, 42, 43,
761
762 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
763 54, 55, 5, 56, 57, 58, 59, 60, 61, 62,
764 63, 64, 65, 5, 66, 5, 5, 5, 5, 5,
765 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
766 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
767 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
768 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
769 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
770 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
771 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
772
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 5, 5, 5, 5, 5
779 } ;
780
781static const YY_CHAR yy_meta[67] =
782 { 0,
783 1, 1, 2, 3, 3, 4, 3, 3, 3, 3,
784 3, 3, 3, 5, 5, 5, 3, 3, 3, 3,
785 5, 5, 5, 5, 5, 5, 3, 3, 3, 3,
786 3, 3, 3, 3, 3, 3, 3, 3, 3, 5,
787 5, 5, 5, 5, 5, 3, 3, 3, 3, 3,
788 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
789 3, 3, 3, 3, 3, 3
790 } ;
791
792static const flex_int16_t yy_base[399] =
793 { 0,
794 0, 0, 65, 68, 71, 0, 69, 73, 54, 70,
795 706, 707, 89, 702, 137, 0, 192, 707, 197, 200,
796 86, 212, 707, 684, 97, 74, 63, 69, 707, 707,
797 83, 68, 78, 707, 707, 707, 124, 690, 649, 0,
798 682, 128, 697, 212, 234, 707, 645, 651, 172, 643,
799 196, 196, 257, 645, 641, 187, 191, 640, 638, 648,
800 637, 650, 91, 630, 634, 643, 642, 209, 210, 0,
801 281, 289, 308, 314, 293, 707, 0, 707, 232, 257,
802 182, 224, 219, 283, 284, 285, 707, 643, 678, 707,
803 294, 707, 330, 630, 640, 291, 635, 296, 301, 674,
804
805 0, 376, 633, 626, 624, 635, 629, 617, 614, 616,
806 614, 659, 606, 622, 605, 614, 609, 606, 607, 602,
807 299, 613, 616, 0, 305, 312, 255, 309, 318, 324,
808 608, 707, 0, 600, 602, 319, 610, 649, 648, 647,
809 707, 408, 598, 599, 593, 590, 604, 636, 589, 584,
810 586, 603, 631, 595, 290, 596, 628, 583, 579, 592,
811 579, 590, 587, 576, 329, 707, 707, 330, 707, 707,
812 572, 0, 574, 337, 623, 580, 707, 707, 440, 571,
813 582, 614, 578, 566, 565, 574, 580, 566, 575, 564,
814 572, 567, 570, 607, 205, 553, 605, 554, 565, 552,
815
816 596, 595, 707, 707, 562, 0, 550, 597, 596, 558,
817 707, 547, 472, 551, 545, 554, 545, 537, 550, 587,
818 536, 551, 547, 549, 532, 523, 530, 707, 531, 528,
819 525, 707, 525, 523, 532, 529, 536, 533, 0, 525,
820 707, 707, 522, 528, 515, 514, 517, 526, 558, 512,
821 707, 524, 514, 509, 512, 506, 518, 555, 504, 505,
822 354, 514, 551, 498, 511, 500, 707, 542, 495, 545,
823 497, 525, 477, 464, 470, 450, 498, 464, 463, 462,
824 499, 498, 707, 451, 444, 707, 447, 489, 707, 436,
825 429, 438, 450, 483, 707, 427, 707, 438, 433, 428,
826
827 431, 431, 467, 415, 465, 707, 707, 430, 415, 413,
828 424, 454, 402, 400, 411, 707, 441, 398, 394, 386,
829 387, 399, 707, 384, 707, 382, 397, 380, 394, 707,
830 430, 391, 384, 707, 374, 420, 368, 346, 362, 408,
831 407, 358, 363, 357, 707, 347, 355, 350, 707, 400,
832 347, 398, 339, 707, 707, 344, 340, 330, 327, 326,
833 376, 707, 333, 707, 374, 373, 325, 371, 370, 364,
834 707, 313, 707, 707, 307, 707, 707, 707, 221, 258,
835 205, 707, 196, 185, 217, 707, 707, 517, 522, 527,
836 532, 537, 542, 545, 216, 130, 115, 87
837
838 } ;
839
840static const flex_int16_t yy_def[399] =
841 { 0,
842 387, 1, 388, 388, 1, 5, 5, 5, 5, 5,
843 387, 387, 387, 387, 387, 389, 387, 387, 387, 387,
844 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
845 387, 387, 387, 387, 387, 387, 387, 387, 387, 390,
846 387, 387, 387, 391, 15, 387, 45, 45, 45, 45,
847 45, 45, 392, 45, 45, 45, 45, 45, 45, 45,
848 45, 45, 45, 45, 45, 45, 45, 45, 45, 389,
849 387, 387, 387, 387, 387, 387, 393, 387, 387, 387,
850 387, 387, 387, 387, 387, 387, 387, 387, 390, 387,
851 391, 387, 387, 45, 45, 45, 45, 45, 45, 394,
852
853 45, 392, 45, 45, 45, 45, 45, 45, 45, 45,
854 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
855 45, 45, 45, 393, 387, 387, 387, 387, 387, 387,
856 387, 387, 395, 45, 45, 45, 45, 45, 45, 394,
857 387, 392, 45, 45, 45, 45, 45, 45, 45, 45,
858 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
859 45, 45, 45, 45, 387, 387, 387, 387, 387, 387,
860 387, 396, 45, 45, 45, 45, 387, 387, 392, 45,
861 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
862 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
863
864 45, 45, 387, 387, 387, 397, 45, 45, 45, 45,
865 387, 45, 392, 45, 45, 45, 45, 45, 45, 45,
866 45, 45, 45, 45, 45, 45, 45, 387, 45, 45,
867 45, 387, 45, 45, 45, 45, 45, 387, 398, 45,
868 387, 387, 45, 45, 45, 45, 45, 45, 45, 45,
869 387, 45, 45, 45, 45, 45, 45, 45, 45, 45,
870 45, 45, 45, 45, 45, 45, 387, 45, 45, 45,
871 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
872 45, 45, 387, 45, 45, 387, 45, 45, 387, 45,
873 45, 45, 45, 45, 387, 45, 387, 45, 45, 45,
874
875 45, 45, 45, 45, 45, 387, 387, 45, 45, 45,
876 45, 45, 45, 45, 45, 387, 45, 45, 45, 45,
877 45, 45, 387, 45, 387, 45, 45, 45, 45, 387,
878 45, 45, 45, 387, 45, 45, 45, 45, 45, 45,
879 45, 45, 45, 45, 387, 45, 45, 45, 387, 45,
880 45, 45, 45, 387, 387, 45, 45, 45, 45, 45,
881 45, 387, 45, 387, 45, 45, 45, 45, 45, 45,
882 387, 45, 387, 387, 45, 387, 387, 387, 45, 45,
883 45, 387, 45, 45, 45, 387, 0, 387, 387, 387,
884 387, 387, 387, 387, 387, 387, 387, 387
885
886 } ;
887
888static const flex_int16_t yy_nxt[774] =
889 { 0,
890 12, 13, 14, 13, 12, 15, 16, 12, 17, 18,
891 19, 20, 21, 22, 22, 22, 23, 24, 12, 12,
892 12, 12, 12, 12, 25, 26, 12, 12, 27, 12,
893 12, 12, 12, 28, 12, 29, 12, 30, 12, 12,
894 12, 12, 12, 25, 31, 12, 12, 12, 12, 12,
895 12, 12, 32, 12, 12, 12, 12, 33, 12, 12,
896 12, 12, 12, 12, 34, 35, 37, 14, 37, 37,
897 14, 37, 38, 41, 40, 38, 12, 12, 40, 12,
898 12, 12, 12, 12, 12, 12, 12, 12, 12, 41,
899 42, 91, 42, 76, 81, 12, 12, 82, 77, 12,
900
901 83, 12, 82, 81, 12, 79, 12, 79, 12, 83,
902 80, 80, 80, 81, 12, 12, 12, 12, 39, 239,
903 12, 82, 84, 12, 83, 42, 85, 42, 12, 42,
904 116, 42, 117, 86, 206, 12, 12, 44, 44, 44,
905 45, 45, 46, 45, 45, 45, 45, 45, 45, 45,
906 45, 45, 45, 45, 45, 45, 45, 45, 45, 47,
907 48, 45, 45, 49, 50, 45, 45, 45, 45, 45,
908 51, 52, 45, 53, 45, 45, 54, 45, 55, 56,
909 45, 57, 45, 58, 59, 49, 60, 61, 62, 63,
910 64, 65, 66, 67, 68, 69, 45, 45, 45, 45,
911
912 45, 45, 45, 71, 96, 72, 72, 72, 71, 125,
913 74, 74, 74, 75, 75, 75, 73, 92, 98, 99,
914 172, 73, 386, 71, 73, 74, 74, 74, 96, 105,
915 106, 98, 125, 99, 107, 73, 73, 98, 99, 108,
916 73, 109, 385, 73, 110, 80, 80, 80, 93, 229,
917 98, 126, 99, 127, 384, 73, 45, 45, 383, 230,
918 45, 45, 101, 382, 381, 122, 123, 45, 45, 45,
919 80, 80, 80, 45, 126, 45, 45, 127, 45, 167,
920 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
921 45, 45, 45, 45, 75, 75, 75, 45, 167, 92,
922
923 71, 45, 72, 72, 72, 73, 75, 75, 75, 45,
924 125, 126, 45, 73, 45, 102, 79, 73, 79, 127,
925 136, 80, 80, 80, 73, 71, 138, 74, 74, 74,
926 93, 139, 73, 128, 129, 91, 73, 165, 73, 166,
927 161, 165, 91, 130, 136, 166, 192, 175, 167, 193,
928 138, 208, 209, 203, 203, 139, 351, 73, 162, 286,
929 210, 165, 166, 380, 379, 168, 91, 170, 169, 378,
930 91, 175, 203, 204, 91, 377, 376, 375, 374, 373,
931 372, 371, 91, 370, 369, 91, 368, 91, 133, 142,
932 142, 142, 287, 367, 366, 365, 142, 142, 142, 142,
933
934 142, 142, 352, 364, 363, 362, 361, 360, 359, 358,
935 357, 356, 355, 354, 353, 142, 142, 142, 142, 142,
936 142, 179, 179, 179, 350, 349, 348, 347, 179, 179,
937 179, 179, 179, 179, 346, 345, 344, 343, 342, 341,
938 340, 339, 338, 337, 336, 335, 334, 179, 179, 179,
939 179, 179, 179, 213, 213, 213, 333, 332, 331, 330,
940 213, 213, 213, 213, 213, 213, 329, 328, 327, 326,
941 325, 324, 323, 322, 321, 320, 319, 318, 317, 213,
942 213, 213, 213, 213, 213, 45, 45, 45, 316, 315,
943 314, 313, 45, 45, 45, 45, 45, 45, 312, 311,
944
945 310, 309, 308, 307, 306, 305, 304, 303, 302, 301,
946 300, 45, 45, 45, 45, 45, 45, 36, 36, 36,
947 36, 36, 70, 299, 70, 70, 70, 89, 298, 89,
948 297, 89, 91, 91, 91, 91, 91, 100, 100, 100,
949 100, 100, 124, 296, 124, 124, 124, 140, 140, 140,
950 295, 294, 293, 292, 291, 290, 289, 288, 285, 284,
951 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
952 273, 272, 271, 270, 269, 268, 267, 266, 265, 264,
953 263, 262, 261, 260, 259, 258, 257, 256, 255, 254,
954 253, 252, 251, 250, 249, 248, 247, 246, 245, 244,
955
956 243, 242, 241, 240, 238, 237, 236, 235, 234, 233,
957 232, 231, 228, 227, 226, 225, 224, 223, 222, 221,
958 220, 219, 218, 217, 216, 215, 214, 212, 211, 207,
959 205, 202, 201, 200, 199, 198, 197, 196, 195, 194,
960 191, 190, 189, 188, 187, 186, 185, 184, 183, 182,
961 181, 180, 141, 178, 177, 176, 174, 173, 171, 164,
962 163, 160, 159, 158, 157, 156, 155, 154, 153, 152,
963 151, 150, 149, 148, 147, 146, 145, 144, 143, 141,
964 137, 135, 134, 132, 131, 121, 120, 119, 118, 115,
965 114, 113, 112, 111, 104, 103, 97, 95, 94, 43,
966
967 90, 88, 87, 78, 43, 387, 11, 387, 387, 387,
968 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
969 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
970 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
971 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
972 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
973 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
974 387, 387, 387
975 } ;
976
977static const flex_int16_t yy_chk[774] =
978 { 0,
979 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
980 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
981 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
982 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
983 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
984 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
985 1, 1, 1, 1, 1, 1, 3, 3, 3, 4,
986 4, 4, 3, 9, 7, 4, 5, 5, 8, 5,
987 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
988 13, 398, 13, 21, 26, 5, 5, 27, 21, 5,
989
990 28, 9, 32, 31, 5, 25, 5, 25, 5, 33,
991 25, 25, 25, 26, 5, 5, 7, 10, 5, 397,
992 8, 27, 31, 5, 28, 37, 32, 37, 5, 42,
993 63, 42, 63, 33, 396, 5, 5, 15, 15, 15,
994 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
995 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
996 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
997 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
998 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
999 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
1000
1001 15, 15, 15, 17, 49, 17, 17, 17, 19, 81,
1002 19, 19, 19, 20, 20, 20, 17, 44, 51, 52,
1003 395, 19, 385, 22, 20, 22, 22, 22, 49, 56,
1004 56, 68, 81, 69, 56, 17, 22, 51, 52, 56,
1005 19, 57, 384, 20, 57, 79, 79, 79, 44, 195,
1006 68, 82, 69, 83, 383, 22, 45, 45, 381, 195,
1007 45, 45, 53, 380, 379, 68, 69, 45, 45, 53,
1008 80, 80, 80, 45, 82, 45, 45, 83, 45, 127,
1009 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
1010 45, 45, 45, 53, 71, 71, 71, 53, 127, 91,
1011
1012 72, 53, 72, 72, 72, 71, 75, 75, 75, 53,
1013 84, 85, 53, 72, 53, 53, 73, 75, 73, 86,
1014 96, 73, 73, 73, 71, 74, 98, 74, 74, 74,
1015 91, 99, 72, 84, 85, 93, 75, 125, 74, 126,
1016 121, 128, 93, 86, 96, 129, 155, 136, 130, 155,
1017 98, 174, 174, 165, 168, 99, 338, 74, 121, 261,
1018 174, 125, 126, 375, 372, 128, 93, 130, 129, 370,
1019 93, 136, 165, 168, 93, 369, 368, 367, 366, 365,
1020 363, 361, 93, 360, 359, 93, 358, 93, 93, 102,
1021 102, 102, 261, 357, 356, 353, 102, 102, 102, 102,
1022
1023 102, 102, 338, 352, 351, 350, 348, 347, 346, 344,
1024 343, 342, 341, 340, 339, 102, 102, 102, 102, 102,
1025 102, 142, 142, 142, 337, 336, 335, 333, 142, 142,
1026 142, 142, 142, 142, 332, 331, 329, 328, 327, 326,
1027 324, 322, 321, 320, 319, 318, 317, 142, 142, 142,
1028 142, 142, 142, 179, 179, 179, 315, 314, 313, 312,
1029 179, 179, 179, 179, 179, 179, 311, 310, 309, 308,
1030 305, 304, 303, 302, 301, 300, 299, 298, 296, 179,
1031 179, 179, 179, 179, 179, 213, 213, 213, 294, 293,
1032 292, 291, 213, 213, 213, 213, 213, 213, 290, 288,
1033
1034 287, 285, 284, 282, 281, 280, 279, 278, 277, 276,
1035 275, 213, 213, 213, 213, 213, 213, 388, 388, 388,
1036 388, 388, 389, 274, 389, 389, 389, 390, 273, 390,
1037 272, 390, 391, 391, 391, 391, 391, 392, 392, 392,
1038 392, 392, 393, 271, 393, 393, 393, 394, 394, 394,
1039 270, 269, 268, 266, 265, 264, 263, 262, 260, 259,
1040 258, 257, 256, 255, 254, 253, 252, 250, 249, 248,
1041 247, 246, 245, 244, 243, 240, 238, 237, 236, 235,
1042 234, 233, 231, 230, 229, 227, 226, 225, 224, 223,
1043 222, 221, 220, 219, 218, 217, 216, 215, 214, 212,
1044
1045 210, 209, 208, 207, 205, 202, 201, 200, 199, 198,
1046 197, 196, 194, 193, 192, 191, 190, 189, 188, 187,
1047 186, 185, 184, 183, 182, 181, 180, 176, 175, 173,
1048 171, 164, 163, 162, 161, 160, 159, 158, 157, 156,
1049 154, 153, 152, 151, 150, 149, 148, 147, 146, 145,
1050 144, 143, 140, 139, 138, 137, 135, 134, 131, 123,
1051 122, 120, 119, 118, 117, 116, 115, 114, 113, 112,
1052 111, 110, 109, 108, 107, 106, 105, 104, 103, 100,
1053 97, 95, 94, 89, 88, 67, 66, 65, 64, 62,
1054 61, 60, 59, 58, 55, 54, 50, 48, 47, 43,
1055
1056 41, 39, 38, 24, 14, 11, 387, 387, 387, 387,
1057 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
1058 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
1059 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
1060 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
1061 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
1062 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
1063 387, 387, 387
1064 } ;
1065
1066static yy_state_type yy_last_accepting_state;
1067static char *yy_last_accepting_cpos;
1068
1069extern int yy_flex_debug;
1071
1072static const flex_int16_t yy_rule_linenum[64] =
1073 { 0,
1074 133, 135, 137, 142, 143, 148, 149, 150, 162, 165,
1075 170, 176, 185, 196, 207, 216, 225, 234, 244, 254,
1076 264, 280, 296, 305, 314, 324, 334, 344, 355, 364,
1077 374, 384, 395, 404, 413, 422, 431, 440, 449, 458,
1078 471, 480, 489, 498, 507, 517, 616, 621, 626, 631,
1079 632, 633, 634, 635, 636, 638, 656, 669, 674, 678,
1080 680, 682, 684
1081 } ;
1082
1083/* The intent behind this definition is that it'll catch
1084 * any uses of REJECT which flex missed.
1085 */
1086#define REJECT reject_used_but_not_detected
1087#define yymore() yymore_used_but_not_detected
1088#define YY_MORE_ADJ 0
1089#define YY_RESTORE_YY_MORE_OFFSET
1091#line 1 "d2_lexer.ll"
1092/* Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
1093
1094 This Source Code Form is subject to the terms of the Mozilla Public
1095 License, v. 2.0. If a copy of the MPL was not distributed with this
1096 file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1097#line 8 "d2_lexer.ll"
1098
1099/* Generated files do not make clang static analyser so happy */
1100#ifndef __clang_analyzer__
1101
1102#include <cerrno>
1103#include <climits>
1104#include <cstdlib>
1105#include <string>
1106#include <d2/parser_context.h>
1107#include <asiolink/io_address.h>
1108#include <boost/lexical_cast.hpp>
1109#include <exceptions/exceptions.h>
1110
1111/* Please avoid C++ style comments (// ... eol) as they break flex 2.6.2 */
1112
1113/* Work around an incompatibility in flex (at least versions
1114 2.5.31 through 2.5.33): it generates code that does
1115 not conform to C89. See Debian bug 333231
1116 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
1117# undef yywrap
1118# define yywrap() 1
1119
1120namespace {
1121
1122bool start_token_flag = false;
1123
1124isc::d2::D2ParserContext::ParserType start_token_value;
1125unsigned int comment_start_line = 0;
1126
1127};
1128
1129/* To avoid the call to exit... oops! */
1130#define YY_FATAL_ERROR(msg) isc::d2::D2ParserContext::fatal(msg)
1131#line 1131 "d2_lexer.cc"
1132/* noyywrap disables automatic rewinding for the next file to parse. Since we
1133 always parse only a single string, there's no need to do any wraps. And
1134 using yywrap requires linking with -lfl, which provides the default yywrap
1135 implementation that always returns 1 anyway. */
1136/* nounput simplifies the lexer, by removing support for putting a character
1137 back into the input stream. We never use such capability anyway. */
1138/* batch means that we'll never use the generated lexer interactively. */
1139/* avoid to get static global variables to remain with C++. */
1140/* in last resort %option reentrant */
1141/* Enables debug mode. To see the debug messages, one needs to also set
1142 yy_flex_debug to 1, then the debug messages will be printed on stderr. */
1143/* I have no idea what this option does, except it was specified in the bison
1144 examples and Postgres folks added it to remove gcc 4.3 warnings. Let's
1145 be on the safe side and keep it. */
1146#define YY_NO_INPUT 1
1147
1148/* These are not token expressions yet, just convenience expressions that
1149 can be used during actual token definitions. Note some can match
1150 incorrect inputs (e.g., IP addresses) which must be checked. */
1151/* for errors */
1152#line 92 "d2_lexer.ll"
1153/* This code run each time a pattern is matched. It updates the location
1154 by moving it ahead by yyleng bytes. yyleng specifies the length of the
1155 currently matched token. */
1156#define YY_USER_ACTION driver.loc_.columns(yyleng);
1157#line 1157 "d2_lexer.cc"
1158#line 1158 "d2_lexer.cc"
1159
1160#define INITIAL 0
1161#define COMMENT 1
1162#define DIR_ENTER 2
1163#define DIR_INCLUDE 3
1164#define DIR_EXIT 4
1165
1166#ifndef YY_NO_UNISTD_H
1167/* Special case for "unistd.h", since it is non-ANSI. We include it way
1168 * down here because we want the user's section 1 to have been scanned first.
1169 * The user has a chance to override it with an option.
1170 */
1171/* %if-c-only */
1172#include <unistd.h>
1173/* %endif */
1174/* %if-c++-only */
1175/* %endif */
1176#endif
1177
1178#ifndef YY_EXTRA_TYPE
1179#define YY_EXTRA_TYPE void *
1180#endif
1181
1182/* %if-c-only Reentrant structure and macros (non-C++). */
1183/* %if-reentrant */
1184/* %if-c-only */
1185
1186static int yy_init_globals ( void );
1187
1188/* %endif */
1189/* %if-reentrant */
1190/* %endif */
1191/* %endif End reentrant structures and macros. */
1192
1193/* Accessor methods to globals.
1194 These are made visible to non-reentrant scanners for convenience. */
1195
1196int yylex_destroy ( void );
1197
1198int yyget_debug ( void );
1199
1200void yyset_debug ( int debug_flag );
1201
1202YY_EXTRA_TYPE yyget_extra ( void );
1203
1204void yyset_extra ( YY_EXTRA_TYPE user_defined );
1205
1206FILE *yyget_in ( void );
1207
1208void yyset_in ( FILE * _in_str );
1209
1210FILE *yyget_out ( void );
1211
1212void yyset_out ( FILE * _out_str );
1213
1214 int yyget_leng ( void );
1215
1216char *yyget_text ( void );
1217
1218int yyget_lineno ( void );
1219
1220void yyset_lineno ( int _line_number );
1221
1222/* %if-bison-bridge */
1223/* %endif */
1224
1225/* Macros after this point can all be overridden by user definitions in
1226 * section 1.
1227 */
1228
1229#ifndef YY_SKIP_YYWRAP
1230#ifdef __cplusplus
1231extern "C" int yywrap ( void );
1232#else
1233extern int yywrap ( void );
1234#endif
1235#endif
1236
1237/* %not-for-header */
1238#ifndef YY_NO_UNPUT
1239
1240#endif
1241/* %ok-for-header */
1242
1243/* %endif */
1244
1245#ifndef yytext_ptr
1246static void yy_flex_strncpy ( char *, const char *, int );
1247#endif
1248
1249#ifdef YY_NEED_STRLEN
1250static int yy_flex_strlen ( const char * );
1251#endif
1252
1253#ifndef YY_NO_INPUT
1254/* %if-c-only Standard (non-C++) definition */
1255/* %not-for-header */
1256#ifdef __cplusplus
1257static int yyinput ( void );
1258#else
1259static int input ( void );
1260#endif
1261/* %ok-for-header */
1262
1263/* %endif */
1264#endif
1265
1266/* %if-c-only */
1267
1268/* %endif */
1269
1270/* Amount of stuff to slurp up with each read. */
1271#ifndef YY_READ_BUF_SIZE
1272#ifdef __ia64__
1273/* On IA-64, the buffer size is 16k, not 8k */
1274#define YY_READ_BUF_SIZE 16384
1275#else
1276#define YY_READ_BUF_SIZE 8192
1277#endif /* __ia64__ */
1278#endif
1279
1280/* Copy whatever the last rule matched to the standard output. */
1281#ifndef ECHO
1282/* %if-c-only Standard (non-C++) definition */
1283/* This used to be an fputs(), but since the string might contain NUL's,
1284 * we now use fwrite().
1285 */
1286#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1287/* %endif */
1288/* %if-c++-only C++ definition */
1289/* %endif */
1290#endif
1291
1292/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1293 * is returned in "result".
1294 */
1295#ifndef YY_INPUT
1296#define YY_INPUT(buf,result,max_size) \
1297/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1298 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1299 { \
1300 int c = '*'; \
1301 int n; \
1302 for ( n = 0; n < max_size && \
1303 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1304 buf[n] = (char) c; \
1305 if ( c == '\n' ) \
1306 buf[n++] = (char) c; \
1307 if ( c == EOF && ferror( yyin ) ) \
1308 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1309 result = n; \
1310 } \
1311 else \
1312 { \
1313 errno=0; \
1314 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1315 { \
1316 if( errno != EINTR) \
1317 { \
1318 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1319 break; \
1320 } \
1321 errno=0; \
1322 clearerr(yyin); \
1323 } \
1324 }\
1325\
1326/* %if-c++-only C++ definition \ */\
1327/* %endif */
1328
1329#endif
1330
1331/* No semi-colon after return; correct usage is to write "yyterminate();" -
1332 * we don't want an extra ';' after the "return" because that will cause
1333 * some compilers to complain about unreachable statements.
1334 */
1335#ifndef yyterminate
1336#define yyterminate() return YY_NULL
1337#endif
1338
1339/* Number of entries by which start-condition stack grows. */
1340#ifndef YY_START_STACK_INCR
1341#define YY_START_STACK_INCR 25
1342#endif
1343
1344/* Report a fatal error. */
1345#ifndef YY_FATAL_ERROR
1346/* %if-c-only */
1347#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1348/* %endif */
1349/* %if-c++-only */
1350/* %endif */
1351#endif
1352
1353/* %if-tables-serialization structures and prototypes */
1354/* %not-for-header */
1355/* %ok-for-header */
1356
1357/* %not-for-header */
1358/* %tables-yydmap generated elements */
1359/* %endif */
1360/* end tables serialization structures and prototypes */
1361
1362/* %ok-for-header */
1363
1364/* Default declaration of generated scanner - a define so the user can
1365 * easily add parameters.
1366 */
1367#ifndef YY_DECL
1368#define YY_DECL_IS_OURS 1
1369/* %if-c-only Standard (non-C++) definition */
1370
1371extern int yylex (void);
1372
1373#define YY_DECL int yylex (void)
1374/* %endif */
1375/* %if-c++-only C++ definition */
1376/* %endif */
1377#endif /* !YY_DECL */
1378
1379/* Code executed at the beginning of each rule, after yytext and yyleng
1380 * have been set up.
1381 */
1382#ifndef YY_USER_ACTION
1383#define YY_USER_ACTION
1384#endif
1385
1386/* Code executed at the end of each rule. */
1387#ifndef YY_BREAK
1388#define YY_BREAK /*LINTED*/break;
1389#endif
1390
1391/* %% [6.0] YY_RULE_SETUP definition goes here */
1392#define YY_RULE_SETUP \
1393 YY_USER_ACTION
1394
1395/* %not-for-header */
1399{
1400 yy_state_type yy_current_state;
1401 char *yy_cp, *yy_bp;
1403
1404 if ( !(yy_init) )
1405 {
1406 (yy_init) = 1;
1407
1408#ifdef YY_USER_INIT
1409 YY_USER_INIT;
1410#endif
1411
1412 if ( ! (yy_start) )
1413 (yy_start) = 1; /* first start state */
1414
1415 if ( ! yyin )
1416/* %if-c-only */
1417 yyin = stdin;
1418/* %endif */
1419/* %if-c++-only */
1420/* %endif */
1421
1422 if ( ! yyout )
1423/* %if-c-only */
1424 yyout = stdout;
1425/* %endif */
1426/* %if-c++-only */
1427/* %endif */
1428
1429 if ( ! YY_CURRENT_BUFFER ) {
1433 }
1434
1436 }
1437
1438 {
1439/* %% [7.0] user's declarations go here */
1440#line 98 "d2_lexer.ll"
1441
1442
1443
1444#line 102 "d2_lexer.ll"
1445 /* This part of the code is copied over to the verbatim to the top
1446 of the generated yylex function. Explanation:
1447 http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html */
1448
1449 /* Code run each time yylex is called. */
1450 driver.loc_.step();
1451
1452 if (start_token_flag) {
1453 start_token_flag = false;
1454 switch (start_token_value) {
1456 default:
1457 return isc::d2::D2Parser::make_TOPLEVEL_JSON(driver.loc_);
1461 return isc::d2::D2Parser::make_SUB_DHCPDDNS(driver.loc_);
1463 return isc::d2::D2Parser::make_SUB_TSIG_KEY(driver.loc_);
1465 return isc::d2::D2Parser::make_SUB_TSIG_KEYS(driver.loc_);
1467 return isc::d2::D2Parser::make_SUB_DDNS_DOMAIN(driver.loc_);
1469 return isc::d2::D2Parser::make_SUB_DDNS_DOMAINS(driver.loc_);
1471 return isc::d2::D2Parser::make_SUB_DNS_SERVER(driver.loc_);
1472 }
1473 }
1474
1475
1476#line 1476 "d2_lexer.cc"
1477
1478 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1479 {
1480/* %% [8.0] yymore()-related code goes here */
1481 yy_cp = (yy_c_buf_p);
1482
1483 /* Support of yytext. */
1484 *yy_cp = (yy_hold_char);
1485
1486 /* yy_bp points to the position in yy_ch_buf of the start of
1487 * the current run.
1488 */
1489 yy_bp = yy_cp;
1490
1491/* %% [9.0] code to set up and find next match goes here */
1492 yy_current_state = (yy_start);
1493yy_match:
1494 do
1495 {
1496 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1497 if ( yy_accept[yy_current_state] )
1498 {
1499 (yy_last_accepting_state) = yy_current_state;
1500 (yy_last_accepting_cpos) = yy_cp;
1501 }
1502 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1503 {
1504 yy_current_state = (int) yy_def[yy_current_state];
1505 if ( yy_current_state >= 388 )
1506 yy_c = yy_meta[yy_c];
1507 }
1508 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1509 ++yy_cp;
1510 }
1511 while ( yy_current_state != 387 );
1512 yy_cp = (yy_last_accepting_cpos);
1513 yy_current_state = (yy_last_accepting_state);
1514
1515yy_find_action:
1516/* %% [10.0] code to find the action number goes here */
1517 yy_act = yy_accept[yy_current_state];
1518
1520
1521/* %% [11.0] code for yylineno update goes here */
1522
1523do_action: /* This label is used only to access EOF actions. */
1524
1525/* %% [12.0] debug code goes here */
1526 if ( yy_flex_debug )
1527 {
1528 if ( yy_act == 0 )
1529 fprintf( stderr, "--scanner backing up\n" );
1530 else if ( yy_act < 64 )
1531 fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1532 (long)yy_rule_linenum[yy_act], yytext );
1533 else if ( yy_act == 64 )
1534 fprintf( stderr, "--accepting default rule (\"%s\")\n",
1535 yytext );
1536 else if ( yy_act == 65 )
1537 fprintf( stderr, "--(end of buffer or a NUL)\n" );
1538 else
1539 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1540 }
1541
1542 switch ( yy_act )
1543 { /* beginning of action switch */
1544/* %% [13.0] actions go here */
1545 case 0: /* must back up */
1546 /* undo the effects of YY_DO_BEFORE_ACTION */
1547 *yy_cp = (yy_hold_char);
1548 yy_cp = (yy_last_accepting_cpos);
1549 yy_current_state = (yy_last_accepting_state);
1550 goto yy_find_action;
1551
1552case 1:
1554#line 133 "d2_lexer.ll"
1555;
1556 YY_BREAK
1557case 2:
1559#line 135 "d2_lexer.ll"
1560;
1561 YY_BREAK
1562case 3:
1564#line 137 "d2_lexer.ll"
1565{
1566 BEGIN(COMMENT);
1567 comment_start_line = driver.loc_.end.line;;
1568}
1569 YY_BREAK
1570case 4:
1572#line 142 "d2_lexer.ll"
1573BEGIN(INITIAL);
1574 YY_BREAK
1575case 5:
1577#line 143 "d2_lexer.ll"
1578;
1579 YY_BREAK
1580case YY_STATE_EOF(COMMENT):
1581#line 144 "d2_lexer.ll"
1582{
1583 isc_throw(D2ParseError, "Comment not closed. (/* in line " << comment_start_line);
1584}
1585 YY_BREAK
1586case 6:
1588#line 148 "d2_lexer.ll"
1590 YY_BREAK
1591case 7:
1593#line 149 "d2_lexer.ll"
1595 YY_BREAK
1596case 8:
1598#line 150 "d2_lexer.ll"
1599{
1600 /* Include directive. */
1601
1602 /* Extract the filename. */
1603 std::string tmp(yytext+1);
1604 tmp.resize(tmp.size() - 1);
1605
1606 driver.includeFile(tmp);
1607}
1608 YY_BREAK
1612#line 159 "d2_lexer.ll"
1613{
1614 isc_throw(D2ParseError, "Directive not closed.");
1615}
1616 YY_BREAK
1617case 9:
1619#line 162 "d2_lexer.ll"
1620BEGIN(INITIAL);
1621 YY_BREAK
1622case 10:
1624#line 165 "d2_lexer.ll"
1625{
1626 /* Ok, we found a with space. Let's ignore it and update loc variable. */
1627 driver.loc_.step();
1628}
1629 YY_BREAK
1630case 11:
1631/* rule 11 can match eol */
1633#line 170 "d2_lexer.ll"
1634{
1635 /* Newline found. Let's update the location and continue. */
1636 driver.loc_.lines(yyleng);
1637 driver.loc_.step();
1638}
1639 YY_BREAK
1640case 12:
1642#line 176 "d2_lexer.ll"
1643{
1644 switch(driver.ctx_) {
1646 return isc::d2::D2Parser::make_DHCPDDNS(driver.loc_);
1647 default:
1648 return isc::d2::D2Parser::make_STRING("DhcpDdns", driver.loc_);
1649 }
1650}
1651 YY_BREAK
1652case 13:
1654#line 185 "d2_lexer.ll"
1655{
1656 switch(driver.ctx_) {
1660 return isc::d2::D2Parser::make_IP_ADDRESS(driver.loc_);
1661 default:
1662 return isc::d2::D2Parser::make_STRING("ip-address", driver.loc_);
1663 }
1664}
1665 YY_BREAK
1666case 14:
1668#line 196 "d2_lexer.ll"
1669{
1670 switch(driver.ctx_) {
1674 return isc::d2::D2Parser::make_PORT(driver.loc_);
1675 default:
1676 return isc::d2::D2Parser::make_STRING("port", driver.loc_);
1677 }
1678}
1679 YY_BREAK
1680case 15:
1682#line 207 "d2_lexer.ll"
1683{
1684 switch(driver.ctx_) {
1687 default:
1688 return isc::d2::D2Parser::make_STRING("dns-server-timeout", driver.loc_);
1689 }
1690}
1691 YY_BREAK
1692case 16:
1694#line 216 "d2_lexer.ll"
1695{
1696 switch(driver.ctx_) {
1698 return isc::d2::D2Parser::make_NCR_PROTOCOL(driver.loc_);
1699 default:
1700 return isc::d2::D2Parser::make_STRING("ncr-protocol", driver.loc_);
1701 }
1702}
1703 YY_BREAK
1704case 17:
1706#line 225 "d2_lexer.ll"
1707{
1708 switch(driver.ctx_) {
1710 return isc::d2::D2Parser::make_NCR_FORMAT(driver.loc_);
1711 default:
1712 return isc::d2::D2Parser::make_STRING("ncr-format", driver.loc_);
1713 }
1714}
1715 YY_BREAK
1716case 18:
1718#line 234 "d2_lexer.ll"
1719{
1720 /* dhcp-ddns value keywords are case insensitive */
1721 if (driver.ctx_ == isc::d2::D2ParserContext::NCR_PROTOCOL) {
1722 return isc::d2::D2Parser::make_UDP(driver.loc_);
1723 }
1724 std::string tmp(yytext+1);
1725 tmp.resize(tmp.size() - 1);
1726 return isc::d2::D2Parser::make_STRING(tmp, driver.loc_);
1727}
1728 YY_BREAK
1729case 19:
1731#line 244 "d2_lexer.ll"
1732{
1733 /* dhcp-ddns value keywords are case insensitive */
1734 if (driver.ctx_ == isc::d2::D2ParserContext::NCR_PROTOCOL) {
1735 return isc::d2::D2Parser::make_TCP(driver.loc_);
1736 }
1737 std::string tmp(yytext+1);
1738 tmp.resize(tmp.size() - 1);
1739 return isc::d2::D2Parser::make_STRING(tmp, driver.loc_);
1740}
1741 YY_BREAK
1742case 20:
1744#line 254 "d2_lexer.ll"
1745{
1746 /* dhcp-ddns value keywords are case insensitive */
1747 if (driver.ctx_ == isc::d2::D2ParserContext::NCR_FORMAT) {
1748 return isc::d2::D2Parser::make_JSON(driver.loc_);
1749 }
1750 std::string tmp(yytext+1);
1751 tmp.resize(tmp.size() - 1);
1752 return isc::d2::D2Parser::make_STRING(tmp, driver.loc_);
1753}
1754 YY_BREAK
1755case 21:
1757#line 264 "d2_lexer.ll"
1758{
1759 switch(driver.ctx_) {
1768 return isc::d2::D2Parser::make_USER_CONTEXT(driver.loc_);
1769 default:
1770 return isc::d2::D2Parser::make_STRING("user-context", driver.loc_);
1771 }
1772}
1773 YY_BREAK
1774case 22:
1776#line 280 "d2_lexer.ll"
1777{
1778 switch(driver.ctx_) {
1787 return isc::d2::D2Parser::make_COMMENT(driver.loc_);
1788 default:
1789 return isc::d2::D2Parser::make_STRING("comment", driver.loc_);
1790 }
1791}
1792 YY_BREAK
1793case 23:
1795#line 296 "d2_lexer.ll"
1796{
1797 switch(driver.ctx_) {
1799 return isc::d2::D2Parser::make_FORWARD_DDNS(driver.loc_);
1800 default:
1801 return isc::d2::D2Parser::make_STRING("forward-ddns", driver.loc_);
1802 }
1803}
1804 YY_BREAK
1805case 24:
1807#line 305 "d2_lexer.ll"
1808{
1809 switch(driver.ctx_) {
1811 return isc::d2::D2Parser::make_REVERSE_DDNS(driver.loc_);
1812 default:
1813 return isc::d2::D2Parser::make_STRING("reverse-ddns", driver.loc_);
1814 }
1815}
1816 YY_BREAK
1817case 25:
1819#line 314 "d2_lexer.ll"
1820{
1821 switch(driver.ctx_) {
1824 return isc::d2::D2Parser::make_DDNS_DOMAINS(driver.loc_);
1825 default:
1826 return isc::d2::D2Parser::make_STRING("ddns-domains", driver.loc_);
1827 }
1828}
1829 YY_BREAK
1830case 26:
1832#line 324 "d2_lexer.ll"
1833{
1834 switch(driver.ctx_) {
1837 return isc::d2::D2Parser::make_KEY_NAME(driver.loc_);
1838 default:
1839 return isc::d2::D2Parser::make_STRING("key-name", driver.loc_);
1840 }
1841}
1842 YY_BREAK
1843case 27:
1845#line 334 "d2_lexer.ll"
1846{
1847 switch(driver.ctx_) {
1850 return isc::d2::D2Parser::make_DNS_SERVERS(driver.loc_);
1851 default:
1852 return isc::d2::D2Parser::make_STRING("dns-servers", driver.loc_);
1853 }
1854}
1855 YY_BREAK
1856case 28:
1858#line 344 "d2_lexer.ll"
1859{
1860 switch(driver.ctx_) {
1863 return isc::d2::D2Parser::make_HOSTNAME(driver.loc_);
1864 default:
1865 return isc::d2::D2Parser::make_STRING("hostname", driver.loc_);
1866 }
1867}
1868 YY_BREAK
1869case 29:
1871#line 355 "d2_lexer.ll"
1872{
1873 switch(driver.ctx_) {
1875 return isc::d2::D2Parser::make_TSIG_KEYS(driver.loc_);
1876 default:
1877 return isc::d2::D2Parser::make_STRING("tsig-keys", driver.loc_);
1878 }
1879}
1880 YY_BREAK
1881case 30:
1883#line 364 "d2_lexer.ll"
1884{
1885 switch(driver.ctx_) {
1888 return isc::d2::D2Parser::make_ALGORITHM(driver.loc_);
1889 default:
1890 return isc::d2::D2Parser::make_STRING("algorithm", driver.loc_);
1891 }
1892}
1893 YY_BREAK
1894case 31:
1896#line 374 "d2_lexer.ll"
1897{
1898 switch(driver.ctx_) {
1901 return isc::d2::D2Parser::make_DIGEST_BITS(driver.loc_);
1902 default:
1903 return isc::d2::D2Parser::make_STRING("digest-bits", driver.loc_);
1904 }
1905}
1906 YY_BREAK
1907case 32:
1909#line 384 "d2_lexer.ll"
1910{
1911 switch(driver.ctx_) {
1914 return isc::d2::D2Parser::make_SECRET(driver.loc_);
1915 default:
1916 return isc::d2::D2Parser::make_STRING("secret", driver.loc_);
1917 }
1918}
1919 YY_BREAK
1920case 33:
1922#line 395 "d2_lexer.ll"
1923{
1924 switch(driver.ctx_) {
1926 return isc::d2::D2Parser::make_LOGGING(driver.loc_);
1927 default:
1928 return isc::d2::D2Parser::make_STRING("Logging", driver.loc_);
1929 }
1930}
1931 YY_BREAK
1932case 34:
1934#line 404 "d2_lexer.ll"
1935{
1936 switch(driver.ctx_) {
1938 return isc::d2::D2Parser::make_LOGGERS(driver.loc_);
1939 default:
1940 return isc::d2::D2Parser::make_STRING("loggers", driver.loc_);
1941 }
1942}
1943 YY_BREAK
1944case 35:
1946#line 413 "d2_lexer.ll"
1947{
1948 switch(driver.ctx_) {
1950 return isc::d2::D2Parser::make_OUTPUT_OPTIONS(driver.loc_);
1951 default:
1952 return isc::d2::D2Parser::make_STRING("output_options", driver.loc_);
1953 }
1954}
1955 YY_BREAK
1956case 36:
1958#line 422 "d2_lexer.ll"
1959{
1960 switch(driver.ctx_) {
1962 return isc::d2::D2Parser::make_OUTPUT(driver.loc_);
1963 default:
1964 return isc::d2::D2Parser::make_STRING("output", driver.loc_);
1965 }
1966}
1967 YY_BREAK
1968case 37:
1970#line 431 "d2_lexer.ll"
1971{
1972 switch(driver.ctx_) {
1974 return isc::d2::D2Parser::make_FLUSH(driver.loc_);
1975 default:
1976 return isc::d2::D2Parser::make_STRING("flush", driver.loc_);
1977 }
1978}
1979 YY_BREAK
1980case 38:
1982#line 440 "d2_lexer.ll"
1983{
1984 switch(driver.ctx_) {
1986 return isc::d2::D2Parser::make_MAXSIZE(driver.loc_);
1987 default:
1988 return isc::d2::D2Parser::make_STRING("maxsize", driver.loc_);
1989 }
1990}
1991 YY_BREAK
1992case 39:
1994#line 449 "d2_lexer.ll"
1995{
1996 switch(driver.ctx_) {
1998 return isc::d2::D2Parser::make_MAXVER(driver.loc_);
1999 default:
2000 return isc::d2::D2Parser::make_STRING("maxver", driver.loc_);
2001 }
2002}
2003 YY_BREAK
2004case 40:
2006#line 458 "d2_lexer.ll"
2007{
2008 switch(driver.ctx_) {
2014 return isc::d2::D2Parser::make_NAME(driver.loc_);
2015 default:
2016 return isc::d2::D2Parser::make_STRING("name", driver.loc_);
2017 }
2018}
2019 YY_BREAK
2020case 41:
2022#line 471 "d2_lexer.ll"
2023{
2024 switch(driver.ctx_) {
2026 return isc::d2::D2Parser::make_DEBUGLEVEL(driver.loc_);
2027 default:
2028 return isc::d2::D2Parser::make_STRING("debuglevel", driver.loc_);
2029 }
2030}
2031 YY_BREAK
2032case 42:
2034#line 480 "d2_lexer.ll"
2035{
2036 switch(driver.ctx_) {
2038 return isc::d2::D2Parser::make_SEVERITY(driver.loc_);
2039 default:
2040 return isc::d2::D2Parser::make_STRING("severity", driver.loc_);
2041 }
2042}
2043 YY_BREAK
2044case 43:
2046#line 489 "d2_lexer.ll"
2047{
2048 switch(driver.ctx_) {
2050 return isc::d2::D2Parser::make_DHCP4(driver.loc_);
2051 default:
2052 return isc::d2::D2Parser::make_STRING("Dhcp4", driver.loc_);
2053 }
2054}
2055 YY_BREAK
2056case 44:
2058#line 498 "d2_lexer.ll"
2059{
2060 switch(driver.ctx_) {
2062 return isc::d2::D2Parser::make_DHCP6(driver.loc_);
2063 default:
2064 return isc::d2::D2Parser::make_STRING("Dhcp6", driver.loc_);
2065 }
2066}
2067 YY_BREAK
2068case 45:
2070#line 507 "d2_lexer.ll"
2071{
2072 switch(driver.ctx_) {
2074 return isc::d2::D2Parser::make_CONTROL_AGENT(driver.loc_);
2075 default:
2076 return isc::d2::D2Parser::make_STRING("Control-agent", driver.loc_);
2077 }
2078}
2079 YY_BREAK
2080case 46:
2082#line 517 "d2_lexer.ll"
2083{
2084 /* A string has been matched. It contains the actual string and single quotes.
2085 We need to get those quotes out of the way and just use its content, e.g.
2086 for 'foo' we should get foo */
2087 std::string raw(yytext+1);
2088 size_t len = raw.size() - 1;
2089 raw.resize(len);
2090 std::string decoded;
2091 decoded.reserve(len);
2092 for (size_t pos = 0; pos < len; ++pos) {
2093 int b = 0;
2094 char c = raw[pos];
2095 switch (c) {
2096 case '"':
2097 /* impossible condition */
2098 driver.error(driver.loc_, "Bad quote in \"" + raw + "\"");
2099 break;
2100 case '\\':
2101 ++pos;
2102 if (pos >= len) {
2103 /* impossible condition */
2104 driver.error(driver.loc_, "Overflow escape in \"" + raw + "\"");
2105 }
2106 c = raw[pos];
2107 switch (c) {
2108 case '"':
2109 case '\\':
2110 case '/':
2111 decoded.push_back(c);
2112 break;
2113 case 'b':
2114 decoded.push_back('\b');
2115 break;
2116 case 'f':
2117 decoded.push_back('\f');
2118 break;
2119 case 'n':
2120 decoded.push_back('\n');
2121 break;
2122 case 'r':
2123 decoded.push_back('\r');
2124 break;
2125 case 't':
2126 decoded.push_back('\t');
2127 break;
2128 case 'u':
2129 /* support only \u0000 to \u00ff */
2130 ++pos;
2131 if (pos + 4 > len) {
2132 /* impossible condition */
2133 driver.error(driver.loc_,
2134 "Overflow unicode escape in \"" + raw + "\"");
2135 }
2136 if ((raw[pos] != '0') || (raw[pos + 1] != '0')) {
2137 driver.error(driver.loc_, "Unsupported unicode escape in \"" + raw + "\"");
2138 }
2139 pos += 2;
2140 c = raw[pos];
2141 if ((c >= '0') && (c <= '9')) {
2142 b = (c - '0') << 4;
2143 } else if ((c >= 'A') && (c <= 'F')) {
2144 b = (c - 'A' + 10) << 4;
2145 } else if ((c >= 'a') && (c <= 'f')) {
2146 b = (c - 'a' + 10) << 4;
2147 } else {
2148 /* impossible condition */
2149 driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\"");
2150 }
2151 pos++;
2152 c = raw[pos];
2153 if ((c >= '0') && (c <= '9')) {
2154 b |= c - '0';
2155 } else if ((c >= 'A') && (c <= 'F')) {
2156 b |= c - 'A' + 10;
2157 } else if ((c >= 'a') && (c <= 'f')) {
2158 b |= c - 'a' + 10;
2159 } else {
2160 /* impossible condition */
2161 driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\"");
2162 }
2163 decoded.push_back(static_cast<char>(b & 0xff));
2164 break;
2165 default:
2166 /* impossible condition */
2167 driver.error(driver.loc_, "Bad escape in \"" + raw + "\"");
2168 }
2169 break;
2170 default:
2171 if ((c >= 0) && (c < 0x20)) {
2172 /* impossible condition */
2173 driver.error(driver.loc_, "Invalid control in \"" + raw + "\"");
2174 }
2175 decoded.push_back(c);
2176 }
2177 }
2178
2179 return isc::d2::D2Parser::make_STRING(decoded, driver.loc_);
2180}
2181 YY_BREAK
2182case 47:
2183/* rule 47 can match eol */
2185#line 616 "d2_lexer.ll"
2186{
2187 /* Bad string with a forbidden control character inside */
2188 driver.error(driver.loc_, "Invalid control in " + std::string(yytext));
2189}
2190 YY_BREAK
2191case 48:
2192/* rule 48 can match eol */
2194#line 621 "d2_lexer.ll"
2195{
2196 /* Bad string with a bad escape inside */
2197 driver.error(driver.loc_, "Bad escape in " + std::string(yytext));
2198}
2199 YY_BREAK
2200case 49:
2202#line 626 "d2_lexer.ll"
2203{
2204 /* Bad string with an open escape at the end */
2205 driver.error(driver.loc_, "Overflow escape in " + std::string(yytext));
2206}
2207 YY_BREAK
2208case 50:
2210#line 631 "d2_lexer.ll"
2211{ return isc::d2::D2Parser::make_LSQUARE_BRACKET(driver.loc_); }
2212 YY_BREAK
2213case 51:
2215#line 632 "d2_lexer.ll"
2216{ return isc::d2::D2Parser::make_RSQUARE_BRACKET(driver.loc_); }
2217 YY_BREAK
2218case 52:
2220#line 633 "d2_lexer.ll"
2221{ return isc::d2::D2Parser::make_LCURLY_BRACKET(driver.loc_); }
2222 YY_BREAK
2223case 53:
2225#line 634 "d2_lexer.ll"
2226{ return isc::d2::D2Parser::make_RCURLY_BRACKET(driver.loc_); }
2227 YY_BREAK
2228case 54:
2230#line 635 "d2_lexer.ll"
2231{ return isc::d2::D2Parser::make_COMMA(driver.loc_); }
2232 YY_BREAK
2233case 55:
2235#line 636 "d2_lexer.ll"
2236{ return isc::d2::D2Parser::make_COLON(driver.loc_); }
2237 YY_BREAK
2238case 56:
2240#line 638 "d2_lexer.ll"
2241{
2242 /* An integer was found. */
2243 std::string tmp(yytext);
2244 int64_t integer = 0;
2245 try {
2246 /* In substring we want to use negative values (e.g. -1).
2247 In enterprise-id we need to use values up to 0xffffffff.
2248 To cover both of those use cases, we need at least
2249 int64_t. */
2250 integer = boost::lexical_cast<int64_t>(tmp);
2251 } catch (const boost::bad_lexical_cast &) {
2252 driver.error(driver.loc_, "Failed to convert " + tmp + " to an integer.");
2253 }
2254
2255 /* The parser needs the string form as double conversion is no lossless */
2256 return isc::d2::D2Parser::make_INTEGER(integer, driver.loc_);
2257}
2258 YY_BREAK
2259case 57:
2261#line 656 "d2_lexer.ll"
2262{
2263 /* A floating point was found. */
2264 std::string tmp(yytext);
2265 double fp = 0.0;
2266 try {
2267 fp = boost::lexical_cast<double>(tmp);
2268 } catch (const boost::bad_lexical_cast &) {
2269 driver.error(driver.loc_, "Failed to convert " + tmp + " to a floating point.");
2270 }
2271
2272 return isc::d2::D2Parser::make_FLOAT(fp, driver.loc_);
2273}
2274 YY_BREAK
2275case 58:
2277#line 669 "d2_lexer.ll"
2278{
2279 string tmp(yytext);
2280 return isc::d2::D2Parser::make_BOOLEAN(tmp == "true", driver.loc_);
2281}
2282 YY_BREAK
2283case 59:
2285#line 674 "d2_lexer.ll"
2286{
2287 return isc::d2::D2Parser::make_NULL_TYPE(driver.loc_);
2288}
2289 YY_BREAK
2290case 60:
2292#line 678 "d2_lexer.ll"
2293driver.error (driver.loc_, "JSON true reserved keyword is lower case only");
2294 YY_BREAK
2295case 61:
2297#line 680 "d2_lexer.ll"
2298driver.error (driver.loc_, "JSON false reserved keyword is lower case only");
2299 YY_BREAK
2300case 62:
2302#line 682 "d2_lexer.ll"
2303driver.error (driver.loc_, "JSON null reserved keyword is lower case only");
2304 YY_BREAK
2305case 63:
2307#line 684 "d2_lexer.ll"
2308driver.error (driver.loc_, "Invalid character: " + std::string(yytext));
2309 YY_BREAK
2310case YY_STATE_EOF(INITIAL):
2311#line 686 "d2_lexer.ll"
2312{
2313 if (driver.states_.empty()) {
2314 return isc::d2::D2Parser::make_END(driver.loc_);
2315 }
2316 driver.loc_ = driver.locs_.back();
2317 driver.locs_.pop_back();
2318 driver.file_ = driver.files_.back();
2319 driver.files_.pop_back();
2320 if (driver.sfile_) {
2321 fclose(driver.sfile_);
2322 driver.sfile_ = 0;
2323 }
2324 if (!driver.sfiles_.empty()) {
2325 driver.sfile_ = driver.sfiles_.back();
2326 driver.sfiles_.pop_back();
2327 }
2328 d2_parser__delete_buffer(YY_CURRENT_BUFFER);
2329 d2_parser__switch_to_buffer(driver.states_.back());
2330 driver.states_.pop_back();
2331
2332 BEGIN(DIR_EXIT);
2333}
2334 YY_BREAK
2335case 64:
2337#line 709 "d2_lexer.ll"
2338ECHO;
2339 YY_BREAK
2340#line 2340 "d2_lexer.cc"
2341
2342 case YY_END_OF_BUFFER:
2343 {
2344 /* Amount of text matched not including the EOB char. */
2345 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2346
2347 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2348 *yy_cp = (yy_hold_char);
2350
2351 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2352 {
2353 /* We're scanning a new file or input source. It's
2354 * possible that this happened because the user
2355 * just pointed yyin at a new source and called
2356 * yylex(). If so, then we have to assure
2357 * consistency between YY_CURRENT_BUFFER and our
2358 * globals. Here is the right place to do so, because
2359 * this is the first action (other than possibly a
2360 * back-up) that will match for the new input source.
2361 */
2362 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2363/* %if-c-only */
2364 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2365/* %endif */
2366/* %if-c++-only */
2367/* %endif */
2368 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2369 }
2370
2371 /* Note that here we test for yy_c_buf_p "<=" to the position
2372 * of the first EOB in the buffer, since yy_c_buf_p will
2373 * already have been incremented past the NUL character
2374 * (since all states make transitions on EOB to the
2375 * end-of-buffer state). Contrast this with the test
2376 * in input().
2377 */
2378 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2379 { /* This was really a NUL. */
2380 yy_state_type yy_next_state;
2381
2382 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2383
2384 yy_current_state = yy_get_previous_state( );
2385
2386 /* Okay, we're now positioned to make the NUL
2387 * transition. We couldn't have
2388 * yy_get_previous_state() go ahead and do it
2389 * for us because it doesn't know how to deal
2390 * with the possibility of jamming (and we don't
2391 * want to build jamming into it because then it
2392 * will run more slowly).
2393 */
2394
2395 yy_next_state = yy_try_NUL_trans( yy_current_state );
2396
2398
2399 if ( yy_next_state )
2400 {
2401 /* Consume the NUL. */
2402 yy_cp = ++(yy_c_buf_p);
2403 yy_current_state = yy_next_state;
2404 goto yy_match;
2405 }
2406
2407 else
2408 {
2409/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
2410 yy_cp = (yy_last_accepting_cpos);
2411 yy_current_state = (yy_last_accepting_state);
2412 goto yy_find_action;
2413 }
2414 }
2415
2416 else switch ( yy_get_next_buffer( ) )
2417 {
2419 {
2420 (yy_did_buffer_switch_on_eof) = 0;
2421
2422 if ( yywrap( ) )
2423 {
2424 /* Note: because we've taken care in
2425 * yy_get_next_buffer() to have set up
2426 * yytext, we can now set up
2427 * yy_c_buf_p so that if some total
2428 * hoser (like flex itself) wants to
2429 * call the scanner after we return the
2430 * YY_NULL, it'll still work - another
2431 * YY_NULL will get returned.
2432 */
2433 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2434
2436 goto do_action;
2437 }
2438
2439 else
2440 {
2441 if ( ! (yy_did_buffer_switch_on_eof) )
2443 }
2444 break;
2445 }
2446
2448 (yy_c_buf_p) =
2449 (yytext_ptr) + yy_amount_of_matched_text;
2450
2451 yy_current_state = yy_get_previous_state( );
2452
2453 yy_cp = (yy_c_buf_p);
2455 goto yy_match;
2456
2457 case EOB_ACT_LAST_MATCH:
2458 (yy_c_buf_p) =
2459 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2460
2461 yy_current_state = yy_get_previous_state( );
2462
2463 yy_cp = (yy_c_buf_p);
2465 goto yy_find_action;
2466 }
2467 break;
2468 }
2469
2470 default:
2472 "fatal flex scanner internal error--no action found" );
2473 } /* end of action switch */
2474 } /* end of scanning one token */
2475 } /* end of user's declarations */
2476} /* end of yylex */
2477/* %ok-for-header */
2478
2479/* %if-c++-only */
2480/* %not-for-header */
2481/* %ok-for-header */
2482
2483/* %endif */
2484
2485/* yy_get_next_buffer - try to read in a new buffer
2486 *
2487 * Returns a code representing an action:
2488 * EOB_ACT_LAST_MATCH -
2489 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2490 * EOB_ACT_END_OF_FILE - end of file
2491 */
2492/* %if-c-only */
2493static int yy_get_next_buffer (void)
2494/* %endif */
2495/* %if-c++-only */
2496/* %endif */
2497{
2498 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2499 char *source = (yytext_ptr);
2500 int number_to_move, i;
2501 int ret_val;
2502
2503 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2505 "fatal flex scanner internal error--end of buffer missed" );
2506
2507 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2508 { /* Don't try to fill the buffer, so this is an EOF. */
2509 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2510 {
2511 /* We matched a single character, the EOB, so
2512 * treat this as a final EOF.
2513 */
2514 return EOB_ACT_END_OF_FILE;
2515 }
2516
2517 else
2518 {
2519 /* We matched some text prior to the EOB, first
2520 * process it.
2521 */
2522 return EOB_ACT_LAST_MATCH;
2523 }
2524 }
2525
2526 /* Try to read more data. */
2527
2528 /* First move last chars to start of buffer. */
2529 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
2530
2531 for ( i = 0; i < number_to_move; ++i )
2532 *(dest++) = *(source++);
2533
2534 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2535 /* don't do the read, it's not guaranteed to return an EOF,
2536 * just force an EOF
2537 */
2538 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2539
2540 else
2541 {
2542 int num_to_read =
2543 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2544
2545 while ( num_to_read <= 0 )
2546 { /* Not enough room in the buffer - grow it. */
2547
2548 /* just a shorter name for the current buffer */
2550
2551 int yy_c_buf_p_offset =
2552 (int) ((yy_c_buf_p) - b->yy_ch_buf);
2553
2554 if ( b->yy_is_our_buffer )
2555 {
2556 int new_size = b->yy_buf_size * 2;
2557
2558 if ( new_size <= 0 )
2559 b->yy_buf_size += b->yy_buf_size / 8;
2560 else
2561 b->yy_buf_size *= 2;
2562
2563 b->yy_ch_buf = (char *)
2564 /* Include room in for 2 EOB chars. */
2565 yyrealloc( (void *) b->yy_ch_buf,
2566 (yy_size_t) (b->yy_buf_size + 2) );
2567 }
2568 else
2569 /* Can't grow it, we don't own it. */
2570 b->yy_ch_buf = NULL;
2571
2572 if ( ! b->yy_ch_buf )
2574 "fatal error - scanner input buffer overflow" );
2575
2576 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2577
2578 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2579 number_to_move - 1;
2580
2581 }
2582
2583 if ( num_to_read > YY_READ_BUF_SIZE )
2584 num_to_read = YY_READ_BUF_SIZE;
2585
2586 /* Read in more data. */
2587 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2588 (yy_n_chars), num_to_read );
2589
2590 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2591 }
2592
2593 if ( (yy_n_chars) == 0 )
2594 {
2595 if ( number_to_move == YY_MORE_ADJ )
2596 {
2597 ret_val = EOB_ACT_END_OF_FILE;
2598 yyrestart( yyin );
2599 }
2600
2601 else
2602 {
2603 ret_val = EOB_ACT_LAST_MATCH;
2604 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2606 }
2607 }
2608
2609 else
2610 ret_val = EOB_ACT_CONTINUE_SCAN;
2611
2612 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2613 /* Extend the array by 50%, plus the number we really need. */
2614 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2615 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2616 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
2617 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2618 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2619 /* "- 2" to take care of EOB's */
2620 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2621 }
2622
2623 (yy_n_chars) += number_to_move;
2624 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2625 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2626
2627 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2628
2629 return ret_val;
2630}
2631
2632/* yy_get_previous_state - get the state just before the EOB char was reached */
2633
2634/* %if-c-only */
2635/* %not-for-header */
2636 static yy_state_type yy_get_previous_state (void)
2637/* %endif */
2638/* %if-c++-only */
2639/* %endif */
2640{
2641 yy_state_type yy_current_state;
2642 char *yy_cp;
2643
2644/* %% [15.0] code to get the start state into yy_current_state goes here */
2645 yy_current_state = (yy_start);
2646
2647 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2648 {
2649/* %% [16.0] code to find the next state goes here */
2650 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2651 if ( yy_accept[yy_current_state] )
2652 {
2653 (yy_last_accepting_state) = yy_current_state;
2654 (yy_last_accepting_cpos) = yy_cp;
2655 }
2656 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2657 {
2658 yy_current_state = (int) yy_def[yy_current_state];
2659 if ( yy_current_state >= 388 )
2660 yy_c = yy_meta[yy_c];
2661 }
2662 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2663 }
2664
2665 return yy_current_state;
2666}
2667
2668/* yy_try_NUL_trans - try to make a transition on the NUL character
2669 *
2670 * synopsis
2671 * next_state = yy_try_NUL_trans( current_state );
2672 */
2673/* %if-c-only */
2674 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2675/* %endif */
2676/* %if-c++-only */
2677/* %endif */
2678{
2679 int yy_is_jam;
2680 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2681 char *yy_cp = (yy_c_buf_p);
2682
2683 YY_CHAR yy_c = 1;
2684 if ( yy_accept[yy_current_state] )
2685 {
2686 (yy_last_accepting_state) = yy_current_state;
2687 (yy_last_accepting_cpos) = yy_cp;
2688 }
2689 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2690 {
2691 yy_current_state = (int) yy_def[yy_current_state];
2692 if ( yy_current_state >= 388 )
2693 yy_c = yy_meta[yy_c];
2694 }
2695 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2696 yy_is_jam = (yy_current_state == 387);
2697
2698 return yy_is_jam ? 0 : yy_current_state;
2699}
2700
2701#ifndef YY_NO_UNPUT
2702/* %if-c-only */
2703
2704/* %endif */
2705#endif
2706
2707/* %if-c-only */
2708#ifndef YY_NO_INPUT
2709#ifdef __cplusplus
2710 static int yyinput (void)
2711#else
2712 static int input (void)
2713#endif
2714
2715/* %endif */
2716/* %if-c++-only */
2717/* %endif */
2718{
2719 int c;
2720
2721 *(yy_c_buf_p) = (yy_hold_char);
2722
2723 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2724 {
2725 /* yy_c_buf_p now points to the character we want to return.
2726 * If this occurs *before* the EOB characters, then it's a
2727 * valid NUL; if not, then we've hit the end of the buffer.
2728 */
2729 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2730 /* This was really a NUL. */
2731 *(yy_c_buf_p) = '\0';
2732
2733 else
2734 { /* need more input */
2735 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2736 ++(yy_c_buf_p);
2737
2738 switch ( yy_get_next_buffer( ) )
2739 {
2740 case EOB_ACT_LAST_MATCH:
2741 /* This happens because yy_g_n_b()
2742 * sees that we've accumulated a
2743 * token and flags that we need to
2744 * try matching the token before
2745 * proceeding. But for input(),
2746 * there's no matching to consider.
2747 * So convert the EOB_ACT_LAST_MATCH
2748 * to EOB_ACT_END_OF_FILE.
2749 */
2750
2751 /* Reset buffer status. */
2752 yyrestart( yyin );
2753
2754 /*FALLTHROUGH*/
2755
2757 {
2758 if ( yywrap( ) )
2759 return 0;
2760
2761 if ( ! (yy_did_buffer_switch_on_eof) )
2763#ifdef __cplusplus
2764 return yyinput();
2765#else
2766 return input();
2767#endif
2768 }
2769
2771 (yy_c_buf_p) = (yytext_ptr) + offset;
2772 break;
2773 }
2774 }
2775 }
2776
2777 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2778 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2779 (yy_hold_char) = *++(yy_c_buf_p);
2780
2781/* %% [19.0] update BOL and yylineno */
2782
2783 return c;
2784}
2785/* %if-c-only */
2786#endif /* ifndef YY_NO_INPUT */
2787/* %endif */
2788
2794/* %if-c-only */
2795 void yyrestart (FILE * input_file )
2796/* %endif */
2797/* %if-c++-only */
2798/* %endif */
2799{
2800
2801 if ( ! YY_CURRENT_BUFFER ){
2805 }
2806
2807 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2809}
2810
2811/* %if-c++-only */
2812/* %endif */
2813
2818/* %if-c-only */
2820/* %endif */
2821/* %if-c++-only */
2822/* %endif */
2823{
2824
2825 /* TODO. We should be able to replace this entire function body
2826 * with
2827 * yypop_buffer_state();
2828 * yypush_buffer_state(new_buffer);
2829 */
2831 if ( YY_CURRENT_BUFFER == new_buffer )
2832 return;
2833
2834 if ( YY_CURRENT_BUFFER )
2835 {
2836 /* Flush out information for old buffer. */
2837 *(yy_c_buf_p) = (yy_hold_char);
2838 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2839 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2840 }
2841
2842 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2844
2845 /* We don't actually know whether we did this switch during
2846 * EOF (yywrap()) processing, but the only time this flag
2847 * is looked at is after yywrap() is called, so it's safe
2848 * to go ahead and always set it.
2849 */
2850 (yy_did_buffer_switch_on_eof) = 1;
2851}
2852
2853/* %if-c-only */
2854static void yy_load_buffer_state (void)
2855/* %endif */
2856/* %if-c++-only */
2857/* %endif */
2858{
2859 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2860 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2861/* %if-c-only */
2862 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2863/* %endif */
2864/* %if-c++-only */
2865/* %endif */
2866 (yy_hold_char) = *(yy_c_buf_p);
2867}
2868
2875/* %if-c-only */
2876 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2877/* %endif */
2878/* %if-c++-only */
2879/* %endif */
2880{
2882
2883 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2884 if ( ! b )
2885 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2886
2887 b->yy_buf_size = size;
2888
2889 /* yy_ch_buf has to be 2 characters longer than the size given because
2890 * we need to put in 2 end-of-buffer characters.
2891 */
2892 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
2893 if ( ! b->yy_ch_buf )
2894 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2895
2896 b->yy_is_our_buffer = 1;
2897
2898 yy_init_buffer( b, file );
2899
2900 return b;
2901}
2902
2903/* %if-c++-only */
2904/* %endif */
2905
2910/* %if-c-only */
2912/* %endif */
2913/* %if-c++-only */
2914/* %endif */
2915{
2916
2917 if ( ! b )
2918 return;
2919
2920 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2922
2923 if ( b->yy_is_our_buffer )
2924 yyfree( (void *) b->yy_ch_buf );
2925
2926 yyfree( (void *) b );
2927}
2928
2929/* Initializes or reinitializes a buffer.
2930 * This function is sometimes called more than once on the same buffer,
2931 * such as during a yyrestart() or at EOF.
2932 */
2933/* %if-c-only */
2934 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2935/* %endif */
2936/* %if-c++-only */
2937/* %endif */
2938
2939{
2940 int oerrno = errno;
2941
2942 yy_flush_buffer( b );
2943
2944/* %if-c-only */
2945 b->yy_input_file = file;
2946/* %endif */
2947/* %if-c++-only */
2948/* %endif */
2949 b->yy_fill_buffer = 1;
2950
2951 /* If b is the current buffer, then yy_init_buffer was _probably_
2952 * called from yyrestart() or through yy_get_next_buffer.
2953 * In that case, we don't want to reset the lineno or column.
2954 */
2955 if (b != YY_CURRENT_BUFFER){
2956 b->yy_bs_lineno = 1;
2957 b->yy_bs_column = 0;
2958 }
2959
2960/* %if-c-only */
2961
2962 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2963
2964/* %endif */
2965/* %if-c++-only */
2966/* %endif */
2967 errno = oerrno;
2968}
2969
2974/* %if-c-only */
2976/* %endif */
2977/* %if-c++-only */
2978/* %endif */
2979{
2980 if ( ! b )
2981 return;
2982
2983 b->yy_n_chars = 0;
2984
2985 /* We always need two end-of-buffer characters. The first causes
2986 * a transition to the end-of-buffer state. The second causes
2987 * a jam in that state.
2988 */
2991
2992 b->yy_buf_pos = &b->yy_ch_buf[0];
2993
2994 b->yy_at_bol = 1;
2996
2997 if ( b == YY_CURRENT_BUFFER )
2999}
3000
3001/* %if-c-or-c++ */
3008/* %if-c-only */
3010/* %endif */
3011/* %if-c++-only */
3012/* %endif */
3013{
3014 if (new_buffer == NULL)
3015 return;
3016
3018
3019 /* This block is copied from yy_switch_to_buffer. */
3020 if ( YY_CURRENT_BUFFER )
3021 {
3022 /* Flush out information for old buffer. */
3023 *(yy_c_buf_p) = (yy_hold_char);
3024 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3025 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3026 }
3027
3028 /* Only push if top exists. Otherwise, replace top. */
3030 (yy_buffer_stack_top)++;
3031 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3032
3033 /* copied from yy_switch_to_buffer. */
3035 (yy_did_buffer_switch_on_eof) = 1;
3036}
3037/* %endif */
3038
3039/* %if-c-or-c++ */
3044/* %if-c-only */
3045void yypop_buffer_state (void)
3046/* %endif */
3047/* %if-c++-only */
3048/* %endif */
3049{
3050 if (!YY_CURRENT_BUFFER)
3051 return;
3052
3055 if ((yy_buffer_stack_top) > 0)
3056 --(yy_buffer_stack_top);
3057
3058 if (YY_CURRENT_BUFFER) {
3060 (yy_did_buffer_switch_on_eof) = 1;
3061 }
3062}
3063/* %endif */
3064
3065/* %if-c-or-c++ */
3066/* Allocates the stack if it does not exist.
3067 * Guarantees space for at least one push.
3068 */
3069/* %if-c-only */
3070static void yyensure_buffer_stack (void)
3071/* %endif */
3072/* %if-c++-only */
3073/* %endif */
3074{
3075 yy_size_t num_to_alloc;
3076
3077 if (!(yy_buffer_stack)) {
3078
3079 /* First allocation is just for 2 elements, since we don't know if this
3080 * scanner will even need a stack. We use 2 instead of 1 to avoid an
3081 * immediate realloc on the next call.
3082 */
3083 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
3084 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
3085 (num_to_alloc * sizeof(struct yy_buffer_state*)
3086 );
3087 if ( ! (yy_buffer_stack) )
3088 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3089
3090 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3091
3092 (yy_buffer_stack_max) = num_to_alloc;
3093 (yy_buffer_stack_top) = 0;
3094 return;
3095 }
3096
3097 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3098
3099 /* Increase the buffer to prepare for a possible push. */
3100 yy_size_t grow_size = 8 /* arbitrary grow size */;
3101
3102 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3103 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
3104 ((yy_buffer_stack),
3105 num_to_alloc * sizeof(struct yy_buffer_state*)
3106 );
3107 if ( ! (yy_buffer_stack) )
3108 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3109
3110 /* zero only the new slots.*/
3111 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3112 (yy_buffer_stack_max) = num_to_alloc;
3113 }
3114}
3115/* %endif */
3116
3117/* %if-c-only */
3125{
3127
3128 if ( size < 2 ||
3129 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3130 base[size-1] != YY_END_OF_BUFFER_CHAR )
3131 /* They forgot to leave room for the EOB's. */
3132 return NULL;
3133
3134 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
3135 if ( ! b )
3136 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3137
3138 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
3139 b->yy_buf_pos = b->yy_ch_buf = base;
3140 b->yy_is_our_buffer = 0;
3141 b->yy_input_file = NULL;
3142 b->yy_n_chars = b->yy_buf_size;
3143 b->yy_is_interactive = 0;
3144 b->yy_at_bol = 1;
3145 b->yy_fill_buffer = 0;
3147
3149
3150 return b;
3151}
3152/* %endif */
3153
3154/* %if-c-only */
3163YY_BUFFER_STATE yy_scan_string (const char * yystr )
3164{
3165
3166 return yy_scan_bytes( yystr, (int) strlen(yystr) );
3167}
3168/* %endif */
3169
3170/* %if-c-only */
3178YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
3179{
3181 char *buf;
3182 yy_size_t n;
3183 int i;
3184
3185 /* Get memory for full buffer, including space for trailing EOB's. */
3186 n = (yy_size_t) (_yybytes_len + 2);
3187 buf = (char *) yyalloc( n );
3188 if ( ! buf )
3189 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3190
3191 for ( i = 0; i < _yybytes_len; ++i )
3192 buf[i] = yybytes[i];
3193
3194 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3195
3196 b = yy_scan_buffer( buf, n );
3197 if ( ! b )
3198 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3199
3200 /* It's okay to grow etc. this buffer, and we should throw it
3201 * away when we're done.
3202 */
3203 b->yy_is_our_buffer = 1;
3204
3205 return b;
3206}
3207/* %endif */
3208
3209#ifndef YY_EXIT_FAILURE
3210#define YY_EXIT_FAILURE 2
3211#endif
3212
3213/* %if-c-only */
3214static void yynoreturn yy_fatal_error (const char* msg )
3215{
3216 fprintf( stderr, "%s\n", msg );
3217 exit( YY_EXIT_FAILURE );
3218}
3219/* %endif */
3220/* %if-c++-only */
3221/* %endif */
3222
3223/* Redefine yyless() so it works in section 3 code. */
3224
3225#undef yyless
3226#define yyless(n) \
3227 do \
3228 { \
3229 /* Undo effects of setting up yytext. */ \
3230 int yyless_macro_arg = (n); \
3231 YY_LESS_LINENO(yyless_macro_arg);\
3232 yytext[yyleng] = (yy_hold_char); \
3233 (yy_c_buf_p) = yytext + yyless_macro_arg; \
3234 (yy_hold_char) = *(yy_c_buf_p); \
3235 *(yy_c_buf_p) = '\0'; \
3236 yyleng = yyless_macro_arg; \
3237 } \
3238 while ( 0 )
3239
3240/* Accessor methods (get/set functions) to struct members. */
3241
3242/* %if-c-only */
3243/* %if-reentrant */
3244/* %endif */
3245
3249int yyget_lineno (void)
3250{
3251
3252 return yylineno;
3253}
3254
3258FILE *yyget_in (void)
3259{
3260 return yyin;
3261}
3262
3266FILE *yyget_out (void)
3267{
3268 return yyout;
3269}
3270
3274int yyget_leng (void)
3275{
3276 return yyleng;
3277}
3278
3283char *yyget_text (void)
3284{
3285 return yytext;
3286}
3287
3288/* %if-reentrant */
3289/* %endif */
3290
3295void yyset_lineno (int _line_number )
3296{
3297
3298 yylineno = _line_number;
3299}
3300
3307void yyset_in (FILE * _in_str )
3308{
3309 yyin = _in_str ;
3310}
3311
3312void yyset_out (FILE * _out_str )
3313{
3314 yyout = _out_str ;
3315}
3316
3317int yyget_debug (void)
3318{
3319 return yy_flex_debug;
3320}
3321
3322void yyset_debug (int _bdebug )
3323{
3324 yy_flex_debug = _bdebug ;
3325}
3326
3327/* %endif */
3328
3329/* %if-reentrant */
3330/* %if-bison-bridge */
3331/* %endif */
3332/* %endif if-c-only */
3333
3334/* %if-c-only */
3335static int yy_init_globals (void)
3336{
3337 /* Initialization is the same as for the non-reentrant scanner.
3338 * This function is called from yylex_destroy(), so don't allocate here.
3339 */
3340
3341 (yy_buffer_stack) = NULL;
3342 (yy_buffer_stack_top) = 0;
3343 (yy_buffer_stack_max) = 0;
3344 (yy_c_buf_p) = NULL;
3345 (yy_init) = 0;
3346 (yy_start) = 0;
3347
3348/* Defined in main.c */
3349#ifdef YY_STDINIT
3350 yyin = stdin;
3351 yyout = stdout;
3352#else
3353 yyin = NULL;
3354 yyout = NULL;
3355#endif
3356
3357 /* For future reference: Set errno on error, since we are called by
3358 * yylex_init()
3359 */
3360 return 0;
3361}
3362/* %endif */
3363
3364/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
3365/* yylex_destroy is for both reentrant and non-reentrant scanners. */
3366int yylex_destroy (void)
3367{
3368
3369 /* Pop the buffer stack, destroying each element. */
3370 while(YY_CURRENT_BUFFER){
3374 }
3375
3376 /* Destroy the stack itself. */
3377 yyfree((yy_buffer_stack) );
3378 (yy_buffer_stack) = NULL;
3379
3380 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3381 * yylex() is called, initialization will occur. */
3382 yy_init_globals( );
3383
3384/* %if-reentrant */
3385/* %endif */
3386 return 0;
3387}
3388/* %endif */
3389
3390/*
3391 * Internal utility routines.
3392 */
3393
3394#ifndef yytext_ptr
3395static void yy_flex_strncpy (char* s1, const char * s2, int n )
3396{
3397
3398 int i;
3399 for ( i = 0; i < n; ++i )
3400 s1[i] = s2[i];
3401}
3402#endif
3403
3404#ifdef YY_NEED_STRLEN
3405static int yy_flex_strlen (const char * s )
3406{
3407 int n;
3408 for ( n = 0; s[n]; ++n )
3409 ;
3410
3411 return n;
3412}
3413#endif
3414
3415void *yyalloc (yy_size_t size )
3416{
3417 return malloc(size);
3418}
3419
3420void *yyrealloc (void * ptr, yy_size_t size )
3421{
3422
3423 /* The cast to (char *) in the following accommodates both
3424 * implementations that use char* generic pointers, and those
3425 * that use void* generic pointers. It works with the latter
3426 * because both ANSI C and C++ allow castless assignment from
3427 * any pointer type to void*, and deal with argument conversions
3428 * as though doing an assignment.
3429 */
3430 return realloc(ptr, size);
3431}
3432
3433void yyfree (void * ptr )
3434{
3435 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3436}
3437
3438/* %if-tables-serialization definitions */
3439/* %define-yytables The name for this specific scanner's tables. */
3440#define YYTABLES_NAME "yytables"
3441/* %endif */
3442
3443/* %ok-for-header */
3444
3445#line 709 "d2_lexer.ll"
3446
3447
3448using namespace isc::dhcp;
3449
3450void
3451D2ParserContext::scanStringBegin(const std::string& str, ParserType parser_type)
3452{
3453 start_token_flag = true;
3454 start_token_value = parser_type;
3455
3456 file_ = "<string>";
3457 sfile_ = 0;
3458 loc_.initialize(&file_);
3459 yy_flex_debug = trace_scanning_;
3460 YY_BUFFER_STATE buffer;
3461 buffer = d2_parser__scan_bytes(str.c_str(), str.size());
3462 if (!buffer) {
3463 fatal("cannot scan string");
3464 /* fatal() throws an exception so this can't be reached */
3465 }
3466}
3467
3468void
3470 const std::string& filename,
3471 ParserType parser_type)
3472{
3473 start_token_flag = true;
3474 start_token_value = parser_type;
3475
3476 file_ = filename;
3477 sfile_ = f;
3478 loc_.initialize(&file_);
3479 yy_flex_debug = trace_scanning_;
3480 YY_BUFFER_STATE buffer;
3481
3482 /* See d2_lexer.cc header for available definitions */
3483 buffer = d2_parser__create_buffer(f, 65536 /*buffer size*/);
3484 if (!buffer) {
3485 fatal("cannot scan file " + filename);
3486 }
3487 d2_parser__switch_to_buffer(buffer);
3488}
3489
3490void
3492 if (sfile_)
3493 fclose(sfile_);
3494 sfile_ = 0;
3495 static_cast<void>(d2_parser_lex_destroy());
3496 /* Close files */
3497 while (!sfiles_.empty()) {
3498 FILE* f = sfiles_.back();
3499 if (f) {
3500 fclose(f);
3501 }
3502 sfiles_.pop_back();
3503 }
3504 /* Delete states */
3505 while (!states_.empty()) {
3506 d2_parser__delete_buffer(states_.back());
3507 states_.pop_back();
3508 }
3509}
3510
3511void
3512D2ParserContext::includeFile(const std::string& filename) {
3513 if (states_.size() > 10) {
3514 fatal("Too many nested include.");
3515 }
3516
3517 FILE* f = fopen(filename.c_str(), "r");
3518 if (!f) {
3519 fatal("Can't open include file " + filename);
3520 }
3521 if (sfile_) {
3522 sfiles_.push_back(sfile_);
3523 }
3524 sfile_ = f;
3525 states_.push_back(YY_CURRENT_BUFFER);
3526 YY_BUFFER_STATE buffer;
3527 buffer = d2_parser__create_buffer(f, 65536 /*buffer size*/);
3528 if (!buffer) {
3529 fatal( "Can't scan include file " + filename);
3530 }
3531 d2_parser__switch_to_buffer(buffer);
3532 files_.push_back(file_);
3533 file_ = filename;
3534 locs_.push_back(loc_);
3535 loc_.initialize(&file_);
3536
3537 BEGIN(INITIAL);
3538}
3539
3540namespace {
3542class Dummy {
3543 /* cppcheck-suppress unusedPrivateFunction */
3544 void dummy() { yy_fatal_error("Fix me: how to disable its definition?"); }
3545};
3546}
3547#endif /* !__clang_analyzer__ */
3548
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:3512
@ DDNS_DOMAIN
Used while parsing a list of ddns-domains.
@ DNS_SERVERS
Used while parsing content of Logging.
@ 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 Logging/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 Logging/loggers structures.
@ 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:3451
void scanFileBegin(FILE *f, const std::string &filename, ParserType type)
Method called before scanning starts on a file.
Definition: d2_lexer.cc:3469
std::vector< isc::d2::location > locs_
Location stack.
std::vector< struct yy_buffer_state * > states_
Lexer state stack.
static void fatal(const std::string &what)
Fatal error handler.
std::vector< std::string > files_
File name stack.
void scanEnd()
Method called after the last tokens are scanned.
Definition: d2_lexer.cc:3491
static symbol_type make_DHCP6(YY_COPY(location_type) l)
Definition: d2_parser.h:1580
static symbol_type make_SUB_DHCPDDNS(YY_COPY(location_type) l)
Definition: d2_parser.h:1832
static symbol_type make_FLUSH(YY_COPY(location_type) l)
Definition: d2_parser.h:1797
static symbol_type make_SUB_DDNS_DOMAIN(YY_COPY(location_type) l)
Definition: d2_parser.h:1853
static symbol_type make_NULL_TYPE(YY_COPY(location_type) l)
Definition: d2_parser.h:1573
static symbol_type make_UDP(YY_COPY(location_type) l)
Definition: d2_parser.h:1636
static symbol_type make_LCURLY_BRACKET(YY_COPY(location_type) l)
Definition: d2_parser.h:1559
static symbol_type make_RSQUARE_BRACKET(YY_COPY(location_type) l)
Definition: d2_parser.h:1552
static symbol_type make_LSQUARE_BRACKET(YY_COPY(location_type) l)
Definition: d2_parser.h:1545
static symbol_type make_DDNS_DOMAINS(YY_COPY(location_type) l)
Definition: d2_parser.h:1692
static symbol_type make_HOSTNAME(YY_COPY(location_type) l)
Definition: d2_parser.h:1713
static symbol_type make_CONTROL_AGENT(YY_COPY(location_type) l)
Definition: d2_parser.h:1594
static symbol_type make_DHCPDDNS(YY_COPY(location_type) l)
Definition: d2_parser.h:1601
static symbol_type make_PORT(YY_COPY(location_type) l)
Definition: d2_parser.h:1615
static symbol_type make_TOPLEVEL_DHCPDDNS(YY_COPY(location_type) l)
Definition: d2_parser.h:1825
static symbol_type make_IP_ADDRESS(YY_COPY(location_type) l)
Definition: d2_parser.h:1608
static symbol_type make_TSIG_KEYS(YY_COPY(location_type) l)
Definition: d2_parser.h:1720
static symbol_type make_OUTPUT(YY_COPY(location_type) l)
Definition: d2_parser.h:1776
static symbol_type make_COMMENT(YY_COPY(location_type) l)
Definition: d2_parser.h:1671
static symbol_type make_USER_CONTEXT(YY_COPY(location_type) l)
Definition: d2_parser.h:1664
static symbol_type make_FORWARD_DDNS(YY_COPY(location_type) l)
Definition: d2_parser.h:1678
static symbol_type make_DHCP4(YY_COPY(location_type) l)
Definition: d2_parser.h:1587
static symbol_type make_BOOLEAN(YY_COPY(bool) v, YY_COPY(location_type) l)
Definition: d2_parser.h:1902
static symbol_type make_DNS_SERVER_TIMEOUT(YY_COPY(location_type) l)
Definition: d2_parser.h:1622
static symbol_type make_LOGGERS(YY_COPY(location_type) l)
Definition: d2_parser.h:1755
static symbol_type make_SECRET(YY_COPY(location_type) l)
Definition: d2_parser.h:1741
static symbol_type make_SUB_DNS_SERVER(YY_COPY(location_type) l)
Definition: d2_parser.h:1867
static symbol_type make_COLON(YY_COPY(location_type) l)
Definition: d2_parser.h:1538
static symbol_type make_COMMA(YY_COPY(location_type) l)
Definition: d2_parser.h:1531
static symbol_type make_ALGORITHM(YY_COPY(location_type) l)
Definition: d2_parser.h:1727
static symbol_type make_NCR_PROTOCOL(YY_COPY(location_type) l)
Definition: d2_parser.h:1629
static symbol_type make_JSON(YY_COPY(location_type) l)
Definition: d2_parser.h:1657
static symbol_type make_DEBUGLEVEL(YY_COPY(location_type) l)
Definition: d2_parser.h:1783
static symbol_type make_SUB_TSIG_KEY(YY_COPY(location_type) l)
Definition: d2_parser.h:1839
static symbol_type make_SUB_TSIG_KEYS(YY_COPY(location_type) l)
Definition: d2_parser.h:1846
static symbol_type make_LOGGING(YY_COPY(location_type) l)
Definition: d2_parser.h:1748
static symbol_type make_DNS_SERVERS(YY_COPY(location_type) l)
Definition: d2_parser.h:1706
static symbol_type make_KEY_NAME(YY_COPY(location_type) l)
Definition: d2_parser.h:1699
static symbol_type make_MAXSIZE(YY_COPY(location_type) l)
Definition: d2_parser.h:1804
static symbol_type make_RCURLY_BRACKET(YY_COPY(location_type) l)
Definition: d2_parser.h:1566
static symbol_type make_NCR_FORMAT(YY_COPY(location_type) l)
Definition: d2_parser.h:1650
static symbol_type make_INTEGER(YY_COPY(int64_t) v, YY_COPY(location_type) l)
Definition: d2_parser.h:1888
static symbol_type make_MAXVER(YY_COPY(location_type) l)
Definition: d2_parser.h:1811
static symbol_type make_NAME(YY_COPY(location_type) l)
Definition: d2_parser.h:1762
static symbol_type make_DIGEST_BITS(YY_COPY(location_type) l)
Definition: d2_parser.h:1734
static symbol_type make_END(YY_COPY(location_type) l)
Definition: d2_parser.h:1524
static symbol_type make_SEVERITY(YY_COPY(location_type) l)
Definition: d2_parser.h:1790
static symbol_type make_OUTPUT_OPTIONS(YY_COPY(location_type) l)
Definition: d2_parser.h:1769
static symbol_type make_SUB_DDNS_DOMAINS(YY_COPY(location_type) l)
Definition: d2_parser.h:1860
static symbol_type make_TOPLEVEL_JSON(YY_COPY(location_type) l)
Definition: d2_parser.h:1818
static symbol_type make_TCP(YY_COPY(location_type) l)
Definition: d2_parser.h:1643
static symbol_type make_REVERSE_DDNS(YY_COPY(location_type) l)
Definition: d2_parser.h:1685
static symbol_type make_FLOAT(YY_COPY(double) v, YY_COPY(location_type) l)
Definition: d2_parser.h:1895
static symbol_type make_STRING(YY_COPY(std::string) v, YY_COPY(location_type) l)
Definition: d2_parser.h:1881
#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:1161
#define yyrestart
Definition: d2_lexer.cc:30
#define yyset_debug
Definition: d2_lexer.cc:164
#define YY_EXTRA_TYPE
Definition: d2_lexer.cc:1179
#define DIR_INCLUDE
Definition: d2_lexer.cc:1163
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:1388
#define yynoreturn
Definition: d2_lexer.cc:388
#define yyget_debug
Definition: d2_lexer.cc:158
int yy_act
Definition: d2_lexer.cc:1402
#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:1089
#define yyget_leng
Get the length of the current token.
Definition: d2_lexer.cc:206
#define yywrap
Definition: d2_lexer.cc:1118
#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:1401
#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:1088
#define YY_RULE_SETUP
Definition: d2_lexer.cc:1392
#define yy_scan_string
Definition: d2_lexer.cc:15
#define DIR_EXIT
Definition: d2_lexer.cc:1164
#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:1160
#define yyget_extra
Definition: d2_lexer.cc:170
char * yy_bp
Definition: d2_lexer.cc:1401
#define yyin
Definition: d2_lexer.cc:25
#define YY_READ_BUF_SIZE
Definition: d2_lexer.cc:1276
#define YY_INPUT(buf, result, max_size)
Definition: d2_lexer.cc:1296
#define ECHO
Definition: d2_lexer.cc:1286
#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:1130
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:1373
#define YY_BUF_SIZE
Definition: d2_lexer.cc:436
#define YY_EXIT_FAILURE
Definition: d2_lexer.cc:3210
#define YY_SC_TO_UI(c)
Definition: d2_lexer.cc:400
#define DIR_ENTER
Definition: d2_lexer.cc:1162
#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.
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