/[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 1425 - (show annotations) (download)
Wed Mar 19 13:51:18 2008 UTC (5 years, 2 months ago) by frankie
File size: 52672 byte(s)
Fixating flex.dpatch
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-0.9.1~/src/core/CMakeLists.txt qgis-0.9.1/src/core/CMakeLists.txt
9 --- qgis-0.9.1~/src/core/CMakeLists.txt 2008-03-19 14:47:31.000000000 +0100
10 +++ qgis-0.9.1/src/core/CMakeLists.txt 2008-03-19 14:50:21.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-0.9.1~/src/core/qgssearchstringlexer.cc qgis-0.9.1/src/core/qgssearchstringlexer.cc
22 --- qgis-0.9.1~/src/core/qgssearchstringlexer.cc 1970-01-01 01:00:00.000000000 +0100
23 +++ qgis-0.9.1/src/core/qgssearchstringlexer.cc 2008-03-19 14:50:21.000000000 +0100
24 @@ -0,0 +1,1878 @@
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 +

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5