Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/ce_lex.cpp

Source at commit 1322 created 12 years 8 months ago.
By meklort, Add doxygen to utils folder
1
2#line 3 "<stdout>"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
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
26
27#define FLEX_SCANNER
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
32#define FLEX_BETA
33#endif
34
35/* First, we deal with platform-specific or compiler-specific issues. */
36
37/* begin standard C headers. */
38#include <stdio.h>
39#include <string.h>
40#include <errno.h>
41#include <stdlib.h>
42
43/* end standard C headers. */
44
45/* flex integer type definitions */
46
47#ifndef FLEXINT_H
48#define FLEXINT_H
49
50/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
56 */
57#ifndef __STDC_LIMIT_MACROS
58#define __STDC_LIMIT_MACROS 1
59#endif
60
61#include <inttypes.h>
62typedef int8_t flex_int8_t;
63typedef uint8_t flex_uint8_t;
64typedef int16_t flex_int16_t;
65typedef uint16_t flex_uint16_t;
66typedef int32_t flex_int32_t;
67typedef uint32_t flex_uint32_t;
68#else
69typedef signed char flex_int8_t;
70typedef short int flex_int16_t;
71typedef int flex_int32_t;
72typedef unsigned char flex_uint8_t;
73typedef unsigned short int flex_uint16_t;
74typedef unsigned int flex_uint32_t;
75#endif /* ! C99 */
76
77/* Limits of integral types. */
78#ifndef INT8_MIN
79#define INT8_MIN (-128)
80#endif
81#ifndef INT16_MIN
82#define INT16_MIN (-32767-1)
83#endif
84#ifndef INT32_MIN
85#define INT32_MIN (-2147483647-1)
86#endif
87#ifndef INT8_MAX
88#define INT8_MAX (127)
89#endif
90#ifndef INT16_MAX
91#define INT16_MAX (32767)
92#endif
93#ifndef INT32_MAX
94#define INT32_MAX (2147483647)
95#endif
96#ifndef UINT8_MAX
97#define UINT8_MAX (255U)
98#endif
99#ifndef UINT16_MAX
100#define UINT16_MAX (65535U)
101#endif
102#ifndef UINT32_MAX
103#define UINT32_MAX (4294967295U)
104#endif
105
106#endif /* ! FLEXINT_H */
107
108#ifdef __cplusplus
109
110/* The "const" storage-class-modifier is valid. */
111#define YY_USE_CONST
112
113#else/* ! __cplusplus */
114
115/* C99 requires __STDC__ to be defined as 1. */
116#if defined (__STDC__)
117
118#define YY_USE_CONST
119
120#endif/* defined (__STDC__) */
121#endif/* ! __cplusplus */
122
123#ifdef YY_USE_CONST
124#define yyconst const
125#else
126#define yyconst
127#endif
128
129/* Returned upon end-of-file. */
130#define YY_NULL 0
131
132/* Promotes a possibly negative, possibly signed char to an unsigned
133 * integer for use as an array index. If the signed char is negative,
134 * we want to instead treat it as an 8-bit unsigned char, hence the
135 * double cast.
136 */
137#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
138
139/* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
142 */
143#define BEGIN (yy_start) = 1 + 2 *
144
145/* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
147 * compatibility.
148 */
149#define YY_START (((yy_start) - 1) / 2)
150#define YYSTATE YY_START
151
152/* Action number for EOF rule of a given start state. */
153#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155/* Special action meaning "start processing a new file". */
156#define YY_NEW_FILE cppExpYYrestart(cppExpYYin )
157
158#define YY_END_OF_BUFFER_CHAR 0
159
160/* Size of default input buffer. */
161#ifndef YY_BUF_SIZE
162#define YY_BUF_SIZE 262144
163#endif
164
165/* The state buf must be large enough to hold one state per character in the main buffer.
166 */
167#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169#ifndef YY_TYPEDEF_YY_BUFFER_STATE
170#define YY_TYPEDEF_YY_BUFFER_STATE
171typedef struct yy_buffer_state *YY_BUFFER_STATE;
172#endif
173
174#ifndef YY_TYPEDEF_YY_SIZE_T
175#define YY_TYPEDEF_YY_SIZE_T
176typedef size_t yy_size_t;
177#endif
178
179extern yy_size_t cppExpYYleng;
180
181extern FILE *cppExpYYin, *cppExpYYout;
182
183#define EOB_ACT_CONTINUE_SCAN 0
184#define EOB_ACT_END_OF_FILE 1
185#define EOB_ACT_LAST_MATCH 2
186
187 #define YY_LESS_LINENO(n)
188
189/* Return all but the first "n" matched characters back to the input stream. */
190#define yyless(n) \
191do \
192{ \
193/* Undo effects of setting up cppExpYYtext. */ \
194 int yyless_macro_arg = (n); \
195 YY_LESS_LINENO(yyless_macro_arg);\
196*yy_cp = (yy_hold_char); \
197YY_RESTORE_YY_MORE_OFFSET \
198(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
199YY_DO_BEFORE_ACTION; /* set up cppExpYYtext again */ \
200} \
201while ( 0 )
202
203#define unput(c) yyunput( c, (yytext_ptr) )
204
205#ifndef YY_STRUCT_YY_BUFFER_STATE
206#define YY_STRUCT_YY_BUFFER_STATE
207struct yy_buffer_state
208{
209FILE *yy_input_file;
210
211char *yy_ch_buf;/* input buffer */
212char *yy_buf_pos;/* current position in input buffer */
213
214/* Size of input buffer in bytes, not including room for EOB
215 * characters.
216 */
217yy_size_t yy_buf_size;
218
219/* Number of characters read into yy_ch_buf, not including EOB
220 * characters.
221 */
222yy_size_t yy_n_chars;
223
224/* Whether we "own" the buffer - i.e., we know we created it,
225 * and can realloc() it to grow it, and should free() it to
226 * delete it.
227 */
228int yy_is_our_buffer;
229
230/* Whether this is an "interactive" input source; if so, and
231 * if we're using stdio for input, then we want to use getc()
232 * instead of fread(), to make sure we stop fetching input after
233 * each newline.
234 */
235int yy_is_interactive;
236
237/* Whether we're considered to be at the beginning of a line.
238 * If so, '^' rules will be active on the next match, otherwise
239 * not.
240 */
241int yy_at_bol;
242
243 int yy_bs_lineno; /**< The line count. */
244 int yy_bs_column; /**< The column count. */
245
246/* Whether to try to fill the input buffer when we reach the
247 * end of it.
248 */
249int yy_fill_buffer;
250
251int yy_buffer_status;
252
253#define YY_BUFFER_NEW 0
254#define YY_BUFFER_NORMAL 1
255/* When an EOF's been seen but there's still some text to process
256 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257 * shouldn't try reading from the input source any more. We might
258 * still have a bunch of tokens to match, though, because of
259 * possible backing-up.
260 *
261 * When we actually see the EOF, we change the status to "new"
262 * (via cppExpYYrestart()), so that the user can continue scanning by
263 * just pointing cppExpYYin at a new input file.
264 */
265#define YY_BUFFER_EOF_PENDING 2
266
267};
268#endif /* !YY_STRUCT_YY_BUFFER_STATE */
269
270/* Stack of input buffers. */
271static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
274
275/* We provide macros for accessing buffer states in case in the
276 * future we want to put the buffer states in a more general
277 * "scanner state".
278 *
279 * Returns the top of the stack, or NULL.
280 */
281#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
283 : NULL)
284
285/* Same as previous macro, but useful when we know that the buffer stack is not
286 * NULL or when we need an lvalue. For internal use only.
287 */
288#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
289
290/* yy_hold_char holds the character lost when cppExpYYtext is formed. */
291static char yy_hold_char;
292static yy_size_t yy_n_chars;/* number of characters read into yy_ch_buf */
293yy_size_t cppExpYYleng;
294
295/* Points to current character in buffer. */
296static char *yy_c_buf_p = (char *) 0;
297static int yy_init = 0;/* whether we need to initialize */
298static int yy_start = 0;/* start state number */
299
300/* Flag which is used to allow cppExpYYwrap()'s to do buffer switches
301 * instead of setting up a fresh cppExpYYin. A bit of a hack ...
302 */
303static int yy_did_buffer_switch_on_eof;
304
305void cppExpYYrestart (FILE *input_file );
306void cppExpYY_switch_to_buffer (YY_BUFFER_STATE new_buffer );
307YY_BUFFER_STATE cppExpYY_create_buffer (FILE *file,int size );
308void cppExpYY_delete_buffer (YY_BUFFER_STATE b );
309void cppExpYY_flush_buffer (YY_BUFFER_STATE b );
310void cppExpYYpush_buffer_state (YY_BUFFER_STATE new_buffer );
311void cppExpYYpop_buffer_state (void );
312
313static void cppExpYYensure_buffer_stack (void );
314static void cppExpYY_load_buffer_state (void );
315static void cppExpYY_init_buffer (YY_BUFFER_STATE b,FILE *file );
316
317#define YY_FLUSH_BUFFER cppExpYY_flush_buffer(YY_CURRENT_BUFFER )
318
319YY_BUFFER_STATE cppExpYY_scan_buffer (char *base,yy_size_t size );
320YY_BUFFER_STATE cppExpYY_scan_string (yyconst char *yy_str );
321YY_BUFFER_STATE cppExpYY_scan_bytes (yyconst char *bytes,yy_size_t len );
322
323void *cppExpYYalloc (yy_size_t );
324void *cppExpYYrealloc (void *,yy_size_t );
325void cppExpYYfree (void * );
326
327#define yy_new_buffer cppExpYY_create_buffer
328
329#define yy_set_interactive(is_interactive) \
330{ \
331if ( ! YY_CURRENT_BUFFER ){ \
332 cppExpYYensure_buffer_stack (); \
333YY_CURRENT_BUFFER_LVALUE = \
334 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); \
335} \
336YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337}
338
339#define yy_set_bol(at_bol) \
340{ \
341if ( ! YY_CURRENT_BUFFER ){\
342 cppExpYYensure_buffer_stack (); \
343YY_CURRENT_BUFFER_LVALUE = \
344 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); \
345} \
346YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347}
348
349#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
350
351/* Begin user sect3 */
352
353typedef unsigned char YY_CHAR;
354
355FILE *cppExpYYin = (FILE *) 0, *cppExpYYout = (FILE *) 0;
356
357typedef int yy_state_type;
358
359extern int cppExpYYlineno;
360
361int cppExpYYlineno = 1;
362
363extern char *cppExpYYtext;
364#define yytext_ptr cppExpYYtext
365
366static yy_state_type yy_get_previous_state (void );
367static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
368static int yy_get_next_buffer (void );
369static void yy_fatal_error (yyconst char msg[] );
370
371/* Done after the current pattern has been matched and before the
372 * corresponding action - sets up cppExpYYtext.
373 */
374#define YY_DO_BEFORE_ACTION \
375(yytext_ptr) = yy_bp; \
376cppExpYYleng = (size_t) (yy_cp - yy_bp); \
377(yy_hold_char) = *yy_cp; \
378*yy_cp = '\0'; \
379(yy_c_buf_p) = yy_cp;
380
381#define YY_NUM_RULES 33
382#define YY_END_OF_BUFFER 34
383/* This struct is not used in this scanner,
384 but its presence is necessary. */
385struct yy_trans_info
386{
387flex_int32_t yy_verify;
388flex_int32_t yy_nxt;
389};
390static yyconst flex_int16_t yy_accept[77] =
391 { 0,
392 0, 0, 34, 31, 32, 22, 20, 7, 31, 23,
393 24, 18, 16, 17, 31, 19, 26, 27, 2, 10,
394 31, 11, 1, 6, 5, 21, 8, 4, 0, 0,
395 29, 29, 26, 0, 0, 26, 26, 0, 27, 27,
396 27, 14, 12, 9, 13, 15, 3, 25, 0, 0,
397 0, 0, 29, 29, 0, 30, 26, 26, 26, 28,
398 27, 27, 27, 0, 0, 29, 30, 26, 28, 28,
399 27, 28, 28, 28, 28, 0
400 } ;
401
402static yyconst flex_int32_t yy_ec[256] =
403 { 0,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
405 1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 4, 5, 1, 1, 6, 7, 8, 9,
408 10, 11, 12, 1, 13, 14, 15, 16, 17, 17,
409 17, 17, 17, 17, 17, 18, 18, 19, 1, 20,
410 21, 22, 23, 1, 24, 24, 24, 24, 25, 26,
411 1, 1, 1, 1, 1, 27, 1, 1, 1, 1,
412 1, 1, 1, 1, 28, 1, 1, 29, 1, 1,
413 1, 30, 1, 31, 1, 1, 32, 32, 24, 24,
414
415 25, 33, 1, 1, 1, 1, 1, 27, 1, 5,
416 1, 1, 1, 5, 1, 5, 28, 5, 1, 34,
417 1, 1, 1, 35, 1, 36, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 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
426 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
432 } ;
433
434static yyconst flex_int32_t yy_meta[37] =
435 { 0,
436 1, 2, 2, 1, 1, 1, 1, 2, 1, 1,
437 1, 1, 1, 1, 1, 3, 3, 3, 1, 1,
438 1, 1, 1, 3, 3, 3, 1, 1, 1, 1,
439 1, 3, 3, 1, 1, 1
440 } ;
441
442static yyconst flex_int16_t yy_base[80] =
443 { 0,
444 0, 0, 145, 163, 163, 119, 163, 132, 108, 163,
445 163, 163, 163, 163, 21, 163, 26, 47, 163, 25,
446 116, 26, 163, 163, 101, 163, 163, 163, 41, 71,
447 90, 40, 33, 52, 68, 55, 106, 0, 0, 63,
448 105, 163, 163, 163, 163, 163, 163, 163, 123, 94,
449 0, 80, 163, 0, 102, 108, 102, 163, 82, 86,
450 71, 163, 68, 70, 111, 126, 163, 163, 94, 46,
451 163, 31, 163, 25, 163, 163, 159, 47, 38
452 } ;
453
454static yyconst flex_int16_t yy_def[80] =
455 { 0,
456 76, 1, 76, 76, 76, 76, 76, 76, 77, 76,
457 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
458 76, 76, 76, 76, 76, 76, 76, 76, 77, 76,
459 76, 31, 17, 76, 76, 76, 76, 78, 18, 76,
460 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
461 79, 76, 76, 32, 76, 76, 76, 76, 76, 78,
462 76, 76, 76, 79, 76, 76, 76, 76, 76, 76,
463 76, 76, 76, 76, 76, 0, 76, 76, 76
464 } ;
465
466static yyconst flex_int16_t yy_nxt[200] =
467 { 0,
468 4, 5, 4, 6, 4, 7, 8, 9, 10, 11,
469 12, 13, 14, 15, 16, 17, 18, 18, 19, 20,
470 21, 22, 23, 4, 4, 4, 4, 4, 4, 4,
471 24, 4, 4, 4, 25, 26, 31, 31, 31, 32,
472 64, 33, 33, 34, 42, 43, 45, 46, 48, 60,
473 35, 75, 36, 37, 38, 54, 54, 54, 73, 38,
474 32, 76, 39, 39, 39, 32, 76, 34, 34, 34,
475 76, 35, 74, 40, 41, 49, 35, 48, 49, 55,
476 55, 57, 58, 56, 56, 56, 50, 50, 50, 61,
477 62, 65, 65, 49, 71, 66, 66, 66, 62, 51,
478
479 49, 48, 49, 49, 51, 31, 31, 31, 68, 50,
480 50, 50, 69, 70, 52, 53, 53, 56, 56, 56,
481 72, 73, 53, 56, 56, 56, 66, 66, 66, 58,
482 48, 63, 59, 67, 67, 47, 44, 30, 28, 27,
483 67, 66, 66, 66, 76, 76, 76, 76, 76, 76,
484 76, 53, 53, 76, 76, 76, 76, 76, 53, 29,
485 76, 29, 3, 76, 76, 76, 76, 76, 76, 76,
486 76, 76, 76, 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
489
490 } ;
491
492static yyconst flex_int16_t yy_chk[200] =
493 { 0,
494 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 15, 15, 15, 17,
498 79, 17, 17, 17, 20, 20, 22, 22, 29, 78,
499 17, 74, 17, 17, 17, 32, 32, 32, 72, 17,
500 18, 33, 18, 18, 18, 34, 33, 34, 34, 34,
501 29, 18, 70, 18, 18, 30, 34, 64, 30, 35,
502 35, 36, 36, 35, 35, 35, 30, 30, 30, 40,
503 40, 52, 52, 30, 63, 52, 52, 52, 61, 30,
504
505 30, 50, 30, 30, 30, 31, 31, 31, 59, 50,
506 50, 50, 60, 60, 31, 31, 31, 55, 55, 55,
507 69, 69, 31, 56, 56, 56, 65, 65, 65, 57,
508 49, 41, 37, 56, 56, 25, 21, 9, 8, 6,
509 56, 66, 66, 66, 3, 0, 0, 0, 0, 0,
510 0, 66, 66, 0, 0, 0, 0, 0, 66, 77,
511 0, 77, 76, 76, 76, 76, 76, 76, 76, 76,
512 76, 76, 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
515
516 } ;
517
518static yy_state_type yy_last_accepting_state;
519static char *yy_last_accepting_cpos;
520
521extern int cppExpYY_flex_debug;
522int cppExpYY_flex_debug = 0;
523
524/* The intent behind this definition is that it'll catch
525 * any uses of REJECT which flex missed.
526 */
527#define REJECT reject_used_but_not_detected
528#define yymore() yymore_used_but_not_detected
529#define YY_MORE_ADJ 0
530#define YY_RESTORE_YY_MORE_OFFSET
531char *cppExpYYtext;
532#line 1 "constexp.l"
533/******************************************************************************
534 *
535 * $Id: constexp.l,v 1.11 2001/03/19 19:27:40 root Exp $
536 *
537 *
538 * Copyright (C) 1997-2011 by Dimitri van Heesch.
539 *
540 * Permission to use, copy, modify, and distribute this software and its
541 * documentation under the terms of the GNU General Public License is hereby
542 * granted. No representations are made about the suitability of this software
543 * for any purpose. It is provided "as is" without express or implied warranty.
544 * See the GNU General Public License for more details.
545 *
546 * Documents produced by Doxygen are derivative works derived from the
547 * input used in their production; they are not affected by this license.
548 *
549 */
550#line 20 "constexp.l"
551
552#include "constexp.h"
553#include "cppvalue.h"
554#include "ce_parse.h" // generated header file
555
556#define YY_NEVER_INTERACTIVE 1
557
558QCString g_strToken;
559CPPValue g_resultValue;
560int g_constExpLineNr;
561QCString g_constExpFileName;
562
563static const char *g_inputString;
564static int g_inputPosition;
565
566#undef YY_INPUT
567#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
568
569static int yyread(char *buf,int max_size)
570{
571 int c=0;
572 while( c < max_size && g_inputString[g_inputPosition] )
573 {
574 *buf = g_inputString[g_inputPosition++] ;
575 c++; buf++;
576 }
577 return c;
578}
579
580#line 581 "<stdout>"
581
582#define INITIAL 0
583
584#ifndef YY_NO_UNISTD_H
585/* Special case for "unistd.h", since it is non-ANSI. We include it way
586 * down here because we want the user's section 1 to have been scanned first.
587 * The user has a chance to override it with an option.
588 */
589#include <unistd.h>
590#endif
591
592#ifndef YY_EXTRA_TYPE
593#define YY_EXTRA_TYPE void *
594#endif
595
596static int yy_init_globals (void );
597
598/* Accessor methods to globals.
599 These are made visible to non-reentrant scanners for convenience. */
600
601int cppExpYYlex_destroy (void );
602
603int cppExpYYget_debug (void );
604
605void cppExpYYset_debug (int debug_flag );
606
607YY_EXTRA_TYPE cppExpYYget_extra (void );
608
609void cppExpYYset_extra (YY_EXTRA_TYPE user_defined );
610
611FILE *cppExpYYget_in (void );
612
613void cppExpYYset_in (FILE * in_str );
614
615FILE *cppExpYYget_out (void );
616
617void cppExpYYset_out (FILE * out_str );
618
619yy_size_t cppExpYYget_leng (void );
620
621char *cppExpYYget_text (void );
622
623int cppExpYYget_lineno (void );
624
625void cppExpYYset_lineno (int line_number );
626
627/* Macros after this point can all be overridden by user definitions in
628 * section 1.
629 */
630
631#ifndef YY_SKIP_YYWRAP
632#ifdef __cplusplus
633extern "C" int cppExpYYwrap (void );
634#else
635extern int cppExpYYwrap (void );
636#endif
637#endif
638
639#ifndef yytext_ptr
640static void yy_flex_strncpy (char *,yyconst char *,int );
641#endif
642
643#ifdef YY_NEED_STRLEN
644static int yy_flex_strlen (yyconst char * );
645#endif
646
647#ifndef YY_NO_INPUT
648
649#ifdef __cplusplus
650static int yyinput (void );
651#else
652static int input (void );
653#endif
654
655#endif
656
657/* Amount of stuff to slurp up with each read. */
658#ifndef YY_READ_BUF_SIZE
659#define YY_READ_BUF_SIZE 262144
660#endif
661
662/* Copy whatever the last rule matched to the standard output. */
663#ifndef ECHO
664/* This used to be an fputs(), but since the string might contain NUL's,
665 * we now use fwrite().
666 */
667#define ECHO fwrite( cppExpYYtext, cppExpYYleng, 1, cppExpYYout )
668#endif
669
670/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
671 * is returned in "result".
672 */
673#ifndef YY_INPUT
674#define YY_INPUT(buf,result,max_size) \
675if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
676{ \
677int c = '*'; \
678yy_size_t n; \
679for ( n = 0; n < max_size && \
680 (c = getc( cppExpYYin )) != EOF && c != '\n'; ++n ) \
681buf[n] = (char) c; \
682if ( c == '\n' ) \
683buf[n++] = (char) c; \
684if ( c == EOF && ferror( cppExpYYin ) ) \
685YY_FATAL_ERROR( "input in flex scanner failed" ); \
686result = n; \
687} \
688else \
689{ \
690errno=0; \
691while ( (result = fread(buf, 1, max_size, cppExpYYin))==0 && ferror(cppExpYYin)) \
692{ \
693if( errno != EINTR) \
694{ \
695YY_FATAL_ERROR( "input in flex scanner failed" ); \
696break; \
697} \
698errno=0; \
699clearerr(cppExpYYin); \
700} \
701}\
702\
703
704#endif
705
706/* No semi-colon after return; correct usage is to write "yyterminate();" -
707 * we don't want an extra ';' after the "return" because that will cause
708 * some compilers to complain about unreachable statements.
709 */
710#ifndef yyterminate
711#define yyterminate() return YY_NULL
712#endif
713
714/* Number of entries by which start-condition stack grows. */
715#ifndef YY_START_STACK_INCR
716#define YY_START_STACK_INCR 25
717#endif
718
719/* Report a fatal error. */
720#ifndef YY_FATAL_ERROR
721#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
722#endif
723
724/* end tables serialization structures and prototypes */
725
726/* Default declaration of generated scanner - a define so the user can
727 * easily add parameters.
728 */
729#ifndef YY_DECL
730#define YY_DECL_IS_OURS 1
731
732extern int cppExpYYlex (void);
733
734#define YY_DECL int cppExpYYlex (void)
735#endif /* !YY_DECL */
736
737/* Code executed at the beginning of each rule, after cppExpYYtext and cppExpYYleng
738 * have been set up.
739 */
740#ifndef YY_USER_ACTION
741#define YY_USER_ACTION
742#endif
743
744/* Code executed at the end of each rule. */
745#ifndef YY_BREAK
746#define YY_BREAK break;
747#endif
748
749#define YY_RULE_SETUP \
750YY_USER_ACTION
751
752/** The main scanner function which does all the work.
753 */
754YY_DECL
755{
756register yy_state_type yy_current_state;
757register char *yy_cp, *yy_bp;
758register int yy_act;
759
760#line 55 "constexp.l"
761
762
763#line 764 "<stdout>"
764
765if ( !(yy_init) )
766{
767(yy_init) = 1;
768
769#ifdef YY_USER_INIT
770YY_USER_INIT;
771#endif
772
773if ( ! (yy_start) )
774(yy_start) = 1;/* first start state */
775
776if ( ! cppExpYYin )
777cppExpYYin = stdin;
778
779if ( ! cppExpYYout )
780cppExpYYout = stdout;
781
782if ( ! YY_CURRENT_BUFFER ) {
783cppExpYYensure_buffer_stack ();
784YY_CURRENT_BUFFER_LVALUE =
785cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE );
786}
787
788cppExpYY_load_buffer_state( );
789}
790
791while ( 1 )/* loops until end-of-file is reached */
792{
793yy_cp = (yy_c_buf_p);
794
795/* Support of cppExpYYtext. */
796*yy_cp = (yy_hold_char);
797
798/* yy_bp points to the position in yy_ch_buf of the start of
799 * the current run.
800 */
801yy_bp = yy_cp;
802
803yy_current_state = (yy_start);
804yy_match:
805do
806{
807register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
808if ( yy_accept[yy_current_state] )
809{
810(yy_last_accepting_state) = yy_current_state;
811(yy_last_accepting_cpos) = yy_cp;
812}
813while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
814{
815yy_current_state = (int) yy_def[yy_current_state];
816if ( yy_current_state >= 77 )
817yy_c = yy_meta[(unsigned int) yy_c];
818}
819yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
820++yy_cp;
821}
822while ( yy_base[yy_current_state] != 163 );
823
824yy_find_action:
825yy_act = yy_accept[yy_current_state];
826if ( yy_act == 0 )
827{ /* have to back up */
828yy_cp = (yy_last_accepting_cpos);
829yy_current_state = (yy_last_accepting_state);
830yy_act = yy_accept[yy_current_state];
831}
832
833YY_DO_BEFORE_ACTION;
834
835do_action:/* This label is used only to access EOF actions. */
836
837switch ( yy_act )
838{ /* beginning of action switch */
839case 0: /* must back up */
840/* undo the effects of YY_DO_BEFORE_ACTION */
841*yy_cp = (yy_hold_char);
842yy_cp = (yy_last_accepting_cpos);
843yy_current_state = (yy_last_accepting_state);
844goto yy_find_action;
845
846case 1:
847YY_RULE_SETUP
848#line 57 "constexp.l"
849{ return TOK_QUESTIONMARK; }
850YY_BREAK
851case 2:
852YY_RULE_SETUP
853#line 58 "constexp.l"
854{ return TOK_COLON; }
855YY_BREAK
856case 3:
857YY_RULE_SETUP
858#line 59 "constexp.l"
859{ return TOK_OR; }
860YY_BREAK
861case 4:
862YY_RULE_SETUP
863#line 60 "constexp.l"
864{ return TOK_AND; }
865YY_BREAK
866case 5:
867YY_RULE_SETUP
868#line 61 "constexp.l"
869{ return TOK_BITWISEOR; }
870YY_BREAK
871case 6:
872YY_RULE_SETUP
873#line 62 "constexp.l"
874{ return TOK_BITWISEXOR; }
875YY_BREAK
876case 7:
877YY_RULE_SETUP
878#line 63 "constexp.l"
879{ return TOK_AMPERSAND; }
880YY_BREAK
881case 8:
882YY_RULE_SETUP
883#line 64 "constexp.l"
884{ return TOK_NOTEQUAL; }
885YY_BREAK
886case 9:
887YY_RULE_SETUP
888#line 65 "constexp.l"
889{ return TOK_EQUAL; }
890YY_BREAK
891case 10:
892YY_RULE_SETUP
893#line 66 "constexp.l"
894{ return TOK_LESSTHAN; }
895YY_BREAK
896case 11:
897YY_RULE_SETUP
898#line 67 "constexp.l"
899{ return TOK_GREATERTHAN; }
900YY_BREAK
901case 12:
902YY_RULE_SETUP
903#line 68 "constexp.l"
904{ return TOK_LESSTHANOREQUALTO; }
905YY_BREAK
906case 13:
907YY_RULE_SETUP
908#line 69 "constexp.l"
909{ return TOK_GREATERTHANOREQUALTO; }
910YY_BREAK
911case 14:
912YY_RULE_SETUP
913#line 70 "constexp.l"
914{ return TOK_SHIFTLEFT; }
915YY_BREAK
916case 15:
917YY_RULE_SETUP
918#line 71 "constexp.l"
919{ return TOK_SHIFTRIGHT; }
920YY_BREAK
921case 16:
922YY_RULE_SETUP
923#line 72 "constexp.l"
924{ return TOK_PLUS; }
925YY_BREAK
926case 17:
927YY_RULE_SETUP
928#line 73 "constexp.l"
929{ return TOK_MINUS; }
930YY_BREAK
931case 18:
932YY_RULE_SETUP
933#line 74 "constexp.l"
934{ return TOK_STAR; }
935YY_BREAK
936case 19:
937YY_RULE_SETUP
938#line 75 "constexp.l"
939{ return TOK_DIVIDE; }
940YY_BREAK
941case 20:
942YY_RULE_SETUP
943#line 76 "constexp.l"
944{ return TOK_MOD; }
945YY_BREAK
946case 21:
947YY_RULE_SETUP
948#line 77 "constexp.l"
949{ return TOK_TILDE; }
950YY_BREAK
951case 22:
952YY_RULE_SETUP
953#line 78 "constexp.l"
954{ return TOK_NOT; }
955YY_BREAK
956case 23:
957YY_RULE_SETUP
958#line 79 "constexp.l"
959{ return TOK_LPAREN; }
960YY_BREAK
961case 24:
962YY_RULE_SETUP
963#line 80 "constexp.l"
964{ return TOK_RPAREN; }
965YY_BREAK
966case 25:
967YY_RULE_SETUP
968#line 81 "constexp.l"
969{
970 g_strToken=cppExpYYtext;
971 return TOK_CHARACTER;
972 }
973YY_BREAK
974case 26:
975YY_RULE_SETUP
976#line 85 "constexp.l"
977{ g_strToken=cppExpYYtext;
978 return TOK_OCTALINT;
979 }
980YY_BREAK
981case 27:
982YY_RULE_SETUP
983#line 88 "constexp.l"
984{ g_strToken=cppExpYYtext;
985 return TOK_DECIMALINT;
986 }
987YY_BREAK
988case 28:
989YY_RULE_SETUP
990#line 91 "constexp.l"
991{ g_strToken=cppExpYYtext+2;
992 return TOK_HEXADECIMALINT;
993 }
994YY_BREAK
995case 29:
996YY_RULE_SETUP
997#line 94 "constexp.l"
998{
999 g_strToken=cppExpYYtext; return TOK_FLOAT;
1000 }
1001YY_BREAK
1002case 30:
1003YY_RULE_SETUP
1004#line 97 "constexp.l"
1005{
1006 g_strToken=cppExpYYtext; return TOK_FLOAT;
1007 }
1008YY_BREAK
1009case 31:
1010YY_RULE_SETUP
1011#line 100 "constexp.l"
1012
1013YY_BREAK
1014case 32:
1015/* rule 32 can match eol */
1016YY_RULE_SETUP
1017#line 101 "constexp.l"
1018
1019YY_BREAK
1020case 33:
1021YY_RULE_SETUP
1022#line 103 "constexp.l"
1023ECHO;
1024YY_BREAK
1025#line 1026 "<stdout>"
1026case YY_STATE_EOF(INITIAL):
1027yyterminate();
1028
1029case YY_END_OF_BUFFER:
1030{
1031/* Amount of text matched not including the EOB char. */
1032int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1033
1034/* Undo the effects of YY_DO_BEFORE_ACTION. */
1035*yy_cp = (yy_hold_char);
1036YY_RESTORE_YY_MORE_OFFSET
1037
1038if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1039{
1040/* We're scanning a new file or input source. It's
1041 * possible that this happened because the user
1042 * just pointed cppExpYYin at a new source and called
1043 * cppExpYYlex(). If so, then we have to assure
1044 * consistency between YY_CURRENT_BUFFER and our
1045 * globals. Here is the right place to do so, because
1046 * this is the first action (other than possibly a
1047 * back-up) that will match for the new input source.
1048 */
1049(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1050YY_CURRENT_BUFFER_LVALUE->yy_input_file = cppExpYYin;
1051YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1052}
1053
1054/* Note that here we test for yy_c_buf_p "<=" to the position
1055 * of the first EOB in the buffer, since yy_c_buf_p will
1056 * already have been incremented past the NUL character
1057 * (since all states make transitions on EOB to the
1058 * end-of-buffer state). Contrast this with the test
1059 * in input().
1060 */
1061if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1062{ /* This was really a NUL. */
1063yy_state_type yy_next_state;
1064
1065(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1066
1067yy_current_state = yy_get_previous_state( );
1068
1069/* Okay, we're now positioned to make the NUL
1070 * transition. We couldn't have
1071 * yy_get_previous_state() go ahead and do it
1072 * for us because it doesn't know how to deal
1073 * with the possibility of jamming (and we don't
1074 * want to build jamming into it because then it
1075 * will run more slowly).
1076 */
1077
1078yy_next_state = yy_try_NUL_trans( yy_current_state );
1079
1080yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1081
1082if ( yy_next_state )
1083{
1084/* Consume the NUL. */
1085yy_cp = ++(yy_c_buf_p);
1086yy_current_state = yy_next_state;
1087goto yy_match;
1088}
1089
1090else
1091{
1092yy_cp = (yy_c_buf_p);
1093goto yy_find_action;
1094}
1095}
1096
1097else switch ( yy_get_next_buffer( ) )
1098{
1099case EOB_ACT_END_OF_FILE:
1100{
1101(yy_did_buffer_switch_on_eof) = 0;
1102
1103if ( cppExpYYwrap( ) )
1104{
1105/* Note: because we've taken care in
1106 * yy_get_next_buffer() to have set up
1107 * cppExpYYtext, we can now set up
1108 * yy_c_buf_p so that if some total
1109 * hoser (like flex itself) wants to
1110 * call the scanner after we return the
1111 * YY_NULL, it'll still work - another
1112 * YY_NULL will get returned.
1113 */
1114(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1115
1116yy_act = YY_STATE_EOF(YY_START);
1117goto do_action;
1118}
1119
1120else
1121{
1122if ( ! (yy_did_buffer_switch_on_eof) )
1123YY_NEW_FILE;
1124}
1125break;
1126}
1127
1128case EOB_ACT_CONTINUE_SCAN:
1129(yy_c_buf_p) =
1130(yytext_ptr) + yy_amount_of_matched_text;
1131
1132yy_current_state = yy_get_previous_state( );
1133
1134yy_cp = (yy_c_buf_p);
1135yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1136goto yy_match;
1137
1138case EOB_ACT_LAST_MATCH:
1139(yy_c_buf_p) =
1140&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1141
1142yy_current_state = yy_get_previous_state( );
1143
1144yy_cp = (yy_c_buf_p);
1145yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1146goto yy_find_action;
1147}
1148break;
1149}
1150
1151default:
1152YY_FATAL_ERROR(
1153"fatal flex scanner internal error--no action found" );
1154} /* end of action switch */
1155} /* end of scanning one token */
1156} /* end of cppExpYYlex */
1157
1158/* yy_get_next_buffer - try to read in a new buffer
1159 *
1160 * Returns a code representing an action:
1161 *EOB_ACT_LAST_MATCH -
1162 *EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1163 *EOB_ACT_END_OF_FILE - end of file
1164 */
1165static int yy_get_next_buffer (void)
1166{
1167 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1168register char *source = (yytext_ptr);
1169register int number_to_move, i;
1170int ret_val;
1171
1172if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1173YY_FATAL_ERROR(
1174"fatal flex scanner internal error--end of buffer missed" );
1175
1176if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1177{ /* Don't try to fill the buffer, so this is an EOF. */
1178if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1179{
1180/* We matched a single character, the EOB, so
1181 * treat this as a final EOF.
1182 */
1183return EOB_ACT_END_OF_FILE;
1184}
1185
1186else
1187{
1188/* We matched some text prior to the EOB, first
1189 * process it.
1190 */
1191return EOB_ACT_LAST_MATCH;
1192}
1193}
1194
1195/* Try to read more data. */
1196
1197/* First move last chars to start of buffer. */
1198number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1199
1200for ( i = 0; i < number_to_move; ++i )
1201*(dest++) = *(source++);
1202
1203if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1204/* don't do the read, it's not guaranteed to return an EOF,
1205 * just force an EOF
1206 */
1207YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1208
1209else
1210{
1211yy_size_t num_to_read =
1212YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1213
1214while ( num_to_read <= 0 )
1215{ /* Not enough room in the buffer - grow it. */
1216
1217/* just a shorter name for the current buffer */
1218YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1219
1220int yy_c_buf_p_offset =
1221(int) ((yy_c_buf_p) - b->yy_ch_buf);
1222
1223if ( b->yy_is_our_buffer )
1224{
1225yy_size_t new_size = b->yy_buf_size * 2;
1226
1227if ( new_size <= 0 )
1228b->yy_buf_size += b->yy_buf_size / 8;
1229else
1230b->yy_buf_size *= 2;
1231
1232b->yy_ch_buf = (char *)
1233/* Include room in for 2 EOB chars. */
1234cppExpYYrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1235}
1236else
1237/* Can't grow it, we don't own it. */
1238b->yy_ch_buf = 0;
1239
1240if ( ! b->yy_ch_buf )
1241YY_FATAL_ERROR(
1242"fatal error - scanner input buffer overflow" );
1243
1244(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1245
1246num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1247number_to_move - 1;
1248
1249}
1250
1251if ( num_to_read > YY_READ_BUF_SIZE )
1252num_to_read = YY_READ_BUF_SIZE;
1253
1254/* Read in more data. */
1255YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1256(yy_n_chars), num_to_read );
1257
1258YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1259}
1260
1261if ( (yy_n_chars) == 0 )
1262{
1263if ( number_to_move == YY_MORE_ADJ )
1264{
1265ret_val = EOB_ACT_END_OF_FILE;
1266cppExpYYrestart(cppExpYYin );
1267}
1268
1269else
1270{
1271ret_val = EOB_ACT_LAST_MATCH;
1272YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1273YY_BUFFER_EOF_PENDING;
1274}
1275}
1276
1277else
1278ret_val = EOB_ACT_CONTINUE_SCAN;
1279
1280if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1281/* Extend the array by 50%, plus the number we really need. */
1282yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1283YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cppExpYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1284if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1285YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1286}
1287
1288(yy_n_chars) += number_to_move;
1289YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1290YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1291
1292(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1293
1294return ret_val;
1295}
1296
1297/* yy_get_previous_state - get the state just before the EOB char was reached */
1298
1299 static yy_state_type yy_get_previous_state (void)
1300{
1301register yy_state_type yy_current_state;
1302register char *yy_cp;
1303
1304yy_current_state = (yy_start);
1305
1306for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1307{
1308register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1309if ( yy_accept[yy_current_state] )
1310{
1311(yy_last_accepting_state) = yy_current_state;
1312(yy_last_accepting_cpos) = yy_cp;
1313}
1314while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1315{
1316yy_current_state = (int) yy_def[yy_current_state];
1317if ( yy_current_state >= 77 )
1318yy_c = yy_meta[(unsigned int) yy_c];
1319}
1320yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1321}
1322
1323return yy_current_state;
1324}
1325
1326/* yy_try_NUL_trans - try to make a transition on the NUL character
1327 *
1328 * synopsis
1329 *next_state = yy_try_NUL_trans( current_state );
1330 */
1331 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1332{
1333register int yy_is_jam;
1334 register char *yy_cp = (yy_c_buf_p);
1335
1336register YY_CHAR yy_c = 1;
1337if ( yy_accept[yy_current_state] )
1338{
1339(yy_last_accepting_state) = yy_current_state;
1340(yy_last_accepting_cpos) = yy_cp;
1341}
1342while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1343{
1344yy_current_state = (int) yy_def[yy_current_state];
1345if ( yy_current_state >= 77 )
1346yy_c = yy_meta[(unsigned int) yy_c];
1347}
1348yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1349yy_is_jam = (yy_current_state == 76);
1350
1351return yy_is_jam ? 0 : yy_current_state;
1352}
1353
1354#ifndef YY_NO_INPUT
1355#ifdef __cplusplus
1356 static int yyinput (void)
1357#else
1358 static int input (void)
1359#endif
1360
1361{
1362int c;
1363
1364*(yy_c_buf_p) = (yy_hold_char);
1365
1366if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1367{
1368/* yy_c_buf_p now points to the character we want to return.
1369 * If this occurs *before* the EOB characters, then it's a
1370 * valid NUL; if not, then we've hit the end of the buffer.
1371 */
1372if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1373/* This was really a NUL. */
1374*(yy_c_buf_p) = '\0';
1375
1376else
1377{ /* need more input */
1378yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1379++(yy_c_buf_p);
1380
1381switch ( yy_get_next_buffer( ) )
1382{
1383case EOB_ACT_LAST_MATCH:
1384/* This happens because yy_g_n_b()
1385 * sees that we've accumulated a
1386 * token and flags that we need to
1387 * try matching the token before
1388 * proceeding. But for input(),
1389 * there's no matching to consider.
1390 * So convert the EOB_ACT_LAST_MATCH
1391 * to EOB_ACT_END_OF_FILE.
1392 */
1393
1394/* Reset buffer status. */
1395cppExpYYrestart(cppExpYYin );
1396
1397/*FALLTHROUGH*/
1398
1399case EOB_ACT_END_OF_FILE:
1400{
1401if ( cppExpYYwrap( ) )
1402return 0;
1403
1404if ( ! (yy_did_buffer_switch_on_eof) )
1405YY_NEW_FILE;
1406#ifdef __cplusplus
1407return yyinput();
1408#else
1409return input();
1410#endif
1411}
1412
1413case EOB_ACT_CONTINUE_SCAN:
1414(yy_c_buf_p) = (yytext_ptr) + offset;
1415break;
1416}
1417}
1418}
1419
1420c = *(unsigned char *) (yy_c_buf_p);/* cast for 8-bit char's */
1421*(yy_c_buf_p) = '\0';/* preserve cppExpYYtext */
1422(yy_hold_char) = *++(yy_c_buf_p);
1423
1424return c;
1425}
1426#endif/* ifndef YY_NO_INPUT */
1427
1428/** Immediately switch to a different input stream.
1429 * @param input_file A readable stream.
1430 *
1431 * @note This function does not reset the start condition to @c INITIAL .
1432 */
1433 void cppExpYYrestart (FILE * input_file )
1434{
1435
1436if ( ! YY_CURRENT_BUFFER ){
1437 cppExpYYensure_buffer_stack ();
1438YY_CURRENT_BUFFER_LVALUE =
1439 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE );
1440}
1441
1442cppExpYY_init_buffer(YY_CURRENT_BUFFER,input_file );
1443cppExpYY_load_buffer_state( );
1444}
1445
1446/** Switch to a different input buffer.
1447 * @param new_buffer The new input buffer.
1448 *
1449 */
1450 void cppExpYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1451{
1452
1453/* TODO. We should be able to replace this entire function body
1454 * with
1455 *cppExpYYpop_buffer_state();
1456 *cppExpYYpush_buffer_state(new_buffer);
1457 */
1458cppExpYYensure_buffer_stack ();
1459if ( YY_CURRENT_BUFFER == new_buffer )
1460return;
1461
1462if ( YY_CURRENT_BUFFER )
1463{
1464/* Flush out information for old buffer. */
1465*(yy_c_buf_p) = (yy_hold_char);
1466YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1467YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1468}
1469
1470YY_CURRENT_BUFFER_LVALUE = new_buffer;
1471cppExpYY_load_buffer_state( );
1472
1473/* We don't actually know whether we did this switch during
1474 * EOF (cppExpYYwrap()) processing, but the only time this flag
1475 * is looked at is after cppExpYYwrap() is called, so it's safe
1476 * to go ahead and always set it.
1477 */
1478(yy_did_buffer_switch_on_eof) = 1;
1479}
1480
1481static void cppExpYY_load_buffer_state (void)
1482{
1483 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1484(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1485cppExpYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1486(yy_hold_char) = *(yy_c_buf_p);
1487}
1488
1489/** Allocate and initialize an input buffer state.
1490 * @param file A readable stream.
1491 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1492 *
1493 * @return the allocated buffer state.
1494 */
1495 YY_BUFFER_STATE cppExpYY_create_buffer (FILE * file, int size )
1496{
1497YY_BUFFER_STATE b;
1498
1499b = (YY_BUFFER_STATE) cppExpYYalloc(sizeof( struct yy_buffer_state ) );
1500if ( ! b )
1501YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_create_buffer()" );
1502
1503b->yy_buf_size = size;
1504
1505/* yy_ch_buf has to be 2 characters longer than the size given because
1506 * we need to put in 2 end-of-buffer characters.
1507 */
1508b->yy_ch_buf = (char *) cppExpYYalloc(b->yy_buf_size + 2 );
1509if ( ! b->yy_ch_buf )
1510YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_create_buffer()" );
1511
1512b->yy_is_our_buffer = 1;
1513
1514cppExpYY_init_buffer(b,file );
1515
1516return b;
1517}
1518
1519/** Destroy the buffer.
1520 * @param b a buffer created with cppExpYY_create_buffer()
1521 *
1522 */
1523 void cppExpYY_delete_buffer (YY_BUFFER_STATE b )
1524{
1525
1526if ( ! b )
1527return;
1528
1529if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1530YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1531
1532if ( b->yy_is_our_buffer )
1533cppExpYYfree((void *) b->yy_ch_buf );
1534
1535cppExpYYfree((void *) b );
1536}
1537
1538#ifndef __cplusplus
1539extern int isatty (int );
1540#endif /* __cplusplus */
1541
1542/* Initializes or reinitializes a buffer.
1543 * This function is sometimes called more than once on the same buffer,
1544 * such as during a cppExpYYrestart() or at EOF.
1545 */
1546 static void cppExpYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
1547
1548{
1549int oerrno = errno;
1550
1551cppExpYY_flush_buffer(b );
1552
1553b->yy_input_file = file;
1554b->yy_fill_buffer = 1;
1555
1556 /* If b is the current buffer, then cppExpYY_init_buffer was _probably_
1557 * called from cppExpYYrestart() or through yy_get_next_buffer.
1558 * In that case, we don't want to reset the lineno or column.
1559 */
1560 if (b != YY_CURRENT_BUFFER){
1561 b->yy_bs_lineno = 1;
1562 b->yy_bs_column = 0;
1563 }
1564
1565 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1566
1567errno = oerrno;
1568}
1569
1570/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1571 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1572 *
1573 */
1574 void cppExpYY_flush_buffer (YY_BUFFER_STATE b )
1575{
1576 if ( ! b )
1577return;
1578
1579b->yy_n_chars = 0;
1580
1581/* We always need two end-of-buffer characters. The first causes
1582 * a transition to the end-of-buffer state. The second causes
1583 * a jam in that state.
1584 */
1585b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1586b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1587
1588b->yy_buf_pos = &b->yy_ch_buf[0];
1589
1590b->yy_at_bol = 1;
1591b->yy_buffer_status = YY_BUFFER_NEW;
1592
1593if ( b == YY_CURRENT_BUFFER )
1594cppExpYY_load_buffer_state( );
1595}
1596
1597/** Pushes the new state onto the stack. The new state becomes
1598 * the current state. This function will allocate the stack
1599 * if necessary.
1600 * @param new_buffer The new state.
1601 *
1602 */
1603void cppExpYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
1604{
1605 if (new_buffer == NULL)
1606return;
1607
1608cppExpYYensure_buffer_stack();
1609
1610/* This block is copied from cppExpYY_switch_to_buffer. */
1611if ( YY_CURRENT_BUFFER )
1612{
1613/* Flush out information for old buffer. */
1614*(yy_c_buf_p) = (yy_hold_char);
1615YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1616YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1617}
1618
1619/* Only push if top exists. Otherwise, replace top. */
1620if (YY_CURRENT_BUFFER)
1621(yy_buffer_stack_top)++;
1622YY_CURRENT_BUFFER_LVALUE = new_buffer;
1623
1624/* copied from cppExpYY_switch_to_buffer. */
1625cppExpYY_load_buffer_state( );
1626(yy_did_buffer_switch_on_eof) = 1;
1627}
1628
1629/** Removes and deletes the top of the stack, if present.
1630 * The next element becomes the new top.
1631 *
1632 */
1633void cppExpYYpop_buffer_state (void)
1634{
1635 if (!YY_CURRENT_BUFFER)
1636return;
1637
1638cppExpYY_delete_buffer(YY_CURRENT_BUFFER );
1639YY_CURRENT_BUFFER_LVALUE = NULL;
1640if ((yy_buffer_stack_top) > 0)
1641--(yy_buffer_stack_top);
1642
1643if (YY_CURRENT_BUFFER) {
1644cppExpYY_load_buffer_state( );
1645(yy_did_buffer_switch_on_eof) = 1;
1646}
1647}
1648
1649/* Allocates the stack if it does not exist.
1650 * Guarantees space for at least one push.
1651 */
1652static void cppExpYYensure_buffer_stack (void)
1653{
1654yy_size_t num_to_alloc;
1655
1656if (!(yy_buffer_stack)) {
1657
1658/* First allocation is just for 2 elements, since we don't know if this
1659 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1660 * immediate realloc on the next call.
1661 */
1662num_to_alloc = 1;
1663(yy_buffer_stack) = (struct yy_buffer_state**)cppExpYYalloc
1664(num_to_alloc * sizeof(struct yy_buffer_state*)
1665);
1666if ( ! (yy_buffer_stack) )
1667YY_FATAL_ERROR( "out of dynamic memory in cppExpYYensure_buffer_stack()" );
1668
1669memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1670
1671(yy_buffer_stack_max) = num_to_alloc;
1672(yy_buffer_stack_top) = 0;
1673return;
1674}
1675
1676if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1677
1678/* Increase the buffer to prepare for a possible push. */
1679int grow_size = 8 /* arbitrary grow size */;
1680
1681num_to_alloc = (yy_buffer_stack_max) + grow_size;
1682(yy_buffer_stack) = (struct yy_buffer_state**)cppExpYYrealloc
1683((yy_buffer_stack),
1684num_to_alloc * sizeof(struct yy_buffer_state*)
1685);
1686if ( ! (yy_buffer_stack) )
1687YY_FATAL_ERROR( "out of dynamic memory in cppExpYYensure_buffer_stack()" );
1688
1689/* zero only the new slots.*/
1690memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1691(yy_buffer_stack_max) = num_to_alloc;
1692}
1693}
1694
1695/** Setup the input buffer state to scan directly from a user-specified character buffer.
1696 * @param base the character buffer
1697 * @param size the size in bytes of the character buffer
1698 *
1699 * @return the newly allocated buffer state object.
1700 */
1701YY_BUFFER_STATE cppExpYY_scan_buffer (char * base, yy_size_t size )
1702{
1703YY_BUFFER_STATE b;
1704
1705if ( size < 2 ||
1706 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1707 base[size-1] != YY_END_OF_BUFFER_CHAR )
1708/* They forgot to leave room for the EOB's. */
1709return 0;
1710
1711b = (YY_BUFFER_STATE) cppExpYYalloc(sizeof( struct yy_buffer_state ) );
1712if ( ! b )
1713YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_scan_buffer()" );
1714
1715b->yy_buf_size = size - 2;/* "- 2" to take care of EOB's */
1716b->yy_buf_pos = b->yy_ch_buf = base;
1717b->yy_is_our_buffer = 0;
1718b->yy_input_file = 0;
1719b->yy_n_chars = b->yy_buf_size;
1720b->yy_is_interactive = 0;
1721b->yy_at_bol = 1;
1722b->yy_fill_buffer = 0;
1723b->yy_buffer_status = YY_BUFFER_NEW;
1724
1725cppExpYY_switch_to_buffer(b );
1726
1727return b;
1728}
1729
1730/** Setup the input buffer state to scan a string. The next call to cppExpYYlex() will
1731 * scan from a @e copy of @a str.
1732 * @param yystr a NUL-terminated string to scan
1733 *
1734 * @return the newly allocated buffer state object.
1735 * @note If you want to scan bytes that may contain NUL values, then use
1736 * cppExpYY_scan_bytes() instead.
1737 */
1738YY_BUFFER_STATE cppExpYY_scan_string (yyconst char * yystr )
1739{
1740
1741return cppExpYY_scan_bytes(yystr,strlen(yystr) );
1742}
1743
1744/** Setup the input buffer state to scan the given bytes. The next call to cppExpYYlex() will
1745 * scan from a @e copy of @a bytes.
1746 * @param bytes the byte buffer to scan
1747 * @param len the number of bytes in the buffer pointed to by @a bytes.
1748 *
1749 * @return the newly allocated buffer state object.
1750 */
1751YY_BUFFER_STATE cppExpYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1752{
1753YY_BUFFER_STATE b;
1754char *buf;
1755yy_size_t n, i;
1756
1757/* Get memory for full buffer, including space for trailing EOB's. */
1758n = _yybytes_len + 2;
1759buf = (char *) cppExpYYalloc(n );
1760if ( ! buf )
1761YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_scan_bytes()" );
1762
1763for ( i = 0; i < _yybytes_len; ++i )
1764buf[i] = yybytes[i];
1765
1766buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1767
1768b = cppExpYY_scan_buffer(buf,n );
1769if ( ! b )
1770YY_FATAL_ERROR( "bad buffer in cppExpYY_scan_bytes()" );
1771
1772/* It's okay to grow etc. this buffer, and we should throw it
1773 * away when we're done.
1774 */
1775b->yy_is_our_buffer = 1;
1776
1777return b;
1778}
1779
1780#ifndef YY_EXIT_FAILURE
1781#define YY_EXIT_FAILURE 2
1782#endif
1783
1784static void yy_fatal_error (yyconst char* msg )
1785{
1786 (void) fprintf( stderr, "%s\n", msg );
1787exit( YY_EXIT_FAILURE );
1788}
1789
1790/* Redefine yyless() so it works in section 3 code. */
1791
1792#undef yyless
1793#define yyless(n) \
1794do \
1795{ \
1796/* Undo effects of setting up cppExpYYtext. */ \
1797 int yyless_macro_arg = (n); \
1798 YY_LESS_LINENO(yyless_macro_arg);\
1799cppExpYYtext[cppExpYYleng] = (yy_hold_char); \
1800(yy_c_buf_p) = cppExpYYtext + yyless_macro_arg; \
1801(yy_hold_char) = *(yy_c_buf_p); \
1802*(yy_c_buf_p) = '\0'; \
1803cppExpYYleng = yyless_macro_arg; \
1804} \
1805while ( 0 )
1806
1807/* Accessor methods (get/set functions) to struct members. */
1808
1809/** Get the current line number.
1810 *
1811 */
1812int cppExpYYget_lineno (void)
1813{
1814
1815 return cppExpYYlineno;
1816}
1817
1818/** Get the input stream.
1819 *
1820 */
1821FILE *cppExpYYget_in (void)
1822{
1823 return cppExpYYin;
1824}
1825
1826/** Get the output stream.
1827 *
1828 */
1829FILE *cppExpYYget_out (void)
1830{
1831 return cppExpYYout;
1832}
1833
1834/** Get the length of the current token.
1835 *
1836 */
1837yy_size_t cppExpYYget_leng (void)
1838{
1839 return cppExpYYleng;
1840}
1841
1842/** Get the current token.
1843 *
1844 */
1845
1846char *cppExpYYget_text (void)
1847{
1848 return cppExpYYtext;
1849}
1850
1851/** Set the current line number.
1852 * @param line_number
1853 *
1854 */
1855void cppExpYYset_lineno (int line_number )
1856{
1857
1858 cppExpYYlineno = line_number;
1859}
1860
1861/** Set the input stream. This does not discard the current
1862 * input buffer.
1863 * @param in_str A readable stream.
1864 *
1865 * @see cppExpYY_switch_to_buffer
1866 */
1867void cppExpYYset_in (FILE * in_str )
1868{
1869 cppExpYYin = in_str ;
1870}
1871
1872void cppExpYYset_out (FILE * out_str )
1873{
1874 cppExpYYout = out_str ;
1875}
1876
1877int cppExpYYget_debug (void)
1878{
1879 return cppExpYY_flex_debug;
1880}
1881
1882void cppExpYYset_debug (int bdebug )
1883{
1884 cppExpYY_flex_debug = bdebug ;
1885}
1886
1887static int yy_init_globals (void)
1888{
1889 /* Initialization is the same as for the non-reentrant scanner.
1890 * This function is called from cppExpYYlex_destroy(), so don't allocate here.
1891 */
1892
1893 (yy_buffer_stack) = 0;
1894 (yy_buffer_stack_top) = 0;
1895 (yy_buffer_stack_max) = 0;
1896 (yy_c_buf_p) = (char *) 0;
1897 (yy_init) = 0;
1898 (yy_start) = 0;
1899
1900/* Defined in main.c */
1901#ifdef YY_STDINIT
1902 cppExpYYin = stdin;
1903 cppExpYYout = stdout;
1904#else
1905 cppExpYYin = (FILE *) 0;
1906 cppExpYYout = (FILE *) 0;
1907#endif
1908
1909 /* For future reference: Set errno on error, since we are called by
1910 * cppExpYYlex_init()
1911 */
1912 return 0;
1913}
1914
1915/* cppExpYYlex_destroy is for both reentrant and non-reentrant scanners. */
1916int cppExpYYlex_destroy (void)
1917{
1918
1919 /* Pop the buffer stack, destroying each element. */
1920while(YY_CURRENT_BUFFER){
1921cppExpYY_delete_buffer(YY_CURRENT_BUFFER );
1922YY_CURRENT_BUFFER_LVALUE = NULL;
1923cppExpYYpop_buffer_state();
1924}
1925
1926/* Destroy the stack itself. */
1927cppExpYYfree((yy_buffer_stack) );
1928(yy_buffer_stack) = NULL;
1929
1930 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1931 * cppExpYYlex() is called, initialization will occur. */
1932 yy_init_globals( );
1933
1934 return 0;
1935}
1936
1937/*
1938 * Internal utility routines.
1939 */
1940
1941#ifndef yytext_ptr
1942static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1943{
1944register int i;
1945for ( i = 0; i < n; ++i )
1946s1[i] = s2[i];
1947}
1948#endif
1949
1950#ifdef YY_NEED_STRLEN
1951static int yy_flex_strlen (yyconst char * s )
1952{
1953register int n;
1954for ( n = 0; s[n]; ++n )
1955;
1956
1957return n;
1958}
1959#endif
1960
1961void *cppExpYYalloc (yy_size_t size )
1962{
1963return (void *) malloc( size );
1964}
1965
1966void *cppExpYYrealloc (void * ptr, yy_size_t size )
1967{
1968/* The cast to (char *) in the following accommodates both
1969 * implementations that use char* generic pointers, and those
1970 * that use void* generic pointers. It works with the latter
1971 * because both ANSI C and C++ allow castless assignment from
1972 * any pointer type to void*, and deal with argument conversions
1973 * as though doing an assignment.
1974 */
1975return (void *) realloc( (char *) ptr, size );
1976}
1977
1978void cppExpYYfree (void * ptr )
1979{
1980free( (char *) ptr );/* see cppExpYYrealloc() for (char *) cast */
1981}
1982
1983#define YYTABLES_NAME "yytables"
1984
1985#line 103 "constexp.l"
1986
1987
1988
1989bool parseCppExpression(const char *fileName,int lineNr,const QCString &s)
1990{
1991 //printf("Expression: `%s'\n",s.data());
1992 g_constExpFileName = fileName;
1993 g_constExpLineNr = lineNr;
1994 g_inputString = s;
1995 g_inputPosition = 0;
1996 cppExpYYrestart( cppExpYYin );
1997 cppExpYYparse();
1998 //printf("Result: %ld\n",(long)g_resultValue);
1999 return (long)g_resultValue!=0;
2000}
2001
2002extern "C" {
2003 int cppExpYYwrap() { return 1; }
2004}
2005
2006

Archive Download this file

Revision: 1322