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