4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer cppExpYY_create_buffer
9 #define yy_delete_buffer cppExpYY_delete_buffer
10 #define yy_flex_debug cppExpYY_flex_debug
11 #define yy_init_buffer cppExpYY_init_buffer
12 #define yy_flush_buffer cppExpYY_flush_buffer
13 #define yy_load_buffer_state cppExpYY_load_buffer_state
14 #define yy_switch_to_buffer cppExpYY_switch_to_buffer
15 #define yyin cppExpYYin
16 #define yyleng cppExpYYleng
17 #define yylex cppExpYYlex
18 #define yylineno cppExpYYlineno
19 #define yyout cppExpYYout
20 #define yyrestart cppExpYYrestart
21 #define yytext cppExpYYtext
22 #define yywrap cppExpYYwrap
23 #define yyalloc cppExpYYalloc
24 #define yyrealloc cppExpYYrealloc
25 #define yyfree cppExpYYfree
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 typedef uint64_t flex_uint64_t;
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
78 /* Limits of integral types. */
80 #define INT8_MIN (-128)
83 #define INT16_MIN (-32767-1)
86 #define INT32_MIN (-2147483647-1)
89 #define INT8_MAX (127)
92 #define INT16_MAX (32767)
95 #define INT32_MAX (2147483647)
98 #define UINT8_MAX (255U)
101 #define UINT16_MAX (65535U)
104 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
144 #define BEGIN (yy_start) = 1 + 2 *
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE cppExpYYrestart(cppExpYYin )
159 #define YY_END_OF_BUFFER_CHAR 0
161 /* Size of default input buffer. */
163 #define YY_BUF_SIZE 262144
166 /* The state buf must be large enough to hold one state per character in the main buffer.
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
175 #ifndef YY_TYPEDEF_YY_SIZE_T
176 #define YY_TYPEDEF_YY_SIZE_T
177 typedef size_t yy_size_t;
180 extern yy_size_t cppExpYYleng;
182 extern FILE *cppExpYYin, *cppExpYYout;
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
188 #define YY_LESS_LINENO(n)
190 /* Return all but the first "n" matched characters back to the input stream. */
194 /* Undo effects of setting up cppExpYYtext. */ \
195 int yyless_macro_arg = (n); \
196 YY_LESS_LINENO(yyless_macro_arg);\
197 *yy_cp = (yy_hold_char); \
198 YY_RESTORE_YY_MORE_OFFSET \
199 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
200 YY_DO_BEFORE_ACTION; /* set up cppExpYYtext again */ \
204 #define unput(c) yyunput( c, (yytext_ptr) )
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
212 char *yy_ch_buf; /* input buffer */
213 char *yy_buf_pos; /* current position in input buffer */
215 /* Size of input buffer in bytes, not including room for EOB
218 yy_size_t yy_buf_size;
220 /* Number of characters read into yy_ch_buf, not including EOB
223 yy_size_t yy_n_chars;
225 /* Whether we "own" the buffer - i.e., we know we created it,
226 * and can realloc() it to grow it, and should free() it to
229 int yy_is_our_buffer;
231 /* Whether this is an "interactive" input source; if so, and
232 * if we're using stdio for input, then we want to use getc()
233 * instead of fread(), to make sure we stop fetching input after
236 int yy_is_interactive;
238 /* Whether we're considered to be at the beginning of a line.
239 * If so, '^' rules will be active on the next match, otherwise
244 int yy_bs_lineno; /**< The line count. */
245 int yy_bs_column; /**< The column count. */
247 /* Whether to try to fill the input buffer when we reach the
252 int yy_buffer_status;
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256 /* When an EOF's been seen but there's still some text to process
257 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258 * shouldn't try reading from the input source any more. We might
259 * still have a bunch of tokens to match, though, because of
260 * possible backing-up.
262 * When we actually see the EOF, we change the status to "new"
263 * (via cppExpYYrestart()), so that the user can continue scanning by
264 * just pointing cppExpYYin at a new input file.
266 #define YY_BUFFER_EOF_PENDING 2
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
273 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
274 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
276 /* We provide macros for accessing buffer states in case in the
277 * future we want to put the buffer states in a more general
280 * Returns the top of the stack, or NULL.
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287 * NULL or when we need an lvalue. For internal use only.
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
291 /* yy_hold_char holds the character lost when cppExpYYtext is formed. */
292 static char yy_hold_char;
293 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
294 yy_size_t cppExpYYleng;
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0; /* whether we need to initialize */
299 static int yy_start = 0; /* start state number */
301 /* Flag which is used to allow cppExpYYwrap()'s to do buffer switches
302 * instead of setting up a fresh cppExpYYin. A bit of a hack ...
304 static int yy_did_buffer_switch_on_eof;
306 void cppExpYYrestart (FILE *input_file );
307 void cppExpYY_switch_to_buffer (YY_BUFFER_STATE new_buffer );
308 YY_BUFFER_STATE cppExpYY_create_buffer (FILE *file,int size );
309 void cppExpYY_delete_buffer (YY_BUFFER_STATE b );
310 void cppExpYY_flush_buffer (YY_BUFFER_STATE b );
311 void cppExpYYpush_buffer_state (YY_BUFFER_STATE new_buffer );
312 void cppExpYYpop_buffer_state (void );
314 static void cppExpYYensure_buffer_stack (void );
315 static void cppExpYY_load_buffer_state (void );
316 static void cppExpYY_init_buffer (YY_BUFFER_STATE b,FILE *file );
318 #define YY_FLUSH_BUFFER cppExpYY_flush_buffer(YY_CURRENT_BUFFER )
320 YY_BUFFER_STATE cppExpYY_scan_buffer (char *base,yy_size_t size );
321 YY_BUFFER_STATE cppExpYY_scan_string (yyconst char *yy_str );
322 YY_BUFFER_STATE cppExpYY_scan_bytes (yyconst char *bytes,yy_size_t len );
324 void *cppExpYYalloc (yy_size_t );
325 void *cppExpYYrealloc (void *,yy_size_t );
326 void cppExpYYfree (void * );
328 #define yy_new_buffer cppExpYY_create_buffer
330 #define yy_set_interactive(is_interactive) \
332 if ( ! YY_CURRENT_BUFFER ){ \
333 cppExpYYensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); \
337 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
340 #define yy_set_bol(at_bol) \
342 if ( ! YY_CURRENT_BUFFER ){\
343 cppExpYYensure_buffer_stack (); \
344 YY_CURRENT_BUFFER_LVALUE = \
345 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); \
347 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
352 /* Begin user sect3 */
354 typedef unsigned char YY_CHAR;
356 FILE *cppExpYYin = (FILE *) 0, *cppExpYYout = (FILE *) 0;
358 typedef int yy_state_type;
360 extern int cppExpYYlineno;
362 int cppExpYYlineno = 1;
364 extern char *cppExpYYtext;
365 #define yytext_ptr cppExpYYtext
367 static yy_state_type yy_get_previous_state (void );
368 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
369 static int yy_get_next_buffer (void );
370 static void yy_fatal_error (yyconst char msg[] );
372 /* Done after the current pattern has been matched and before the
373 * corresponding action - sets up cppExpYYtext.
375 #define YY_DO_BEFORE_ACTION \
376 (yytext_ptr) = yy_bp; \
377 cppExpYYleng = (yy_size_t) (yy_cp - yy_bp); \
378 (yy_hold_char) = *yy_cp; \
380 (yy_c_buf_p) = yy_cp;
382 #define YY_NUM_RULES 33
383 #define YY_END_OF_BUFFER 34
384 /* This struct is not used in this scanner,
385 but its presence is necessary. */
388 flex_int32_t yy_verify;
391 static yyconst flex_int16_t yy_accept[77] =
393 0, 0, 34, 31, 32, 22, 20, 7, 31, 23,
394 24, 18, 16, 17, 31, 19, 26, 27, 2, 10,
395 31, 11, 1, 6, 5, 21, 8, 4, 0, 0,
396 29, 29, 26, 0, 0, 26, 26, 0, 27, 27,
397 27, 14, 12, 9, 13, 15, 3, 25, 0, 0,
398 0, 0, 29, 29, 0, 30, 26, 26, 26, 28,
399 27, 27, 27, 0, 0, 29, 30, 26, 28, 28,
400 27, 28, 28, 28, 28, 0
403 static yyconst flex_int32_t yy_ec[256] =
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
406 1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 4, 5, 1, 1, 6, 7, 8, 9,
409 10, 11, 12, 1, 13, 14, 15, 16, 17, 17,
410 17, 17, 17, 17, 17, 18, 18, 19, 1, 20,
411 21, 22, 23, 1, 24, 24, 24, 24, 25, 26,
412 1, 1, 1, 1, 1, 27, 1, 1, 1, 1,
413 1, 1, 1, 1, 28, 1, 1, 29, 1, 1,
414 1, 30, 1, 31, 1, 1, 32, 32, 24, 24,
416 25, 33, 1, 1, 1, 1, 1, 27, 1, 5,
417 1, 1, 1, 5, 1, 5, 28, 5, 1, 34,
418 1, 1, 1, 35, 1, 36, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 static yyconst flex_int32_t yy_meta[37] =
437 1, 2, 2, 1, 1, 1, 1, 2, 1, 1,
438 1, 1, 1, 1, 1, 3, 3, 3, 1, 1,
439 1, 1, 1, 3, 3, 3, 1, 1, 1, 1,
443 static yyconst flex_int16_t yy_base[80] =
445 0, 0, 145, 163, 163, 119, 163, 132, 108, 163,
446 163, 163, 163, 163, 21, 163, 26, 47, 163, 25,
447 116, 26, 163, 163, 101, 163, 163, 163, 41, 71,
448 90, 40, 33, 52, 68, 55, 106, 0, 0, 63,
449 105, 163, 163, 163, 163, 163, 163, 163, 123, 94,
450 0, 80, 163, 0, 102, 108, 102, 163, 82, 86,
451 71, 163, 68, 70, 111, 126, 163, 163, 94, 46,
452 163, 31, 163, 25, 163, 163, 159, 47, 38
455 static yyconst flex_int16_t yy_def[80] =
457 76, 1, 76, 76, 76, 76, 76, 76, 77, 76,
458 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
459 76, 76, 76, 76, 76, 76, 76, 76, 77, 76,
460 76, 31, 17, 76, 76, 76, 76, 78, 18, 76,
461 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
462 79, 76, 76, 32, 76, 76, 76, 76, 76, 78,
463 76, 76, 76, 79, 76, 76, 76, 76, 76, 76,
464 76, 76, 76, 76, 76, 0, 76, 76, 76
467 static yyconst flex_int16_t yy_nxt[200] =
469 4, 5, 4, 6, 4, 7, 8, 9, 10, 11,
470 12, 13, 14, 15, 16, 17, 18, 18, 19, 20,
471 21, 22, 23, 4, 4, 4, 4, 4, 4, 4,
472 24, 4, 4, 4, 25, 26, 31, 31, 31, 32,
473 64, 33, 33, 34, 42, 43, 45, 46, 48, 60,
474 35, 75, 36, 37, 38, 54, 54, 54, 73, 38,
475 32, 76, 39, 39, 39, 32, 76, 34, 34, 34,
476 76, 35, 74, 40, 41, 49, 35, 48, 49, 55,
477 55, 57, 58, 56, 56, 56, 50, 50, 50, 61,
478 62, 65, 65, 49, 71, 66, 66, 66, 62, 51,
480 49, 48, 49, 49, 51, 31, 31, 31, 68, 50,
481 50, 50, 69, 70, 52, 53, 53, 56, 56, 56,
482 72, 73, 53, 56, 56, 56, 66, 66, 66, 58,
483 48, 63, 59, 67, 67, 47, 44, 30, 28, 27,
484 67, 66, 66, 66, 76, 76, 76, 76, 76, 76,
485 76, 53, 53, 76, 76, 76, 76, 76, 53, 29,
486 76, 29, 3, 76, 76, 76, 76, 76, 76, 76,
487 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
488 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
489 76, 76, 76, 76, 76, 76, 76, 76, 76
493 static yyconst flex_int16_t yy_chk[200] =
495 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
497 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1, 1, 1, 1, 1, 1, 15, 15, 15, 17,
499 79, 17, 17, 17, 20, 20, 22, 22, 29, 78,
500 17, 74, 17, 17, 17, 32, 32, 32, 72, 17,
501 18, 33, 18, 18, 18, 34, 33, 34, 34, 34,
502 29, 18, 70, 18, 18, 30, 34, 64, 30, 35,
503 35, 36, 36, 35, 35, 35, 30, 30, 30, 40,
504 40, 52, 52, 30, 63, 52, 52, 52, 61, 30,
506 30, 50, 30, 30, 30, 31, 31, 31, 59, 50,
507 50, 50, 60, 60, 31, 31, 31, 55, 55, 55,
508 69, 69, 31, 56, 56, 56, 65, 65, 65, 57,
509 49, 41, 37, 56, 56, 25, 21, 9, 8, 6,
510 56, 66, 66, 66, 3, 0, 0, 0, 0, 0,
511 0, 66, 66, 0, 0, 0, 0, 0, 66, 77,
512 0, 77, 76, 76, 76, 76, 76, 76, 76, 76,
513 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
514 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
515 76, 76, 76, 76, 76, 76, 76, 76, 76
519 static yy_state_type yy_last_accepting_state;
520 static char *yy_last_accepting_cpos;
522 extern int cppExpYY_flex_debug;
523 int cppExpYY_flex_debug = 0;
525 /* The intent behind this definition is that it'll catch
526 * any uses of REJECT which flex missed.
528 #define REJECT reject_used_but_not_detected
529 #define yymore() yymore_used_but_not_detected
530 #define YY_MORE_ADJ 0
531 #define YY_RESTORE_YY_MORE_OFFSET
534 /******************************************************************************
536 * $Id: constexp.l,v 1.11 2001/03/19 19:27:40 root Exp $
539 * Copyright (C) 1997-2012 by Dimitri van Heesch.
541 * Permission to use, copy, modify, and distribute this software and its
542 * documentation under the terms of the GNU General Public License is hereby
543 * granted. No representations are made about the suitability of this software
544 * for any purpose. It is provided "as is" without express or implied warranty.
545 * See the GNU General Public License for more details.
547 * Documents produced by Doxygen are derivative works derived from the
548 * input used in their production; they are not affected by this license.
551 #line 20 "constexp.l"
553 #include "constexp.h"
554 #include "cppvalue.h"
555 #include "ce_parse.h" // generated header file
557 #define YY_NEVER_INTERACTIVE 1
558 #define YY_NO_INPUT 1
561 CPPValue g_resultValue;
562 int g_constExpLineNr;
563 QCString g_constExpFileName;
565 static const char *g_inputString;
566 static int g_inputPosition;
569 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
571 static int yyread(char *buf,int max_size)
574 while( c < max_size && g_inputString[g_inputPosition] )
576 *buf = g_inputString[g_inputPosition++] ;
586 #ifndef YY_NO_UNISTD_H
587 /* Special case for "unistd.h", since it is non-ANSI. We include it way
588 * down here because we want the user's section 1 to have been scanned first.
589 * The user has a chance to override it with an option.
594 #ifndef YY_EXTRA_TYPE
595 #define YY_EXTRA_TYPE void *
598 static int yy_init_globals (void );
600 /* Accessor methods to globals.
601 These are made visible to non-reentrant scanners for convenience. */
603 int cppExpYYlex_destroy (void );
605 int cppExpYYget_debug (void );
607 void cppExpYYset_debug (int debug_flag );
609 YY_EXTRA_TYPE cppExpYYget_extra (void );
611 void cppExpYYset_extra (YY_EXTRA_TYPE user_defined );
613 FILE *cppExpYYget_in (void );
615 void cppExpYYset_in (FILE * in_str );
617 FILE *cppExpYYget_out (void );
619 void cppExpYYset_out (FILE * out_str );
621 yy_size_t cppExpYYget_leng (void );
623 char *cppExpYYget_text (void );
625 int cppExpYYget_lineno (void );
627 void cppExpYYset_lineno (int line_number );
629 /* Macros after this point can all be overridden by user definitions in
633 #ifndef YY_SKIP_YYWRAP
635 extern "C" int cppExpYYwrap (void );
637 extern int cppExpYYwrap (void );
642 static void yy_flex_strncpy (char *,yyconst char *,int );
645 #ifdef YY_NEED_STRLEN
646 static int yy_flex_strlen (yyconst char * );
652 static int yyinput (void );
654 static int input (void );
659 /* Amount of stuff to slurp up with each read. */
660 #ifndef YY_READ_BUF_SIZE
661 #define YY_READ_BUF_SIZE 262144
664 /* Copy whatever the last rule matched to the standard output. */
666 /* This used to be an fputs(), but since the string might contain NUL's,
667 * we now use fwrite().
669 #define ECHO fwrite( cppExpYYtext, cppExpYYleng, 1, cppExpYYout )
672 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
673 * is returned in "result".
676 #define YY_INPUT(buf,result,max_size) \
677 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
681 for ( n = 0; n < max_size && \
682 (c = getc( cppExpYYin )) != EOF && c != '\n'; ++n ) \
685 buf[n++] = (char) c; \
686 if ( c == EOF && ferror( cppExpYYin ) ) \
687 YY_FATAL_ERROR( "input in flex scanner failed" ); \
693 while ( (result = fread(buf, 1, max_size, cppExpYYin))==0 && ferror(cppExpYYin)) \
695 if( errno != EINTR) \
697 YY_FATAL_ERROR( "input in flex scanner failed" ); \
701 clearerr(cppExpYYin); \
708 /* No semi-colon after return; correct usage is to write "yyterminate();" -
709 * we don't want an extra ';' after the "return" because that will cause
710 * some compilers to complain about unreachable statements.
713 #define yyterminate() return YY_NULL
716 /* Number of entries by which start-condition stack grows. */
717 #ifndef YY_START_STACK_INCR
718 #define YY_START_STACK_INCR 25
721 /* Report a fatal error. */
722 #ifndef YY_FATAL_ERROR
723 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
726 /* end tables serialization structures and prototypes */
728 /* Default declaration of generated scanner - a define so the user can
729 * easily add parameters.
732 #define YY_DECL_IS_OURS 1
734 extern int cppExpYYlex (void);
736 #define YY_DECL int cppExpYYlex (void)
737 #endif /* !YY_DECL */
739 /* Code executed at the beginning of each rule, after cppExpYYtext and cppExpYYleng
742 #ifndef YY_USER_ACTION
743 #define YY_USER_ACTION
746 /* Code executed at the end of each rule. */
748 #define YY_BREAK break;
751 #define YY_RULE_SETUP \
754 /** The main scanner function which does all the work.
758 register yy_state_type yy_current_state;
759 register char *yy_cp, *yy_bp;
762 #line 56 "constexp.l"
776 (yy_start) = 1; /* first start state */
782 cppExpYYout = stdout;
784 if ( ! YY_CURRENT_BUFFER ) {
785 cppExpYYensure_buffer_stack ();
786 YY_CURRENT_BUFFER_LVALUE =
787 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE );
790 cppExpYY_load_buffer_state( );
793 while ( 1 ) /* loops until end-of-file is reached */
795 yy_cp = (yy_c_buf_p);
797 /* Support of cppExpYYtext. */
798 *yy_cp = (yy_hold_char);
800 /* yy_bp points to the position in yy_ch_buf of the start of
805 yy_current_state = (yy_start);
809 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
810 if ( yy_accept[yy_current_state] )
812 (yy_last_accepting_state) = yy_current_state;
813 (yy_last_accepting_cpos) = yy_cp;
815 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
817 yy_current_state = (int) yy_def[yy_current_state];
818 if ( yy_current_state >= 77 )
819 yy_c = yy_meta[(unsigned int) yy_c];
821 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
824 while ( yy_base[yy_current_state] != 163 );
827 yy_act = yy_accept[yy_current_state];
829 { /* have to back up */
830 yy_cp = (yy_last_accepting_cpos);
831 yy_current_state = (yy_last_accepting_state);
832 yy_act = yy_accept[yy_current_state];
837 do_action: /* This label is used only to access EOF actions. */
840 { /* beginning of action switch */
841 case 0: /* must back up */
842 /* undo the effects of YY_DO_BEFORE_ACTION */
843 *yy_cp = (yy_hold_char);
844 yy_cp = (yy_last_accepting_cpos);
845 yy_current_state = (yy_last_accepting_state);
850 #line 58 "constexp.l"
851 { return TOK_QUESTIONMARK; }
855 #line 59 "constexp.l"
856 { return TOK_COLON; }
860 #line 60 "constexp.l"
865 #line 61 "constexp.l"
870 #line 62 "constexp.l"
871 { return TOK_BITWISEOR; }
875 #line 63 "constexp.l"
876 { return TOK_BITWISEXOR; }
880 #line 64 "constexp.l"
881 { return TOK_AMPERSAND; }
885 #line 65 "constexp.l"
886 { return TOK_NOTEQUAL; }
890 #line 66 "constexp.l"
891 { return TOK_EQUAL; }
895 #line 67 "constexp.l"
896 { return TOK_LESSTHAN; }
900 #line 68 "constexp.l"
901 { return TOK_GREATERTHAN; }
905 #line 69 "constexp.l"
906 { return TOK_LESSTHANOREQUALTO; }
910 #line 70 "constexp.l"
911 { return TOK_GREATERTHANOREQUALTO; }
915 #line 71 "constexp.l"
916 { return TOK_SHIFTLEFT; }
920 #line 72 "constexp.l"
921 { return TOK_SHIFTRIGHT; }
925 #line 73 "constexp.l"
930 #line 74 "constexp.l"
931 { return TOK_MINUS; }
935 #line 75 "constexp.l"
940 #line 76 "constexp.l"
941 { return TOK_DIVIDE; }
945 #line 77 "constexp.l"
950 #line 78 "constexp.l"
951 { return TOK_TILDE; }
955 #line 79 "constexp.l"
960 #line 80 "constexp.l"
961 { return TOK_LPAREN; }
965 #line 81 "constexp.l"
966 { return TOK_RPAREN; }
970 #line 82 "constexp.l"
972 g_strToken=cppExpYYtext;
973 return TOK_CHARACTER;
978 #line 86 "constexp.l"
979 { g_strToken=cppExpYYtext;
985 #line 89 "constexp.l"
986 { g_strToken=cppExpYYtext;
987 return TOK_DECIMALINT;
992 #line 92 "constexp.l"
993 { g_strToken=cppExpYYtext+2;
994 return TOK_HEXADECIMALINT;
999 #line 95 "constexp.l"
1001 g_strToken=cppExpYYtext; return TOK_FLOAT;
1006 #line 98 "constexp.l"
1008 g_strToken=cppExpYYtext; return TOK_FLOAT;
1013 #line 101 "constexp.l"
1017 /* rule 32 can match eol */
1019 #line 102 "constexp.l"
1024 #line 104 "constexp.l"
1027 #line 1028 "<stdout>"
1028 case YY_STATE_EOF(INITIAL):
1031 case YY_END_OF_BUFFER:
1033 /* Amount of text matched not including the EOB char. */
1034 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1036 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1037 *yy_cp = (yy_hold_char);
1038 YY_RESTORE_YY_MORE_OFFSET
1040 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1042 /* We're scanning a new file or input source. It's
1043 * possible that this happened because the user
1044 * just pointed cppExpYYin at a new source and called
1045 * cppExpYYlex(). If so, then we have to assure
1046 * consistency between YY_CURRENT_BUFFER and our
1047 * globals. Here is the right place to do so, because
1048 * this is the first action (other than possibly a
1049 * back-up) that will match for the new input source.
1051 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1052 YY_CURRENT_BUFFER_LVALUE->yy_input_file = cppExpYYin;
1053 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1056 /* Note that here we test for yy_c_buf_p "<=" to the position
1057 * of the first EOB in the buffer, since yy_c_buf_p will
1058 * already have been incremented past the NUL character
1059 * (since all states make transitions on EOB to the
1060 * end-of-buffer state). Contrast this with the test
1063 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1064 { /* This was really a NUL. */
1065 yy_state_type yy_next_state;
1067 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1069 yy_current_state = yy_get_previous_state( );
1071 /* Okay, we're now positioned to make the NUL
1072 * transition. We couldn't have
1073 * yy_get_previous_state() go ahead and do it
1074 * for us because it doesn't know how to deal
1075 * with the possibility of jamming (and we don't
1076 * want to build jamming into it because then it
1077 * will run more slowly).
1080 yy_next_state = yy_try_NUL_trans( yy_current_state );
1082 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1084 if ( yy_next_state )
1086 /* Consume the NUL. */
1087 yy_cp = ++(yy_c_buf_p);
1088 yy_current_state = yy_next_state;
1094 yy_cp = (yy_c_buf_p);
1095 goto yy_find_action;
1099 else switch ( yy_get_next_buffer( ) )
1101 case EOB_ACT_END_OF_FILE:
1103 (yy_did_buffer_switch_on_eof) = 0;
1105 if ( cppExpYYwrap( ) )
1107 /* Note: because we've taken care in
1108 * yy_get_next_buffer() to have set up
1109 * cppExpYYtext, we can now set up
1110 * yy_c_buf_p so that if some total
1111 * hoser (like flex itself) wants to
1112 * call the scanner after we return the
1113 * YY_NULL, it'll still work - another
1114 * YY_NULL will get returned.
1116 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1118 yy_act = YY_STATE_EOF(YY_START);
1124 if ( ! (yy_did_buffer_switch_on_eof) )
1130 case EOB_ACT_CONTINUE_SCAN:
1132 (yytext_ptr) + yy_amount_of_matched_text;
1134 yy_current_state = yy_get_previous_state( );
1136 yy_cp = (yy_c_buf_p);
1137 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1140 case EOB_ACT_LAST_MATCH:
1142 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1144 yy_current_state = yy_get_previous_state( );
1146 yy_cp = (yy_c_buf_p);
1147 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1148 goto yy_find_action;
1155 "fatal flex scanner internal error--no action found" );
1156 } /* end of action switch */
1157 } /* end of scanning one token */
1158 } /* end of cppExpYYlex */
1160 /* yy_get_next_buffer - try to read in a new buffer
1162 * Returns a code representing an action:
1163 * EOB_ACT_LAST_MATCH -
1164 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1165 * EOB_ACT_END_OF_FILE - end of file
1167 static int yy_get_next_buffer (void)
1169 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1170 register char *source = (yytext_ptr);
1171 register int number_to_move, i;
1174 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1176 "fatal flex scanner internal error--end of buffer missed" );
1178 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1179 { /* Don't try to fill the buffer, so this is an EOF. */
1180 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1182 /* We matched a single character, the EOB, so
1183 * treat this as a final EOF.
1185 return EOB_ACT_END_OF_FILE;
1190 /* We matched some text prior to the EOB, first
1193 return EOB_ACT_LAST_MATCH;
1197 /* Try to read more data. */
1199 /* First move last chars to start of buffer. */
1200 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1202 for ( i = 0; i < number_to_move; ++i )
1203 *(dest++) = *(source++);
1205 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1206 /* don't do the read, it's not guaranteed to return an EOF,
1209 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1213 yy_size_t num_to_read =
1214 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1216 while ( num_to_read <= 0 )
1217 { /* Not enough room in the buffer - grow it. */
1219 /* just a shorter name for the current buffer */
1220 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1222 int yy_c_buf_p_offset =
1223 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1225 if ( b->yy_is_our_buffer )
1227 yy_size_t new_size = b->yy_buf_size * 2;
1229 if ( new_size <= 0 )
1230 b->yy_buf_size += b->yy_buf_size / 8;
1232 b->yy_buf_size *= 2;
1234 b->yy_ch_buf = (char *)
1235 /* Include room in for 2 EOB chars. */
1236 cppExpYYrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1239 /* Can't grow it, we don't own it. */
1242 if ( ! b->yy_ch_buf )
1244 "fatal error - scanner input buffer overflow" );
1246 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1248 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1253 if ( num_to_read > YY_READ_BUF_SIZE )
1254 num_to_read = YY_READ_BUF_SIZE;
1256 /* Read in more data. */
1257 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1258 (yy_n_chars), num_to_read );
1260 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1263 if ( (yy_n_chars) == 0 )
1265 if ( number_to_move == YY_MORE_ADJ )
1267 ret_val = EOB_ACT_END_OF_FILE;
1268 cppExpYYrestart(cppExpYYin );
1273 ret_val = EOB_ACT_LAST_MATCH;
1274 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1275 YY_BUFFER_EOF_PENDING;
1280 ret_val = EOB_ACT_CONTINUE_SCAN;
1282 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1283 /* Extend the array by 50%, plus the number we really need. */
1284 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1285 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cppExpYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1286 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1287 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1290 (yy_n_chars) += number_to_move;
1291 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1292 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1294 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1299 /* yy_get_previous_state - get the state just before the EOB char was reached */
1301 static yy_state_type yy_get_previous_state (void)
1303 register yy_state_type yy_current_state;
1304 register char *yy_cp;
1306 yy_current_state = (yy_start);
1308 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1310 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1311 if ( yy_accept[yy_current_state] )
1313 (yy_last_accepting_state) = yy_current_state;
1314 (yy_last_accepting_cpos) = yy_cp;
1316 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1318 yy_current_state = (int) yy_def[yy_current_state];
1319 if ( yy_current_state >= 77 )
1320 yy_c = yy_meta[(unsigned int) yy_c];
1322 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1325 return yy_current_state;
1328 /* yy_try_NUL_trans - try to make a transition on the NUL character
1331 * next_state = yy_try_NUL_trans( current_state );
1333 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1335 register int yy_is_jam;
1336 register char *yy_cp = (yy_c_buf_p);
1338 register YY_CHAR yy_c = 1;
1339 if ( yy_accept[yy_current_state] )
1341 (yy_last_accepting_state) = yy_current_state;
1342 (yy_last_accepting_cpos) = yy_cp;
1344 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1346 yy_current_state = (int) yy_def[yy_current_state];
1347 if ( yy_current_state >= 77 )
1348 yy_c = yy_meta[(unsigned int) yy_c];
1350 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1351 yy_is_jam = (yy_current_state == 76);
1353 return yy_is_jam ? 0 : yy_current_state;
1358 static int yyinput (void)
1360 static int input (void)
1366 *(yy_c_buf_p) = (yy_hold_char);
1368 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1370 /* yy_c_buf_p now points to the character we want to return.
1371 * If this occurs *before* the EOB characters, then it's a
1372 * valid NUL; if not, then we've hit the end of the buffer.
1374 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1375 /* This was really a NUL. */
1376 *(yy_c_buf_p) = '\0';
1379 { /* need more input */
1380 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1383 switch ( yy_get_next_buffer( ) )
1385 case EOB_ACT_LAST_MATCH:
1386 /* This happens because yy_g_n_b()
1387 * sees that we've accumulated a
1388 * token and flags that we need to
1389 * try matching the token before
1390 * proceeding. But for input(),
1391 * there's no matching to consider.
1392 * So convert the EOB_ACT_LAST_MATCH
1393 * to EOB_ACT_END_OF_FILE.
1396 /* Reset buffer status. */
1397 cppExpYYrestart(cppExpYYin );
1401 case EOB_ACT_END_OF_FILE:
1403 if ( cppExpYYwrap( ) )
1406 if ( ! (yy_did_buffer_switch_on_eof) )
1415 case EOB_ACT_CONTINUE_SCAN:
1416 (yy_c_buf_p) = (yytext_ptr) + offset;
1422 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1423 *(yy_c_buf_p) = '\0'; /* preserve cppExpYYtext */
1424 (yy_hold_char) = *++(yy_c_buf_p);
1428 #endif /* ifndef YY_NO_INPUT */
1430 /** Immediately switch to a different input stream.
1431 * @param input_file A readable stream.
1433 * @note This function does not reset the start condition to @c INITIAL .
1435 void cppExpYYrestart (FILE * input_file )
1438 if ( ! YY_CURRENT_BUFFER ){
1439 cppExpYYensure_buffer_stack ();
1440 YY_CURRENT_BUFFER_LVALUE =
1441 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE );
1444 cppExpYY_init_buffer(YY_CURRENT_BUFFER,input_file );
1445 cppExpYY_load_buffer_state( );
1448 /** Switch to a different input buffer.
1449 * @param new_buffer The new input buffer.
1452 void cppExpYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1455 /* TODO. We should be able to replace this entire function body
1457 * cppExpYYpop_buffer_state();
1458 * cppExpYYpush_buffer_state(new_buffer);
1460 cppExpYYensure_buffer_stack ();
1461 if ( YY_CURRENT_BUFFER == new_buffer )
1464 if ( YY_CURRENT_BUFFER )
1466 /* Flush out information for old buffer. */
1467 *(yy_c_buf_p) = (yy_hold_char);
1468 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1469 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1472 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1473 cppExpYY_load_buffer_state( );
1475 /* We don't actually know whether we did this switch during
1476 * EOF (cppExpYYwrap()) processing, but the only time this flag
1477 * is looked at is after cppExpYYwrap() is called, so it's safe
1478 * to go ahead and always set it.
1480 (yy_did_buffer_switch_on_eof) = 1;
1483 static void cppExpYY_load_buffer_state (void)
1485 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1486 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1487 cppExpYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1488 (yy_hold_char) = *(yy_c_buf_p);
1491 /** Allocate and initialize an input buffer state.
1492 * @param file A readable stream.
1493 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1495 * @return the allocated buffer state.
1497 YY_BUFFER_STATE cppExpYY_create_buffer (FILE * file, int size )
1501 b = (YY_BUFFER_STATE) cppExpYYalloc(sizeof( struct yy_buffer_state ) );
1503 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_create_buffer()" );
1505 b->yy_buf_size = size;
1507 /* yy_ch_buf has to be 2 characters longer than the size given because
1508 * we need to put in 2 end-of-buffer characters.
1510 b->yy_ch_buf = (char *) cppExpYYalloc(b->yy_buf_size + 2 );
1511 if ( ! b->yy_ch_buf )
1512 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_create_buffer()" );
1514 b->yy_is_our_buffer = 1;
1516 cppExpYY_init_buffer(b,file );
1521 /** Destroy the buffer.
1522 * @param b a buffer created with cppExpYY_create_buffer()
1525 void cppExpYY_delete_buffer (YY_BUFFER_STATE b )
1531 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1532 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1534 if ( b->yy_is_our_buffer )
1535 cppExpYYfree((void *) b->yy_ch_buf );
1537 cppExpYYfree((void *) b );
1541 extern int isatty (int );
1542 #endif /* __cplusplus */
1544 /* Initializes or reinitializes a buffer.
1545 * This function is sometimes called more than once on the same buffer,
1546 * such as during a cppExpYYrestart() or at EOF.
1548 static void cppExpYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
1553 cppExpYY_flush_buffer(b );
1555 b->yy_input_file = file;
1556 b->yy_fill_buffer = 1;
1558 /* If b is the current buffer, then cppExpYY_init_buffer was _probably_
1559 * called from cppExpYYrestart() or through yy_get_next_buffer.
1560 * In that case, we don't want to reset the lineno or column.
1562 if (b != YY_CURRENT_BUFFER){
1563 b->yy_bs_lineno = 1;
1564 b->yy_bs_column = 0;
1567 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1572 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1573 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1576 void cppExpYY_flush_buffer (YY_BUFFER_STATE b )
1583 /* We always need two end-of-buffer characters. The first causes
1584 * a transition to the end-of-buffer state. The second causes
1585 * a jam in that state.
1587 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1588 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1590 b->yy_buf_pos = &b->yy_ch_buf[0];
1593 b->yy_buffer_status = YY_BUFFER_NEW;
1595 if ( b == YY_CURRENT_BUFFER )
1596 cppExpYY_load_buffer_state( );
1599 /** Pushes the new state onto the stack. The new state becomes
1600 * the current state. This function will allocate the stack
1602 * @param new_buffer The new state.
1605 void cppExpYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
1607 if (new_buffer == NULL)
1610 cppExpYYensure_buffer_stack();
1612 /* This block is copied from cppExpYY_switch_to_buffer. */
1613 if ( YY_CURRENT_BUFFER )
1615 /* Flush out information for old buffer. */
1616 *(yy_c_buf_p) = (yy_hold_char);
1617 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1618 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1621 /* Only push if top exists. Otherwise, replace top. */
1622 if (YY_CURRENT_BUFFER)
1623 (yy_buffer_stack_top)++;
1624 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1626 /* copied from cppExpYY_switch_to_buffer. */
1627 cppExpYY_load_buffer_state( );
1628 (yy_did_buffer_switch_on_eof) = 1;
1631 /** Removes and deletes the top of the stack, if present.
1632 * The next element becomes the new top.
1635 void cppExpYYpop_buffer_state (void)
1637 if (!YY_CURRENT_BUFFER)
1640 cppExpYY_delete_buffer(YY_CURRENT_BUFFER );
1641 YY_CURRENT_BUFFER_LVALUE = NULL;
1642 if ((yy_buffer_stack_top) > 0)
1643 --(yy_buffer_stack_top);
1645 if (YY_CURRENT_BUFFER) {
1646 cppExpYY_load_buffer_state( );
1647 (yy_did_buffer_switch_on_eof) = 1;
1651 /* Allocates the stack if it does not exist.
1652 * Guarantees space for at least one push.
1654 static void cppExpYYensure_buffer_stack (void)
1656 yy_size_t num_to_alloc;
1658 if (!(yy_buffer_stack)) {
1660 /* First allocation is just for 2 elements, since we don't know if this
1661 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1662 * immediate realloc on the next call.
1665 (yy_buffer_stack) = (struct yy_buffer_state**)cppExpYYalloc
1666 (num_to_alloc * sizeof(struct yy_buffer_state*)
1668 if ( ! (yy_buffer_stack) )
1669 YY_FATAL_ERROR( "out of dynamic memory in cppExpYYensure_buffer_stack()" );
1671 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1673 (yy_buffer_stack_max) = num_to_alloc;
1674 (yy_buffer_stack_top) = 0;
1678 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1680 /* Increase the buffer to prepare for a possible push. */
1681 int grow_size = 8 /* arbitrary grow size */;
1683 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1684 (yy_buffer_stack) = (struct yy_buffer_state**)cppExpYYrealloc
1686 num_to_alloc * sizeof(struct yy_buffer_state*)
1688 if ( ! (yy_buffer_stack) )
1689 YY_FATAL_ERROR( "out of dynamic memory in cppExpYYensure_buffer_stack()" );
1691 /* zero only the new slots.*/
1692 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1693 (yy_buffer_stack_max) = num_to_alloc;
1697 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1698 * @param base the character buffer
1699 * @param size the size in bytes of the character buffer
1701 * @return the newly allocated buffer state object.
1703 YY_BUFFER_STATE cppExpYY_scan_buffer (char * base, yy_size_t size )
1708 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1709 base[size-1] != YY_END_OF_BUFFER_CHAR )
1710 /* They forgot to leave room for the EOB's. */
1713 b = (YY_BUFFER_STATE) cppExpYYalloc(sizeof( struct yy_buffer_state ) );
1715 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_scan_buffer()" );
1717 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1718 b->yy_buf_pos = b->yy_ch_buf = base;
1719 b->yy_is_our_buffer = 0;
1720 b->yy_input_file = 0;
1721 b->yy_n_chars = b->yy_buf_size;
1722 b->yy_is_interactive = 0;
1724 b->yy_fill_buffer = 0;
1725 b->yy_buffer_status = YY_BUFFER_NEW;
1727 cppExpYY_switch_to_buffer(b );
1732 /** Setup the input buffer state to scan a string. The next call to cppExpYYlex() will
1733 * scan from a @e copy of @a str.
1734 * @param yystr a NUL-terminated string to scan
1736 * @return the newly allocated buffer state object.
1737 * @note If you want to scan bytes that may contain NUL values, then use
1738 * cppExpYY_scan_bytes() instead.
1740 YY_BUFFER_STATE cppExpYY_scan_string (yyconst char * yystr )
1743 return cppExpYY_scan_bytes(yystr,strlen(yystr) );
1746 /** Setup the input buffer state to scan the given bytes. The next call to cppExpYYlex() will
1747 * scan from a @e copy of @a bytes.
1748 * @param bytes the byte buffer to scan
1749 * @param len the number of bytes in the buffer pointed to by @a bytes.
1751 * @return the newly allocated buffer state object.
1753 YY_BUFFER_STATE cppExpYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1759 /* Get memory for full buffer, including space for trailing EOB's. */
1760 n = _yybytes_len + 2;
1761 buf = (char *) cppExpYYalloc(n );
1763 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_scan_bytes()" );
1765 for ( i = 0; i < _yybytes_len; ++i )
1766 buf[i] = yybytes[i];
1768 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1770 b = cppExpYY_scan_buffer(buf,n );
1772 YY_FATAL_ERROR( "bad buffer in cppExpYY_scan_bytes()" );
1774 /* It's okay to grow etc. this buffer, and we should throw it
1775 * away when we're done.
1777 b->yy_is_our_buffer = 1;
1782 #ifndef YY_EXIT_FAILURE
1783 #define YY_EXIT_FAILURE 2
1786 static void yy_fatal_error (yyconst char* msg )
1788 (void) fprintf( stderr, "%s\n", msg );
1789 exit( YY_EXIT_FAILURE );
1792 /* Redefine yyless() so it works in section 3 code. */
1798 /* Undo effects of setting up cppExpYYtext. */ \
1799 int yyless_macro_arg = (n); \
1800 YY_LESS_LINENO(yyless_macro_arg);\
1801 cppExpYYtext[cppExpYYleng] = (yy_hold_char); \
1802 (yy_c_buf_p) = cppExpYYtext + yyless_macro_arg; \
1803 (yy_hold_char) = *(yy_c_buf_p); \
1804 *(yy_c_buf_p) = '\0'; \
1805 cppExpYYleng = yyless_macro_arg; \
1809 /* Accessor methods (get/set functions) to struct members. */
1811 /** Get the current line number.
1814 int cppExpYYget_lineno (void)
1817 return cppExpYYlineno;
1820 /** Get the input stream.
1823 FILE *cppExpYYget_in (void)
1828 /** Get the output stream.
1831 FILE *cppExpYYget_out (void)
1836 /** Get the length of the current token.
1839 yy_size_t cppExpYYget_leng (void)
1841 return cppExpYYleng;
1844 /** Get the current token.
1848 char *cppExpYYget_text (void)
1850 return cppExpYYtext;
1853 /** Set the current line number.
1854 * @param line_number
1857 void cppExpYYset_lineno (int line_number )
1860 cppExpYYlineno = line_number;
1863 /** Set the input stream. This does not discard the current
1865 * @param in_str A readable stream.
1867 * @see cppExpYY_switch_to_buffer
1869 void cppExpYYset_in (FILE * in_str )
1871 cppExpYYin = in_str ;
1874 void cppExpYYset_out (FILE * out_str )
1876 cppExpYYout = out_str ;
1879 int cppExpYYget_debug (void)
1881 return cppExpYY_flex_debug;
1884 void cppExpYYset_debug (int bdebug )
1886 cppExpYY_flex_debug = bdebug ;
1889 static int yy_init_globals (void)
1891 /* Initialization is the same as for the non-reentrant scanner.
1892 * This function is called from cppExpYYlex_destroy(), so don't allocate here.
1895 (yy_buffer_stack) = 0;
1896 (yy_buffer_stack_top) = 0;
1897 (yy_buffer_stack_max) = 0;
1898 (yy_c_buf_p) = (char *) 0;
1902 /* Defined in main.c */
1905 cppExpYYout = stdout;
1907 cppExpYYin = (FILE *) 0;
1908 cppExpYYout = (FILE *) 0;
1911 /* For future reference: Set errno on error, since we are called by
1912 * cppExpYYlex_init()
1917 /* cppExpYYlex_destroy is for both reentrant and non-reentrant scanners. */
1918 int cppExpYYlex_destroy (void)
1921 /* Pop the buffer stack, destroying each element. */
1922 while(YY_CURRENT_BUFFER){
1923 cppExpYY_delete_buffer(YY_CURRENT_BUFFER );
1924 YY_CURRENT_BUFFER_LVALUE = NULL;
1925 cppExpYYpop_buffer_state();
1928 /* Destroy the stack itself. */
1929 cppExpYYfree((yy_buffer_stack) );
1930 (yy_buffer_stack) = NULL;
1932 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1933 * cppExpYYlex() is called, initialization will occur. */
1940 * Internal utility routines.
1944 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1947 for ( i = 0; i < n; ++i )
1952 #ifdef YY_NEED_STRLEN
1953 static int yy_flex_strlen (yyconst char * s )
1956 for ( n = 0; s[n]; ++n )
1963 void *cppExpYYalloc (yy_size_t size )
1965 return (void *) malloc( size );
1968 void *cppExpYYrealloc (void * ptr, yy_size_t size )
1970 /* The cast to (char *) in the following accommodates both
1971 * implementations that use char* generic pointers, and those
1972 * that use void* generic pointers. It works with the latter
1973 * because both ANSI C and C++ allow castless assignment from
1974 * any pointer type to void*, and deal with argument conversions
1975 * as though doing an assignment.
1977 return (void *) realloc( (char *) ptr, size );
1980 void cppExpYYfree (void * ptr )
1982 free( (char *) ptr ); /* see cppExpYYrealloc() for (char *) cast */
1985 #define YYTABLES_NAME "yytables"
1987 #line 104 "constexp.l"
1991 bool parseCppExpression(const char *fileName,int lineNr,const QCString &s)
1993 //printf("Expression: `%s'\n",s.data());
1994 g_constExpFileName = fileName;
1995 g_constExpLineNr = lineNr;
1997 g_inputPosition = 0;
1998 cppExpYYrestart( cppExpYYin );
2000 //printf("Result: %ld\n",(long)g_resultValue);
2001 return (long)g_resultValue!=0;
2005 int cppExpYYwrap() { return 1; }