Merge topic 'vs-framework-references'
[kiteware-cmake.git] / Source / LexerParser / cmExprLexer.cxx
blob5a76590a1a57c8ec15cc9714564b67d23b9a0825
1 #include "cmStandardLexer.h"
3 #define FLEXINT_H 1
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 6
11 #define YY_FLEX_SUBMINOR_VERSION 4
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
16 #ifdef yy_create_buffer
17 #define cmExpr_yy_create_buffer_ALREADY_DEFINED
18 #else
19 #define yy_create_buffer cmExpr_yy_create_buffer
20 #endif
22 #ifdef yy_delete_buffer
23 #define cmExpr_yy_delete_buffer_ALREADY_DEFINED
24 #else
25 #define yy_delete_buffer cmExpr_yy_delete_buffer
26 #endif
28 #ifdef yy_scan_buffer
29 #define cmExpr_yy_scan_buffer_ALREADY_DEFINED
30 #else
31 #define yy_scan_buffer cmExpr_yy_scan_buffer
32 #endif
34 #ifdef yy_scan_string
35 #define cmExpr_yy_scan_string_ALREADY_DEFINED
36 #else
37 #define yy_scan_string cmExpr_yy_scan_string
38 #endif
40 #ifdef yy_scan_bytes
41 #define cmExpr_yy_scan_bytes_ALREADY_DEFINED
42 #else
43 #define yy_scan_bytes cmExpr_yy_scan_bytes
44 #endif
46 #ifdef yy_init_buffer
47 #define cmExpr_yy_init_buffer_ALREADY_DEFINED
48 #else
49 #define yy_init_buffer cmExpr_yy_init_buffer
50 #endif
52 #ifdef yy_flush_buffer
53 #define cmExpr_yy_flush_buffer_ALREADY_DEFINED
54 #else
55 #define yy_flush_buffer cmExpr_yy_flush_buffer
56 #endif
58 #ifdef yy_load_buffer_state
59 #define cmExpr_yy_load_buffer_state_ALREADY_DEFINED
60 #else
61 #define yy_load_buffer_state cmExpr_yy_load_buffer_state
62 #endif
64 #ifdef yy_switch_to_buffer
65 #define cmExpr_yy_switch_to_buffer_ALREADY_DEFINED
66 #else
67 #define yy_switch_to_buffer cmExpr_yy_switch_to_buffer
68 #endif
70 #ifdef yypush_buffer_state
71 #define cmExpr_yypush_buffer_state_ALREADY_DEFINED
72 #else
73 #define yypush_buffer_state cmExpr_yypush_buffer_state
74 #endif
76 #ifdef yypop_buffer_state
77 #define cmExpr_yypop_buffer_state_ALREADY_DEFINED
78 #else
79 #define yypop_buffer_state cmExpr_yypop_buffer_state
80 #endif
82 #ifdef yyensure_buffer_stack
83 #define cmExpr_yyensure_buffer_stack_ALREADY_DEFINED
84 #else
85 #define yyensure_buffer_stack cmExpr_yyensure_buffer_stack
86 #endif
88 #ifdef yylex
89 #define cmExpr_yylex_ALREADY_DEFINED
90 #else
91 #define yylex cmExpr_yylex
92 #endif
94 #ifdef yyrestart
95 #define cmExpr_yyrestart_ALREADY_DEFINED
96 #else
97 #define yyrestart cmExpr_yyrestart
98 #endif
100 #ifdef yylex_init
101 #define cmExpr_yylex_init_ALREADY_DEFINED
102 #else
103 #define yylex_init cmExpr_yylex_init
104 #endif
106 #ifdef yylex_init_extra
107 #define cmExpr_yylex_init_extra_ALREADY_DEFINED
108 #else
109 #define yylex_init_extra cmExpr_yylex_init_extra
110 #endif
112 #ifdef yylex_destroy
113 #define cmExpr_yylex_destroy_ALREADY_DEFINED
114 #else
115 #define yylex_destroy cmExpr_yylex_destroy
116 #endif
118 #ifdef yyget_debug
119 #define cmExpr_yyget_debug_ALREADY_DEFINED
120 #else
121 #define yyget_debug cmExpr_yyget_debug
122 #endif
124 #ifdef yyset_debug
125 #define cmExpr_yyset_debug_ALREADY_DEFINED
126 #else
127 #define yyset_debug cmExpr_yyset_debug
128 #endif
130 #ifdef yyget_extra
131 #define cmExpr_yyget_extra_ALREADY_DEFINED
132 #else
133 #define yyget_extra cmExpr_yyget_extra
134 #endif
136 #ifdef yyset_extra
137 #define cmExpr_yyset_extra_ALREADY_DEFINED
138 #else
139 #define yyset_extra cmExpr_yyset_extra
140 #endif
142 #ifdef yyget_in
143 #define cmExpr_yyget_in_ALREADY_DEFINED
144 #else
145 #define yyget_in cmExpr_yyget_in
146 #endif
148 #ifdef yyset_in
149 #define cmExpr_yyset_in_ALREADY_DEFINED
150 #else
151 #define yyset_in cmExpr_yyset_in
152 #endif
154 #ifdef yyget_out
155 #define cmExpr_yyget_out_ALREADY_DEFINED
156 #else
157 #define yyget_out cmExpr_yyget_out
158 #endif
160 #ifdef yyset_out
161 #define cmExpr_yyset_out_ALREADY_DEFINED
162 #else
163 #define yyset_out cmExpr_yyset_out
164 #endif
166 #ifdef yyget_leng
167 #define cmExpr_yyget_leng_ALREADY_DEFINED
168 #else
169 #define yyget_leng cmExpr_yyget_leng
170 #endif
172 #ifdef yyget_text
173 #define cmExpr_yyget_text_ALREADY_DEFINED
174 #else
175 #define yyget_text cmExpr_yyget_text
176 #endif
178 #ifdef yyget_lineno
179 #define cmExpr_yyget_lineno_ALREADY_DEFINED
180 #else
181 #define yyget_lineno cmExpr_yyget_lineno
182 #endif
184 #ifdef yyset_lineno
185 #define cmExpr_yyset_lineno_ALREADY_DEFINED
186 #else
187 #define yyset_lineno cmExpr_yyset_lineno
188 #endif
190 #ifdef yyget_column
191 #define cmExpr_yyget_column_ALREADY_DEFINED
192 #else
193 #define yyget_column cmExpr_yyget_column
194 #endif
196 #ifdef yyset_column
197 #define cmExpr_yyset_column_ALREADY_DEFINED
198 #else
199 #define yyset_column cmExpr_yyset_column
200 #endif
202 #ifdef yywrap
203 #define cmExpr_yywrap_ALREADY_DEFINED
204 #else
205 #define yywrap cmExpr_yywrap
206 #endif
208 #ifdef yyalloc
209 #define cmExpr_yyalloc_ALREADY_DEFINED
210 #else
211 #define yyalloc cmExpr_yyalloc
212 #endif
214 #ifdef yyrealloc
215 #define cmExpr_yyrealloc_ALREADY_DEFINED
216 #else
217 #define yyrealloc cmExpr_yyrealloc
218 #endif
220 #ifdef yyfree
221 #define cmExpr_yyfree_ALREADY_DEFINED
222 #else
223 #define yyfree cmExpr_yyfree
224 #endif
226 /* First, we deal with platform-specific or compiler-specific issues. */
228 /* begin standard C headers. */
229 #include <stdio.h>
230 #include <string.h>
231 #include <errno.h>
232 #include <stdlib.h>
234 /* end standard C headers. */
236 /* flex integer type definitions */
238 #ifndef FLEXINT_H
239 #define FLEXINT_H
241 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
243 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
245 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
246 * if you want the limit (max/min) macros for int types.
248 #ifndef __STDC_LIMIT_MACROS
249 #define __STDC_LIMIT_MACROS 1
250 #endif
252 #include <inttypes.h>
253 typedef int8_t flex_int8_t;
254 typedef uint8_t flex_uint8_t;
255 typedef int16_t flex_int16_t;
256 typedef uint16_t flex_uint16_t;
257 typedef int32_t flex_int32_t;
258 typedef uint32_t flex_uint32_t;
259 #else
260 typedef signed char flex_int8_t;
261 typedef short int flex_int16_t;
262 typedef int flex_int32_t;
263 typedef unsigned char flex_uint8_t;
264 typedef unsigned short int flex_uint16_t;
265 typedef unsigned int flex_uint32_t;
267 /* Limits of integral types. */
268 #ifndef INT8_MIN
269 #define INT8_MIN (-128)
270 #endif
271 #ifndef INT16_MIN
272 #define INT16_MIN (-32767-1)
273 #endif
274 #ifndef INT32_MIN
275 #define INT32_MIN (-2147483647-1)
276 #endif
277 #ifndef INT8_MAX
278 #define INT8_MAX (127)
279 #endif
280 #ifndef INT16_MAX
281 #define INT16_MAX (32767)
282 #endif
283 #ifndef INT32_MAX
284 #define INT32_MAX (2147483647)
285 #endif
286 #ifndef UINT8_MAX
287 #define UINT8_MAX (255U)
288 #endif
289 #ifndef UINT16_MAX
290 #define UINT16_MAX (65535U)
291 #endif
292 #ifndef UINT32_MAX
293 #define UINT32_MAX (4294967295U)
294 #endif
296 #ifndef SIZE_MAX
297 #define SIZE_MAX (~(size_t)0)
298 #endif
300 #endif /* ! C99 */
302 #endif /* ! FLEXINT_H */
304 /* begin standard C++ headers. */
306 /* TODO: this is always defined, so inline it */
307 #define yyconst const
309 #if defined(__GNUC__) && __GNUC__ >= 3
310 #define yynoreturn __attribute__((__noreturn__))
311 #else
312 #define yynoreturn
313 #endif
315 /* Returned upon end-of-file. */
316 #define YY_NULL 0
318 /* Promotes a possibly negative, possibly signed char to an
319 * integer in range [0..255] for use as an array index.
321 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
323 /* An opaque pointer. */
324 #ifndef YY_TYPEDEF_YY_SCANNER_T
325 #define YY_TYPEDEF_YY_SCANNER_T
326 typedef void* yyscan_t;
327 #endif
329 /* For convenience, these vars (plus the bison vars far below)
330 are macros in the reentrant scanner. */
331 #define yyin yyg->yyin_r
332 #define yyout yyg->yyout_r
333 #define yyextra yyg->yyextra_r
334 #define yyleng yyg->yyleng_r
335 #define yytext yyg->yytext_r
336 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
337 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
338 #define yy_flex_debug yyg->yy_flex_debug_r
340 /* Enter a start condition. This macro really ought to take a parameter,
341 * but we do it the disgusting crufty way forced on us by the ()-less
342 * definition of BEGIN.
344 #define BEGIN yyg->yy_start = 1 + 2 *
345 /* Translate the current start state into a value that can be later handed
346 * to BEGIN to return to the state. The YYSTATE alias is for lex
347 * compatibility.
349 #define YY_START ((yyg->yy_start - 1) / 2)
350 #define YYSTATE YY_START
351 /* Action number for EOF rule of a given start state. */
352 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
353 /* Special action meaning "start processing a new file". */
354 #define YY_NEW_FILE yyrestart( yyin , yyscanner )
355 #define YY_END_OF_BUFFER_CHAR 0
357 /* Size of default input buffer. */
358 #ifndef YY_BUF_SIZE
359 #ifdef __ia64__
360 /* On IA-64, the buffer size is 16k, not 8k.
361 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
362 * Ditto for the __ia64__ case accordingly.
364 #define YY_BUF_SIZE 32768
365 #else
366 #define YY_BUF_SIZE 16384
367 #endif /* __ia64__ */
368 #endif
370 /* The state buf must be large enough to hold one state per character in the main buffer.
372 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
374 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
375 #define YY_TYPEDEF_YY_BUFFER_STATE
376 typedef struct yy_buffer_state *YY_BUFFER_STATE;
377 #endif
379 #ifndef YY_TYPEDEF_YY_SIZE_T
380 #define YY_TYPEDEF_YY_SIZE_T
381 typedef size_t yy_size_t;
382 #endif
384 #define EOB_ACT_CONTINUE_SCAN 0
385 #define EOB_ACT_END_OF_FILE 1
386 #define EOB_ACT_LAST_MATCH 2
388 #define YY_LESS_LINENO(n)
389 #define YY_LINENO_REWIND_TO(ptr)
391 /* Return all but the first "n" matched characters back to the input stream. */
392 #define yyless(n) \
393 do \
395 /* Undo effects of setting up yytext. */ \
396 int yyless_macro_arg = (n); \
397 YY_LESS_LINENO(yyless_macro_arg);\
398 *yy_cp = yyg->yy_hold_char; \
399 YY_RESTORE_YY_MORE_OFFSET \
400 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
401 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
403 while ( 0 )
404 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
406 #ifndef YY_STRUCT_YY_BUFFER_STATE
407 #define YY_STRUCT_YY_BUFFER_STATE
408 struct yy_buffer_state
410 FILE *yy_input_file;
412 char *yy_ch_buf; /* input buffer */
413 char *yy_buf_pos; /* current position in input buffer */
415 /* Size of input buffer in bytes, not including room for EOB
416 * characters.
418 int yy_buf_size;
420 /* Number of characters read into yy_ch_buf, not including EOB
421 * characters.
423 int yy_n_chars;
425 /* Whether we "own" the buffer - i.e., we know we created it,
426 * and can realloc() it to grow it, and should free() it to
427 * delete it.
429 int yy_is_our_buffer;
431 /* Whether this is an "interactive" input source; if so, and
432 * if we're using stdio for input, then we want to use getc()
433 * instead of fread(), to make sure we stop fetching input after
434 * each newline.
436 int yy_is_interactive;
438 /* Whether we're considered to be at the beginning of a line.
439 * If so, '^' rules will be active on the next match, otherwise
440 * not.
442 int yy_at_bol;
444 int yy_bs_lineno; /**< The line count. */
445 int yy_bs_column; /**< The column count. */
447 /* Whether to try to fill the input buffer when we reach the
448 * end of it.
450 int yy_fill_buffer;
452 int yy_buffer_status;
454 #define YY_BUFFER_NEW 0
455 #define YY_BUFFER_NORMAL 1
456 /* When an EOF's been seen but there's still some text to process
457 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
458 * shouldn't try reading from the input source any more. We might
459 * still have a bunch of tokens to match, though, because of
460 * possible backing-up.
462 * When we actually see the EOF, we change the status to "new"
463 * (via yyrestart()), so that the user can continue scanning by
464 * just pointing yyin at a new input file.
466 #define YY_BUFFER_EOF_PENDING 2
469 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
471 /* We provide macros for accessing buffer states in case in the
472 * future we want to put the buffer states in a more general
473 * "scanner state".
475 * Returns the top of the stack, or NULL.
477 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
478 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
479 : NULL)
480 /* Same as previous macro, but useful when we know that the buffer stack is not
481 * NULL or when we need an lvalue. For internal use only.
483 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
485 void yyrestart ( FILE *input_file , yyscan_t yyscanner );
486 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
487 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
488 void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
489 void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
490 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
491 void yypop_buffer_state ( yyscan_t yyscanner );
493 static void yyensure_buffer_stack ( yyscan_t yyscanner );
494 static void yy_load_buffer_state ( yyscan_t yyscanner );
495 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
496 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
498 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
499 YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
500 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
502 void *yyalloc ( yy_size_t , yyscan_t yyscanner );
503 void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
504 void yyfree ( void * , yyscan_t yyscanner );
506 #define yy_new_buffer yy_create_buffer
507 #define yy_set_interactive(is_interactive) \
509 if ( ! YY_CURRENT_BUFFER ){ \
510 yyensure_buffer_stack (yyscanner); \
511 YY_CURRENT_BUFFER_LVALUE = \
512 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
514 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
516 #define yy_set_bol(at_bol) \
518 if ( ! YY_CURRENT_BUFFER ){\
519 yyensure_buffer_stack (yyscanner); \
520 YY_CURRENT_BUFFER_LVALUE = \
521 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
523 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
525 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
527 /* Begin user sect3 */
529 #define cmExpr_yywrap(yyscanner) (/*CONSTCOND*/1)
530 #define YY_SKIP_YYWRAP
531 typedef flex_uint8_t YY_CHAR;
533 typedef int yy_state_type;
535 #define yytext_ptr yytext_r
537 static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
538 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
539 static int yy_get_next_buffer ( yyscan_t yyscanner );
540 static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
542 /* Done after the current pattern has been matched and before the
543 * corresponding action - sets up yytext.
545 #define YY_DO_BEFORE_ACTION \
546 yyg->yytext_ptr = yy_bp; \
547 yyleng = (int) (yy_cp - yy_bp); \
548 yyg->yy_hold_char = *yy_cp; \
549 *yy_cp = '\0'; \
550 yyg->yy_c_buf_p = yy_cp;
551 #define YY_NUM_RULES 18
552 #define YY_END_OF_BUFFER 19
553 /* This struct is not used in this scanner,
554 but its presence is necessary. */
555 struct yy_trans_info
557 flex_int32_t yy_verify;
558 flex_int32_t yy_nxt;
560 static const flex_int16_t yy_accept[29] =
561 { 0,
562 0, 0, 19, 17, 1, 18, 8, 10, 15, 16,
563 6, 4, 5, 7, 2, 2, 17, 17, 11, 9,
564 12, 2, 0, 13, 14, 3, 3, 0
567 static const YY_CHAR yy_ec[256] =
568 { 0,
569 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
570 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
571 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
572 1, 2, 1, 1, 1, 1, 4, 5, 1, 6,
573 7, 8, 9, 1, 10, 1, 11, 12, 13, 13,
574 13, 13, 13, 13, 13, 13, 13, 1, 1, 14,
575 1, 15, 1, 1, 16, 16, 16, 16, 16, 16,
576 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
577 1, 1, 1, 1, 1, 1, 1, 17, 1, 1,
578 1, 1, 1, 18, 1, 1, 16, 16, 16, 16,
580 16, 16, 1, 1, 1, 1, 1, 1, 1, 1,
581 1, 1, 1, 1, 1, 1, 1, 1, 1, 17,
582 1, 1, 1, 19, 1, 20, 1, 1, 1, 1,
583 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
584 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
585 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
586 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
587 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
588 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
589 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
591 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
592 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
593 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
594 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
595 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
596 1, 1, 1, 1, 1
599 static const YY_CHAR yy_meta[21] =
600 { 0,
601 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 1, 2, 2, 1, 1, 3, 4, 1, 1, 1
605 static const flex_int16_t yy_base[32] =
606 { 0,
607 0, 0, 34, 35, 35, 35, 35, 35, 35, 35,
608 35, 35, 35, 35, 16, 9, 18, 11, 35, 35,
609 35, 11, 0, 35, 35, 0, 0, 35, 23, 26,
613 static const flex_int16_t yy_def[32] =
614 { 0,
615 28, 1, 28, 28, 28, 28, 28, 28, 28, 28,
616 28, 28, 28, 28, 29, 28, 28, 28, 28, 28,
617 28, 28, 30, 28, 28, 31, 31, 0, 28, 28,
621 static const flex_int16_t yy_nxt[56] =
622 { 0,
623 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
624 14, 15, 16, 17, 18, 4, 4, 19, 20, 21,
625 22, 22, 22, 22, 22, 25, 22, 26, 26, 27,
626 27, 24, 23, 28, 3, 28, 28, 28, 28, 28,
627 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
628 28, 28, 28, 28, 28
631 static const flex_int16_t yy_chk[56] =
632 { 0,
633 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
634 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
635 16, 16, 22, 22, 29, 18, 29, 30, 30, 31,
636 31, 17, 15, 3, 28, 28, 28, 28, 28, 28,
637 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
638 28, 28, 28, 28, 28
641 /* The intent behind this definition is that it'll catch
642 * any uses of REJECT which flex missed.
644 #define REJECT reject_used_but_not_detected
645 #define yymore() yymore_used_but_not_detected
646 #define YY_MORE_ADJ 0
647 #define YY_RESTORE_YY_MORE_OFFSET
648 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
649 file Copyright.txt or https://cmake.org/licensing for details. */
652 This file must be translated to C++ and modified to build everywhere.
654 Run flex >= 2.6 like this:
656 flex --nounistd -DFLEXINT_H --noline --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
658 Modify cmExprLexer.cxx:
659 - remove trailing whitespace: sed -i 's/\s*$//' cmExprLexer.h cmExprLexer.cxx
660 - remove blank lines at end of file: sed -i '${/^$/d;}' cmExprLexer.h cmExprLexer.cxx
661 - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmExprLexer.cxx
665 /* IWYU pragma: no_forward_declare yyguts_t */
667 #ifndef __clang_analyzer__ /* Suppress clang-analyzer warnings */
669 #include "cmExprParserHelper.h"
671 /* Replace the lexer input function. */
672 #undef YY_INPUT
673 #define YY_INPUT(buf, result, max_size) \
674 do { result = yyextra->LexInput(buf, max_size); } while (0)
676 /* Include the set of tokens from the parser. */
677 #include "cmExprParserTokens.h"
679 #include <string>
681 /*--------------------------------------------------------------------------*/
683 #define INITIAL 0
685 #ifndef YY_EXTRA_TYPE
686 #define YY_EXTRA_TYPE void *
687 #endif
689 /* Holds the entire state of the reentrant scanner. */
690 struct yyguts_t
693 /* User-defined. Not touched by flex. */
694 YY_EXTRA_TYPE yyextra_r;
696 /* The rest are the same as the globals declared in the non-reentrant scanner. */
697 FILE *yyin_r, *yyout_r;
698 size_t yy_buffer_stack_top; /**< index of top of stack. */
699 size_t yy_buffer_stack_max; /**< capacity of stack. */
700 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
701 char yy_hold_char;
702 int yy_n_chars;
703 int yyleng_r;
704 char *yy_c_buf_p;
705 int yy_init;
706 int yy_start;
707 int yy_did_buffer_switch_on_eof;
708 int yy_start_stack_ptr;
709 int yy_start_stack_depth;
710 int *yy_start_stack;
711 yy_state_type yy_last_accepting_state;
712 char* yy_last_accepting_cpos;
714 int yylineno_r;
715 int yy_flex_debug_r;
717 char *yytext_r;
718 int yy_more_flag;
719 int yy_more_len;
721 }; /* end struct yyguts_t */
723 static int yy_init_globals ( yyscan_t yyscanner );
725 int yylex_init (yyscan_t* scanner);
727 int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
729 /* Accessor methods to globals.
730 These are made visible to non-reentrant scanners for convenience. */
732 int yylex_destroy ( yyscan_t yyscanner );
734 int yyget_debug ( yyscan_t yyscanner );
736 void yyset_debug ( int debug_flag , yyscan_t yyscanner );
738 YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
740 void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
742 FILE *yyget_in ( yyscan_t yyscanner );
744 void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
746 FILE *yyget_out ( yyscan_t yyscanner );
748 void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
750 int yyget_leng ( yyscan_t yyscanner );
752 char *yyget_text ( yyscan_t yyscanner );
754 int yyget_lineno ( yyscan_t yyscanner );
756 void yyset_lineno ( int _line_number , yyscan_t yyscanner );
758 int yyget_column ( yyscan_t yyscanner );
760 void yyset_column ( int _column_no , yyscan_t yyscanner );
762 /* Macros after this point can all be overridden by user definitions in
763 * section 1.
766 #ifndef YY_SKIP_YYWRAP
767 #ifdef __cplusplus
768 extern "C" int yywrap ( yyscan_t yyscanner );
769 #else
770 extern int yywrap ( yyscan_t yyscanner );
771 #endif
772 #endif
774 #ifndef YY_NO_UNPUT
776 static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
778 #endif
780 #ifndef yytext_ptr
781 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
782 #endif
784 #ifdef YY_NEED_STRLEN
785 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
786 #endif
788 #ifndef YY_NO_INPUT
789 #ifdef __cplusplus
790 static int yyinput ( yyscan_t yyscanner );
791 #else
792 static int input ( yyscan_t yyscanner );
793 #endif
795 #endif
797 /* Amount of stuff to slurp up with each read. */
798 #ifndef YY_READ_BUF_SIZE
799 #ifdef __ia64__
800 /* On IA-64, the buffer size is 16k, not 8k */
801 #define YY_READ_BUF_SIZE 16384
802 #else
803 #define YY_READ_BUF_SIZE 8192
804 #endif /* __ia64__ */
805 #endif
807 /* Copy whatever the last rule matched to the standard output. */
808 #ifndef ECHO
809 /* This used to be an fputs(), but since the string might contain NUL's,
810 * we now use fwrite().
812 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
813 #endif
815 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
816 * is returned in "result".
818 #ifndef YY_INPUT
819 #define YY_INPUT(buf,result,max_size) \
820 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
822 int c = '*'; \
823 int n; \
824 for ( n = 0; n < max_size && \
825 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
826 buf[n] = (char) c; \
827 if ( c == '\n' ) \
828 buf[n++] = (char) c; \
829 if ( c == EOF && ferror( yyin ) ) \
830 YY_FATAL_ERROR( "input in flex scanner failed" ); \
831 result = n; \
833 else \
835 errno=0; \
836 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
838 if( errno != EINTR) \
840 YY_FATAL_ERROR( "input in flex scanner failed" ); \
841 break; \
843 errno=0; \
844 clearerr(yyin); \
849 #endif
851 /* No semi-colon after return; correct usage is to write "yyterminate();" -
852 * we don't want an extra ';' after the "return" because that will cause
853 * some compilers to complain about unreachable statements.
855 #ifndef yyterminate
856 #define yyterminate() return YY_NULL
857 #endif
859 /* Number of entries by which start-condition stack grows. */
860 #ifndef YY_START_STACK_INCR
861 #define YY_START_STACK_INCR 25
862 #endif
864 /* Report a fatal error. */
865 #ifndef YY_FATAL_ERROR
866 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
867 #endif
869 /* end tables serialization structures and prototypes */
871 /* Default declaration of generated scanner - a define so the user can
872 * easily add parameters.
874 #ifndef YY_DECL
875 #define YY_DECL_IS_OURS 1
877 extern int yylex (yyscan_t yyscanner);
879 #define YY_DECL int yylex (yyscan_t yyscanner)
880 #endif /* !YY_DECL */
882 /* Code executed at the beginning of each rule, after yytext and yyleng
883 * have been set up.
885 #ifndef YY_USER_ACTION
886 #define YY_USER_ACTION
887 #endif
889 /* Code executed at the end of each rule. */
890 #ifndef YY_BREAK
891 #define YY_BREAK /*LINTED*/break;
892 #endif
894 #define YY_RULE_SETUP \
895 YY_USER_ACTION
897 /** The main scanner function which does all the work.
899 YY_DECL
901 yy_state_type yy_current_state;
902 char *yy_cp, *yy_bp;
903 int yy_act;
904 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
906 if ( !yyg->yy_init )
908 yyg->yy_init = 1;
910 #ifdef YY_USER_INIT
911 YY_USER_INIT;
912 #endif
914 if ( ! yyg->yy_start )
915 yyg->yy_start = 1; /* first start state */
917 if ( ! yyin )
918 yyin = stdin;
920 if ( ! yyout )
921 yyout = stdout;
923 if ( ! YY_CURRENT_BUFFER ) {
924 yyensure_buffer_stack (yyscanner);
925 YY_CURRENT_BUFFER_LVALUE =
926 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
929 yy_load_buffer_state( yyscanner );
934 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
936 yy_cp = yyg->yy_c_buf_p;
938 /* Support of yytext. */
939 *yy_cp = yyg->yy_hold_char;
941 /* yy_bp points to the position in yy_ch_buf of the start of
942 * the current run.
944 yy_bp = yy_cp;
946 yy_current_state = yyg->yy_start;
947 yy_match:
950 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
951 if ( yy_accept[yy_current_state] )
953 yyg->yy_last_accepting_state = yy_current_state;
954 yyg->yy_last_accepting_cpos = yy_cp;
956 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
958 yy_current_state = (int) yy_def[yy_current_state];
959 if ( yy_current_state >= 29 )
960 yy_c = yy_meta[yy_c];
962 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
963 ++yy_cp;
965 while ( yy_base[yy_current_state] != 35 );
967 yy_find_action:
968 yy_act = yy_accept[yy_current_state];
969 if ( yy_act == 0 )
970 { /* have to back up */
971 yy_cp = yyg->yy_last_accepting_cpos;
972 yy_current_state = yyg->yy_last_accepting_state;
973 yy_act = yy_accept[yy_current_state];
976 YY_DO_BEFORE_ACTION;
978 do_action: /* This label is used only to access EOF actions. */
980 switch ( yy_act )
981 { /* beginning of action switch */
982 case 0: /* must back up */
983 /* undo the effects of YY_DO_BEFORE_ACTION */
984 *yy_cp = yyg->yy_hold_char;
985 yy_cp = yyg->yy_last_accepting_cpos;
986 yy_current_state = yyg->yy_last_accepting_state;
987 goto yy_find_action;
989 case 1:
990 YY_RULE_SETUP
992 YY_BREAK
993 case 2:
994 YY_RULE_SETUP
995 { yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; }
996 YY_BREAK
997 case 3:
998 YY_RULE_SETUP
999 { yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; }
1000 YY_BREAK
1001 case 4:
1002 YY_RULE_SETUP
1003 { return exp_PLUS; }
1004 YY_BREAK
1005 case 5:
1006 YY_RULE_SETUP
1007 { return exp_MINUS; }
1008 YY_BREAK
1009 case 6:
1010 YY_RULE_SETUP
1011 { return exp_TIMES; }
1012 YY_BREAK
1013 case 7:
1014 YY_RULE_SETUP
1015 { return exp_DIVIDE; }
1016 YY_BREAK
1017 case 8:
1018 YY_RULE_SETUP
1019 { return exp_MOD; }
1020 YY_BREAK
1021 case 9:
1022 YY_RULE_SETUP
1023 { return exp_OR; }
1024 YY_BREAK
1025 case 10:
1026 YY_RULE_SETUP
1027 { return exp_AND; }
1028 YY_BREAK
1029 case 11:
1030 YY_RULE_SETUP
1031 { return exp_XOR; }
1032 YY_BREAK
1033 case 12:
1034 YY_RULE_SETUP
1035 { return exp_NOT; }
1036 YY_BREAK
1037 case 13:
1038 YY_RULE_SETUP
1039 { return exp_SHIFTLEFT; }
1040 YY_BREAK
1041 case 14:
1042 YY_RULE_SETUP
1043 { return exp_SHIFTRIGHT; }
1044 YY_BREAK
1045 case 15:
1046 YY_RULE_SETUP
1047 { return exp_OPENPARENT; }
1048 YY_BREAK
1049 case 16:
1050 YY_RULE_SETUP
1051 { return exp_CLOSEPARENT; }
1052 YY_BREAK
1053 case 17:
1054 YY_RULE_SETUP
1055 { yyextra->UnexpectedChar(yytext[0]); }
1056 YY_BREAK
1057 case 18:
1058 YY_RULE_SETUP
1059 ECHO;
1060 YY_BREAK
1061 case YY_STATE_EOF(INITIAL):
1062 yyterminate();
1064 case YY_END_OF_BUFFER:
1066 /* Amount of text matched not including the EOB char. */
1067 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1069 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1070 *yy_cp = yyg->yy_hold_char;
1071 YY_RESTORE_YY_MORE_OFFSET
1073 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1075 /* We're scanning a new file or input source. It's
1076 * possible that this happened because the user
1077 * just pointed yyin at a new source and called
1078 * yylex(). If so, then we have to assure
1079 * consistency between YY_CURRENT_BUFFER and our
1080 * globals. Here is the right place to do so, because
1081 * this is the first action (other than possibly a
1082 * back-up) that will match for the new input source.
1084 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1085 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1086 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1089 /* Note that here we test for yy_c_buf_p "<=" to the position
1090 * of the first EOB in the buffer, since yy_c_buf_p will
1091 * already have been incremented past the NUL character
1092 * (since all states make transitions on EOB to the
1093 * end-of-buffer state). Contrast this with the test
1094 * in input().
1096 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1097 { /* This was really a NUL. */
1098 yy_state_type yy_next_state;
1100 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1102 yy_current_state = yy_get_previous_state( yyscanner );
1104 /* Okay, we're now positioned to make the NUL
1105 * transition. We couldn't have
1106 * yy_get_previous_state() go ahead and do it
1107 * for us because it doesn't know how to deal
1108 * with the possibility of jamming (and we don't
1109 * want to build jamming into it because then it
1110 * will run more slowly).
1113 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1115 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1117 if ( yy_next_state )
1119 /* Consume the NUL. */
1120 yy_cp = ++yyg->yy_c_buf_p;
1121 yy_current_state = yy_next_state;
1122 goto yy_match;
1125 else
1127 yy_cp = yyg->yy_c_buf_p;
1128 goto yy_find_action;
1132 else switch ( yy_get_next_buffer( yyscanner ) )
1134 case EOB_ACT_END_OF_FILE:
1136 yyg->yy_did_buffer_switch_on_eof = 0;
1138 if ( yywrap( yyscanner ) )
1140 /* Note: because we've taken care in
1141 * yy_get_next_buffer() to have set up
1142 * yytext, we can now set up
1143 * yy_c_buf_p so that if some total
1144 * hoser (like flex itself) wants to
1145 * call the scanner after we return the
1146 * YY_NULL, it'll still work - another
1147 * YY_NULL will get returned.
1149 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1151 yy_act = YY_STATE_EOF(YY_START);
1152 goto do_action;
1155 else
1157 if ( ! yyg->yy_did_buffer_switch_on_eof )
1158 YY_NEW_FILE;
1160 break;
1163 case EOB_ACT_CONTINUE_SCAN:
1164 yyg->yy_c_buf_p =
1165 yyg->yytext_ptr + yy_amount_of_matched_text;
1167 yy_current_state = yy_get_previous_state( yyscanner );
1169 yy_cp = yyg->yy_c_buf_p;
1170 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1171 goto yy_match;
1173 case EOB_ACT_LAST_MATCH:
1174 yyg->yy_c_buf_p =
1175 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1177 yy_current_state = yy_get_previous_state( yyscanner );
1179 yy_cp = yyg->yy_c_buf_p;
1180 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1181 goto yy_find_action;
1183 break;
1186 default:
1187 YY_FATAL_ERROR(
1188 "fatal flex scanner internal error--no action found" );
1189 } /* end of action switch */
1190 } /* end of scanning one token */
1191 } /* end of user's declarations */
1192 } /* end of yylex */
1194 /* yy_get_next_buffer - try to read in a new buffer
1196 * Returns a code representing an action:
1197 * EOB_ACT_LAST_MATCH -
1198 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1199 * EOB_ACT_END_OF_FILE - end of file
1201 static int yy_get_next_buffer (yyscan_t yyscanner)
1203 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1204 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1205 char *source = yyg->yytext_ptr;
1206 int number_to_move, i;
1207 int ret_val;
1209 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1210 YY_FATAL_ERROR(
1211 "fatal flex scanner internal error--end of buffer missed" );
1213 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1214 { /* Don't try to fill the buffer, so this is an EOF. */
1215 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1217 /* We matched a single character, the EOB, so
1218 * treat this as a final EOF.
1220 return EOB_ACT_END_OF_FILE;
1223 else
1225 /* We matched some text prior to the EOB, first
1226 * process it.
1228 return EOB_ACT_LAST_MATCH;
1232 /* Try to read more data. */
1234 /* First move last chars to start of buffer. */
1235 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1237 for ( i = 0; i < number_to_move; ++i )
1238 *(dest++) = *(source++);
1240 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1241 /* don't do the read, it's not guaranteed to return an EOF,
1242 * just force an EOF
1244 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1246 else
1248 int num_to_read =
1249 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1251 while ( num_to_read <= 0 )
1252 { /* Not enough room in the buffer - grow it. */
1254 /* just a shorter name for the current buffer */
1255 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1257 int yy_c_buf_p_offset =
1258 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1260 if ( b->yy_is_our_buffer )
1262 int new_size = b->yy_buf_size * 2;
1264 if ( new_size <= 0 )
1265 b->yy_buf_size += b->yy_buf_size / 8;
1266 else
1267 b->yy_buf_size *= 2;
1269 b->yy_ch_buf = (char *)
1270 /* Include room in for 2 EOB chars. */
1271 yyrealloc( (void *) b->yy_ch_buf,
1272 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1274 else
1275 /* Can't grow it, we don't own it. */
1276 b->yy_ch_buf = NULL;
1278 if ( ! b->yy_ch_buf )
1279 YY_FATAL_ERROR(
1280 "fatal error - scanner input buffer overflow" );
1282 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1284 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1285 number_to_move - 1;
1289 if ( num_to_read > YY_READ_BUF_SIZE )
1290 num_to_read = YY_READ_BUF_SIZE;
1292 /* Read in more data. */
1293 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1294 yyg->yy_n_chars, num_to_read );
1296 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1299 if ( yyg->yy_n_chars == 0 )
1301 if ( number_to_move == YY_MORE_ADJ )
1303 ret_val = EOB_ACT_END_OF_FILE;
1304 yyrestart( yyin , yyscanner);
1307 else
1309 ret_val = EOB_ACT_LAST_MATCH;
1310 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1311 YY_BUFFER_EOF_PENDING;
1315 else
1316 ret_val = EOB_ACT_CONTINUE_SCAN;
1318 if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1319 /* Extend the array by 50%, plus the number we really need. */
1320 int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1321 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1322 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1323 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1324 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1325 /* "- 2" to take care of EOB's */
1326 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1329 yyg->yy_n_chars += number_to_move;
1330 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1331 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1333 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1335 return ret_val;
1338 /* yy_get_previous_state - get the state just before the EOB char was reached */
1340 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1342 yy_state_type yy_current_state;
1343 char *yy_cp;
1344 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1346 yy_current_state = yyg->yy_start;
1348 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1350 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1351 if ( yy_accept[yy_current_state] )
1353 yyg->yy_last_accepting_state = yy_current_state;
1354 yyg->yy_last_accepting_cpos = yy_cp;
1356 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1358 yy_current_state = (int) yy_def[yy_current_state];
1359 if ( yy_current_state >= 29 )
1360 yy_c = yy_meta[yy_c];
1362 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1365 return yy_current_state;
1368 /* yy_try_NUL_trans - try to make a transition on the NUL character
1370 * synopsis
1371 * next_state = yy_try_NUL_trans( current_state );
1373 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1375 int yy_is_jam;
1376 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1377 char *yy_cp = yyg->yy_c_buf_p;
1379 YY_CHAR yy_c = 1;
1380 if ( yy_accept[yy_current_state] )
1382 yyg->yy_last_accepting_state = yy_current_state;
1383 yyg->yy_last_accepting_cpos = yy_cp;
1385 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1387 yy_current_state = (int) yy_def[yy_current_state];
1388 if ( yy_current_state >= 29 )
1389 yy_c = yy_meta[yy_c];
1391 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1392 yy_is_jam = (yy_current_state == 28);
1394 (void)yyg;
1395 return yy_is_jam ? 0 : yy_current_state;
1398 #ifndef YY_NO_UNPUT
1400 static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
1402 char *yy_cp;
1403 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1405 yy_cp = yyg->yy_c_buf_p;
1407 /* undo effects of setting up yytext */
1408 *yy_cp = yyg->yy_hold_char;
1410 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1411 { /* need to shift things up to make room */
1412 /* +2 for EOB chars. */
1413 int number_to_move = yyg->yy_n_chars + 2;
1414 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1415 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1416 char *source =
1417 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1419 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1420 *--dest = *--source;
1422 yy_cp += (int) (dest - source);
1423 yy_bp += (int) (dest - source);
1424 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1425 yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1427 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1428 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1431 *--yy_cp = (char) c;
1433 yyg->yytext_ptr = yy_bp;
1434 yyg->yy_hold_char = *yy_cp;
1435 yyg->yy_c_buf_p = yy_cp;
1438 #endif
1440 #ifndef YY_NO_INPUT
1441 #ifdef __cplusplus
1442 static int yyinput (yyscan_t yyscanner)
1443 #else
1444 static int input (yyscan_t yyscanner)
1445 #endif
1448 int c;
1449 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1451 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1453 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1455 /* yy_c_buf_p now points to the character we want to return.
1456 * If this occurs *before* the EOB characters, then it's a
1457 * valid NUL; if not, then we've hit the end of the buffer.
1459 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1460 /* This was really a NUL. */
1461 *yyg->yy_c_buf_p = '\0';
1463 else
1464 { /* need more input */
1465 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1466 ++yyg->yy_c_buf_p;
1468 switch ( yy_get_next_buffer( yyscanner ) )
1470 case EOB_ACT_LAST_MATCH:
1471 /* This happens because yy_g_n_b()
1472 * sees that we've accumulated a
1473 * token and flags that we need to
1474 * try matching the token before
1475 * proceeding. But for input(),
1476 * there's no matching to consider.
1477 * So convert the EOB_ACT_LAST_MATCH
1478 * to EOB_ACT_END_OF_FILE.
1481 /* Reset buffer status. */
1482 yyrestart( yyin , yyscanner);
1484 /*FALLTHROUGH*/
1486 case EOB_ACT_END_OF_FILE:
1488 if ( yywrap( yyscanner ) )
1489 return 0;
1491 if ( ! yyg->yy_did_buffer_switch_on_eof )
1492 YY_NEW_FILE;
1493 #ifdef __cplusplus
1494 return yyinput(yyscanner);
1495 #else
1496 return input(yyscanner);
1497 #endif
1500 case EOB_ACT_CONTINUE_SCAN:
1501 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1502 break;
1507 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1508 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1509 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1511 return c;
1513 #endif /* ifndef YY_NO_INPUT */
1515 /** Immediately switch to a different input stream.
1516 * @param input_file A readable stream.
1517 * @param yyscanner The scanner object.
1518 * @note This function does not reset the start condition to @c INITIAL .
1520 void yyrestart (FILE * input_file , yyscan_t yyscanner)
1522 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1524 if ( ! YY_CURRENT_BUFFER ){
1525 yyensure_buffer_stack (yyscanner);
1526 YY_CURRENT_BUFFER_LVALUE =
1527 yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1530 yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
1531 yy_load_buffer_state( yyscanner );
1534 /** Switch to a different input buffer.
1535 * @param new_buffer The new input buffer.
1536 * @param yyscanner The scanner object.
1538 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1540 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1542 /* TODO. We should be able to replace this entire function body
1543 * with
1544 * yypop_buffer_state();
1545 * yypush_buffer_state(new_buffer);
1547 yyensure_buffer_stack (yyscanner);
1548 if ( YY_CURRENT_BUFFER == new_buffer )
1549 return;
1551 if ( YY_CURRENT_BUFFER )
1553 /* Flush out information for old buffer. */
1554 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1555 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1556 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1559 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1560 yy_load_buffer_state( yyscanner );
1562 /* We don't actually know whether we did this switch during
1563 * EOF (yywrap()) processing, but the only time this flag
1564 * is looked at is after yywrap() is called, so it's safe
1565 * to go ahead and always set it.
1567 yyg->yy_did_buffer_switch_on_eof = 1;
1570 static void yy_load_buffer_state (yyscan_t yyscanner)
1572 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1573 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1574 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1575 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1576 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1579 /** Allocate and initialize an input buffer state.
1580 * @param file A readable stream.
1581 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1582 * @param yyscanner The scanner object.
1583 * @return the allocated buffer state.
1585 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1587 YY_BUFFER_STATE b;
1589 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1590 if ( ! b )
1591 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1593 b->yy_buf_size = size;
1595 /* yy_ch_buf has to be 2 characters longer than the size given because
1596 * we need to put in 2 end-of-buffer characters.
1598 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1599 if ( ! b->yy_ch_buf )
1600 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1602 b->yy_is_our_buffer = 1;
1604 yy_init_buffer( b, file , yyscanner);
1606 return b;
1609 /** Destroy the buffer.
1610 * @param b a buffer created with yy_create_buffer()
1611 * @param yyscanner The scanner object.
1613 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1615 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1617 if ( ! b )
1618 return;
1620 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1621 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1623 if ( b->yy_is_our_buffer )
1624 yyfree( (void *) b->yy_ch_buf , yyscanner );
1626 yyfree( (void *) b , yyscanner );
1629 /* Initializes or reinitializes a buffer.
1630 * This function is sometimes called more than once on the same buffer,
1631 * such as during a yyrestart() or at EOF.
1633 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1636 int oerrno = errno;
1637 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1639 yy_flush_buffer( b , yyscanner);
1641 b->yy_input_file = file;
1642 b->yy_fill_buffer = 1;
1644 /* If b is the current buffer, then yy_init_buffer was _probably_
1645 * called from yyrestart() or through yy_get_next_buffer.
1646 * In that case, we don't want to reset the lineno or column.
1648 if (b != YY_CURRENT_BUFFER){
1649 b->yy_bs_lineno = 1;
1650 b->yy_bs_column = 0;
1653 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1655 errno = oerrno;
1658 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1659 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1660 * @param yyscanner The scanner object.
1662 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1664 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1665 if ( ! b )
1666 return;
1668 b->yy_n_chars = 0;
1670 /* We always need two end-of-buffer characters. The first causes
1671 * a transition to the end-of-buffer state. The second causes
1672 * a jam in that state.
1674 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1675 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1677 b->yy_buf_pos = &b->yy_ch_buf[0];
1679 b->yy_at_bol = 1;
1680 b->yy_buffer_status = YY_BUFFER_NEW;
1682 if ( b == YY_CURRENT_BUFFER )
1683 yy_load_buffer_state( yyscanner );
1686 /** Pushes the new state onto the stack. The new state becomes
1687 * the current state. This function will allocate the stack
1688 * if necessary.
1689 * @param new_buffer The new state.
1690 * @param yyscanner The scanner object.
1692 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1694 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1695 if (new_buffer == NULL)
1696 return;
1698 yyensure_buffer_stack(yyscanner);
1700 /* This block is copied from yy_switch_to_buffer. */
1701 if ( YY_CURRENT_BUFFER )
1703 /* Flush out information for old buffer. */
1704 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1705 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1706 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1709 /* Only push if top exists. Otherwise, replace top. */
1710 if (YY_CURRENT_BUFFER)
1711 yyg->yy_buffer_stack_top++;
1712 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1714 /* copied from yy_switch_to_buffer. */
1715 yy_load_buffer_state( yyscanner );
1716 yyg->yy_did_buffer_switch_on_eof = 1;
1719 /** Removes and deletes the top of the stack, if present.
1720 * The next element becomes the new top.
1721 * @param yyscanner The scanner object.
1723 void yypop_buffer_state (yyscan_t yyscanner)
1725 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1726 if (!YY_CURRENT_BUFFER)
1727 return;
1729 yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
1730 YY_CURRENT_BUFFER_LVALUE = NULL;
1731 if (yyg->yy_buffer_stack_top > 0)
1732 --yyg->yy_buffer_stack_top;
1734 if (YY_CURRENT_BUFFER) {
1735 yy_load_buffer_state( yyscanner );
1736 yyg->yy_did_buffer_switch_on_eof = 1;
1740 /* Allocates the stack if it does not exist.
1741 * Guarantees space for at least one push.
1743 static void yyensure_buffer_stack (yyscan_t yyscanner)
1745 yy_size_t num_to_alloc;
1746 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1748 if (!yyg->yy_buffer_stack) {
1750 /* First allocation is just for 2 elements, since we don't know if this
1751 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1752 * immediate realloc on the next call.
1754 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1755 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
1756 (num_to_alloc * sizeof(struct yy_buffer_state*)
1757 , yyscanner);
1758 if ( ! yyg->yy_buffer_stack )
1759 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1761 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1763 yyg->yy_buffer_stack_max = num_to_alloc;
1764 yyg->yy_buffer_stack_top = 0;
1765 return;
1768 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1770 /* Increase the buffer to prepare for a possible push. */
1771 yy_size_t grow_size = 8 /* arbitrary grow size */;
1773 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1774 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
1775 (yyg->yy_buffer_stack,
1776 num_to_alloc * sizeof(struct yy_buffer_state*)
1777 , yyscanner);
1778 if ( ! yyg->yy_buffer_stack )
1779 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1781 /* zero only the new slots.*/
1782 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1783 yyg->yy_buffer_stack_max = num_to_alloc;
1787 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1788 * @param base the character buffer
1789 * @param size the size in bytes of the character buffer
1790 * @param yyscanner The scanner object.
1791 * @return the newly allocated buffer state object.
1793 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1795 YY_BUFFER_STATE b;
1797 if ( size < 2 ||
1798 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1799 base[size-1] != YY_END_OF_BUFFER_CHAR )
1800 /* They forgot to leave room for the EOB's. */
1801 return NULL;
1803 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
1804 if ( ! b )
1805 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1807 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1808 b->yy_buf_pos = b->yy_ch_buf = base;
1809 b->yy_is_our_buffer = 0;
1810 b->yy_input_file = NULL;
1811 b->yy_n_chars = b->yy_buf_size;
1812 b->yy_is_interactive = 0;
1813 b->yy_at_bol = 1;
1814 b->yy_fill_buffer = 0;
1815 b->yy_buffer_status = YY_BUFFER_NEW;
1817 yy_switch_to_buffer( b , yyscanner );
1819 return b;
1822 /** Setup the input buffer state to scan a string. The next call to yylex() will
1823 * scan from a @e copy of @a str.
1824 * @param yystr a NUL-terminated string to scan
1825 * @param yyscanner The scanner object.
1826 * @return the newly allocated buffer state object.
1827 * @note If you want to scan bytes that may contain NUL values, then use
1828 * yy_scan_bytes() instead.
1830 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
1833 return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
1836 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1837 * scan from a @e copy of @a bytes.
1838 * @param yybytes the byte buffer to scan
1839 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1840 * @param yyscanner The scanner object.
1841 * @return the newly allocated buffer state object.
1843 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1845 YY_BUFFER_STATE b;
1846 char *buf;
1847 yy_size_t n;
1848 int i;
1850 /* Get memory for full buffer, including space for trailing EOB's. */
1851 n = (yy_size_t) (_yybytes_len + 2);
1852 buf = (char *) yyalloc( n , yyscanner );
1853 if ( ! buf )
1854 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1856 for ( i = 0; i < _yybytes_len; ++i )
1857 buf[i] = yybytes[i];
1859 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1861 b = yy_scan_buffer( buf, n , yyscanner);
1862 if ( ! b )
1863 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1865 /* It's okay to grow etc. this buffer, and we should throw it
1866 * away when we're done.
1868 b->yy_is_our_buffer = 1;
1870 return b;
1873 #ifndef YY_EXIT_FAILURE
1874 #define YY_EXIT_FAILURE 2
1875 #endif
1877 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
1879 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1880 (void)yyg;
1881 fprintf( stderr, "%s\n", msg );
1882 exit( YY_EXIT_FAILURE );
1885 /* Redefine yyless() so it works in section 3 code. */
1887 #undef yyless
1888 #define yyless(n) \
1889 do \
1891 /* Undo effects of setting up yytext. */ \
1892 int yyless_macro_arg = (n); \
1893 YY_LESS_LINENO(yyless_macro_arg);\
1894 yytext[yyleng] = yyg->yy_hold_char; \
1895 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1896 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1897 *yyg->yy_c_buf_p = '\0'; \
1898 yyleng = yyless_macro_arg; \
1900 while ( 0 )
1902 /* Accessor methods (get/set functions) to struct members. */
1904 /** Get the user-defined data for this scanner.
1905 * @param yyscanner The scanner object.
1907 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
1909 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1910 return yyextra;
1913 /** Get the current line number.
1914 * @param yyscanner The scanner object.
1916 int yyget_lineno (yyscan_t yyscanner)
1918 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1920 if (! YY_CURRENT_BUFFER)
1921 return 0;
1923 return yylineno;
1926 /** Get the current column number.
1927 * @param yyscanner The scanner object.
1929 int yyget_column (yyscan_t yyscanner)
1931 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1933 if (! YY_CURRENT_BUFFER)
1934 return 0;
1936 return yycolumn;
1939 /** Get the input stream.
1940 * @param yyscanner The scanner object.
1942 FILE *yyget_in (yyscan_t yyscanner)
1944 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1945 return yyin;
1948 /** Get the output stream.
1949 * @param yyscanner The scanner object.
1951 FILE *yyget_out (yyscan_t yyscanner)
1953 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1954 return yyout;
1957 /** Get the length of the current token.
1958 * @param yyscanner The scanner object.
1960 int yyget_leng (yyscan_t yyscanner)
1962 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1963 return yyleng;
1966 /** Get the current token.
1967 * @param yyscanner The scanner object.
1970 char *yyget_text (yyscan_t yyscanner)
1972 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1973 return yytext;
1976 /** Set the user-defined data. This data is never touched by the scanner.
1977 * @param user_defined The data to be associated with this scanner.
1978 * @param yyscanner The scanner object.
1980 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
1982 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1983 yyextra = user_defined ;
1986 /** Set the current line number.
1987 * @param _line_number line number
1988 * @param yyscanner The scanner object.
1990 void yyset_lineno (int _line_number , yyscan_t yyscanner)
1992 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1994 /* lineno is only valid if an input buffer exists. */
1995 if (! YY_CURRENT_BUFFER )
1996 YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
1998 yylineno = _line_number;
2001 /** Set the current column.
2002 * @param _column_no column number
2003 * @param yyscanner The scanner object.
2005 void yyset_column (int _column_no , yyscan_t yyscanner)
2007 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2009 /* column is only valid if an input buffer exists. */
2010 if (! YY_CURRENT_BUFFER )
2011 YY_FATAL_ERROR( "yyset_column called with no buffer" );
2013 yycolumn = _column_no;
2016 /** Set the input stream. This does not discard the current
2017 * input buffer.
2018 * @param _in_str A readable stream.
2019 * @param yyscanner The scanner object.
2020 * @see yy_switch_to_buffer
2022 void yyset_in (FILE * _in_str , yyscan_t yyscanner)
2024 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2025 yyin = _in_str ;
2028 void yyset_out (FILE * _out_str , yyscan_t yyscanner)
2030 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2031 yyout = _out_str ;
2034 int yyget_debug (yyscan_t yyscanner)
2036 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2037 return yy_flex_debug;
2040 void yyset_debug (int _bdebug , yyscan_t yyscanner)
2042 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2043 yy_flex_debug = _bdebug ;
2046 /* Accessor methods for yylval and yylloc */
2048 /* User-visible API */
2050 /* yylex_init is special because it creates the scanner itself, so it is
2051 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2052 * That's why we explicitly handle the declaration, instead of using our macros.
2054 int yylex_init(yyscan_t* ptr_yy_globals)
2056 if (ptr_yy_globals == NULL){
2057 errno = EINVAL;
2058 return 1;
2061 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2063 if (*ptr_yy_globals == NULL){
2064 errno = ENOMEM;
2065 return 1;
2068 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2069 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2071 return yy_init_globals ( *ptr_yy_globals );
2074 /* yylex_init_extra has the same functionality as yylex_init, but follows the
2075 * convention of taking the scanner as the last argument. Note however, that
2076 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2077 * is the reason, too, why this function also must handle its own declaration).
2078 * The user defined value in the first argument will be available to yyalloc in
2079 * the yyextra field.
2081 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2083 struct yyguts_t dummy_yyguts;
2085 yyset_extra (yy_user_defined, &dummy_yyguts);
2087 if (ptr_yy_globals == NULL){
2088 errno = EINVAL;
2089 return 1;
2092 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2094 if (*ptr_yy_globals == NULL){
2095 errno = ENOMEM;
2096 return 1;
2099 /* By setting to 0xAA, we expose bugs in
2100 yy_init_globals. Leave at 0x00 for releases. */
2101 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2103 yyset_extra (yy_user_defined, *ptr_yy_globals);
2105 return yy_init_globals ( *ptr_yy_globals );
2108 static int yy_init_globals (yyscan_t yyscanner)
2110 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2111 /* Initialization is the same as for the non-reentrant scanner.
2112 * This function is called from yylex_destroy(), so don't allocate here.
2115 yyg->yy_buffer_stack = NULL;
2116 yyg->yy_buffer_stack_top = 0;
2117 yyg->yy_buffer_stack_max = 0;
2118 yyg->yy_c_buf_p = NULL;
2119 yyg->yy_init = 0;
2120 yyg->yy_start = 0;
2122 yyg->yy_start_stack_ptr = 0;
2123 yyg->yy_start_stack_depth = 0;
2124 yyg->yy_start_stack = NULL;
2126 /* Defined in main.c */
2127 #ifdef YY_STDINIT
2128 yyin = stdin;
2129 yyout = stdout;
2130 #else
2131 yyin = NULL;
2132 yyout = NULL;
2133 #endif
2135 /* For future reference: Set errno on error, since we are called by
2136 * yylex_init()
2138 return 0;
2141 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2142 int yylex_destroy (yyscan_t yyscanner)
2144 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2146 /* Pop the buffer stack, destroying each element. */
2147 while(YY_CURRENT_BUFFER){
2148 yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2149 YY_CURRENT_BUFFER_LVALUE = NULL;
2150 yypop_buffer_state(yyscanner);
2153 /* Destroy the stack itself. */
2154 yyfree(yyg->yy_buffer_stack , yyscanner);
2155 yyg->yy_buffer_stack = NULL;
2157 /* Destroy the start condition stack. */
2158 yyfree( yyg->yy_start_stack , yyscanner );
2159 yyg->yy_start_stack = NULL;
2161 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2162 * yylex() is called, initialization will occur. */
2163 yy_init_globals( yyscanner);
2165 /* Destroy the main struct (reentrant only). */
2166 yyfree ( yyscanner , yyscanner );
2167 yyscanner = NULL;
2168 return 0;
2172 * Internal utility routines.
2175 #ifndef yytext_ptr
2176 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2178 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2179 (void)yyg;
2181 int i;
2182 for ( i = 0; i < n; ++i )
2183 s1[i] = s2[i];
2185 #endif
2187 #ifdef YY_NEED_STRLEN
2188 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2190 int n;
2191 for ( n = 0; s[n]; ++n )
2194 return n;
2196 #endif
2198 void *yyalloc (yy_size_t size , yyscan_t yyscanner)
2200 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2201 (void)yyg;
2202 return malloc(size);
2205 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2207 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2208 (void)yyg;
2210 /* The cast to (char *) in the following accommodates both
2211 * implementations that use char* generic pointers, and those
2212 * that use void* generic pointers. It works with the latter
2213 * because both ANSI C and C++ allow castless assignment from
2214 * any pointer type to void*, and deal with argument conversions
2215 * as though doing an assignment.
2217 return realloc(ptr, size);
2220 void yyfree (void * ptr , yyscan_t yyscanner)
2222 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2223 (void)yyg;
2224 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2227 #define YYTABLES_NAME "yytables"
2229 /*--------------------------------------------------------------------------*/
2231 #endif /* __clang_analyzer__ */