/[pkg-grass]/packages/qgis/trunk/debian/patches/flex.dpatch
ViewVC logotype

Contents of /packages/qgis/trunk/debian/patches/flex.dpatch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1423 - (show annotations) (download)
Wed Mar 19 12:24:52 2008 UTC (5 years, 2 months ago) by frankie
File size: 104495 byte(s)
One urgent workaround and a GCC 4.3 patch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## flex.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: No description.
6
7 @DPATCH@
8 diff -urNad qgis~/src/core/CMakeLists.txt qgis/src/core/CMakeLists.txt
9 --- qgis~/src/core/CMakeLists.txt 2008-01-18 17:56:30.000000000 +0100
10 +++ qgis/src/core/CMakeLists.txt 2008-03-19 12:02:00.000000000 +0100
11 @@ -61,7 +61,8 @@
12 spatialindex/qgsspatialindex.cpp
13 )
14
15 -ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)
16 +# Disable run-time use of flex
17 +#ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)
18
19 ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy)
20
21 diff -urNad qgis~/src/core/lex.yy.c qgis/src/core/lex.yy.c
22 --- qgis~/src/core/lex.yy.c 2008-03-18 23:54:25.000000000 +0100
23 +++ qgis/src/core/lex.yy.c 1970-01-01 01:00:00.000000000 +0100
24 @@ -1,1878 +0,0 @@
25 -
26 -#line 3 "lex.yy.c"
27 -
28 -#define YY_INT_ALIGNED short int
29 -
30 -/* A lexical scanner generated by flex */
31 -
32 -#define FLEX_SCANNER
33 -#define YY_FLEX_MAJOR_VERSION 2
34 -#define YY_FLEX_MINOR_VERSION 5
35 -#define YY_FLEX_SUBMINOR_VERSION 34
36 -#if YY_FLEX_SUBMINOR_VERSION > 0
37 -#define FLEX_BETA
38 -#endif
39 -
40 -/* First, we deal with platform-specific or compiler-specific issues. */
41 -
42 -/* begin standard C headers. */
43 -#include <stdio.h>
44 -#include <string.h>
45 -#include <errno.h>
46 -#include <stdlib.h>
47 -
48 -/* end standard C headers. */
49 -
50 -/* flex integer type definitions */
51 -
52 -#ifndef FLEXINT_H
53 -#define FLEXINT_H
54 -
55 -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
56 -
57 -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
58 -
59 -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
60 - * if you want the limit (max/min) macros for int types.
61 - */
62 -#ifndef __STDC_LIMIT_MACROS
63 -#define __STDC_LIMIT_MACROS 1
64 -#endif
65 -
66 -#include <inttypes.h>
67 -typedef int8_t flex_int8_t;
68 -typedef uint8_t flex_uint8_t;
69 -typedef int16_t flex_int16_t;
70 -typedef uint16_t flex_uint16_t;
71 -typedef int32_t flex_int32_t;
72 -typedef uint32_t flex_uint32_t;
73 -#else
74 -typedef signed char flex_int8_t;
75 -typedef short int flex_int16_t;
76 -typedef int flex_int32_t;
77 -typedef unsigned char flex_uint8_t;
78 -typedef unsigned short int flex_uint16_t;
79 -typedef unsigned int flex_uint32_t;
80 -#endif /* ! C99 */
81 -
82 -/* Limits of integral types. */
83 -#ifndef INT8_MIN
84 -#define INT8_MIN (-128)
85 -#endif
86 -#ifndef INT16_MIN
87 -#define INT16_MIN (-32767-1)
88 -#endif
89 -#ifndef INT32_MIN
90 -#define INT32_MIN (-2147483647-1)
91 -#endif
92 -#ifndef INT8_MAX
93 -#define INT8_MAX (127)
94 -#endif
95 -#ifndef INT16_MAX
96 -#define INT16_MAX (32767)
97 -#endif
98 -#ifndef INT32_MAX
99 -#define INT32_MAX (2147483647)
100 -#endif
101 -#ifndef UINT8_MAX
102 -#define UINT8_MAX (255U)
103 -#endif
104 -#ifndef UINT16_MAX
105 -#define UINT16_MAX (65535U)
106 -#endif
107 -#ifndef UINT32_MAX
108 -#define UINT32_MAX (4294967295U)
109 -#endif
110 -
111 -#endif /* ! FLEXINT_H */
112 -
113 -#ifdef __cplusplus
114 -
115 -/* The "const" storage-class-modifier is valid. */
116 -#define YY_USE_CONST
117 -
118 -#else /* ! __cplusplus */
119 -
120 -/* C99 requires __STDC__ to be defined as 1. */
121 -#if defined (__STDC__)
122 -
123 -#define YY_USE_CONST
124 -
125 -#endif /* defined (__STDC__) */
126 -#endif /* ! __cplusplus */
127 -
128 -#ifdef YY_USE_CONST
129 -#define yyconst const
130 -#else
131 -#define yyconst
132 -#endif
133 -
134 -/* Returned upon end-of-file. */
135 -#define YY_NULL 0
136 -
137 -/* Promotes a possibly negative, possibly signed char to an unsigned
138 - * integer for use as an array index. If the signed char is negative,
139 - * we want to instead treat it as an 8-bit unsigned char, hence the
140 - * double cast.
141 - */
142 -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
143 -
144 -/* Enter a start condition. This macro really ought to take a parameter,
145 - * but we do it the disgusting crufty way forced on us by the ()-less
146 - * definition of BEGIN.
147 - */
148 -#define BEGIN (yy_start) = 1 + 2 *
149 -
150 -/* Translate the current start state into a value that can be later handed
151 - * to BEGIN to return to the state. The YYSTATE alias is for lex
152 - * compatibility.
153 - */
154 -#define YY_START (((yy_start) - 1) / 2)
155 -#define YYSTATE YY_START
156 -
157 -/* Action number for EOF rule of a given start state. */
158 -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
159 -
160 -/* Special action meaning "start processing a new file". */
161 -#define YY_NEW_FILE yyrestart(yyin )
162 -
163 -#define YY_END_OF_BUFFER_CHAR 0
164 -
165 -/* Size of default input buffer. */
166 -#ifndef YY_BUF_SIZE
167 -#define YY_BUF_SIZE 16384
168 -#endif
169 -
170 -/* The state buf must be large enough to hold one state per character in the main buffer.
171 - */
172 -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
173 -
174 -#ifndef YY_TYPEDEF_YY_BUFFER_STATE
175 -#define YY_TYPEDEF_YY_BUFFER_STATE
176 -typedef struct yy_buffer_state *YY_BUFFER_STATE;
177 -#endif
178 -
179 -extern int yyleng;
180 -
181 -extern FILE *yyin, *yyout;
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) \
191 - do \
192 - { \
193 - /* Undo effects of setting up yytext. */ \
194 - int yyless_macro_arg = (n); \
195 - YY_LESS_LINENO(yyless_macro_arg);\
196 - *yy_cp = (yy_hold_char); \
197 - YY_RESTORE_YY_MORE_OFFSET \
198 - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
199 - YY_DO_BEFORE_ACTION; /* set up yytext again */ \
200 - } \
201 - while ( 0 )
202 -
203 -#define unput(c) yyunput( c, (yytext_ptr) )
204 -
205 -/* The following is because we cannot portably get our hands on size_t
206 - * (without autoconf's help, which isn't available because we want
207 - * flex-generated scanners to compile on their own).
208 - * Given that the standard has decreed that size_t exists since 1989,
209 - * I guess we can afford to depend on it. Manoj.
210 - */
211 -
212 -#ifndef YY_TYPEDEF_YY_SIZE_T
213 -#define YY_TYPEDEF_YY_SIZE_T
214 -typedef size_t yy_size_t;
215 -#endif
216 -
217 -#ifndef YY_STRUCT_YY_BUFFER_STATE
218 -#define YY_STRUCT_YY_BUFFER_STATE
219 -struct yy_buffer_state
220 - {
221 - FILE *yy_input_file;
222 -
223 - char *yy_ch_buf; /* input buffer */
224 - char *yy_buf_pos; /* current position in input buffer */
225 -
226 - /* Size of input buffer in bytes, not including room for EOB
227 - * characters.
228 - */
229 - yy_size_t yy_buf_size;
230 -
231 - /* Number of characters read into yy_ch_buf, not including EOB
232 - * characters.
233 - */
234 - int yy_n_chars;
235 -
236 - /* Whether we "own" the buffer - i.e., we know we created it,
237 - * and can realloc() it to grow it, and should free() it to
238 - * delete it.
239 - */
240 - int yy_is_our_buffer;
241 -
242 - /* Whether this is an "interactive" input source; if so, and
243 - * if we're using stdio for input, then we want to use getc()
244 - * instead of fread(), to make sure we stop fetching input after
245 - * each newline.
246 - */
247 - int yy_is_interactive;
248 -
249 - /* Whether we're considered to be at the beginning of a line.
250 - * If so, '^' rules will be active on the next match, otherwise
251 - * not.
252 - */
253 - int yy_at_bol;
254 -
255 - int yy_bs_lineno; /**< The line count. */
256 - int yy_bs_column; /**< The column count. */
257 -
258 - /* Whether to try to fill the input buffer when we reach the
259 - * end of it.
260 - */
261 - int yy_fill_buffer;
262 -
263 - int yy_buffer_status;
264 -
265 -#define YY_BUFFER_NEW 0
266 -#define YY_BUFFER_NORMAL 1
267 - /* When an EOF's been seen but there's still some text to process
268 - * then we mark the buffer as YY_EOF_PENDING, to indicate that we
269 - * shouldn't try reading from the input source any more. We might
270 - * still have a bunch of tokens to match, though, because of
271 - * possible backing-up.
272 - *
273 - * When we actually see the EOF, we change the status to "new"
274 - * (via yyrestart()), so that the user can continue scanning by
275 - * just pointing yyin at a new input file.
276 - */
277 -#define YY_BUFFER_EOF_PENDING 2
278 -
279 - };
280 -#endif /* !YY_STRUCT_YY_BUFFER_STATE */
281 -
282 -/* Stack of input buffers. */
283 -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
284 -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
285 -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
286 -
287 -/* We provide macros for accessing buffer states in case in the
288 - * future we want to put the buffer states in a more general
289 - * "scanner state".
290 - *
291 - * Returns the top of the stack, or NULL.
292 - */
293 -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
294 - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
295 - : NULL)
296 -
297 -/* Same as previous macro, but useful when we know that the buffer stack is not
298 - * NULL or when we need an lvalue. For internal use only.
299 - */
300 -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
301 -
302 -/* yy_hold_char holds the character lost when yytext is formed. */
303 -static char yy_hold_char;
304 -static int yy_n_chars; /* number of characters read into yy_ch_buf */
305 -int yyleng;
306 -
307 -/* Points to current character in buffer. */
308 -static char *yy_c_buf_p = (char *) 0;
309 -static int yy_init = 0; /* whether we need to initialize */
310 -static int yy_start = 0; /* start state number */
311 -
312 -/* Flag which is used to allow yywrap()'s to do buffer switches
313 - * instead of setting up a fresh yyin. A bit of a hack ...
314 - */
315 -static int yy_did_buffer_switch_on_eof;
316 -
317 -void yyrestart (FILE *input_file );
318 -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
319 -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
320 -void yy_delete_buffer (YY_BUFFER_STATE b );
321 -void yy_flush_buffer (YY_BUFFER_STATE b );
322 -void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
323 -void yypop_buffer_state (void );
324 -
325 -static void yyensure_buffer_stack (void );
326 -static void yy_load_buffer_state (void );
327 -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
328 -
329 -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
330 -
331 -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
332 -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
333 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
334 -
335 -void *yyalloc (yy_size_t );
336 -void *yyrealloc (void *,yy_size_t );
337 -void yyfree (void * );
338 -
339 -#define yy_new_buffer yy_create_buffer
340 -
341 -#define yy_set_interactive(is_interactive) \
342 - { \
343 - if ( ! YY_CURRENT_BUFFER ){ \
344 - yyensure_buffer_stack (); \
345 - YY_CURRENT_BUFFER_LVALUE = \
346 - yy_create_buffer(yyin,YY_BUF_SIZE ); \
347 - } \
348 - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
349 - }
350 -
351 -#define yy_set_bol(at_bol) \
352 - { \
353 - if ( ! YY_CURRENT_BUFFER ){\
354 - yyensure_buffer_stack (); \
355 - YY_CURRENT_BUFFER_LVALUE = \
356 - yy_create_buffer(yyin,YY_BUF_SIZE ); \
357 - } \
358 - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
359 - }
360 -
361 -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
362 -
363 -/* Begin user sect3 */
364 -
365 -#define yywrap(n) 1
366 -#define YY_SKIP_YYWRAP
367 -
368 -typedef unsigned char YY_CHAR;
369 -
370 -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
371 -
372 -typedef int yy_state_type;
373 -
374 -extern int yylineno;
375 -
376 -int yylineno = 1;
377 -
378 -extern char *yytext;
379 -#define yytext_ptr yytext
380 -
381 -static yy_state_type yy_get_previous_state (void );
382 -static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
383 -static int yy_get_next_buffer (void );
384 -static void yy_fatal_error (yyconst char msg[] );
385 -
386 -/* Done after the current pattern has been matched and before the
387 - * corresponding action - sets up yytext.
388 - */
389 -#define YY_DO_BEFORE_ACTION \
390 - (yytext_ptr) = yy_bp; \
391 - yyleng = (size_t) (yy_cp - yy_bp); \
392 - (yy_hold_char) = *yy_cp; \
393 - *yy_cp = '\0'; \
394 - (yy_c_buf_p) = yy_cp;
395 -
396 -#define YY_NUM_RULES 20
397 -#define YY_END_OF_BUFFER 21
398 -/* This struct is not used in this scanner,
399 - but its presence is necessary. */
400 -struct yy_trans_info
401 - {
402 - flex_int32_t yy_verify;
403 - flex_int32_t yy_nxt;
404 - };
405 -static yyconst flex_int16_t yy_accept[49] =
406 - { 0,
407 - 0, 0, 21, 19, 18, 18, 19, 19, 14, 13,
408 - 13, 15, 9, 4, 10, 17, 17, 17, 17, 17,
409 - 11, 18, 5, 0, 16, 0, 15, 15, 15, 0,
410 - 6, 8, 7, 17, 17, 17, 17, 3, 0, 0,
411 - 15, 2, 17, 1, 0, 15, 12, 0
412 - } ;
413 -
414 -static yyconst flex_int32_t yy_ec[256] =
415 - { 0,
416 - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
417 - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
418 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 - 1, 2, 4, 1, 1, 1, 1, 1, 5, 6,
420 - 6, 7, 8, 7, 8, 9, 7, 10, 10, 10,
421 - 10, 10, 10, 10, 10, 10, 10, 1, 1, 11,
422 - 12, 13, 1, 1, 14, 15, 15, 16, 17, 15,
423 - 15, 15, 18, 15, 19, 20, 15, 21, 22, 15,
424 - 15, 23, 15, 24, 15, 15, 15, 15, 15, 15,
425 - 1, 25, 1, 1, 15, 1, 26, 15, 15, 27,
426 -
427 - 28, 15, 15, 15, 29, 15, 30, 31, 15, 32,
428 - 33, 15, 15, 34, 15, 35, 15, 15, 15, 15,
429 - 15, 15, 1, 1, 1, 36, 1, 37, 37, 37,
430 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
431 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
432 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
433 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
434 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
435 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
436 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
437 -
438 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
439 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
440 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
441 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
442 - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
443 - 37, 37, 37, 37, 37
444 - } ;
445 -
446 -static yyconst flex_int32_t yy_meta[38] =
447 - { 0,
448 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
449 - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
450 - 2, 2, 2, 2, 1, 2, 2, 2, 2, 2,
451 - 2, 2, 2, 2, 2, 1, 2
452 - } ;
453 -
454 -static yyconst flex_int16_t yy_base[51] =
455 - { 0,
456 - 0, 0, 96, 97, 36, 38, 83, 37, 97, 97,
457 - 84, 35, 34, 97, 81, 22, 0, 30, 27, 27,
458 - 97, 53, 97, 46, 87, 85, 47, 48, 57, 60,
459 - 97, 97, 97, 0, 53, 53, 49, 0, 69, 77,
460 - 76, 0, 61, 0, 72, 71, 0, 97, 89, 51
461 - } ;
462 -
463 -static yyconst flex_int16_t yy_def[51] =
464 - { 0,
465 - 48, 1, 48, 48, 48, 48, 48, 49, 48, 48,
466 - 48, 48, 48, 48, 48, 50, 50, 50, 50, 50,
467 - 48, 48, 48, 49, 48, 49, 48, 48, 48, 48,
468 - 48, 48, 48, 50, 50, 50, 50, 50, 48, 48,
469 - 48, 50, 50, 50, 48, 48, 50, 0, 48, 48
470 - } ;
471 -
472 -static yyconst flex_int16_t yy_nxt[135] =
473 - { 0,
474 - 4, 5, 6, 7, 8, 9, 10, 10, 11, 12,
475 - 13, 14, 15, 16, 17, 17, 17, 17, 17, 18,
476 - 19, 20, 17, 17, 4, 16, 17, 17, 17, 17,
477 - 18, 19, 20, 17, 17, 21, 17, 22, 22, 22,
478 - 22, 25, 35, 28, 29, 31, 32, 36, 37, 38,
479 - 25, 30, 34, 35, 22, 22, 27, 27, 36, 37,
480 - 38, 26, 30, 39, 30, 28, 29, 40, 42, 41,
481 - 26, 43, 44, 30, 39, 30, 45, 47, 46, 42,
482 - 46, 46, 43, 44, 30, 41, 41, 48, 47, 24,
483 - 24, 24, 33, 27, 23, 48, 3, 48, 48, 48,
484 -
485 - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
486 - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
487 - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
488 - 48, 48, 48, 48
489 - } ;
490 -
491 -static yyconst flex_int16_t yy_chk[135] =
492 - { 0,
493 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 5, 5, 6,
497 - 6, 8, 16, 12, 12, 13, 13, 18, 19, 20,
498 - 24, 12, 50, 16, 22, 22, 27, 28, 18, 19,
499 - 20, 8, 12, 27, 28, 29, 29, 30, 35, 30,
500 - 24, 36, 37, 29, 27, 28, 39, 43, 39, 35,
501 - 46, 45, 36, 37, 29, 41, 40, 26, 43, 49,
502 - 49, 25, 15, 11, 7, 3, 48, 48, 48, 48,
503 -
504 - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
505 - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
506 - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
507 - 48, 48, 48, 48
508 - } ;
509 -
510 -static yy_state_type yy_last_accepting_state;
511 -static char *yy_last_accepting_cpos;
512 -
513 -extern int yy_flex_debug;
514 -int yy_flex_debug = 0;
515 -
516 -/* The intent behind this definition is that it'll catch
517 - * any uses of REJECT which flex missed.
518 - */
519 -#define REJECT reject_used_but_not_detected
520 -#define yymore() yymore_used_but_not_detected
521 -#define YY_MORE_ADJ 0
522 -#define YY_RESTORE_YY_MORE_OFFSET
523 -char *yytext;
524 -#line 1 "qgssearchstringlexer.ll"
525 -/***************************************************************************
526 - qgssearchstringparser.ll
527 - Rules for lexical analysis of search strings done by Flex
528 - --------------------
529 - begin : 2005-07-26
530 - copyright : (C) 2005 by Martin Dobias
531 - email : won.der at centrum.sk
532 -***************************************************************************/
533 -/***************************************************************************
534 - * *
535 - * This program is free software; you can redistribute it and/or modify *
536 - * it under the terms of the GNU General Public License as published by *
537 - * the Free Software Foundation; either version 2 of the License, or *
538 - * (at your option) any later version. *
539 - * *
540 - ***************************************************************************/
541 -/* $Id: qgssearchstringlexer.ll 6415 2007-01-09 02:39:15Z wonder $ */
542 -// ensure that lexer will be 8-bit (and not just 7-bit)
543 -#line 27 "qgssearchstringlexer.ll"
544 -
545 -#include <stdlib.h> // atof()
546 -
547 -#include "qgssearchtreenode.h"
548 -#include "qgssearchstringparser.hpp"
549 -
550 -// if not defined, searches for isatty()
551 -// which doesn't in MSVC compiler
552 -#define YY_NEVER_INTERACTIVE 1
553 -
554 -#line 531 "lex.yy.c"
555 -
556 -#define INITIAL 0
557 -
558 -#ifndef YY_NO_UNISTD_H
559 -/* Special case for "unistd.h", since it is non-ANSI. We include it way
560 - * down here because we want the user's section 1 to have been scanned first.
561 - * The user has a chance to override it with an option.
562 - */
563 -#include <unistd.h>
564 -#endif
565 -
566 -#ifndef YY_EXTRA_TYPE
567 -#define YY_EXTRA_TYPE void *
568 -#endif
569 -
570 -static int yy_init_globals (void );
571 -
572 -/* Macros after this point can all be overridden by user definitions in
573 - * section 1.
574 - */
575 -
576 -#ifndef YY_SKIP_YYWRAP
577 -#ifdef __cplusplus
578 -extern "C" int yywrap (void );
579 -#else
580 -extern int yywrap (void );
581 -#endif
582 -#endif
583 -
584 - static void yyunput (int c,char *buf_ptr );
585 -
586 -#ifndef yytext_ptr
587 -static void yy_flex_strncpy (char *,yyconst char *,int );
588 -#endif
589 -
590 -#ifdef YY_NEED_STRLEN
591 -static int yy_flex_strlen (yyconst char * );
592 -#endif
593 -
594 -#ifndef YY_NO_INPUT
595 -
596 -#ifdef __cplusplus
597 -static int yyinput (void );
598 -#else
599 -static int input (void );
600 -#endif
601 -
602 -#endif
603 -
604 -/* Amount of stuff to slurp up with each read. */
605 -#ifndef YY_READ_BUF_SIZE
606 -#define YY_READ_BUF_SIZE 8192
607 -#endif
608 -
609 -/* Copy whatever the last rule matched to the standard output. */
610 -#ifndef ECHO
611 -/* This used to be an fputs(), but since the string might contain NUL's,
612 - * we now use fwrite().
613 - */
614 -#define ECHO fwrite( yytext, yyleng, 1, yyout )
615 -#endif
616 -
617 -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
618 - * is returned in "result".
619 - */
620 -#ifndef YY_INPUT
621 -#define YY_INPUT(buf,result,max_size) \
622 - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
623 - { \
624 - int c = '*'; \
625 - int n; \
626 - for ( n = 0; n < max_size && \
627 - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
628 - buf[n] = (char) c; \
629 - if ( c == '\n' ) \
630 - buf[n++] = (char) c; \
631 - if ( c == EOF && ferror( yyin ) ) \
632 - YY_FATAL_ERROR( "input in flex scanner failed" ); \
633 - result = n; \
634 - } \
635 - else \
636 - { \
637 - errno=0; \
638 - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
639 - { \
640 - if( errno != EINTR) \
641 - { \
642 - YY_FATAL_ERROR( "input in flex scanner failed" ); \
643 - break; \
644 - } \
645 - errno=0; \
646 - clearerr(yyin); \
647 - } \
648 - }\
649 -\
650 -
651 -#endif
652 -
653 -/* No semi-colon after return; correct usage is to write "yyterminate();" -
654 - * we don't want an extra ';' after the "return" because that will cause
655 - * some compilers to complain about unreachable statements.
656 - */
657 -#ifndef yyterminate
658 -#define yyterminate() return YY_NULL
659 -#endif
660 -
661 -/* Number of entries by which start-condition stack grows. */
662 -#ifndef YY_START_STACK_INCR
663 -#define YY_START_STACK_INCR 25
664 -#endif
665 -
666 -/* Report a fatal error. */
667 -#ifndef YY_FATAL_ERROR
668 -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
669 -#endif
670 -
671 -/* end tables serialization structures and prototypes */
672 -
673 -/* Default declaration of generated scanner - a define so the user can
674 - * easily add parameters.
675 - */
676 -#ifndef YY_DECL
677 -#define YY_DECL_IS_OURS 1
678 -
679 -extern int yylex (void);
680 -
681 -#define YY_DECL int yylex (void)
682 -#endif /* !YY_DECL */
683 -
684 -/* Code executed at the beginning of each rule, after yytext and yyleng
685 - * have been set up.
686 - */
687 -#ifndef YY_USER_ACTION
688 -#define YY_USER_ACTION
689 -#endif
690 -
691 -/* Code executed at the end of each rule. */
692 -#ifndef YY_BREAK
693 -#define YY_BREAK break;
694 -#endif
695 -
696 -#define YY_RULE_SETUP \
697 - YY_USER_ACTION
698 -
699 -/** The main scanner function which does all the work.
700 - */
701 -YY_DECL
702 -{
703 - register yy_state_type yy_current_state;
704 - register char *yy_cp, *yy_bp;
705 - register int yy_act;
706 -
707 -#line 55 "qgssearchstringlexer.ll"
708 -
709 -
710 -#line 687 "lex.yy.c"
711 -
712 - if ( !(yy_init) )
713 - {
714 - (yy_init) = 1;
715 -
716 -#ifdef YY_USER_INIT
717 - YY_USER_INIT;
718 -#endif
719 -
720 - if ( ! (yy_start) )
721 - (yy_start) = 1; /* first start state */
722 -
723 - if ( ! yyin )
724 - yyin = stdin;
725 -
726 - if ( ! yyout )
727 - yyout = stdout;
728 -
729 - if ( ! YY_CURRENT_BUFFER ) {
730 - yyensure_buffer_stack ();
731 - YY_CURRENT_BUFFER_LVALUE =
732 - yy_create_buffer(yyin,YY_BUF_SIZE );
733 - }
734 -
735 - yy_load_buffer_state( );
736 - }
737 -
738 - while ( 1 ) /* loops until end-of-file is reached */
739 - {
740 - yy_cp = (yy_c_buf_p);
741 -
742 - /* Support of yytext. */
743 - *yy_cp = (yy_hold_char);
744 -
745 - /* yy_bp points to the position in yy_ch_buf of the start of
746 - * the current run.
747 - */
748 - yy_bp = yy_cp;
749 -
750 - yy_current_state = (yy_start);
751 -yy_match:
752 - do
753 - {
754 - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
755 - if ( yy_accept[yy_current_state] )
756 - {
757 - (yy_last_accepting_state) = yy_current_state;
758 - (yy_last_accepting_cpos) = yy_cp;
759 - }
760 - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
761 - {
762 - yy_current_state = (int) yy_def[yy_current_state];
763 - if ( yy_current_state >= 49 )
764 - yy_c = yy_meta[(unsigned int) yy_c];
765 - }
766 - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
767 - ++yy_cp;
768 - }
769 - while ( yy_base[yy_current_state] != 97 );
770 -
771 -yy_find_action:
772 - yy_act = yy_accept[yy_current_state];
773 - if ( yy_act == 0 )
774 - { /* have to back up */
775 - yy_cp = (yy_last_accepting_cpos);
776 - yy_current_state = (yy_last_accepting_state);
777 - yy_act = yy_accept[yy_current_state];
778 - }
779 -
780 - YY_DO_BEFORE_ACTION;
781 -
782 -do_action: /* This label is used only to access EOF actions. */
783 -
784 - switch ( yy_act )
785 - { /* beginning of action switch */
786 - case 0: /* must back up */
787 - /* undo the effects of YY_DO_BEFORE_ACTION */
788 - *yy_cp = (yy_hold_char);
789 - yy_cp = (yy_last_accepting_cpos);
790 - yy_current_state = (yy_last_accepting_state);
791 - goto yy_find_action;
792 -
793 -case 1:
794 -YY_RULE_SETUP
795 -#line 57 "qgssearchstringlexer.ll"
796 -{ return NOT; }
797 - YY_BREAK
798 -case 2:
799 -YY_RULE_SETUP
800 -#line 58 "qgssearchstringlexer.ll"
801 -{ return AND; }
802 - YY_BREAK
803 -case 3:
804 -YY_RULE_SETUP
805 -#line 59 "qgssearchstringlexer.ll"
806 -{ return OR; }
807 - YY_BREAK
808 -case 4:
809 -YY_RULE_SETUP
810 -#line 61 "qgssearchstringlexer.ll"
811 -{ yylval.op = QgsSearchTreeNode::opEQ; return COMPARISON; }
812 - YY_BREAK
813 -case 5:
814 -YY_RULE_SETUP
815 -#line 62 "qgssearchstringlexer.ll"
816 -{ yylval.op = QgsSearchTreeNode::opNE; return COMPARISON; }
817 - YY_BREAK
818 -case 6:
819 -YY_RULE_SETUP
820 -#line 63 "qgssearchstringlexer.ll"
821 -{ yylval.op = QgsSearchTreeNode::opLE; return COMPARISON; }
822 - YY_BREAK
823 -case 7:
824 -YY_RULE_SETUP
825 -#line 64 "qgssearchstringlexer.ll"
826 -{ yylval.op = QgsSearchTreeNode::opGE; return COMPARISON; }
827 - YY_BREAK
828 -case 8:
829 -YY_RULE_SETUP
830 -#line 65 "qgssearchstringlexer.ll"
831 -{ yylval.op = QgsSearchTreeNode::opNE; return COMPARISON; }
832 - YY_BREAK
833 -case 9:
834 -YY_RULE_SETUP
835 -#line 66 "qgssearchstringlexer.ll"
836 -{ yylval.op = QgsSearchTreeNode::opLT; return COMPARISON; }
837 - YY_BREAK
838 -case 10:
839 -YY_RULE_SETUP
840 -#line 67 "qgssearchstringlexer.ll"
841 -{ yylval.op = QgsSearchTreeNode::opGT; return COMPARISON; }
842 - YY_BREAK
843 -case 11:
844 -YY_RULE_SETUP
845 -#line 68 "qgssearchstringlexer.ll"
846 -{ yylval.op = QgsSearchTreeNode::opRegexp; return COMPARISON; }
847 - YY_BREAK
848 -case 12:
849 -YY_RULE_SETUP
850 -#line 69 "qgssearchstringlexer.ll"
851 -{ yylval.op = QgsSearchTreeNode::opLike; return COMPARISON; }
852 - YY_BREAK
853 -case 13:
854 -YY_RULE_SETUP
855 -#line 71 "qgssearchstringlexer.ll"
856 -{ return yytext[0]; }
857 - YY_BREAK
858 -case 14:
859 -YY_RULE_SETUP
860 -#line 73 "qgssearchstringlexer.ll"
861 -{ return yytext[0]; }
862 - YY_BREAK
863 -case 15:
864 -YY_RULE_SETUP
865 -#line 75 "qgssearchstringlexer.ll"
866 -{ yylval.number = atof(yytext); return NUMBER; }
867 - YY_BREAK
868 -case 16:
869 -/* rule 16 can match eol */
870 -YY_RULE_SETUP
871 -#line 77 "qgssearchstringlexer.ll"
872 -{ return STRING; }
873 - YY_BREAK
874 -case 17:
875 -YY_RULE_SETUP
876 -#line 79 "qgssearchstringlexer.ll"
877 -{ return COLUMN_REF; }
878 - YY_BREAK
879 -case 18:
880 -/* rule 18 can match eol */
881 -YY_RULE_SETUP
882 -#line 81 "qgssearchstringlexer.ll"
883 -/* skip blanks and tabs */
884 - YY_BREAK
885 -case 19:
886 -YY_RULE_SETUP
887 -#line 83 "qgssearchstringlexer.ll"
888 -{ return UNKNOWN_CHARACTER; }
889 - YY_BREAK
890 -case 20:
891 -YY_RULE_SETUP
892 -#line 85 "qgssearchstringlexer.ll"
893 -ECHO;
894 - YY_BREAK
895 -#line 872 "lex.yy.c"
896 -case YY_STATE_EOF(INITIAL):
897 - yyterminate();
898 -
899 - case YY_END_OF_BUFFER:
900 - {
901 - /* Amount of text matched not including the EOB char. */
902 - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
903 -
904 - /* Undo the effects of YY_DO_BEFORE_ACTION. */
905 - *yy_cp = (yy_hold_char);
906 - YY_RESTORE_YY_MORE_OFFSET
907 -
908 - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
909 - {
910 - /* We're scanning a new file or input source. It's
911 - * possible that this happened because the user
912 - * just pointed yyin at a new source and called
913 - * yylex(). If so, then we have to assure
914 - * consistency between YY_CURRENT_BUFFER and our
915 - * globals. Here is the right place to do so, because
916 - * this is the first action (other than possibly a
917 - * back-up) that will match for the new input source.
918 - */
919 - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
920 - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
921 - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
922 - }
923 -
924 - /* Note that here we test for yy_c_buf_p "<=" to the position
925 - * of the first EOB in the buffer, since yy_c_buf_p will
926 - * already have been incremented past the NUL character
927 - * (since all states make transitions on EOB to the
928 - * end-of-buffer state). Contrast this with the test
929 - * in input().
930 - */
931 - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
932 - { /* This was really a NUL. */
933 - yy_state_type yy_next_state;
934 -
935 - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
936 -
937 - yy_current_state = yy_get_previous_state( );
938 -
939 - /* Okay, we're now positioned to make the NUL
940 - * transition. We couldn't have
941 - * yy_get_previous_state() go ahead and do it
942 - * for us because it doesn't know how to deal
943 - * with the possibility of jamming (and we don't
944 - * want to build jamming into it because then it
945 - * will run more slowly).
946 - */
947 -
948 - yy_next_state = yy_try_NUL_trans( yy_current_state );
949 -
950 - yy_bp = (yytext_ptr) + YY_MORE_ADJ;
951 -
952 - if ( yy_next_state )
953 - {
954 - /* Consume the NUL. */
955 - yy_cp = ++(yy_c_buf_p);
956 - yy_current_state = yy_next_state;
957 - goto yy_match;
958 - }
959 -
960 - else
961 - {
962 - yy_cp = (yy_c_buf_p);
963 - goto yy_find_action;
964 - }
965 - }
966 -
967 - else switch ( yy_get_next_buffer( ) )
968 - {
969 - case EOB_ACT_END_OF_FILE:
970 - {
971 - (yy_did_buffer_switch_on_eof) = 0;
972 -
973 - if ( yywrap( ) )
974 - {
975 - /* Note: because we've taken care in
976 - * yy_get_next_buffer() to have set up
977 - * yytext, we can now set up
978 - * yy_c_buf_p so that if some total
979 - * hoser (like flex itself) wants to
980 - * call the scanner after we return the
981 - * YY_NULL, it'll still work - another
982 - * YY_NULL will get returned.
983 - */
984 - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
985 -
986 - yy_act = YY_STATE_EOF(YY_START);
987 - goto do_action;
988 - }
989 -
990 - else
991 - {
992 - if ( ! (yy_did_buffer_switch_on_eof) )
993 - YY_NEW_FILE;
994 - }
995 - break;
996 - }
997 -
998 - case EOB_ACT_CONTINUE_SCAN:
999 - (yy_c_buf_p) =
1000 - (yytext_ptr) + yy_amount_of_matched_text;
1001 -
1002 - yy_current_state = yy_get_previous_state( );
1003 -
1004 - yy_cp = (yy_c_buf_p);
1005 - yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1006 - goto yy_match;
1007 -
1008 - case EOB_ACT_LAST_MATCH:
1009 - (yy_c_buf_p) =
1010 - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1011 -
1012 - yy_current_state = yy_get_previous_state( );
1013 -
1014 - yy_cp = (yy_c_buf_p);
1015 - yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1016 - goto yy_find_action;
1017 - }
1018 - break;
1019 - }
1020 -
1021 - default:
1022 - YY_FATAL_ERROR(
1023 - "fatal flex scanner internal error--no action found" );
1024 - } /* end of action switch */
1025 - } /* end of scanning one token */
1026 -} /* end of yylex */
1027 -
1028 -/* yy_get_next_buffer - try to read in a new buffer
1029 - *
1030 - * Returns a code representing an action:
1031 - * EOB_ACT_LAST_MATCH -
1032 - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1033 - * EOB_ACT_END_OF_FILE - end of file
1034 - */
1035 -static int yy_get_next_buffer (void)
1036 -{
1037 - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1038 - register char *source = (yytext_ptr);
1039 - register int number_to_move, i;
1040 - int ret_val;
1041 -
1042 - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1043 - YY_FATAL_ERROR(
1044 - "fatal flex scanner internal error--end of buffer missed" );
1045 -
1046 - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1047 - { /* Don't try to fill the buffer, so this is an EOF. */
1048 - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1049 - {
1050 - /* We matched a single character, the EOB, so
1051 - * treat this as a final EOF.
1052 - */
1053 - return EOB_ACT_END_OF_FILE;
1054 - }
1055 -
1056 - else
1057 - {
1058 - /* We matched some text prior to the EOB, first
1059 - * process it.
1060 - */
1061 - return EOB_ACT_LAST_MATCH;
1062 - }
1063 - }
1064 -
1065 - /* Try to read more data. */
1066 -
1067 - /* First move last chars to start of buffer. */
1068 - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1069 -
1070 - for ( i = 0; i < number_to_move; ++i )
1071 - *(dest++) = *(source++);
1072 -
1073 - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1074 - /* don't do the read, it's not guaranteed to return an EOF,
1075 - * just force an EOF
1076 - */
1077 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1078 -
1079 - else
1080 - {
1081 - int num_to_read =
1082 - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1083 -
1084 - while ( num_to_read <= 0 )
1085 - { /* Not enough room in the buffer - grow it. */
1086 -
1087 - /* just a shorter name for the current buffer */
1088 - YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1089 -
1090 - int yy_c_buf_p_offset =
1091 - (int) ((yy_c_buf_p) - b->yy_ch_buf);
1092 -
1093 - if ( b->yy_is_our_buffer )
1094 - {
1095 - int new_size = b->yy_buf_size * 2;
1096 -
1097 - if ( new_size <= 0 )
1098 - b->yy_buf_size += b->yy_buf_size / 8;
1099 - else
1100 - b->yy_buf_size *= 2;
1101 -
1102 - b->yy_ch_buf = (char *)
1103 - /* Include room in for 2 EOB chars. */
1104 - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1105 - }
1106 - else
1107 - /* Can't grow it, we don't own it. */
1108 - b->yy_ch_buf = 0;
1109 -
1110 - if ( ! b->yy_ch_buf )
1111 - YY_FATAL_ERROR(
1112 - "fatal error - scanner input buffer overflow" );
1113 -
1114 - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1115 -
1116 - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1117 - number_to_move - 1;
1118 -
1119 - }
1120 -
1121 - if ( num_to_read > YY_READ_BUF_SIZE )
1122 - num_to_read = YY_READ_BUF_SIZE;
1123 -
1124 - /* Read in more data. */
1125 - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1126 - (yy_n_chars), (size_t) num_to_read );
1127 -
1128 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1129 - }
1130 -
1131 - if ( (yy_n_chars) == 0 )
1132 - {
1133 - if ( number_to_move == YY_MORE_ADJ )
1134 - {
1135 - ret_val = EOB_ACT_END_OF_FILE;
1136 - yyrestart(yyin );
1137 - }
1138 -
1139 - else
1140 - {
1141 - ret_val = EOB_ACT_LAST_MATCH;
1142 - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1143 - YY_BUFFER_EOF_PENDING;
1144 - }
1145 - }
1146 -
1147 - else
1148 - ret_val = EOB_ACT_CONTINUE_SCAN;
1149 -
1150 - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1151 - /* Extend the array by 50%, plus the number we really need. */
1152 - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1153 - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1154 - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1155 - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1156 - }
1157 -
1158 - (yy_n_chars) += number_to_move;
1159 - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1160 - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1161 -
1162 - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1163 -
1164 - return ret_val;
1165 -}
1166 -
1167 -/* yy_get_previous_state - get the state just before the EOB char was reached */
1168 -
1169 - static yy_state_type yy_get_previous_state (void)
1170 -{
1171 - register yy_state_type yy_current_state;
1172 - register char *yy_cp;
1173 -
1174 - yy_current_state = (yy_start);
1175 -
1176 - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1177 - {
1178 - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1179 - if ( yy_accept[yy_current_state] )
1180 - {
1181 - (yy_last_accepting_state) = yy_current_state;
1182 - (yy_last_accepting_cpos) = yy_cp;
1183 - }
1184 - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1185 - {
1186 - yy_current_state = (int) yy_def[yy_current_state];
1187 - if ( yy_current_state >= 49 )
1188 - yy_c = yy_meta[(unsigned int) yy_c];
1189 - }
1190 - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1191 - }
1192 -
1193 - return yy_current_state;
1194 -}
1195 -
1196 -/* yy_try_NUL_trans - try to make a transition on the NUL character
1197 - *
1198 - * synopsis
1199 - * next_state = yy_try_NUL_trans( current_state );
1200 - */
1201 - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1202 -{
1203 - register int yy_is_jam;
1204 - register char *yy_cp = (yy_c_buf_p);
1205 -
1206 - register YY_CHAR yy_c = 1;
1207 - if ( yy_accept[yy_current_state] )
1208 - {
1209 - (yy_last_accepting_state) = yy_current_state;
1210 - (yy_last_accepting_cpos) = yy_cp;
1211 - }
1212 - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1213 - {
1214 - yy_current_state = (int) yy_def[yy_current_state];
1215 - if ( yy_current_state >= 49 )
1216 - yy_c = yy_meta[(unsigned int) yy_c];
1217 - }
1218 - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1219 - yy_is_jam = (yy_current_state == 48);
1220 -
1221 - return yy_is_jam ? 0 : yy_current_state;
1222 -}
1223 -
1224 - static void yyunput (int c, register char * yy_bp )
1225 -{
1226 - register char *yy_cp;
1227 -
1228 - yy_cp = (yy_c_buf_p);
1229 -
1230 - /* undo effects of setting up yytext */
1231 - *yy_cp = (yy_hold_char);
1232 -
1233 - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1234 - { /* need to shift things up to make room */
1235 - /* +2 for EOB chars. */
1236 - register int number_to_move = (yy_n_chars) + 2;
1237 - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1238 - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1239 - register char *source =
1240 - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1241 -
1242 - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1243 - *--dest = *--source;
1244 -
1245 - yy_cp += (int) (dest - source);
1246 - yy_bp += (int) (dest - source);
1247 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1248 - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1249 -
1250 - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1251 - YY_FATAL_ERROR( "flex scanner push-back overflow" );
1252 - }
1253 -
1254 - *--yy_cp = (char) c;
1255 -
1256 - (yytext_ptr) = yy_bp;
1257 - (yy_hold_char) = *yy_cp;
1258 - (yy_c_buf_p) = yy_cp;
1259 -}
1260 -
1261 -#ifndef YY_NO_INPUT
1262 -#ifdef __cplusplus
1263 - static int yyinput (void)
1264 -#else
1265 - static int input (void)
1266 -#endif
1267 -
1268 -{
1269 - int c;
1270 -
1271 - *(yy_c_buf_p) = (yy_hold_char);
1272 -
1273 - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1274 - {
1275 - /* yy_c_buf_p now points to the character we want to return.
1276 - * If this occurs *before* the EOB characters, then it's a
1277 - * valid NUL; if not, then we've hit the end of the buffer.
1278 - */
1279 - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1280 - /* This was really a NUL. */
1281 - *(yy_c_buf_p) = '\0';
1282 -
1283 - else
1284 - { /* need more input */
1285 - int offset = (yy_c_buf_p) - (yytext_ptr);
1286 - ++(yy_c_buf_p);
1287 -
1288 - switch ( yy_get_next_buffer( ) )
1289 - {
1290 - case EOB_ACT_LAST_MATCH:
1291 - /* This happens because yy_g_n_b()
1292 - * sees that we've accumulated a
1293 - * token and flags that we need to
1294 - * try matching the token before
1295 - * proceeding. But for input(),
1296 - * there's no matching to consider.
1297 - * So convert the EOB_ACT_LAST_MATCH
1298 - * to EOB_ACT_END_OF_FILE.
1299 - */
1300 -
1301 - /* Reset buffer status. */
1302 - yyrestart(yyin );
1303 -
1304 - /*FALLTHROUGH*/
1305 -
1306 - case EOB_ACT_END_OF_FILE:
1307 - {
1308 - if ( yywrap( ) )
1309 - return EOF;
1310 -
1311 - if ( ! (yy_did_buffer_switch_on_eof) )
1312 - YY_NEW_FILE;
1313 -#ifdef __cplusplus
1314 - return yyinput();
1315 -#else
1316 - return input();
1317 -#endif
1318 - }
1319 -
1320 - case EOB_ACT_CONTINUE_SCAN:
1321 - (yy_c_buf_p) = (yytext_ptr) + offset;
1322 - break;
1323 - }
1324 - }
1325 - }
1326 -
1327 - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1328 - *(yy_c_buf_p) = '\0'; /* preserve yytext */
1329 - (yy_hold_char) = *++(yy_c_buf_p);
1330 -
1331 - return c;
1332 -}
1333 -#endif /* ifndef YY_NO_INPUT */
1334 -
1335 -/** Immediately switch to a different input stream.
1336 - * @param input_file A readable stream.
1337 - *
1338 - * @note This function does not reset the start condition to @c INITIAL .
1339 - */
1340 - void yyrestart (FILE * input_file )
1341 -{
1342 -
1343 - if ( ! YY_CURRENT_BUFFER ){
1344 - yyensure_buffer_stack ();
1345 - YY_CURRENT_BUFFER_LVALUE =
1346 - yy_create_buffer(yyin,YY_BUF_SIZE );
1347 - }
1348 -
1349 - yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1350 - yy_load_buffer_state( );
1351 -}
1352 -
1353 -/** Switch to a different input buffer.
1354 - * @param new_buffer The new input buffer.
1355 - *
1356 - */
1357 - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1358 -{
1359 -
1360 - /* TODO. We should be able to replace this entire function body
1361 - * with
1362 - * yypop_buffer_state();
1363 - * yypush_buffer_state(new_buffer);
1364 - */
1365 - yyensure_buffer_stack ();
1366 - if ( YY_CURRENT_BUFFER == new_buffer )
1367 - return;
1368 -
1369 - if ( YY_CURRENT_BUFFER )
1370 - {
1371 - /* Flush out information for old buffer. */
1372 - *(yy_c_buf_p) = (yy_hold_char);
1373 - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1374 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1375 - }
1376 -
1377 - YY_CURRENT_BUFFER_LVALUE = new_buffer;
1378 - yy_load_buffer_state( );
1379 -
1380 - /* We don't actually know whether we did this switch during
1381 - * EOF (yywrap()) processing, but the only time this flag
1382 - * is looked at is after yywrap() is called, so it's safe
1383 - * to go ahead and always set it.
1384 - */
1385 - (yy_did_buffer_switch_on_eof) = 1;
1386 -}
1387 -
1388 -static void yy_load_buffer_state (void)
1389 -{
1390 - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1391 - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1392 - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1393 - (yy_hold_char) = *(yy_c_buf_p);
1394 -}
1395 -
1396 -/** Allocate and initialize an input buffer state.
1397 - * @param file A readable stream.
1398 - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1399 - *
1400 - * @return the allocated buffer state.
1401 - */
1402 - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1403 -{
1404 - YY_BUFFER_STATE b;
1405 -
1406 - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1407 - if ( ! b )
1408 - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1409 -
1410 - b->yy_buf_size = size;
1411 -
1412 - /* yy_ch_buf has to be 2 characters longer than the size given because
1413 - * we need to put in 2 end-of-buffer characters.
1414 - */
1415 - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1416 - if ( ! b->yy_ch_buf )
1417 - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1418 -
1419 - b->yy_is_our_buffer = 1;
1420 -
1421 - yy_init_buffer(b,file );
1422 -
1423 - return b;
1424 -}
1425 -
1426 -/** Destroy the buffer.
1427 - * @param b a buffer created with yy_create_buffer()
1428 - *
1429 - */
1430 - void yy_delete_buffer (YY_BUFFER_STATE b )
1431 -{
1432 -
1433 - if ( ! b )
1434 - return;
1435 -
1436 - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1437 - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1438 -
1439 - if ( b->yy_is_our_buffer )
1440 - yyfree((void *) b->yy_ch_buf );
1441 -
1442 - yyfree((void *) b );
1443 -}
1444 -
1445 -#ifndef __cplusplus
1446 -extern int isatty (int );
1447 -#endif /* __cplusplus */
1448 -
1449 -/* Initializes or reinitializes a buffer.
1450 - * This function is sometimes called more than once on the same buffer,
1451 - * such as during a yyrestart() or at EOF.
1452 - */
1453 - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1454 -
1455 -{
1456 - int oerrno = errno;
1457 -
1458 - yy_flush_buffer(b );
1459 -
1460 - b->yy_input_file = file;
1461 - b->yy_fill_buffer = 1;
1462 -
1463 - /* If b is the current buffer, then yy_init_buffer was _probably_
1464 - * called from yyrestart() or through yy_get_next_buffer.
1465 - * In that case, we don't want to reset the lineno or column.
1466 - */
1467 - if (b != YY_CURRENT_BUFFER){
1468 - b->yy_bs_lineno = 1;
1469 - b->yy_bs_column = 0;
1470 - }
1471 -
1472 - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1473 -
1474 - errno = oerrno;
1475 -}
1476 -
1477 -/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1478 - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1479 - *
1480 - */
1481 - void yy_flush_buffer (YY_BUFFER_STATE b )
1482 -{
1483 - if ( ! b )
1484 - return;
1485 -
1486 - b->yy_n_chars = 0;
1487 -
1488 - /* We always need two end-of-buffer characters. The first causes
1489 - * a transition to the end-of-buffer state. The second causes
1490 - * a jam in that state.
1491 - */
1492 - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1493 - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1494 -
1495 - b->yy_buf_pos = &b->yy_ch_buf[0];
1496 -
1497 - b->yy_at_bol = 1;
1498 - b->yy_buffer_status = YY_BUFFER_NEW;
1499 -
1500 - if ( b == YY_CURRENT_BUFFER )
1501 - yy_load_buffer_state( );
1502 -}
1503 -
1504 -/** Pushes the new state onto the stack. The new state becomes
1505 - * the current state. This function will allocate the stack
1506 - * if necessary.
1507 - * @param new_buffer The new state.
1508 - *
1509 - */
1510 -void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1511 -{
1512 - if (new_buffer == NULL)
1513 - return;
1514 -
1515 - yyensure_buffer_stack();
1516 -
1517 - /* This block is copied from yy_switch_to_buffer. */
1518 - if ( YY_CURRENT_BUFFER )
1519 - {
1520 - /* Flush out information for old buffer. */
1521 - *(yy_c_buf_p) = (yy_hold_char);
1522 - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1523 - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1524 - }
1525 -
1526 - /* Only push if top exists. Otherwise, replace top. */
1527 - if (YY_CURRENT_BUFFER)
1528 - (yy_buffer_stack_top)++;
1529 - YY_CURRENT_BUFFER_LVALUE = new_buffer;
1530 -
1531 - /* copied from yy_switch_to_buffer. */
1532 - yy_load_buffer_state( );
1533 - (yy_did_buffer_switch_on_eof) = 1;
1534 -}
1535 -
1536 -/** Removes and deletes the top of the stack, if present.
1537 - * The next element becomes the new top.
1538 - *
1539 - */
1540 -void yypop_buffer_state (void)
1541 -{
1542 - if (!YY_CURRENT_BUFFER)
1543 - return;
1544 -
1545 - yy_delete_buffer(YY_CURRENT_BUFFER );
1546 - YY_CURRENT_BUFFER_LVALUE = NULL;
1547 - if ((yy_buffer_stack_top) > 0)
1548 - --(yy_buffer_stack_top);
1549 -
1550 - if (YY_CURRENT_BUFFER) {
1551 - yy_load_buffer_state( );
1552 - (yy_did_buffer_switch_on_eof) = 1;
1553 - }
1554 -}
1555 -
1556 -/* Allocates the stack if it does not exist.
1557 - * Guarantees space for at least one push.
1558 - */
1559 -static void yyensure_buffer_stack (void)
1560 -{
1561 - int num_to_alloc;
1562 -
1563 - if (!(yy_buffer_stack)) {
1564 -
1565 - /* First allocation is just for 2 elements, since we don't know if this
1566 - * scanner will even need a stack. We use 2 instead of 1 to avoid an
1567 - * immediate realloc on the next call.
1568 - */
1569 - num_to_alloc = 1;
1570 - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1571 - (num_to_alloc * sizeof(struct yy_buffer_state*)
1572 - );
1573 - if ( ! (yy_buffer_stack) )
1574 - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1575 -
1576 - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1577 -
1578 - (yy_buffer_stack_max) = num_to_alloc;
1579 - (yy_buffer_stack_top) = 0;
1580 - return;
1581 - }
1582 -
1583 - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1584 -
1585 - /* Increase the buffer to prepare for a possible push. */
1586 - int grow_size = 8 /* arbitrary grow size */;
1587 -
1588 - num_to_alloc = (yy_buffer_stack_max) + grow_size;
1589 - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1590 - ((yy_buffer_stack),
1591 - num_to_alloc * sizeof(struct yy_buffer_state*)
1592 - );
1593 - if ( ! (yy_buffer_stack) )
1594 - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1595 -
1596 - /* zero only the new slots.*/
1597 - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1598 - (yy_buffer_stack_max) = num_to_alloc;
1599 - }
1600 -}
1601 -
1602 -/** Setup the input buffer state to scan directly from a user-specified character buffer.
1603 - * @param base the character buffer
1604 - * @param size the size in bytes of the character buffer
1605 - *
1606 - * @return the newly allocated buffer state object.
1607 - */
1608 -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1609 -{
1610 - YY_BUFFER_STATE b;
1611 -
1612 - if ( size < 2 ||
1613 - base[size-2] != YY_END_OF_BUFFER_CHAR ||
1614 - base[size-1] != YY_END_OF_BUFFER_CHAR )
1615 - /* They forgot to leave room for the EOB's. */
1616 - return 0;
1617 -
1618 - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1619 - if ( ! b )
1620 - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1621 -
1622 - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1623 - b->yy_buf_pos = b->yy_ch_buf = base;
1624 - b->yy_is_our_buffer = 0;
1625 - b->yy_input_file = 0;
1626 - b->yy_n_chars = b->yy_buf_size;
1627 - b->yy_is_interactive = 0;
1628 - b->yy_at_bol = 1;
1629 - b->yy_fill_buffer = 0;
1630 - b->yy_buffer_status = YY_BUFFER_NEW;
1631 -
1632 - yy_switch_to_buffer(b );
1633 -
1634 - return b;
1635 -}
1636 -
1637 -/** Setup the input buffer state to scan a string. The next call to yylex() will
1638 - * scan from a @e copy of @a str.
1639 - * @param yystr a NUL-terminated string to scan
1640 - *
1641 - * @return the newly allocated buffer state object.
1642 - * @note If you want to scan bytes that may contain NUL values, then use
1643 - * yy_scan_bytes() instead.
1644 - */
1645 -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1646 -{
1647 -
1648 - return yy_scan_bytes(yystr,strlen(yystr) );
1649 -}
1650 -
1651 -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1652 - * scan from a @e copy of @a bytes.
1653 - * @param bytes the byte buffer to scan
1654 - * @param len the number of bytes in the buffer pointed to by @a bytes.
1655 - *
1656 - * @return the newly allocated buffer state object.
1657 - */
1658 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1659 -{
1660 - YY_BUFFER_STATE b;
1661 - char *buf;
1662 - yy_size_t n;
1663 - int i;
1664 -
1665 - /* Get memory for full buffer, including space for trailing EOB's. */
1666 - n = _yybytes_len + 2;
1667 - buf = (char *) yyalloc(n );
1668 - if ( ! buf )
1669 - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1670 -
1671 - for ( i = 0; i < _yybytes_len; ++i )
1672 - buf[i] = yybytes[i];
1673 -
1674 - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1675 -
1676 - b = yy_scan_buffer(buf,n );
1677 - if ( ! b )
1678 - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1679 -
1680 - /* It's okay to grow etc. this buffer, and we should throw it
1681 - * away when we're done.
1682 - */
1683 - b->yy_is_our_buffer = 1;
1684 -
1685 - return b;
1686 -}
1687 -
1688 -#ifndef YY_EXIT_FAILURE
1689 -#define YY_EXIT_FAILURE 2
1690 -#endif
1691 -
1692 -static void yy_fatal_error (yyconst char* msg )
1693 -{
1694 - (void) fprintf( stderr, "%s\n", msg );
1695 - exit( YY_EXIT_FAILURE );
1696 -}
1697 -
1698 -/* Redefine yyless() so it works in section 3 code. */
1699 -
1700 -#undef yyless
1701 -#define yyless(n) \
1702 - do \
1703 - { \
1704 - /* Undo effects of setting up yytext. */ \
1705 - int yyless_macro_arg = (n); \
1706 - YY_LESS_LINENO(yyless_macro_arg);\
1707 - yytext[yyleng] = (yy_hold_char); \
1708 - (yy_c_buf_p) = yytext + yyless_macro_arg; \
1709 - (yy_hold_char) = *(yy_c_buf_p); \
1710 - *(yy_c_buf_p) = '\0'; \
1711 - yyleng = yyless_macro_arg; \
1712 - } \
1713 - while ( 0 )
1714 -
1715 -/* Accessor methods (get/set functions) to struct members. */
1716 -
1717 -/** Get the current line number.
1718 - *
1719 - */
1720 -int yyget_lineno (void)
1721 -{
1722 -
1723 - return yylineno;
1724 -}
1725 -
1726 -/** Get the input stream.
1727 - *
1728 - */
1729 -FILE *yyget_in (void)
1730 -{
1731 - return yyin;
1732 -}
1733 -
1734 -/** Get the output stream.
1735 - *
1736 - */
1737 -FILE *yyget_out (void)
1738 -{
1739 - return yyout;
1740 -}
1741 -
1742 -/** Get the length of the current token.
1743 - *
1744 - */
1745 -int yyget_leng (void)
1746 -{
1747 - return yyleng;
1748 -}
1749 -
1750 -/** Get the current token.
1751 - *
1752 - */
1753 -
1754 -char *yyget_text (void)
1755 -{
1756 - return yytext;
1757 -}
1758 -
1759 -/** Set the current line number.
1760 - * @param line_number
1761 - *
1762 - */
1763 -void yyset_lineno (int line_number )
1764 -{
1765 -
1766 - yylineno = line_number;
1767 -}
1768 -
1769 -/** Set the input stream. This does not discard the current
1770 - * input buffer.
1771 - * @param in_str A readable stream.
1772 - *
1773 - * @see yy_switch_to_buffer
1774 - */
1775 -void yyset_in (FILE * in_str )
1776 -{
1777 - yyin = in_str ;
1778 -}
1779 -
1780 -void yyset_out (FILE * out_str )
1781 -{
1782 - yyout = out_str ;
1783 -}
1784 -
1785 -int yyget_debug (void)
1786 -{
1787 - return yy_flex_debug;
1788 -}
1789 -
1790 -void yyset_debug (int bdebug )
1791 -{
1792 - yy_flex_debug = bdebug ;
1793 -}
1794 -
1795 -static int yy_init_globals (void)
1796 -{
1797 - /* Initialization is the same as for the non-reentrant scanner.
1798 - * This function is called from yylex_destroy(), so don't allocate here.
1799 - */
1800 -
1801 - (yy_buffer_stack) = 0;
1802 - (yy_buffer_stack_top) = 0;
1803 - (yy_buffer_stack_max) = 0;
1804 - (yy_c_buf_p) = (char *) 0;
1805 - (yy_init) = 0;
1806 - (yy_start) = 0;
1807 -
1808 -/* Defined in main.c */
1809 -#ifdef YY_STDINIT
1810 - yyin = stdin;
1811 - yyout = stdout;
1812 -#else
1813 - yyin = (FILE *) 0;
1814 - yyout = (FILE *) 0;
1815 -#endif
1816 -
1817 - /* For future reference: Set errno on error, since we are called by
1818 - * yylex_init()
1819 - */
1820 - return 0;
1821 -}
1822 -
1823 -/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1824 -int yylex_destroy (void)
1825 -{
1826 -
1827 - /* Pop the buffer stack, destroying each element. */
1828 - while(YY_CURRENT_BUFFER){
1829 - yy_delete_buffer(YY_CURRENT_BUFFER );
1830 - YY_CURRENT_BUFFER_LVALUE = NULL;
1831 - yypop_buffer_state();
1832 - }
1833 -
1834 - /* Destroy the stack itself. */
1835 - yyfree((yy_buffer_stack) );
1836 - (yy_buffer_stack) = NULL;
1837 -
1838 - /* Reset the globals. This is important in a non-reentrant scanner so the next time
1839 - * yylex() is called, initialization will occur. */
1840 - yy_init_globals( );
1841 -
1842 - return 0;
1843 -}
1844 -
1845 -/*
1846 - * Internal utility routines.
1847 - */
1848 -
1849 -#ifndef yytext_ptr
1850 -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1851 -{
1852 - register int i;
1853 - for ( i = 0; i < n; ++i )
1854 - s1[i] = s2[i];
1855 -}
1856 -#endif
1857 -
1858 -#ifdef YY_NEED_STRLEN
1859 -static int yy_flex_strlen (yyconst char * s )
1860 -{
1861 - register int n;
1862 - for ( n = 0; s[n]; ++n )
1863 - ;
1864 -
1865 - return n;
1866 -}
1867 -#endif
1868 -
1869 -void *yyalloc (yy_size_t size )
1870 -{
1871 - return (void *) malloc( size );
1872 -}
1873 -
1874 -void *yyrealloc (void * ptr, yy_size_t size )
1875 -{
1876 - /* The cast to (char *) in the following accommodates both
1877 - * implementations that use char* generic pointers, and those
1878 - * that use void* generic pointers. It works with the latter
1879 - * because both ANSI C and C++ allow castless assignment from
1880 - * any pointer type to void*, and deal with argument conversions
1881 - * as though doing an assignment.
1882 - */
1883 - return (void *) realloc( (char *) ptr, size );
1884 -}
1885 -
1886 -void yyfree (void * ptr )
1887 -{
1888 - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1889 -}
1890 -
1891 -#define YYTABLES_NAME "yytables"
1892 -
1893 -#line 85 "qgssearchstringlexer.ll"
1894 -
1895 -
1896 -
1897 -void set_input_buffer(const char* buffer)
1898 -{
1899 - yy_scan_string(buffer);
1900 -}
1901 -
1902 -
1903 diff -urNad qgis~/src/core/qgssearchstringlexer.cc qgis/src/core/qgssearchstringlexer.cc
1904 --- qgis~/src/core/qgssearchstringlexer.cc 1970-01-01 01:00:00.000000000 +0100
1905 +++ qgis/src/core/qgssearchstringlexer.cc 2008-03-19 12:02:44.000000000 +0100
1906 @@ -0,0 +1,1878 @@
1907 +
1908 +#line 3 "lex.yy.c"
1909 +
1910 +#define YY_INT_ALIGNED short int
1911 +
1912 +/* A lexical scanner generated by flex */
1913 +
1914 +#define FLEX_SCANNER
1915 +#define YY_FLEX_MAJOR_VERSION 2
1916 +#define YY_FLEX_MINOR_VERSION 5
1917 +#define YY_FLEX_SUBMINOR_VERSION 34
1918 +#if YY_FLEX_SUBMINOR_VERSION > 0
1919 +#define FLEX_BETA
1920 +#endif
1921 +
1922 +/* First, we deal with platform-specific or compiler-specific issues. */
1923 +
1924 +/* begin standard C headers. */
1925 +#include <stdio.h>
1926 +#include <string.h>
1927 +#include <errno.h>
1928 +#include <stdlib.h>
1929 +
1930 +/* end standard C headers. */
1931 +
1932 +/* flex integer type definitions */
1933 +
1934 +#ifndef FLEXINT_H
1935 +#define FLEXINT_H
1936 +
1937 +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
1938 +
1939 +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1940 +
1941 +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
1942 + * if you want the limit (max/min) macros for int types.
1943 + */
1944 +#ifndef __STDC_LIMIT_MACROS
1945 +#define __STDC_LIMIT_MACROS 1
1946 +#endif
1947 +
1948 +#include <inttypes.h>
1949 +typedef int8_t flex_int8_t;
1950 +typedef uint8_t flex_uint8_t;
1951 +typedef int16_t flex_int16_t;
1952 +typedef uint16_t flex_uint16_t;
1953 +typedef int32_t flex_int32_t;
1954 +typedef uint32_t flex_uint32_t;
1955 +#else
1956 +typedef signed char flex_int8_t;
1957 +typedef short int flex_int16_t;
1958 +typedef int flex_int32_t;
1959 +typedef unsigned char flex_uint8_t;
1960 +typedef unsigned short int flex_uint16_t;
1961 +typedef unsigned int flex_uint32_t;
1962 +#endif /* ! C99 */
1963 +
1964 +/* Limits of integral types. */
1965 +#ifndef INT8_MIN
1966 +#define INT8_MIN (-128)
1967 +#endif
1968 +#ifndef INT16_MIN
1969 +#define INT16_MIN (-32767-1)
1970 +#endif
1971 +#ifndef INT32_MIN
1972 +#define INT32_MIN (-2147483647-1)
1973 +#endif
1974 +#ifndef INT8_MAX
1975 +#define INT8_MAX (127)
1976 +#endif
1977 +#ifndef INT16_MAX
1978 +#define INT16_MAX (32767)
1979 +#endif
1980 +#ifndef INT32_MAX
1981 +#define INT32_MAX (2147483647)
1982 +#endif
1983 +#ifndef UINT8_MAX
1984 +#define UINT8_MAX (255U)
1985 +#endif
1986 +#ifndef UINT16_MAX
1987 +#define UINT16_MAX (65535U)
1988 +#endif
1989 +#ifndef UINT32_MAX
1990 +#define UINT32_MAX (4294967295U)
1991 +#endif
1992 +
1993 +#endif /* ! FLEXINT_H */
1994 +
1995 +#ifdef __cplusplus
1996 +
1997 +/* The "const" storage-class-modifier is valid. */
1998 +#define YY_USE_CONST
1999 +
2000 +#else /* ! __cplusplus */
2001 +
2002 +/* C99 requires __STDC__ to be defined as 1. */
2003 +#if defined (__STDC__)
2004 +
2005 +#define YY_USE_CONST
2006 +
2007 +#endif /* defined (__STDC__) */
2008 +#endif /* ! __cplusplus */
2009 +
2010 +#ifdef YY_USE_CONST
2011 +#define yyconst const
2012 +#else
2013 +#define yyconst
2014 +#endif
2015 +
2016 +/* Returned upon end-of-file. */
2017 +#define YY_NULL 0
2018 +
2019 +/* Promotes a possibly negative, possibly signed char to an unsigned
2020 + * integer for use as an array index. If the signed char is negative,
2021 + * we want to instead treat it as an 8-bit unsigned char, hence the
2022 + * double cast.
2023 + */
2024 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
2025 +
2026 +/* Enter a start condition. This macro really ought to take a parameter,
2027 + * but we do it the disgusting crufty way forced on us by the ()-less
2028 + * definition of BEGIN.
2029 + */
2030 +#define BEGIN (yy_start) = 1 + 2 *
2031 +
2032 +/* Translate the current start state into a value that can be later handed
2033 + * to BEGIN to return to the state. The YYSTATE alias is for lex
2034 + * compatibility.
2035 + */
2036 +#define YY_START (((yy_start) - 1) / 2)
2037 +#define YYSTATE YY_START
2038 +
2039 +/* Action number for EOF rule of a given start state. */
2040 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
2041 +
2042 +/* Special action meaning "start processing a new file". */
2043 +#define YY_NEW_FILE yyrestart(yyin )
2044 +
2045 +#define YY_END_OF_BUFFER_CHAR 0
2046 +
2047 +/* Size of default input buffer. */
2048 +#ifndef YY_BUF_SIZE
2049 +#define YY_BUF_SIZE 16384
2050 +#endif
2051 +
2052 +/* The state buf must be large enough to hold one state per character in the main buffer.
2053 + */
2054 +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
2055 +
2056 +#ifndef YY_TYPEDEF_YY_BUFFER_STATE
2057 +#define YY_TYPEDEF_YY_BUFFER_STATE
2058 +typedef struct yy_buffer_state *YY_BUFFER_STATE;
2059 +#endif
2060 +
2061 +extern int yyleng;
2062 +
2063 +extern FILE *yyin, *yyout;
2064 +
2065 +#define EOB_ACT_CONTINUE_SCAN 0
2066 +#define EOB_ACT_END_OF_FILE 1
2067 +#define EOB_ACT_LAST_MATCH 2
2068 +
2069 + #define YY_LESS_LINENO(n)
2070 +
2071 +/* Return all but the first "n" matched characters back to the input stream. */
2072 +#define yyless(n) \
2073 + do \
2074 + { \
2075 + /* Undo effects of setting up yytext. */ \
2076 + int yyless_macro_arg = (n); \
2077 + YY_LESS_LINENO(yyless_macro_arg);\
2078 + *yy_cp = (yy_hold_char); \
2079 + YY_RESTORE_YY_MORE_OFFSET \
2080 + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
2081 + YY_DO_BEFORE_ACTION; /* set up yytext again */ \
2082 + } \
2083 + while ( 0 )
2084 +
2085 +#define unput(c) yyunput( c, (yytext_ptr) )
2086 +
2087 +/* The following is because we cannot portably get our hands on size_t
2088 + * (without autoconf's help, which isn't available because we want
2089 + * flex-generated scanners to compile on their own).
2090 + * Given that the standard has decreed that size_t exists since 1989,
2091 + * I guess we can afford to depend on it. Manoj.
2092 + */
2093 +
2094 +#ifndef YY_TYPEDEF_YY_SIZE_T
2095 +#define YY_TYPEDEF_YY_SIZE_T
2096 +typedef size_t yy_size_t;
2097 +#endif
2098 +
2099 +#ifndef YY_STRUCT_YY_BUFFER_STATE
2100 +#define YY_STRUCT_YY_BUFFER_STATE
2101 +struct yy_buffer_state
2102 + {
2103 + FILE *yy_input_file;
2104 +
2105 + char *yy_ch_buf; /* input buffer */
2106 + char *yy_buf_pos; /* current position in input buffer */
2107 +
2108 + /* Size of input buffer in bytes, not including room for EOB
2109 + * characters.
2110 + */
2111 + yy_size_t yy_buf_size;
2112 +
2113 + /* Number of characters read into yy_ch_buf, not including EOB
2114 + * characters.
2115 + */
2116 + int yy_n_chars;
2117 +
2118 + /* Whether we "own" the buffer - i.e., we know we created it,
2119 + * and can realloc() it to grow it, and should free() it to
2120 + * delete it.
2121 + */
2122 + int yy_is_our_buffer;
2123 +
2124 + /* Whether this is an "interactive" input source; if so, and
2125 + * if we're using stdio for input, then we want to use getc()
2126 + * instead of fread(), to make sure we stop fetching input after
2127 + * each newline.
2128 + */
2129 + int yy_is_interactive;
2130 +
2131 + /* Whether we're considered to be at the beginning of a line.
2132 + * If so, '^' rules will be active on the next match, otherwise
2133 + * not.
2134 + */
2135 + int yy_at_bol;
2136 +
2137 + int yy_bs_lineno; /**< The line count. */
2138 + int yy_bs_column; /**< The column count. */
2139 +
2140 + /* Whether to try to fill the input buffer when we reach the
2141 + * end of it.
2142 + */
2143 + int yy_fill_buffer;
2144 +
2145 + int yy_buffer_status;
2146 +
2147 +#define YY_BUFFER_NEW 0
2148 +#define YY_BUFFER_NORMAL 1
2149 + /* When an EOF's been seen but there's still some text to process
2150 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we
2151 + * shouldn't try reading from the input source any more. We might
2152 + * still have a bunch of tokens to match, though, because of
2153 + * possible backing-up.
2154 + *
2155 + * When we actually see the EOF, we change the status to "new"
2156 + * (via yyrestart()), so that the user can continue scanning by
2157 + * just pointing yyin at a new input file.
2158 + */
2159 +#define YY_BUFFER_EOF_PENDING 2
2160 +
2161 + };
2162 +#endif /* !YY_STRUCT_YY_BUFFER_STATE */
2163 +
2164 +/* Stack of input buffers. */
2165 +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
2166 +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
2167 +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
2168 +
2169 +/* We provide macros for accessing buffer states in case in the
2170 + * future we want to put the buffer states in a more general
2171 + * "scanner state".
2172 + *
2173 + * Returns the top of the stack, or NULL.
2174 + */
2175 +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
2176 + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
2177 + : NULL)
2178 +
2179 +/* Same as previous macro, but useful when we know that the buffer stack is not
2180 + * NULL or when we need an lvalue. For internal use only.
2181 + */
2182 +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
2183 +
2184 +/* yy_hold_char holds the character lost when yytext is formed. */
2185 +static char yy_hold_char;
2186 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
2187 +int yyleng;
2188 +
2189 +/* Points to current character in buffer. */
2190 +static char *yy_c_buf_p = (char *) 0;
2191 +static int yy_init = 0; /* whether we need to initialize */
2192 +static int yy_start = 0; /* start state number */
2193 +
2194 +/* Flag which is used to allow yywrap()'s to do buffer switches
2195 + * instead of setting up a fresh yyin. A bit of a hack ...
2196 + */
2197 +static int yy_did_buffer_switch_on_eof;
2198 +
2199 +void yyrestart (FILE *input_file );
2200 +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
2201 +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
2202 +void yy_delete_buffer (YY_BUFFER_STATE b );
2203 +void yy_flush_buffer (YY_BUFFER_STATE b );
2204 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
2205 +void yypop_buffer_state (void );
2206 +
2207 +static void yyensure_buffer_stack (void );
2208 +static void yy_load_buffer_state (void );
2209 +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
2210 +
2211 +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
2212 +
2213 +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
2214 +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
2215 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
2216 +
2217 +void *yyalloc (yy_size_t );
2218 +void *yyrealloc (void *,yy_size_t );
2219 +void yyfree (void * );
2220 +
2221 +#define yy_new_buffer yy_create_buffer
2222 +
2223 +#define yy_set_interactive(is_interactive) \
2224 + { \
2225 + if ( ! YY_CURRENT_BUFFER ){ \
2226 + yyensure_buffer_stack (); \
2227 + YY_CURRENT_BUFFER_LVALUE = \
2228 + yy_create_buffer(yyin,YY_BUF_SIZE ); \
2229 + } \
2230 + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
2231 + }
2232 +
2233 +#define yy_set_bol(at_bol) \
2234 + { \
2235 + if ( ! YY_CURRENT_BUFFER ){\
2236 + yyensure_buffer_stack (); \
2237 + YY_CURRENT_BUFFER_LVALUE = \
2238 + yy_create_buffer(yyin,YY_BUF_SIZE ); \
2239 + } \
2240 + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
2241 + }
2242 +
2243 +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
2244 +
2245 +/* Begin user sect3 */
2246 +
2247 +#define yywrap(n) 1
2248 +#define YY_SKIP_YYWRAP
2249 +
2250 +typedef unsigned char YY_CHAR;
2251 +
2252 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
2253 +
2254 +typedef int yy_state_type;
2255 +
2256 +extern int yylineno;
2257 +
2258 +int yylineno = 1;
2259 +
2260 +extern char *yytext;
2261 +#define yytext_ptr yytext
2262 +
2263 +static yy_state_type yy_get_previous_state (void );
2264 +static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
2265 +static int yy_get_next_buffer (void );
2266 +static void yy_fatal_error (yyconst char msg[] );
2267 +
2268 +/* Done after the current pattern has been matched and before the
2269 + * corresponding action - sets up yytext.
2270 + */
2271 +#define YY_DO_BEFORE_ACTION \
2272 + (yytext_ptr) = yy_bp; \
2273 + yyleng = (size_t) (yy_cp - yy_bp); \
2274 + (yy_hold_char) = *yy_cp; \
2275 + *yy_cp = '\0'; \
2276 + (yy_c_buf_p) = yy_cp;
2277 +
2278 +#define YY_NUM_RULES 20
2279 +#define YY_END_OF_BUFFER 21
2280 +/* This struct is not used in this scanner,
2281 + but its presence is necessary. */
2282 +struct yy_trans_info
2283 + {
2284 + flex_int32_t yy_verify;
2285 + flex_int32_t yy_nxt;
2286 + };
2287 +static yyconst flex_int16_t yy_accept[49] =
2288 + { 0,
2289 + 0, 0, 21, 19, 18, 18, 19, 19, 14, 13,
2290 + 13, 15, 9, 4, 10, 17, 17, 17, 17, 17,
2291 + 11, 18, 5, 0, 16, 0, 15, 15, 15, 0,
2292 + 6, 8, 7, 17, 17, 17, 17, 3, 0, 0,
2293 + 15, 2, 17, 1, 0, 15, 12, 0
2294 + } ;
2295 +
2296 +static yyconst flex_int32_t yy_ec[256] =
2297 + { 0,
2298 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2299 + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
2300 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2301 + 1, 2, 4, 1, 1, 1, 1, 1, 5, 6,
2302 + 6, 7, 8, 7, 8, 9, 7, 10, 10, 10,
2303 + 10, 10, 10, 10, 10, 10, 10, 1, 1, 11,
2304 + 12, 13, 1, 1, 14, 15, 15, 16, 17, 15,
2305 + 15, 15, 18, 15, 19, 20, 15, 21, 22, 15,
2306 + 15, 23, 15, 24, 15, 15, 15, 15, 15, 15,
2307 + 1, 25, 1, 1, 15, 1, 26, 15, 15, 27,
2308 +
2309 + 28, 15, 15, 15, 29, 15, 30, 31, 15, 32,
2310 + 33, 15, 15, 34, 15, 35, 15, 15, 15, 15,
2311 + 15, 15, 1, 1, 1, 36, 1, 37, 37, 37,
2312 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2313 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2314 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2315 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2316 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2317 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2318 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2319 +
2320 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2321 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2322 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2323 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2324 + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
2325 + 37, 37, 37, 37, 37
2326 + } ;
2327 +
2328 +static yyconst flex_int32_t yy_meta[38] =
2329 + { 0,
2330 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
2331 + 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
2332 + 2, 2, 2, 2, 1, 2, 2, 2, 2, 2,
2333 + 2, 2, 2, 2, 2, 1, 2
2334 + } ;
2335 +
2336 +static yyconst flex_int16_t yy_base[51] =
2337 + { 0,
2338 + 0, 0, 96, 97, 36, 38, 83, 37, 97, 97,
2339 + 84, 35, 34, 97, 81, 22, 0, 30, 27, 27,
2340 + 97, 53, 97, 46, 87, 85, 47, 48, 57, 60,
2341 + 97, 97, 97, 0, 53, 53, 49, 0, 69, 77,
2342 + 76, 0, 61, 0, 72, 71, 0, 97, 89, 51
2343 + } ;
2344 +
2345 +static yyconst flex_int16_t yy_def[51] =
2346 + { 0,
2347 + 48, 1, 48, 48, 48, 48, 48, 49, 48, 48,
2348 + 48, 48, 48, 48, 48, 50, 50, 50, 50, 50,
2349 + 48, 48, 48, 49, 48, 49, 48, 48, 48, 48,
2350 + 48, 48, 48, 50, 50, 50, 50, 50, 48, 48,
2351 + 48, 50, 50, 50, 48, 48, 50, 0, 48, 48
2352 + } ;
2353 +
2354 +static yyconst flex_int16_t yy_nxt[135] =
2355 + { 0,
2356 + 4, 5, 6, 7, 8, 9, 10, 10, 11, 12,
2357 + 13, 14, 15, 16, 17, 17, 17, 17, 17, 18,
2358 + 19, 20, 17, 17, 4, 16, 17, 17, 17, 17,
2359 + 18, 19, 20, 17, 17, 21, 17, 22, 22, 22,
2360 + 22, 25, 35, 28, 29, 31, 32, 36, 37, 38,
2361 + 25, 30, 34, 35, 22, 22, 27, 27, 36, 37,
2362 + 38, 26, 30, 39, 30, 28, 29, 40, 42, 41,
2363 + 26, 43, 44, 30, 39, 30, 45, 47, 46, 42,
2364 + 46, 46, 43, 44, 30, 41, 41, 48, 47, 24,
2365 + 24, 24, 33, 27, 23, 48, 3, 48, 48, 48,
2366 +
2367 + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
2368 + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
2369 + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
2370 + 48, 48, 48, 48
2371 + } ;
2372 +
2373 +static yyconst flex_int16_t yy_chk[135] =
2374 + { 0,
2375 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2376 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2377 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2378 + 1, 1, 1, 1, 1, 1, 1, 5, 5, 6,
2379 + 6, 8, 16, 12, 12, 13, 13, 18, 19, 20,
2380 + 24, 12, 50, 16, 22, 22, 27, 28, 18, 19,
2381 + 20, 8, 12, 27, 28, 29, 29, 30, 35, 30,
2382 + 24, 36, 37, 29, 27, 28, 39, 43, 39, 35,
2383 + 46, 45, 36, 37, 29, 41, 40, 26, 43, 49,
2384 + 49, 25, 15, 11, 7, 3, 48, 48, 48, 48,
2385 +
2386 + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
2387 + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
2388 + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
2389 + 48, 48, 48, 48
2390 + } ;
2391 +
2392 +static yy_state_type yy_last_accepting_state;
2393 +static char *yy_last_accepting_cpos;
2394 +
2395 +extern int yy_flex_debug;
2396 +int yy_flex_debug = 0;
2397 +
2398 +/* The intent behind this definition is that it'll catch
2399 + * any uses of REJECT which flex missed.
2400 + */
2401 +#define REJECT reject_used_but_not_detected
2402 +#define yymore() yymore_used_but_not_detected
2403 +#define YY_MORE_ADJ 0
2404 +#define YY_RESTORE_YY_MORE_OFFSET
2405 +char *yytext;
2406 +#line 1 "qgssearchstringlexer.ll"
2407 +/***************************************************************************
2408 + qgssearchstringparser.ll
2409 + Rules for lexical analysis of search strings done by Flex
2410 + --------------------
2411 + begin : 2005-07-26
2412 + copyright : (C) 2005 by Martin Dobias
2413 + email : won.der at centrum.sk
2414 +***************************************************************************/
2415 +/***************************************************************************
2416 + * *
2417 + * This program is free software; you can redistribute it and/or modify *
2418 + * it under the terms of the GNU General Public License as published by *
2419 + * the Free Software Foundation; either version 2 of the License, or *
2420 + * (at your option) any later version. *
2421 + * *
2422 + ***************************************************************************/
2423 +/* $Id: qgssearchstringlexer.ll 6415 2007-01-09 02:39:15Z wonder $ */
2424 +// ensure that lexer will be 8-bit (and not just 7-bit)
2425 +#line 27 "qgssearchstringlexer.ll"
2426 +
2427 +#include <stdlib.h> // atof()
2428 +
2429 +#include "qgssearchtreenode.h"
2430 +#include "qgssearchstringparser.hpp"
2431 +
2432 +// if not defined, searches for isatty()
2433 +// which doesn't in MSVC compiler
2434 +#define YY_NEVER_INTERACTIVE 1
2435 +
2436 +#line 531 "lex.yy.c"
2437 +
2438 +#define INITIAL 0
2439 +
2440 +#ifndef YY_NO_UNISTD_H
2441 +/* Special case for "unistd.h", since it is non-ANSI. We include it way
2442 + * down here because we want the user's section 1 to have been scanned first.
2443 + * The user has a chance to override it with an option.
2444 + */
2445 +#include <unistd.h>
2446 +#endif
2447 +
2448 +#ifndef YY_EXTRA_TYPE
2449 +#define YY_EXTRA_TYPE void *
2450 +#endif
2451 +
2452 +static int yy_init_globals (void );
2453 +
2454 +/* Macros after this point can all be overridden by user definitions in
2455 + * section 1.
2456 + */
2457 +
2458 +#ifndef YY_SKIP_YYWRAP
2459 +#ifdef __cplusplus
2460 +extern "C" int yywrap (void );
2461 +#else
2462 +extern int yywrap (void );
2463 +#endif
2464 +#endif
2465 +
2466 + static void yyunput (int c,char *buf_ptr );
2467 +
2468 +#ifndef yytext_ptr
2469 +static void yy_flex_strncpy (char *,yyconst char *,int );
2470 +#endif
2471 +
2472 +#ifdef YY_NEED_STRLEN
2473 +static int yy_flex_strlen (yyconst char * );
2474 +#endif
2475 +
2476 +#ifndef YY_NO_INPUT
2477 +
2478 +#ifdef __cplusplus
2479 +static int yyinput (void );
2480 +#else
2481 +static int input (void );
2482 +#endif
2483 +
2484 +#endif
2485 +
2486 +/* Amount of stuff to slurp up with each read. */
2487 +#ifndef YY_READ_BUF_SIZE
2488 +#define YY_READ_BUF_SIZE 8192
2489 +#endif
2490 +
2491 +/* Copy whatever the last rule matched to the standard output. */
2492 +#ifndef ECHO
2493 +/* This used to be an fputs(), but since the string might contain NUL's,
2494 + * we now use fwrite().
2495 + */
2496 +#define ECHO fwrite( yytext, yyleng, 1, yyout )
2497 +#endif
2498 +
2499 +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
2500 + * is returned in "result".
2501 + */
2502 +#ifndef YY_INPUT
2503 +#define YY_INPUT(buf,result,max_size) \
2504 + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
2505 + { \
2506 + int c = '*'; \
2507 + int n; \
2508 + for ( n = 0; n < max_size && \
2509 + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
2510 + buf[n] = (char) c; \
2511 + if ( c == '\n' ) \
2512 + buf[n++] = (char) c; \
2513 + if ( c == EOF && ferror( yyin ) ) \
2514 + YY_FATAL_ERROR( "input in flex scanner failed" ); \
2515 + result = n; \
2516 + } \
2517 + else \
2518 + { \
2519 + errno=0; \
2520 + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
2521 + { \
2522 + if( errno != EINTR) \
2523 + { \
2524 + YY_FATAL_ERROR( "input in flex scanner failed" ); \
2525 + break; \
2526 + } \
2527 + errno=0; \
2528 + clearerr(yyin); \
2529 + } \
2530 + }\
2531 +\
2532 +
2533 +#endif
2534 +
2535 +/* No semi-colon after return; correct usage is to write "yyterminate();" -
2536 + * we don't want an extra ';' after the "return" because that will cause
2537 + * some compilers to complain about unreachable statements.
2538 + */
2539 +#ifndef yyterminate
2540 +#define yyterminate() return YY_NULL
2541 +#endif
2542 +
2543 +/* Number of entries by which start-condition stack grows. */
2544 +#ifndef YY_START_STACK_INCR
2545 +#define YY_START_STACK_INCR 25
2546 +#endif
2547 +
2548 +/* Report a fatal error. */
2549 +#ifndef YY_FATAL_ERROR
2550 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
2551 +#endif
2552 +
2553 +/* end tables serialization structures and prototypes */
2554 +
2555 +/* Default declaration of generated scanner - a define so the user can
2556 + * easily add parameters.
2557 + */
2558 +#ifndef YY_DECL
2559 +#define YY_DECL_IS_OURS 1
2560 +
2561 +extern int yylex (void);
2562 +
2563 +#define YY_DECL int yylex (void)
2564 +#endif /* !YY_DECL */
2565 +
2566 +/* Code executed at the beginning of each rule, after yytext and yyleng
2567 + * have been set up.
2568 + */
2569 +#ifndef YY_USER_ACTION
2570 +#define YY_USER_ACTION
2571 +#endif
2572 +
2573 +/* Code executed at the end of each rule. */
2574 +#ifndef YY_BREAK
2575 +#define YY_BREAK break;
2576 +#endif
2577 +
2578 +#define YY_RULE_SETUP \
2579 + YY_USER_ACTION
2580 +
2581 +/** The main scanner function which does all the work.
2582 + */
2583 +YY_DECL
2584 +{
2585 + register yy_state_type yy_current_state;
2586 + register char *yy_cp, *yy_bp;
2587 + register int yy_act;
2588 +
2589 +#line 55 "qgssearchstringlexer.ll"
2590 +
2591 +
2592 +#line 687 "lex.yy.c"
2593 +
2594 + if ( !(yy_init) )
2595 + {
2596 + (yy_init) = 1;
2597 +
2598 +#ifdef YY_USER_INIT
2599 + YY_USER_INIT;
2600 +#endif
2601 +
2602 + if ( ! (yy_start) )
2603 + (yy_start) = 1; /* first start state */
2604 +
2605 + if ( ! yyin )
2606 + yyin = stdin;
2607 +
2608 + if ( ! yyout )
2609 + yyout = stdout;
2610 +
2611 + if ( ! YY_CURRENT_BUFFER ) {
2612 + yyensure_buffer_stack ();
2613 + YY_CURRENT_BUFFER_LVALUE =
2614 + yy_create_buffer(yyin,YY_BUF_SIZE );
2615 + }
2616 +
2617 + yy_load_buffer_state( );
2618 + }
2619 +
2620 + while ( 1 ) /* loops until end-of-file is reached */
2621 + {
2622 + yy_cp = (yy_c_buf_p);
2623 +
2624 + /* Support of yytext. */
2625 + *yy_cp = (yy_hold_char);
2626 +
2627 + /* yy_bp points to the position in yy_ch_buf of the start of
2628 + * the current run.
2629 + */
2630 + yy_bp = yy_cp;
2631 +
2632 + yy_current_state = (yy_start);
2633 +yy_match:
2634 + do
2635 + {
2636 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
2637 + if ( yy_accept[yy_current_state] )
2638 + {
2639 + (yy_last_accepting_state) = yy_current_state;
2640 + (yy_last_accepting_cpos) = yy_cp;
2641 + }
2642 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2643 + {
2644 + yy_current_state = (int) yy_def[yy_current_state];
2645 + if ( yy_current_state >= 49 )
2646 + yy_c = yy_meta[(unsigned int) yy_c];
2647 + }
2648 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2649 + ++yy_cp;
2650 + }
2651 + while ( yy_base[yy_current_state] != 97 );
2652 +
2653 +yy_find_action:
2654 + yy_act = yy_accept[yy_current_state];
2655 + if ( yy_act == 0 )
2656 + { /* have to back up */
2657 + yy_cp = (yy_last_accepting_cpos);
2658 + yy_current_state = (yy_last_accepting_state);
2659 + yy_act = yy_accept[yy_current_state];
2660 + }
2661 +
2662 + YY_DO_BEFORE_ACTION;
2663 +
2664 +do_action: /* This label is used only to access EOF actions. */
2665 +
2666 + switch ( yy_act )
2667 + { /* beginning of action switch */
2668 + case 0: /* must back up */
2669 + /* undo the effects of YY_DO_BEFORE_ACTION */
2670 + *yy_cp = (yy_hold_char);
2671 + yy_cp = (yy_last_accepting_cpos);
2672 + yy_current_state = (yy_last_accepting_state);
2673 + goto yy_find_action;
2674 +
2675 +case 1:
2676 +YY_RULE_SETUP
2677 +#line 57 "qgssearchstringlexer.ll"
2678 +{ return NOT; }
2679 + YY_BREAK
2680 +case 2:
2681 +YY_RULE_SETUP
2682 +#line 58 "qgssearchstringlexer.ll"
2683 +{ return AND; }
2684 + YY_BREAK
2685 +case 3:
2686 +YY_RULE_SETUP
2687 +#line 59 "qgssearchstringlexer.ll"
2688 +{ return OR; }
2689 + YY_BREAK
2690 +case 4:
2691 +YY_RULE_SETUP
2692 +#line 61 "qgssearchstringlexer.ll"
2693 +{ yylval.op = QgsSearchTreeNode::opEQ; return COMPARISON; }
2694 + YY_BREAK
2695 +case 5:
2696 +YY_RULE_SETUP
2697 +#line 62 "qgssearchstringlexer.ll"
2698 +{ yylval.op = QgsSearchTreeNode::opNE; return COMPARISON; }
2699 + YY_BREAK
2700 +case 6:
2701 +YY_RULE_SETUP
2702 +#line 63 "qgssearchstringlexer.ll"
2703 +{ yylval.op = QgsSearchTreeNode::opLE; return COMPARISON; }
2704 + YY_BREAK
2705 +case 7:
2706 +YY_RULE_SETUP
2707 +#line 64 "qgssearchstringlexer.ll"
2708 +{ yylval.op = QgsSearchTreeNode::opGE; return COMPARISON; }
2709 + YY_BREAK
2710 +case 8:
2711 +YY_RULE_SETUP
2712 +#line 65 "qgssearchstringlexer.ll"
2713 +{ yylval.op = QgsSearchTreeNode::opNE; return COMPARISON; }
2714 + YY_BREAK
2715 +case 9:
2716 +YY_RULE_SETUP
2717 +#line 66 "qgssearchstringlexer.ll"
2718 +{ yylval.op = QgsSearchTreeNode::opLT; return COMPARISON; }
2719 + YY_BREAK
2720 +case 10:
2721 +YY_RULE_SETUP
2722 +#line 67 "qgssearchstringlexer.ll"
2723 +{ yylval.op = QgsSearchTreeNode::opGT; return COMPARISON; }
2724 + YY_BREAK
2725 +case 11:
2726 +YY_RULE_SETUP
2727 +#line 68 "qgssearchstringlexer.ll"
2728 +{ yylval.op = QgsSearchTreeNode::opRegexp; return COMPARISON; }
2729 + YY_BREAK
2730 +case 12:
2731 +YY_RULE_SETUP
2732 +#line 69 "qgssearchstringlexer.ll"
2733 +{ yylval.op = QgsSearchTreeNode::opLike; return COMPARISON; }
2734 + YY_BREAK
2735 +case 13:
2736 +YY_RULE_SETUP
2737 +#line 71 "qgssearchstringlexer.ll"
2738 +{ return yytext[0]; }
2739 + YY_BREAK
2740 +case 14:
2741 +YY_RULE_SETUP
2742 +#line 73 "qgssearchstringlexer.ll"
2743 +{ return yytext[0]; }
2744 + YY_BREAK
2745 +case 15:
2746 +YY_RULE_SETUP
2747 +#line 75 "qgssearchstringlexer.ll"
2748 +{ yylval.number = atof(yytext); return NUMBER; }
2749 + YY_BREAK
2750 +case 16:
2751 +/* rule 16 can match eol */
2752 +YY_RULE_SETUP
2753 +#line 77 "qgssearchstringlexer.ll"
2754 +{ return STRING; }
2755 + YY_BREAK
2756 +case 17:
2757 +YY_RULE_SETUP
2758 +#line 79 "qgssearchstringlexer.ll"
2759 +{ return COLUMN_REF; }
2760 + YY_BREAK
2761 +case 18:
2762 +/* rule 18 can match eol */
2763 +YY_RULE_SETUP
2764 +#line 81 "qgssearchstringlexer.ll"
2765 +/* skip blanks and tabs */
2766 + YY_BREAK
2767 +case 19:
2768 +YY_RULE_SETUP
2769 +#line 83 "qgssearchstringlexer.ll"
2770 +{ return UNKNOWN_CHARACTER; }
2771 + YY_BREAK
2772 +case 20:
2773 +YY_RULE_SETUP
2774 +#line 85 "qgssearchstringlexer.ll"
2775 +ECHO;
2776 + YY_BREAK
2777 +#line 872 "lex.yy.c"
2778 +case YY_STATE_EOF(INITIAL):
2779 + yyterminate();
2780 +
2781 + case YY_END_OF_BUFFER:
2782 + {
2783 + /* Amount of text matched not including the EOB char. */
2784 + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2785 +
2786 + /* Undo the effects of YY_DO_BEFORE_ACTION. */
2787 + *yy_cp = (yy_hold_char);
2788 + YY_RESTORE_YY_MORE_OFFSET
2789 +
2790 + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2791 + {
2792 + /* We're scanning a new file or input source. It's
2793 + * possible that this happened because the user
2794 + * just pointed yyin at a new source and called
2795 + * yylex(). If so, then we have to assure
2796 + * consistency between YY_CURRENT_BUFFER and our
2797 + * globals. Here is the right place to do so, because
2798 + * this is the first action (other than possibly a
2799 + * back-up) that will match for the new input source.
2800 + */
2801 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2802 + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2803 + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2804 + }
2805 +
2806 + /* Note that here we test for yy_c_buf_p "<=" to the position
2807 + * of the first EOB in the buffer, since yy_c_buf_p will
2808 + * already have been incremented past the NUL character
2809 + * (since all states make transitions on EOB to the
2810 + * end-of-buffer state). Contrast this with the test
2811 + * in input().
2812 + */
2813 + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2814 + { /* This was really a NUL. */
2815 + yy_state_type yy_next_state;
2816 +
2817 + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2818 +
2819 + yy_current_state = yy_get_previous_state( );
2820 +
2821 + /* Okay, we're now positioned to make the NUL
2822 + * transition. We couldn't have
2823 + * yy_get_previous_state() go ahead and do it
2824 + * for us because it doesn't know how to deal
2825 + * with the possibility of jamming (and we don't
2826 + * want to build jamming into it because then it
2827 + * will run more slowly).
2828 + */
2829 +
2830 + yy_next_state = yy_try_NUL_trans( yy_current_state );
2831 +
2832 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2833 +
2834 + if ( yy_next_state )
2835 + {
2836 + /* Consume the NUL. */
2837 + yy_cp = ++(yy_c_buf_p);
2838 + yy_current_state = yy_next_state;
2839 + goto yy_match;
2840 + }
2841 +
2842 + else
2843 + {
2844 + yy_cp = (yy_c_buf_p);
2845 + goto yy_find_action;
2846 + }
2847 + }
2848 +
2849 + else switch ( yy_get_next_buffer( ) )
2850 + {
2851 + case EOB_ACT_END_OF_FILE:
2852 + {
2853 + (yy_did_buffer_switch_on_eof) = 0;
2854 +
2855 + if ( yywrap( ) )
2856 + {
2857 + /* Note: because we've taken care in
2858 + * yy_get_next_buffer() to have set up
2859 + * yytext, we can now set up
2860 + * yy_c_buf_p so that if some total
2861 + * hoser (like flex itself) wants to
2862 + * call the scanner after we return the
2863 + * YY_NULL, it'll still work - another
2864 + * YY_NULL will get returned.
2865 + */
2866 + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2867 +
2868 + yy_act = YY_STATE_EOF(YY_START);
2869 + goto do_action;
2870 + }
2871 +
2872 + else
2873 + {
2874 + if ( ! (yy_did_buffer_switch_on_eof) )
2875 + YY_NEW_FILE;
2876 + }
2877 + break;
2878 + }
2879 +
2880 + case EOB_ACT_CONTINUE_SCAN:
2881 + (yy_c_buf_p) =
2882 + (yytext_ptr) + yy_amount_of_matched_text;
2883 +
2884 + yy_current_state = yy_get_previous_state( );
2885 +
2886 + yy_cp = (yy_c_buf_p);
2887 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2888 + goto yy_match;
2889 +
2890 + case EOB_ACT_LAST_MATCH:
2891 + (yy_c_buf_p) =
2892 + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2893 +
2894 + yy_current_state = yy_get_previous_state( );
2895 +
2896 + yy_cp = (yy_c_buf_p);
2897 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2898 + goto yy_find_action;
2899 + }
2900 + break;
2901 + }
2902 +
2903 + default:
2904 + YY_FATAL_ERROR(
2905 + "fatal flex scanner internal error--no action found" );
2906 + } /* end of action switch */
2907 + } /* end of scanning one token */
2908 +} /* end of yylex */
2909 +
2910 +/* yy_get_next_buffer - try to read in a new buffer
2911 + *
2912 + * Returns a code representing an action:
2913 + * EOB_ACT_LAST_MATCH -
2914 + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2915 + * EOB_ACT_END_OF_FILE - end of file
2916 + */
2917 +static int yy_get_next_buffer (void)
2918 +{
2919 + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2920 + register char *source = (yytext_ptr);
2921 + register int number_to_move, i;
2922 + int ret_val;
2923 +
2924 + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2925 + YY_FATAL_ERROR(
2926 + "fatal flex scanner internal error--end of buffer missed" );
2927 +
2928 + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2929 + { /* Don't try to fill the buffer, so this is an EOF. */
2930 + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2931 + {
2932 + /* We matched a single character, the EOB, so
2933 + * treat this as a final EOF.
2934 + */
2935 + return EOB_ACT_END_OF_FILE;
2936 + }
2937 +
2938 + else
2939 + {
2940 + /* We matched some text prior to the EOB, first
2941 + * process it.
2942 + */
2943 + return EOB_ACT_LAST_MATCH;
2944 + }
2945 + }
2946 +
2947 + /* Try to read more data. */
2948 +
2949 + /* First move last chars to start of buffer. */
2950 + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2951 +
2952 + for ( i = 0; i < number_to_move; ++i )
2953 + *(dest++) = *(source++);
2954 +
2955 + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2956 + /* don't do the read, it's not guaranteed to return an EOF,
2957 + * just force an EOF
2958 + */
2959 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2960 +
2961 + else
2962 + {
2963 + int num_to_read =
2964 + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2965 +
2966 + while ( num_to_read <= 0 )
2967 + { /* Not enough room in the buffer - grow it. */
2968 +
2969 + /* just a shorter name for the current buffer */
2970 + YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2971 +
2972 + int yy_c_buf_p_offset =
2973 + (int) ((yy_c_buf_p) - b->yy_ch_buf);
2974 +
2975 + if ( b->yy_is_our_buffer )
2976 + {
2977 + int new_size = b->yy_buf_size * 2;
2978 +
2979 + if ( new_size <= 0 )
2980 + b->yy_buf_size += b->yy_buf_size / 8;
2981 + else
2982 + b->yy_buf_size *= 2;
2983 +
2984 + b->yy_ch_buf = (char *)
2985 + /* Include room in for 2 EOB chars. */
2986 + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
2987 + }
2988 + else
2989 + /* Can't grow it, we don't own it. */
2990 + b->yy_ch_buf = 0;
2991 +
2992 + if ( ! b->yy_ch_buf )
2993 + YY_FATAL_ERROR(
2994 + "fatal error - scanner input buffer overflow" );
2995 +
2996 + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2997 +
2998 + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2999 + number_to_move - 1;
3000 +
3001 + }
3002 +
3003 + if ( num_to_read > YY_READ_BUF_SIZE )
3004 + num_to_read = YY_READ_BUF_SIZE;
3005 +
3006 + /* Read in more data. */
3007 + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
3008 + (yy_n_chars), (size_t) num_to_read );
3009 +
3010 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3011 + }
3012 +
3013 + if ( (yy_n_chars) == 0 )
3014 + {
3015 + if ( number_to_move == YY_MORE_ADJ )
3016 + {
3017 + ret_val = EOB_ACT_END_OF_FILE;
3018 + yyrestart(yyin );
3019 + }
3020 +
3021 + else
3022 + {
3023 + ret_val = EOB_ACT_LAST_MATCH;
3024 + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3025 + YY_BUFFER_EOF_PENDING;
3026 + }
3027 + }
3028 +
3029 + else
3030 + ret_val = EOB_ACT_CONTINUE_SCAN;
3031 +
3032 + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
3033 + /* Extend the array by 50%, plus the number we really need. */
3034 + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
3035 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
3036 + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3037 + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
3038 + }
3039 +
3040 + (yy_n_chars) += number_to_move;
3041 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
3042 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
3043 +
3044 + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
3045 +
3046 + return ret_val;
3047 +}
3048 +
3049 +/* yy_get_previous_state - get the state just before the EOB char was reached */
3050 +
3051 + static yy_state_type yy_get_previous_state (void)
3052 +{
3053 + register yy_state_type yy_current_state;
3054 + register char *yy_cp;
3055 +
3056 + yy_current_state = (yy_start);
3057 +
3058 + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
3059 + {
3060 + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3061 + if ( yy_accept[yy_current_state] )
3062 + {
3063 + (yy_last_accepting_state) = yy_current_state;
3064 + (yy_last_accepting_cpos) = yy_cp;
3065 + }
3066 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3067 + {
3068 + yy_current_state = (int) yy_def[yy_current_state];
3069 + if ( yy_current_state >= 49 )
3070 + yy_c = yy_meta[(unsigned int) yy_c];
3071 + }
3072 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3073 + }
3074 +
3075 + return yy_current_state;
3076 +}
3077 +
3078 +/* yy_try_NUL_trans - try to make a transition on the NUL character
3079 + *
3080 + * synopsis
3081 + * next_state = yy_try_NUL_trans( current_state );
3082 + */
3083 + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
3084 +{
3085 + register int yy_is_jam;
3086 + register char *yy_cp = (yy_c_buf_p);
3087 +
3088 + register YY_CHAR yy_c = 1;
3089 + if ( yy_accept[yy_current_state] )
3090 + {
3091 + (yy_last_accepting_state) = yy_current_state;
3092 + (yy_last_accepting_cpos) = yy_cp;
3093 + }
3094 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3095 + {
3096 + yy_current_state = (int) yy_def[yy_current_state];
3097 + if ( yy_current_state >= 49 )
3098 + yy_c = yy_meta[(unsigned int) yy_c];
3099 + }
3100 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3101 + yy_is_jam = (yy_current_state == 48);
3102 +
3103 + return yy_is_jam ? 0 : yy_current_state;
3104 +}
3105 +
3106 + static void yyunput (int c, register char * yy_bp )
3107 +{
3108 + register char *yy_cp;
3109 +
3110 + yy_cp = (yy_c_buf_p);
3111 +
3112 + /* undo effects of setting up yytext */
3113 + *yy_cp = (yy_hold_char);
3114 +
3115 + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3116 + { /* need to shift things up to make room */
3117 + /* +2 for EOB chars. */
3118 + register int number_to_move = (yy_n_chars) + 2;
3119 + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
3120 + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
3121 + register char *source =
3122 + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
3123 +
3124 + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3125 + *--dest = *--source;
3126 +
3127 + yy_cp += (int) (dest - source);
3128 + yy_bp += (int) (dest - source);
3129 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
3130 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
3131 +
3132 + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3133 + YY_FATAL_ERROR( "flex scanner push-back overflow" );
3134 + }
3135 +
3136 + *--yy_cp = (char) c;
3137 +
3138 + (yytext_ptr) = yy_bp;
3139 + (yy_hold_char) = *yy_cp;
3140 + (yy_c_buf_p) = yy_cp;
3141 +}
3142 +
3143 +#ifndef YY_NO_INPUT
3144 +#ifdef __cplusplus
3145 + static int yyinput (void)
3146 +#else
3147 + static int input (void)
3148 +#endif
3149 +
3150 +{
3151 + int c;
3152 +
3153 + *(yy_c_buf_p) = (yy_hold_char);
3154 +
3155 + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
3156 + {
3157 + /* yy_c_buf_p now points to the character we want to return.
3158 + * If this occurs *before* the EOB characters, then it's a
3159 + * valid NUL; if not, then we've hit the end of the buffer.
3160 + */
3161 + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
3162 + /* This was really a NUL. */
3163 + *(yy_c_buf_p) = '\0';
3164 +
3165 + else
3166 + { /* need more input */
3167 + int offset = (yy_c_buf_p) - (yytext_ptr);
3168 + ++(yy_c_buf_p);
3169 +
3170 + switch ( yy_get_next_buffer( ) )
3171 + {
3172 + case EOB_ACT_LAST_MATCH:
3173 + /* This happens because yy_g_n_b()
3174 + * sees that we've accumulated a
3175 + * token and flags that we need to
3176 + * try matching the token before
3177 + * proceeding. But for input(),
3178 + * there's no matching to consider.
3179 + * So convert the EOB_ACT_LAST_MATCH
3180 + * to EOB_ACT_END_OF_FILE.
3181 + */
3182 +
3183 + /* Reset buffer status. */
3184 + yyrestart(yyin );
3185 +
3186 + /*FALLTHROUGH*/
3187 +
3188 + case EOB_ACT_END_OF_FILE:
3189 + {
3190 + if ( yywrap( ) )
3191 + return EOF;
3192 +
3193 + if ( ! (yy_did_buffer_switch_on_eof) )
3194 + YY_NEW_FILE;
3195 +#ifdef __cplusplus
3196 + return yyinput();
3197 +#else
3198 + return input();
3199 +#endif
3200 + }
3201 +
3202 + case EOB_ACT_CONTINUE_SCAN:
3203 + (yy_c_buf_p) = (yytext_ptr) + offset;
3204 + break;
3205 + }
3206 + }
3207 + }
3208 +
3209 + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
3210 + *(yy_c_buf_p) = '\0'; /* preserve yytext */
3211 + (yy_hold_char) = *++(yy_c_buf_p);
3212 +
3213 + return c;
3214 +}
3215 +#endif /* ifndef YY_NO_INPUT */
3216 +
3217 +/** Immediately switch to a different input stream.
3218 + * @param input_file A readable stream.
3219 + *
3220 + * @note This function does not reset the start condition to @c INITIAL .
3221 + */
3222 + void yyrestart (FILE * input_file )
3223 +{
3224 +
3225 + if ( ! YY_CURRENT_BUFFER ){
3226 + yyensure_buffer_stack ();
3227 + YY_CURRENT_BUFFER_LVALUE =
3228 + yy_create_buffer(yyin,YY_BUF_SIZE );
3229 + }
3230 +
3231 + yy_init_buffer(YY_CURRENT_BUFFER,input_file );
3232 + yy_load_buffer_state( );
3233 +}
3234 +
3235 +/** Switch to a different input buffer.
3236 + * @param new_buffer The new input buffer.
3237 + *
3238 + */
3239 + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
3240 +{
3241 +
3242 + /* TODO. We should be able to replace this entire function body
3243 + * with
3244 + * yypop_buffer_state();
3245 + * yypush_buffer_state(new_buffer);
3246 + */
3247 + yyensure_buffer_stack ();
3248 + if ( YY_CURRENT_BUFFER == new_buffer )
3249 + return;
3250 +
3251 + if ( YY_CURRENT_BUFFER )
3252 + {
3253 + /* Flush out information for old buffer. */
3254 + *(yy_c_buf_p) = (yy_hold_char);
3255 + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3256 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3257 + }
3258 +
3259 + YY_CURRENT_BUFFER_LVALUE = new_buffer;
3260 + yy_load_buffer_state( );
3261 +
3262 + /* We don't actually know whether we did this switch during
3263 + * EOF (yywrap()) processing, but the only time this flag
3264 + * is looked at is after yywrap() is called, so it's safe
3265 + * to go ahead and always set it.
3266 + */
3267 + (yy_did_buffer_switch_on_eof) = 1;
3268 +}
3269 +
3270 +static void yy_load_buffer_state (void)
3271 +{
3272 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3273 + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3274 + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3275 + (yy_hold_char) = *(yy_c_buf_p);
3276 +}
3277 +
3278 +/** Allocate and initialize an input buffer state.
3279 + * @param file A readable stream.
3280 + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3281 + *
3282 + * @return the allocated buffer state.
3283 + */
3284 + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
3285 +{
3286 + YY_BUFFER_STATE b;
3287 +
3288 + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
3289 + if ( ! b )
3290 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3291 +
3292 + b->yy_buf_size = size;
3293 +
3294 + /* yy_ch_buf has to be 2 characters longer than the size given because
3295 + * we need to put in 2 end-of-buffer characters.
3296 + */
3297 + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
3298 + if ( ! b->yy_ch_buf )
3299 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3300 +
3301 + b->yy_is_our_buffer = 1;
3302 +
3303 + yy_init_buffer(b,file );
3304 +
3305 + return b;
3306 +}
3307 +
3308 +/** Destroy the buffer.
3309 + * @param b a buffer created with yy_create_buffer()
3310 + *
3311 + */
3312 + void yy_delete_buffer (YY_BUFFER_STATE b )
3313 +{
3314 +
3315 + if ( ! b )
3316 + return;
3317 +
3318 + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3319 + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3320 +
3321 + if ( b->yy_is_our_buffer )
3322 + yyfree((void *) b->yy_ch_buf );
3323 +
3324 + yyfree((void *) b );
3325 +}
3326 +
3327 +#ifndef __cplusplus
3328 +extern int isatty (int );
3329 +#endif /* __cplusplus */
3330 +
3331 +/* Initializes or reinitializes a buffer.
3332 + * This function is sometimes called more than once on the same buffer,
3333 + * such as during a yyrestart() or at EOF.
3334 + */
3335 + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
3336 +
3337 +{
3338 + int oerrno = errno;
3339 +
3340 + yy_flush_buffer(b );
3341 +
3342 + b->yy_input_file = file;
3343 + b->yy_fill_buffer = 1;
3344 +
3345 + /* If b is the current buffer, then yy_init_buffer was _probably_
3346 + * called from yyrestart() or through yy_get_next_buffer.
3347 + * In that case, we don't want to reset the lineno or column.
3348 + */
3349 + if (b != YY_CURRENT_BUFFER){
3350 + b->yy_bs_lineno = 1;
3351 + b->yy_bs_column = 0;
3352 + }
3353 +
3354 + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3355 +
3356 + errno = oerrno;
3357 +}
3358 +
3359 +/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3360 + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3361 + *
3362 + */
3363 + void yy_flush_buffer (YY_BUFFER_STATE b )
3364 +{
3365 + if ( ! b )
3366 + return;
3367 +
3368 + b->yy_n_chars = 0;
3369 +
3370 + /* We always need two end-of-buffer characters. The first causes
3371 + * a transition to the end-of-buffer state. The second causes
3372 + * a jam in that state.
3373 + */
3374 + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3375 + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3376 +
3377 + b->yy_buf_pos = &b->yy_ch_buf[0];
3378 +
3379 + b->yy_at_bol = 1;
3380 + b->yy_buffer_status = YY_BUFFER_NEW;
3381 +
3382 + if ( b == YY_CURRENT_BUFFER )
3383 + yy_load_buffer_state( );
3384 +}
3385 +
3386 +/** Pushes the new state onto the stack. The new state becomes
3387 + * the current state. This function will allocate the stack
3388 + * if necessary.
3389 + * @param new_buffer The new state.
3390 + *
3391 + */
3392 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
3393 +{
3394 + if (new_buffer == NULL)
3395 + return;
3396 +
3397 + yyensure_buffer_stack();
3398 +
3399 + /* This block is copied from yy_switch_to_buffer. */
3400 + if ( YY_CURRENT_BUFFER )
3401 + {
3402 + /* Flush out information for old buffer. */
3403 + *(yy_c_buf_p) = (yy_hold_char);
3404 + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3405 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3406 + }
3407 +
3408 + /* Only push if top exists. Otherwise, replace top. */
3409 + if (YY_CURRENT_BUFFER)
3410 + (yy_buffer_stack_top)++;
3411 + YY_CURRENT_BUFFER_LVALUE = new_buffer;
3412 +
3413 + /* copied from yy_switch_to_buffer. */
3414 + yy_load_buffer_state( );
3415 + (yy_did_buffer_switch_on_eof) = 1;
3416 +}
3417 +
3418 +/** Removes and deletes the top of the stack, if present.
3419 + * The next element becomes the new top.
3420 + *
3421 + */
3422 +void yypop_buffer_state (void)
3423 +{
3424 + if (!YY_CURRENT_BUFFER)
3425 + return;
3426 +
3427 + yy_delete_buffer(YY_CURRENT_BUFFER );
3428 + YY_CURRENT_BUFFER_LVALUE = NULL;
3429 + if ((yy_buffer_stack_top) > 0)
3430 + --(yy_buffer_stack_top);
3431 +
3432 + if (YY_CURRENT_BUFFER) {
3433 + yy_load_buffer_state( );
3434 + (yy_did_buffer_switch_on_eof) = 1;
3435 + }
3436 +}
3437 +
3438 +/* Allocates the stack if it does not exist.
3439 + * Guarantees space for at least one push.
3440 + */
3441 +static void yyensure_buffer_stack (void)
3442 +{
3443 + int num_to_alloc;
3444 +
3445 + if (!(yy_buffer_stack)) {
3446 +
3447 + /* First allocation is just for 2 elements, since we don't know if this
3448 + * scanner will even need a stack. We use 2 instead of 1 to avoid an
3449 + * immediate realloc on the next call.
3450 + */
3451 + num_to_alloc = 1;
3452 + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
3453 + (num_to_alloc * sizeof(struct yy_buffer_state*)
3454 + );
3455 + if ( ! (yy_buffer_stack) )
3456 + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3457 +
3458 + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3459 +
3460 + (yy_buffer_stack_max) = num_to_alloc;
3461 + (yy_buffer_stack_top) = 0;
3462 + return;
3463 + }
3464 +
3465 + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3466 +
3467 + /* Increase the buffer to prepare for a possible push. */
3468 + int grow_size = 8 /* arbitrary grow size */;
3469 +
3470 + num_to_alloc = (yy_buffer_stack_max) + grow_size;
3471 + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
3472 + ((yy_buffer_stack),
3473 + num_to_alloc * sizeof(struct yy_buffer_state*)
3474 + );
3475 + if ( ! (yy_buffer_stack) )
3476 + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3477 +
3478 + /* zero only the new slots.*/
3479 + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3480 + (yy_buffer_stack_max) = num_to_alloc;
3481 + }
3482 +}
3483 +
3484 +/** Setup the input buffer state to scan directly from a user-specified character buffer.
3485 + * @param base the character buffer
3486 + * @param size the size in bytes of the character buffer
3487 + *
3488 + * @return the newly allocated buffer state object.
3489 + */
3490 +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
3491 +{
3492 + YY_BUFFER_STATE b;
3493 +
3494 + if ( size < 2 ||
3495 + base[size-2] != YY_END_OF_BUFFER_CHAR ||
3496 + base[size-1] != YY_END_OF_BUFFER_CHAR )
3497 + /* They forgot to leave room for the EOB's. */
3498 + return 0;
3499 +
3500 + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
3501 + if ( ! b )
3502 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3503 +
3504 + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3505 + b->yy_buf_pos = b->yy_ch_buf = base;
3506 + b->yy_is_our_buffer = 0;
3507 + b->yy_input_file = 0;
3508 + b->yy_n_chars = b->yy_buf_size;
3509 + b->yy_is_interactive = 0;
3510 + b->yy_at_bol = 1;
3511 + b->yy_fill_buffer = 0;
3512 + b->yy_buffer_status = YY_BUFFER_NEW;
3513 +
3514 + yy_switch_to_buffer(b );
3515 +
3516 + return b;
3517 +}
3518 +
3519 +/** Setup the input buffer state to scan a string. The next call to yylex() will
3520 + * scan from a @e copy of @a str.
3521 + * @param yystr a NUL-terminated string to scan
3522 + *
3523 + * @return the newly allocated buffer state object.
3524 + * @note If you want to scan bytes that may contain NUL values, then use
3525 + * yy_scan_bytes() instead.
3526 + */
3527 +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
3528 +{
3529 +
3530 + return yy_scan_bytes(yystr,strlen(yystr) );
3531 +}
3532 +
3533 +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3534 + * scan from a @e copy of @a bytes.
3535 + * @param bytes the byte buffer to scan
3536 + * @param len the number of bytes in the buffer pointed to by @a bytes.
3537 + *
3538 + * @return the newly allocated buffer state object.
3539 + */
3540 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
3541 +{
3542 + YY_BUFFER_STATE b;
3543 + char *buf;
3544 + yy_size_t n;
3545 + int i;
3546 +
3547 + /* Get memory for full buffer, including space for trailing EOB's. */
3548 + n = _yybytes_len + 2;
3549 + buf = (char *) yyalloc(n );
3550 + if ( ! buf )
3551 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3552 +
3553 + for ( i = 0; i < _yybytes_len; ++i )
3554 + buf[i] = yybytes[i];
3555 +
3556 + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3557 +
3558 + b = yy_scan_buffer(buf,n );
3559 + if ( ! b )
3560 + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3561 +
3562 + /* It's okay to grow etc. this buffer, and we should throw it
3563 + * away when we're done.
3564 + */
3565 + b->yy_is_our_buffer = 1;
3566 +
3567 + return b;
3568 +}
3569 +
3570 +#ifndef YY_EXIT_FAILURE
3571 +#define YY_EXIT_FAILURE 2
3572 +#endif
3573 +
3574 +static void yy_fatal_error (yyconst char* msg )
3575 +{
3576 + (void) fprintf( stderr, "%s\n", msg );
3577 + exit( YY_EXIT_FAILURE );
3578 +}
3579 +
3580 +/* Redefine yyless() so it works in section 3 code. */
3581 +
3582 +#undef yyless
3583 +#define yyless(n) \
3584 + do \
3585 + { \
3586 + /* Undo effects of setting up yytext. */ \
3587 + int yyless_macro_arg = (n); \
3588 + YY_LESS_LINENO(yyless_macro_arg);\
3589 + yytext[yyleng] = (yy_hold_char); \
3590 + (yy_c_buf_p) = yytext + yyless_macro_arg; \
3591 + (yy_hold_char) = *(yy_c_buf_p); \
3592 + *(yy_c_buf_p) = '\0'; \
3593 + yyleng = yyless_macro_arg; \
3594 + } \
3595 + while ( 0 )
3596 +
3597 +/* Accessor methods (get/set functions) to struct members. */
3598 +
3599 +/** Get the current line number.
3600 + *
3601 + */
3602 +int yyget_lineno (void)
3603 +{
3604 +
3605 + return yylineno;
3606 +}
3607 +
3608 +/** Get the input stream.
3609 + *
3610 + */
3611 +FILE *yyget_in (void)
3612 +{
3613 + return yyin;
3614 +}
3615 +
3616 +/** Get the output stream.
3617 + *
3618 + */
3619 +FILE *yyget_out (void)
3620 +{
3621 + return yyout;
3622 +}
3623 +
3624 +/** Get the length of the current token.
3625 + *
3626 + */
3627 +int yyget_leng (void)
3628 +{
3629 + return yyleng;
3630 +}
3631 +
3632 +/** Get the current token.
3633 + *
3634 + */
3635 +
3636 +char *yyget_text (void)
3637 +{
3638 + return yytext;
3639 +}
3640 +
3641 +/** Set the current line number.
3642 + * @param line_number
3643 + *
3644 + */
3645 +void yyset_lineno (int line_number )
3646 +{
3647 +
3648 + yylineno = line_number;
3649 +}
3650 +
3651 +/** Set the input stream. This does not discard the current
3652 + * input buffer.
3653 + * @param in_str A readable stream.
3654 + *
3655 + * @see yy_switch_to_buffer
3656 + */
3657 +void yyset_in (FILE * in_str )
3658 +{
3659 + yyin = in_str ;
3660 +}
3661 +
3662 +void yyset_out (FILE * out_str )
3663 +{
3664 + yyout = out_str ;
3665 +}
3666 +
3667 +int yyget_debug (void)
3668 +{
3669 + return yy_flex_debug;
3670 +}
3671 +
3672 +void yyset_debug (int bdebug )
3673 +{
3674 + yy_flex_debug = bdebug ;
3675 +}
3676 +
3677 +static int yy_init_globals (void)
3678 +{
3679 + /* Initialization is the same as for the non-reentrant scanner.
3680 + * This function is called from yylex_destroy(), so don't allocate here.
3681 + */
3682 +
3683 + (yy_buffer_stack) = 0;
3684 + (yy_buffer_stack_top) = 0;
3685 + (yy_buffer_stack_max) = 0;
3686 + (yy_c_buf_p) = (char *) 0;
3687 + (yy_init) = 0;
3688 + (yy_start) = 0;
3689 +
3690 +/* Defined in main.c */
3691 +#ifdef YY_STDINIT
3692 + yyin = stdin;
3693 + yyout = stdout;
3694 +#else
3695 + yyin = (FILE *) 0;
3696 + yyout = (FILE *) 0;
3697 +#endif
3698 +
3699 + /* For future reference: Set errno on error, since we are called by
3700 + * yylex_init()
3701 + */
3702 + return 0;
3703 +}
3704 +
3705 +/* yylex_destroy is for both reentrant and non-reentrant scanners. */
3706 +int yylex_destroy (void)
3707 +{
3708 +
3709 + /* Pop the buffer stack, destroying each element. */
3710 + while(YY_CURRENT_BUFFER){
3711 + yy_delete_buffer(YY_CURRENT_BUFFER );
3712 + YY_CURRENT_BUFFER_LVALUE = NULL;
3713 + yypop_buffer_state();
3714 + }
3715 +
3716 + /* Destroy the stack itself. */
3717 + yyfree((yy_buffer_stack) );
3718 + (yy_buffer_stack) = NULL;
3719 +
3720 + /* Reset the globals. This is important in a non-reentrant scanner so the next time
3721 + * yylex() is called, initialization will occur. */
3722 + yy_init_globals( );
3723 +
3724 + return 0;
3725 +}
3726 +
3727 +/*
3728 + * Internal utility routines.
3729 + */
3730 +
3731 +#ifndef yytext_ptr
3732 +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3733 +{
3734 + register int i;
3735 + for ( i = 0; i < n; ++i )
3736 + s1[i] = s2[i];
3737 +}
3738 +#endif
3739 +
3740 +#ifdef YY_NEED_STRLEN
3741 +static int yy_flex_strlen (yyconst char * s )
3742 +{
3743 + register int n;
3744 + for ( n = 0; s[n]; ++n )
3745 + ;
3746 +
3747 + return n;
3748 +}
3749 +#endif
3750 +
3751 +void *yyalloc (yy_size_t size )
3752 +{
3753 + return (void *) malloc( size );
3754 +}
3755 +
3756 +void *yyrealloc (void * ptr, yy_size_t size )
3757 +{
3758 + /* The cast to (char *) in the following accommodates both
3759 + * implementations that use char* generic pointers, and those
3760 + * that use void* generic pointers. It works with the latter
3761 + * because both ANSI C and C++ allow castless assignment from
3762 + * any pointer type to void*, and deal with argument conversions
3763 + * as though doing an assignment.
3764 + */
3765 + return (void *) realloc( (char *) ptr, size );
3766 +}
3767 +
3768 +void yyfree (void * ptr )
3769 +{
3770 + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
3771 +}
3772 +
3773 +#define YYTABLES_NAME "yytables"
3774 +
3775 +#line 85 "qgssearchstringlexer.ll"
3776 +
3777 +
3778 +
3779 +void set_input_buffer(const char* buffer)
3780 +{
3781 + yy_scan_string(buffer);
3782 +}
3783 +
3784 +

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5