/src/rdkit/Code/GraphMol/SmilesParse/lex.yysmarts.cpp
Line | Count | Source |
1 | | |
2 | | #define YY_INT_ALIGNED short int |
3 | | |
4 | | /* A lexical scanner generated by flex */ |
5 | | |
6 | | #define FLEX_SCANNER |
7 | | #define YY_FLEX_MAJOR_VERSION 2 |
8 | | #define YY_FLEX_MINOR_VERSION 6 |
9 | | #define YY_FLEX_SUBMINOR_VERSION 4 |
10 | | #if YY_FLEX_SUBMINOR_VERSION > 0 |
11 | | #define FLEX_BETA |
12 | | #endif |
13 | | |
14 | | #ifdef yy_create_buffer |
15 | | #define yysmarts__create_buffer_ALREADY_DEFINED |
16 | | #else |
17 | 0 | #define yy_create_buffer yysmarts__create_buffer |
18 | | #endif |
19 | | |
20 | | #ifdef yy_delete_buffer |
21 | | #define yysmarts__delete_buffer_ALREADY_DEFINED |
22 | | #else |
23 | 25.1k | #define yy_delete_buffer yysmarts__delete_buffer |
24 | | #endif |
25 | | |
26 | | #ifdef yy_scan_buffer |
27 | | #define yysmarts__scan_buffer_ALREADY_DEFINED |
28 | | #else |
29 | 0 | #define yy_scan_buffer yysmarts__scan_buffer |
30 | | #endif |
31 | | |
32 | | #ifdef yy_scan_string |
33 | | #define yysmarts__scan_string_ALREADY_DEFINED |
34 | | #else |
35 | | #define yy_scan_string yysmarts__scan_string |
36 | | #endif |
37 | | |
38 | | #ifdef yy_scan_bytes |
39 | | #define yysmarts__scan_bytes_ALREADY_DEFINED |
40 | | #else |
41 | 0 | #define yy_scan_bytes yysmarts__scan_bytes |
42 | | #endif |
43 | | |
44 | | #ifdef yy_init_buffer |
45 | | #define yysmarts__init_buffer_ALREADY_DEFINED |
46 | | #else |
47 | 0 | #define yy_init_buffer yysmarts__init_buffer |
48 | | #endif |
49 | | |
50 | | #ifdef yy_flush_buffer |
51 | | #define yysmarts__flush_buffer_ALREADY_DEFINED |
52 | | #else |
53 | 0 | #define yy_flush_buffer yysmarts__flush_buffer |
54 | | #endif |
55 | | |
56 | | #ifdef yy_load_buffer_state |
57 | | #define yysmarts__load_buffer_state_ALREADY_DEFINED |
58 | | #else |
59 | 50.3k | #define yy_load_buffer_state yysmarts__load_buffer_state |
60 | | #endif |
61 | | |
62 | | #ifdef yy_switch_to_buffer |
63 | | #define yysmarts__switch_to_buffer_ALREADY_DEFINED |
64 | | #else |
65 | 25.1k | #define yy_switch_to_buffer yysmarts__switch_to_buffer |
66 | | #endif |
67 | | |
68 | | #ifdef yypush_buffer_state |
69 | | #define yysmarts_push_buffer_state_ALREADY_DEFINED |
70 | | #else |
71 | | #define yypush_buffer_state yysmarts_push_buffer_state |
72 | | #endif |
73 | | |
74 | | #ifdef yypop_buffer_state |
75 | | #define yysmarts_pop_buffer_state_ALREADY_DEFINED |
76 | | #else |
77 | 25.1k | #define yypop_buffer_state yysmarts_pop_buffer_state |
78 | | #endif |
79 | | |
80 | | #ifdef yyensure_buffer_stack |
81 | | #define yysmarts_ensure_buffer_stack_ALREADY_DEFINED |
82 | | #else |
83 | 25.1k | #define yyensure_buffer_stack yysmarts_ensure_buffer_stack |
84 | | #endif |
85 | | |
86 | | #ifdef yylex |
87 | | #define yysmarts_lex_ALREADY_DEFINED |
88 | | #else |
89 | | #define yylex yysmarts_lex |
90 | | #endif |
91 | | |
92 | | #ifdef yyrestart |
93 | | #define yysmarts_restart_ALREADY_DEFINED |
94 | | #else |
95 | 0 | #define yyrestart yysmarts_restart |
96 | | #endif |
97 | | |
98 | | #ifdef yylex_init |
99 | | #define yysmarts_lex_init_ALREADY_DEFINED |
100 | | #else |
101 | | #define yylex_init yysmarts_lex_init |
102 | | #endif |
103 | | |
104 | | #ifdef yylex_init_extra |
105 | | #define yysmarts_lex_init_extra_ALREADY_DEFINED |
106 | | #else |
107 | | #define yylex_init_extra yysmarts_lex_init_extra |
108 | | #endif |
109 | | |
110 | | #ifdef yylex_destroy |
111 | | #define yysmarts_lex_destroy_ALREADY_DEFINED |
112 | | #else |
113 | | #define yylex_destroy yysmarts_lex_destroy |
114 | | #endif |
115 | | |
116 | | #ifdef yyget_debug |
117 | | #define yysmarts_get_debug_ALREADY_DEFINED |
118 | | #else |
119 | | #define yyget_debug yysmarts_get_debug |
120 | | #endif |
121 | | |
122 | | #ifdef yyset_debug |
123 | | #define yysmarts_set_debug_ALREADY_DEFINED |
124 | | #else |
125 | | #define yyset_debug yysmarts_set_debug |
126 | | #endif |
127 | | |
128 | | #ifdef yyget_extra |
129 | | #define yysmarts_get_extra_ALREADY_DEFINED |
130 | | #else |
131 | | #define yyget_extra yysmarts_get_extra |
132 | | #endif |
133 | | |
134 | | #ifdef yyset_extra |
135 | | #define yysmarts_set_extra_ALREADY_DEFINED |
136 | | #else |
137 | 0 | #define yyset_extra yysmarts_set_extra |
138 | | #endif |
139 | | |
140 | | #ifdef yyget_in |
141 | | #define yysmarts_get_in_ALREADY_DEFINED |
142 | | #else |
143 | | #define yyget_in yysmarts_get_in |
144 | | #endif |
145 | | |
146 | | #ifdef yyset_in |
147 | | #define yysmarts_set_in_ALREADY_DEFINED |
148 | | #else |
149 | | #define yyset_in yysmarts_set_in |
150 | | #endif |
151 | | |
152 | | #ifdef yyget_out |
153 | | #define yysmarts_get_out_ALREADY_DEFINED |
154 | | #else |
155 | | #define yyget_out yysmarts_get_out |
156 | | #endif |
157 | | |
158 | | #ifdef yyset_out |
159 | | #define yysmarts_set_out_ALREADY_DEFINED |
160 | | #else |
161 | | #define yyset_out yysmarts_set_out |
162 | | #endif |
163 | | |
164 | | #ifdef yyget_leng |
165 | | #define yysmarts_get_leng_ALREADY_DEFINED |
166 | | #else |
167 | | #define yyget_leng yysmarts_get_leng |
168 | | #endif |
169 | | |
170 | | #ifdef yyget_text |
171 | | #define yysmarts_get_text_ALREADY_DEFINED |
172 | | #else |
173 | | #define yyget_text yysmarts_get_text |
174 | | #endif |
175 | | |
176 | | #ifdef yyget_lineno |
177 | | #define yysmarts_get_lineno_ALREADY_DEFINED |
178 | | #else |
179 | | #define yyget_lineno yysmarts_get_lineno |
180 | | #endif |
181 | | |
182 | | #ifdef yyset_lineno |
183 | | #define yysmarts_set_lineno_ALREADY_DEFINED |
184 | | #else |
185 | | #define yyset_lineno yysmarts_set_lineno |
186 | | #endif |
187 | | |
188 | | #ifdef yyget_column |
189 | | #define yysmarts_get_column_ALREADY_DEFINED |
190 | | #else |
191 | | #define yyget_column yysmarts_get_column |
192 | | #endif |
193 | | |
194 | | #ifdef yyset_column |
195 | | #define yysmarts_set_column_ALREADY_DEFINED |
196 | | #else |
197 | | #define yyset_column yysmarts_set_column |
198 | | #endif |
199 | | |
200 | | #ifdef yywrap |
201 | | #define yysmarts_wrap_ALREADY_DEFINED |
202 | | #else |
203 | 24.9k | #define yywrap yysmarts_wrap |
204 | | #endif |
205 | | |
206 | | #ifdef yyget_lval |
207 | | #define yysmarts_get_lval_ALREADY_DEFINED |
208 | | #else |
209 | | #define yyget_lval yysmarts_get_lval |
210 | | #endif |
211 | | |
212 | | #ifdef yyset_lval |
213 | | #define yysmarts_set_lval_ALREADY_DEFINED |
214 | | #else |
215 | | #define yyset_lval yysmarts_set_lval |
216 | | #endif |
217 | | |
218 | | #ifdef yyalloc |
219 | | #define yysmarts_alloc_ALREADY_DEFINED |
220 | | #else |
221 | 85.3k | #define yyalloc yysmarts_alloc |
222 | | #endif |
223 | | |
224 | | #ifdef yyrealloc |
225 | | #define yysmarts_realloc_ALREADY_DEFINED |
226 | | #else |
227 | 43.1k | #define yyrealloc yysmarts_realloc |
228 | | #endif |
229 | | |
230 | | #ifdef yyfree |
231 | | #define yysmarts_free_ALREADY_DEFINED |
232 | | #else |
233 | 125k | #define yyfree yysmarts_free |
234 | | #endif |
235 | | |
236 | | /* First, we deal with platform-specific or compiler-specific issues. */ |
237 | | |
238 | | /* begin standard C headers. */ |
239 | | #include <stdio.h> |
240 | | #include <string.h> |
241 | | #include <errno.h> |
242 | | #include <stdlib.h> |
243 | | |
244 | | /* end standard C headers. */ |
245 | | |
246 | | /* flex integer type definitions */ |
247 | | |
248 | | #ifndef FLEXINT_H |
249 | | #define FLEXINT_H |
250 | | |
251 | | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
252 | | |
253 | | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
254 | | |
255 | | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
256 | | * if you want the limit (max/min) macros for int types. |
257 | | */ |
258 | | #ifndef __STDC_LIMIT_MACROS |
259 | | #define __STDC_LIMIT_MACROS 1 |
260 | | #endif |
261 | | |
262 | | #include <inttypes.h> |
263 | | typedef int8_t flex_int8_t; |
264 | | typedef uint8_t flex_uint8_t; |
265 | | typedef int16_t flex_int16_t; |
266 | | typedef uint16_t flex_uint16_t; |
267 | | typedef int32_t flex_int32_t; |
268 | | typedef uint32_t flex_uint32_t; |
269 | | #else |
270 | | typedef signed char flex_int8_t; |
271 | | typedef short int flex_int16_t; |
272 | | typedef int flex_int32_t; |
273 | | typedef unsigned char flex_uint8_t; |
274 | | typedef unsigned short int flex_uint16_t; |
275 | | typedef unsigned int flex_uint32_t; |
276 | | |
277 | | /* Limits of integral types. */ |
278 | | #ifndef INT8_MIN |
279 | | #define INT8_MIN (-128) |
280 | | #endif |
281 | | #ifndef INT16_MIN |
282 | | #define INT16_MIN (-32767-1) |
283 | | #endif |
284 | | #ifndef INT32_MIN |
285 | | #define INT32_MIN (-2147483647-1) |
286 | | #endif |
287 | | #ifndef INT8_MAX |
288 | | #define INT8_MAX (127) |
289 | | #endif |
290 | | #ifndef INT16_MAX |
291 | | #define INT16_MAX (32767) |
292 | | #endif |
293 | | #ifndef INT32_MAX |
294 | | #define INT32_MAX (2147483647) |
295 | | #endif |
296 | | #ifndef UINT8_MAX |
297 | | #define UINT8_MAX (255U) |
298 | | #endif |
299 | | #ifndef UINT16_MAX |
300 | | #define UINT16_MAX (65535U) |
301 | | #endif |
302 | | #ifndef UINT32_MAX |
303 | | #define UINT32_MAX (4294967295U) |
304 | | #endif |
305 | | |
306 | | #ifndef SIZE_MAX |
307 | | #define SIZE_MAX (~(size_t)0) |
308 | | #endif |
309 | | |
310 | | #endif /* ! C99 */ |
311 | | |
312 | | #endif /* ! FLEXINT_H */ |
313 | | |
314 | | /* begin standard C++ headers. */ |
315 | | |
316 | | /* TODO: this is always defined, so inline it */ |
317 | 25.1k | #define yyconst const |
318 | | |
319 | | #if defined(__GNUC__) && __GNUC__ >= 3 |
320 | | #define yynoreturn __attribute__((__noreturn__)) |
321 | | #else |
322 | | #define yynoreturn |
323 | | #endif |
324 | | |
325 | | /* Returned upon end-of-file. */ |
326 | | #define YY_NULL 0 |
327 | | |
328 | | /* Promotes a possibly negative, possibly signed char to an |
329 | | * integer in range [0..255] for use as an array index. |
330 | | */ |
331 | 39.1M | #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) |
332 | | |
333 | | /* An opaque pointer. */ |
334 | | #ifndef YY_TYPEDEF_YY_SCANNER_T |
335 | | #define YY_TYPEDEF_YY_SCANNER_T |
336 | | typedef void* yyscan_t; |
337 | | #endif |
338 | | |
339 | | /* For convenience, these vars (plus the bison vars far below) |
340 | | are macros in the reentrant scanner. */ |
341 | 176k | #define yyin yyg->yyin_r |
342 | 100k | #define yyout yyg->yyout_r |
343 | 0 | #define yyextra yyg->yyextra_r |
344 | 38.8M | #define yyleng yyg->yyleng_r |
345 | 1.76M | #define yytext yyg->yytext_r |
346 | 0 | #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
347 | 0 | #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
348 | 0 | #define yy_flex_debug yyg->yy_flex_debug_r |
349 | | |
350 | | /* Enter a start condition. This macro really ought to take a parameter, |
351 | | * but we do it the disgusting crufty way forced on us by the ()-less |
352 | | * definition of BEGIN. |
353 | | */ |
354 | 1.87M | #define BEGIN yyg->yy_start = 1 + 2 * |
355 | | /* Translate the current start state into a value that can be later handed |
356 | | * to BEGIN to return to the state. The YYSTATE alias is for lex |
357 | | * compatibility. |
358 | | */ |
359 | 1.45M | #define YY_START ((yyg->yy_start - 1) / 2) |
360 | | #define YYSTATE YY_START |
361 | | /* Action number for EOF rule of a given start state. */ |
362 | 123k | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
363 | | /* Special action meaning "start processing a new file". */ |
364 | 0 | #define YY_NEW_FILE yyrestart( yyin , yyscanner ) |
365 | 100k | #define YY_END_OF_BUFFER_CHAR 0 |
366 | | |
367 | | /* Size of default input buffer. */ |
368 | | #ifndef YY_BUF_SIZE |
369 | | #ifdef __ia64__ |
370 | | /* On IA-64, the buffer size is 16k, not 8k. |
371 | | * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. |
372 | | * Ditto for the __ia64__ case accordingly. |
373 | | */ |
374 | | #define YY_BUF_SIZE 32768 |
375 | | #else |
376 | 0 | #define YY_BUF_SIZE 16384 |
377 | | #endif /* __ia64__ */ |
378 | | #endif |
379 | | |
380 | | /* The state buf must be large enough to hold one state per character in the main buffer. |
381 | | */ |
382 | | #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
383 | | |
384 | | #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
385 | | #define YY_TYPEDEF_YY_BUFFER_STATE |
386 | | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
387 | | #endif |
388 | | |
389 | | #ifndef YY_TYPEDEF_YY_SIZE_T |
390 | | #define YY_TYPEDEF_YY_SIZE_T |
391 | | typedef size_t yy_size_t; |
392 | | #endif |
393 | | |
394 | 0 | #define EOB_ACT_CONTINUE_SCAN 0 |
395 | 49.9k | #define EOB_ACT_END_OF_FILE 1 |
396 | 50.1k | #define EOB_ACT_LAST_MATCH 2 |
397 | | |
398 | | #define YY_LESS_LINENO(n) |
399 | | #define YY_LINENO_REWIND_TO(ptr) |
400 | | |
401 | | /* Return all but the first "n" matched characters back to the input stream. */ |
402 | | #define yyless(n) \ |
403 | | do \ |
404 | | { \ |
405 | | /* Undo effects of setting up yytext. */ \ |
406 | | int yyless_macro_arg = (n); \ |
407 | | YY_LESS_LINENO(yyless_macro_arg);\ |
408 | | *yy_cp = yyg->yy_hold_char; \ |
409 | | YY_RESTORE_YY_MORE_OFFSET \ |
410 | | yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ |
411 | | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
412 | | } \ |
413 | | while ( 0 ) |
414 | | #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) |
415 | | |
416 | | #ifndef YY_STRUCT_YY_BUFFER_STATE |
417 | | #define YY_STRUCT_YY_BUFFER_STATE |
418 | | struct yy_buffer_state |
419 | | { |
420 | | FILE *yy_input_file; |
421 | | |
422 | | char *yy_ch_buf; /* input buffer */ |
423 | | char *yy_buf_pos; /* current position in input buffer */ |
424 | | |
425 | | /* Size of input buffer in bytes, not including room for EOB |
426 | | * characters. |
427 | | */ |
428 | | int yy_buf_size; |
429 | | |
430 | | /* Number of characters read into yy_ch_buf, not including EOB |
431 | | * characters. |
432 | | */ |
433 | | int yy_n_chars; |
434 | | |
435 | | /* Whether we "own" the buffer - i.e., we know we created it, |
436 | | * and can realloc() it to grow it, and should free() it to |
437 | | * delete it. |
438 | | */ |
439 | | int yy_is_our_buffer; |
440 | | |
441 | | /* Whether this is an "interactive" input source; if so, and |
442 | | * if we're using stdio for input, then we want to use getc() |
443 | | * instead of fread(), to make sure we stop fetching input after |
444 | | * each newline. |
445 | | */ |
446 | | int yy_is_interactive; |
447 | | |
448 | | /* Whether we're considered to be at the beginning of a line. |
449 | | * If so, '^' rules will be active on the next match, otherwise |
450 | | * not. |
451 | | */ |
452 | | int yy_at_bol; |
453 | | |
454 | | int yy_bs_lineno; /**< The line count. */ |
455 | | int yy_bs_column; /**< The column count. */ |
456 | | |
457 | | /* Whether to try to fill the input buffer when we reach the |
458 | | * end of it. |
459 | | */ |
460 | | int yy_fill_buffer; |
461 | | |
462 | | int yy_buffer_status; |
463 | | |
464 | 7.96M | #define YY_BUFFER_NEW 0 |
465 | 24.9k | #define YY_BUFFER_NORMAL 1 |
466 | | /* When an EOF's been seen but there's still some text to process |
467 | | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
468 | | * shouldn't try reading from the input source any more. We might |
469 | | * still have a bunch of tokens to match, though, because of |
470 | | * possible backing-up. |
471 | | * |
472 | | * When we actually see the EOF, we change the status to "new" |
473 | | * (via yyrestart()), so that the user can continue scanning by |
474 | | * just pointing yyin at a new input file. |
475 | | */ |
476 | 0 | #define YY_BUFFER_EOF_PENDING 2 |
477 | | |
478 | | }; |
479 | | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
480 | | |
481 | | /* We provide macros for accessing buffer states in case in the |
482 | | * future we want to put the buffer states in a more general |
483 | | * "scanner state". |
484 | | * |
485 | | * Returns the top of the stack, or NULL. |
486 | | */ |
487 | 201k | #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ |
488 | 201k | ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ |
489 | 201k | : NULL) |
490 | | /* Same as previous macro, but useful when we know that the buffer stack is not |
491 | | * NULL or when we need an lvalue. For internal use only. |
492 | | */ |
493 | 16.3M | #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
494 | | |
495 | | void yyrestart ( FILE *input_file , yyscan_t yyscanner ); |
496 | | void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); |
497 | | YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); |
498 | | void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); |
499 | | void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); |
500 | | void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); |
501 | | void yypop_buffer_state ( yyscan_t yyscanner ); |
502 | | |
503 | | static void yyensure_buffer_stack ( yyscan_t yyscanner ); |
504 | | static void yy_load_buffer_state ( yyscan_t yyscanner ); |
505 | | static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); |
506 | | #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) |
507 | | |
508 | | YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); |
509 | | YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); |
510 | | YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); |
511 | | |
512 | | void *yyalloc ( yy_size_t , yyscan_t yyscanner ); |
513 | | void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); |
514 | | void yyfree ( void * , yyscan_t yyscanner ); |
515 | | |
516 | | #define yy_new_buffer yy_create_buffer |
517 | | #define yy_set_interactive(is_interactive) \ |
518 | | { \ |
519 | | if ( ! YY_CURRENT_BUFFER ){ \ |
520 | | yyensure_buffer_stack (yyscanner); \ |
521 | | YY_CURRENT_BUFFER_LVALUE = \ |
522 | | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ |
523 | | } \ |
524 | | YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
525 | | } |
526 | | #define yy_set_bol(at_bol) \ |
527 | | { \ |
528 | | if ( ! YY_CURRENT_BUFFER ){\ |
529 | | yyensure_buffer_stack (yyscanner); \ |
530 | | YY_CURRENT_BUFFER_LVALUE = \ |
531 | | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ |
532 | | } \ |
533 | | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
534 | | } |
535 | | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
536 | | |
537 | | /* Begin user sect3 */ |
538 | | |
539 | 24.9k | #define yysmarts_wrap(yyscanner) (/*CONSTCOND*/1) |
540 | | #define YY_SKIP_YYWRAP |
541 | | typedef flex_uint8_t YY_CHAR; |
542 | | |
543 | | typedef int yy_state_type; |
544 | | |
545 | 55.2M | #define yytext_ptr yytext_r |
546 | | |
547 | | static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); |
548 | | static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); |
549 | | static int yy_get_next_buffer ( yyscan_t yyscanner ); |
550 | | static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); |
551 | | |
552 | | /* Done after the current pattern has been matched and before the |
553 | | * corresponding action - sets up yytext. |
554 | | */ |
555 | | #define YY_DO_BEFORE_ACTION \ |
556 | 23.3M | yyg->yytext_ptr = yy_bp; \ |
557 | 23.3M | yyleng = (int) (yy_cp - yy_bp); \ |
558 | 23.3M | yyg->yy_hold_char = *yy_cp; \ |
559 | 23.3M | *yy_cp = '\0'; \ |
560 | 23.3M | yyg->yy_c_buf_p = yy_cp; |
561 | | #define YY_NUM_RULES 184 |
562 | 8.06M | #define YY_END_OF_BUFFER 185 |
563 | | /* This struct is not used in this scanner, |
564 | | but its presence is necessary. */ |
565 | | struct yy_trans_info |
566 | | { |
567 | | flex_int32_t yy_verify; |
568 | | flex_int32_t yy_nxt; |
569 | | }; |
570 | | static const flex_int16_t yy_accept[222] = |
571 | | { 0, |
572 | | 0, 0, 0, 0, 0, 0, 0, 0, 185, 183, |
573 | | 182, 172, 149, 152, 169, 174, 160, 144, 158, 175, |
574 | | 157, 168, 154, 170, 171, 147, 173, 183, 150, 6, |
575 | | 146, 124, 125, 128, 123, 133, 126, 127, 129, 130, |
576 | | 165, 153, 167, 183, 148, 145, 134, 135, 136, 137, |
577 | | 138, 139, 163, 164, 151, 152, 146, 124, 125, 112, |
578 | | 183, 128, 183, 123, 133, 16, 183, 183, 126, 127, |
579 | | 129, 120, 130, 183, 87, 20, 69, 114, 35, 118, |
580 | | 166, 145, 113, 119, 122, 121, 139, 183, 116, 115, |
581 | | 117, 161, 162, 155, 156, 0, 0, 0, 0, 0, |
582 | | |
583 | | 132, 131, 153, 176, 177, 178, 179, 180, 181, 159, |
584 | | 84, 43, 13, 90, 15, 30, 80, 74, 51, 9, |
585 | | 102, 78, 92, 17, 44, 53, 93, 91, 107, 23, |
586 | | 21, 50, 26, 100, 105, 61, 63, 94, 58, 24, |
587 | | 109, 95, 82, 28, 59, 29, 7, 67, 75, 62, |
588 | | 103, 45, 72, 32, 52, 8, 98, 66, 111, 96, |
589 | | 12, 22, 38, 104, 11, 37, 55, 10, 25, 97, |
590 | | 88, 71, 86, 77, 42, 56, 79, 54, 73, 89, |
591 | | 83, 33, 70, 99, 106, 41, 81, 40, 47, 18, |
592 | | 31, 101, 14, 57, 46, 34, 68, 60, 39, 48, |
593 | | |
594 | | 85, 19, 76, 64, 0, 49, 65, 27, 36, 141, |
595 | | 142, 140, 143, 2, 5, 3, 4, 1, 110, 108, |
596 | | 0 |
597 | | } ; |
598 | | |
599 | | static const YY_CHAR yy_ec[256] = |
600 | | { 0, |
601 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, |
602 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
603 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
604 | | 1, 3, 4, 1, 5, 6, 7, 8, 3, 9, |
605 | | 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, |
606 | | 20, 21, 22, 23, 23, 23, 23, 24, 25, 26, |
607 | | 27, 28, 1, 29, 30, 31, 32, 33, 34, 35, |
608 | | 36, 37, 38, 1, 39, 40, 41, 42, 43, 44, |
609 | | 1, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
610 | | 54, 55, 56, 57, 58, 1, 59, 60, 61, 62, |
611 | | |
612 | | 63, 64, 65, 66, 67, 1, 68, 69, 70, 71, |
613 | | 72, 73, 1, 74, 75, 76, 77, 78, 1, 79, |
614 | | 80, 81, 82, 1, 83, 84, 1, 1, 1, 1, |
615 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
616 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
617 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
618 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
619 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
620 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
621 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
622 | | |
623 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
624 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
625 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
626 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
627 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
628 | | 1, 1, 1, 1, 1 |
629 | | } ; |
630 | | |
631 | | static const YY_CHAR yy_meta[85] = |
632 | | { 0, |
633 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
634 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
635 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
636 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
637 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
638 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
639 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
640 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
641 | | 1, 1, 1, 1 |
642 | | } ; |
643 | | |
644 | | static const flex_int16_t yy_base[222] = |
645 | | { 0, |
646 | | 0, 0, 79, 0, 222, 217, 215, 213, 221, 278, |
647 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
648 | | 192, 278, 278, 278, 278, 278, 278, 203, 278, 103, |
649 | | 278, 142, 146, 278, 278, 278, 278, 278, 278, 278, |
650 | | 278, 155, 278, 69, 278, 278, 278, 278, 278, 278, |
651 | | 278, 278, 278, 278, 278, 195, 98, 33, 107, 76, |
652 | | 20, 74, 102, 122, 31, 127, 121, 131, 146, 125, |
653 | | 152, 171, 180, 196, 114, 278, 278, 127, 123, 68, |
654 | | 278, 87, 278, 278, 278, 278, 41, 89, 278, 278, |
655 | | 278, 278, 278, 278, 278, 230, 63, 61, 49, 103, |
656 | | |
657 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
658 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
659 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
660 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
661 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
662 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
663 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
664 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
665 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
666 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
667 | | |
668 | | 278, 278, 278, 278, 116, 278, 278, 278, 278, 278, |
669 | | 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, |
670 | | 278 |
671 | | } ; |
672 | | |
673 | | static const flex_int16_t yy_def[222] = |
674 | | { 0, |
675 | | 221, 1, 1, 3, 1, 1, 1, 1, 221, 221, |
676 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
677 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
678 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
679 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
680 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
681 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
682 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
683 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
684 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
685 | | |
686 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
687 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
688 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
689 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
690 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
691 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
692 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
693 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
694 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
695 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
696 | | |
697 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
698 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
699 | | 0 |
700 | | } ; |
701 | | |
702 | | static const flex_int16_t yy_nxt[363] = |
703 | | { 0, |
704 | | 10, 11, 10, 12, 13, 14, 15, 16, 17, 10, |
705 | | 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, |
706 | | 25, 25, 25, 26, 27, 28, 29, 10, 30, 31, |
707 | | 32, 33, 10, 10, 34, 10, 35, 36, 10, 10, |
708 | | 10, 37, 38, 39, 10, 40, 10, 10, 10, 10, |
709 | | 10, 10, 10, 41, 42, 43, 44, 45, 46, 47, |
710 | | 48, 10, 10, 10, 10, 10, 10, 10, 10, 10, |
711 | | 49, 50, 51, 10, 52, 10, 10, 10, 10, 10, |
712 | | 10, 53, 54, 55, 56, 104, 105, 106, 107, 108, |
713 | | 109, 119, 216, 137, 138, 120, 139, 215, 121, 122, |
714 | | |
715 | | 123, 152, 214, 211, 153, 96, 101, 212, 57, 58, |
716 | | 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, |
717 | | 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, |
718 | | 79, 80, 97, 217, 81, 134, 140, 82, 208, 218, |
719 | | 83, 209, 141, 142, 84, 98, 85, 143, 99, 100, |
720 | | 135, 213, 86, 87, 88, 136, 89, 90, 111, 91, |
721 | | 144, 210, 112, 145, 146, 124, 113, 114, 125, 126, |
722 | | 127, 115, 116, 117, 118, 102, 128, 129, 130, 155, |
723 | | 131, 132, 207, 133, 147, 148, 149, 156, 219, 206, |
724 | | 205, 220, 160, 150, 157, 161, 151, 158, 159, 172, |
725 | | |
726 | | 154, 162, 163, 110, 165, 166, 164, 167, 168, 103, |
727 | | 173, 174, 169, 175, 102, 101, 95, 170, 171, 94, |
728 | | 221, 176, 93, 177, 93, 178, 92, 179, 180, 181, |
729 | | 182, 92, 96, 183, 184, 185, 186, 221, 221, 189, |
730 | | 190, 187, 191, 221, 192, 221, 193, 188, 221, 194, |
731 | | 195, 221, 221, 196, 197, 198, 199, 221, 200, 97, |
732 | | 221, 201, 202, 221, 203, 204, 221, 221, 221, 221, |
733 | | 221, 221, 98, 221, 221, 99, 100, 9, 221, 221, |
734 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
735 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
736 | | |
737 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
738 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
739 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
740 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
741 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
742 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
743 | | 221, 221 |
744 | | } ; |
745 | | |
746 | | static const flex_int16_t yy_chk[363] = |
747 | | { 0, |
748 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
749 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
750 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
751 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
752 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
753 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
754 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
755 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
756 | | 1, 1, 1, 1, 3, 44, 44, 44, 44, 44, |
757 | | 44, 58, 99, 61, 61, 58, 61, 98, 58, 58, |
758 | | |
759 | | 58, 65, 97, 87, 65, 30, 58, 87, 3, 3, |
760 | | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
761 | | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
762 | | 3, 3, 30, 100, 3, 60, 62, 3, 80, 100, |
763 | | 3, 80, 62, 62, 3, 30, 3, 62, 30, 30, |
764 | | 60, 88, 3, 3, 3, 60, 3, 3, 57, 3, |
765 | | 63, 82, 57, 63, 63, 59, 57, 57, 59, 59, |
766 | | 59, 57, 57, 57, 57, 59, 59, 59, 59, 67, |
767 | | 59, 59, 79, 59, 64, 64, 64, 67, 205, 78, |
768 | | 75, 205, 68, 64, 67, 68, 64, 67, 67, 70, |
769 | | |
770 | | 66, 68, 68, 56, 69, 69, 68, 69, 69, 42, |
771 | | 71, 71, 69, 71, 33, 32, 28, 69, 69, 21, |
772 | | 9, 71, 8, 71, 7, 71, 6, 71, 71, 72, |
773 | | 72, 5, 96, 72, 72, 72, 72, 0, 0, 73, |
774 | | 73, 72, 73, 0, 73, 0, 73, 72, 0, 73, |
775 | | 73, 0, 0, 73, 74, 74, 74, 0, 74, 96, |
776 | | 0, 74, 74, 0, 74, 74, 0, 0, 0, 0, |
777 | | 0, 0, 96, 0, 0, 96, 96, 221, 221, 221, |
778 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
779 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
780 | | |
781 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
782 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
783 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
784 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
785 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
786 | | 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, |
787 | | 221, 221 |
788 | | } ; |
789 | | |
790 | | /* The intent behind this definition is that it'll catch |
791 | | * any uses of REJECT which flex missed. |
792 | | */ |
793 | | #define REJECT reject_used_but_not_detected |
794 | | #define yymore() yymore_used_but_not_detected |
795 | 15.9M | #define YY_MORE_ADJ 0 |
796 | | #define YY_RESTORE_YY_MORE_OFFSET |
797 | | |
798 | | // |
799 | | // Copyright (C) 2003-2018 Greg Landrum and Rational Discovery LLC |
800 | | // |
801 | | // @@ All Rights Reserved @@ |
802 | | // |
803 | | |
804 | | #if defined(__CYGWIN__) && !defined(fileno) |
805 | | // -std=c++11 turns off recent posix features |
806 | | extern "C" int fileno(FILE*); |
807 | | #endif |
808 | | |
809 | | #include <cstdio> |
810 | | |
811 | | #include <RDGeneral/Exceptions.h> |
812 | | #include <GraphMol/RDKitBase.h> |
813 | | #include <GraphMol/RDKitQueries.h> |
814 | | |
815 | | #include <string> |
816 | | #include <cstring> |
817 | | #include "smarts.tab.hpp" |
818 | | |
819 | | using namespace RDKit; |
820 | | |
821 | | // This will be called every time we construct a token an will allow us to track |
822 | | // the position of the current token. |
823 | | #undef YY_USER_ACTION |
824 | 15.4M | #define YY_USER_ACTION current_token_position += yyleng; |
825 | | |
826 | 0 | #define YY_FATAL_ERROR(msg) smarts_lexer_error(msg) |
827 | | |
828 | 0 | void smarts_lexer_error(const char *msg) { |
829 | 0 | BOOST_LOG(rdErrorLog) << msg<<std::endl; |
830 | 0 | throw ValueErrorException(msg); |
831 | 0 | } |
832 | | |
833 | 25.1k | size_t setup_smarts_string(const std::string &text,yyscan_t yyscanner){ |
834 | | // YY_BUFFER_STATE buff=yysmarts__scan_string(text.c_str()+pos,yyscanner); |
835 | | // Faster implementation of yysmarts__scan_string that handles trimming |
836 | 25.1k | YY_BUFFER_STATE b; |
837 | 25.1k | char *buf; |
838 | 25.1k | yyconst char * yybytes = text.c_str(); |
839 | 25.1k | yy_size_t _yybytes_len=text.size(), n, start, end; |
840 | | /* Get memory for full buffer, including space for trailing EOB's. */ |
841 | 25.1k | n = _yybytes_len + 2; |
842 | 25.1k | buf = (char *) yysmarts_alloc(n ,yyscanner ); |
843 | 25.1k | if ( ! buf ) { |
844 | 0 | smarts_lexer_error( "out of dynamic memory in yysmarts__scan_bytes()" ); |
845 | 0 | } |
846 | | |
847 | | // ltrim |
848 | | |
849 | 48.9k | for(start = 0 ; start < _yybytes_len; ++start) { |
850 | 48.9k | if (yybytes[start] > 32) { break; } |
851 | 48.9k | } |
852 | 92.0k | for(end = _yybytes_len ; end > start; --end) { |
853 | 88.1k | if (yybytes[end] > 32) { break; } |
854 | 88.1k | } |
855 | | |
856 | 25.1k | _yybytes_len = end-start+1; |
857 | 25.1k | n = _yybytes_len + 2; |
858 | 25.1k | memcpy(buf, yybytes+start, _yybytes_len); |
859 | | |
860 | 25.1k | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
861 | | |
862 | 25.1k | b = yysmarts__scan_buffer(buf,n ,yyscanner); |
863 | 25.1k | if ( ! b ) { |
864 | 0 | smarts_lexer_error( "bad buffer in yysmarts__scan_bytes()" ); |
865 | 0 | } |
866 | | |
867 | | /* It's okay to grow etc. this buffer, and we should throw it |
868 | | * away when we're done. |
869 | | */ |
870 | 25.1k | b->yy_is_our_buffer = 1; |
871 | | |
872 | 25.1k | POSTCONDITION(b,"invalid buffer"); |
873 | 25.1k | return start; |
874 | | |
875 | 25.1k | } |
876 | | |
877 | | #define INITIAL 0 |
878 | 72.8k | #define IN_ATOM_STATE 1 |
879 | 1.34M | #define IN_BRANCH_STATE 2 |
880 | 41.4k | #define IN_RECURSION_STATE 3 |
881 | | |
882 | | #ifndef YY_NO_UNISTD_H |
883 | | /* Special case for "unistd.h", since it is non-ANSI. We include it way |
884 | | * down here because we want the user's section 1 to have been scanned first. |
885 | | * The user has a chance to override it with an option. |
886 | | */ |
887 | | #include <unistd.h> |
888 | | #endif |
889 | | |
890 | | #ifndef YY_EXTRA_TYPE |
891 | | #define YY_EXTRA_TYPE void * |
892 | | #endif |
893 | | |
894 | | /* Holds the entire state of the reentrant scanner. */ |
895 | | struct yyguts_t |
896 | | { |
897 | | |
898 | | /* User-defined. Not touched by flex. */ |
899 | | YY_EXTRA_TYPE yyextra_r; |
900 | | |
901 | | /* The rest are the same as the globals declared in the non-reentrant scanner. */ |
902 | | FILE *yyin_r, *yyout_r; |
903 | | size_t yy_buffer_stack_top; /**< index of top of stack. */ |
904 | | size_t yy_buffer_stack_max; /**< capacity of stack. */ |
905 | | YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ |
906 | | char yy_hold_char; |
907 | | int yy_n_chars; |
908 | | int yyleng_r; |
909 | | char *yy_c_buf_p; |
910 | | int yy_init; |
911 | | int yy_start; |
912 | | int yy_did_buffer_switch_on_eof; |
913 | | int yy_start_stack_ptr; |
914 | | int yy_start_stack_depth; |
915 | | int *yy_start_stack; |
916 | | yy_state_type yy_last_accepting_state; |
917 | | char* yy_last_accepting_cpos; |
918 | | |
919 | | int yylineno_r; |
920 | | int yy_flex_debug_r; |
921 | | |
922 | | char *yytext_r; |
923 | | int yy_more_flag; |
924 | | int yy_more_len; |
925 | | |
926 | | YYSTYPE * yylval_r; |
927 | | |
928 | | }; /* end struct yyguts_t */ |
929 | | |
930 | | static int yy_init_globals ( yyscan_t yyscanner ); |
931 | | |
932 | | /* This must go here because YYSTYPE and YYLTYPE are included |
933 | | * from bison output in section 1.*/ |
934 | 28.5M | # define yylval yyg->yylval_r |
935 | | |
936 | | int yylex_init (yyscan_t* scanner); |
937 | | |
938 | | int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); |
939 | | |
940 | | /* Accessor methods to globals. |
941 | | These are made visible to non-reentrant scanners for convenience. */ |
942 | | |
943 | | int yylex_destroy ( yyscan_t yyscanner ); |
944 | | |
945 | | int yyget_debug ( yyscan_t yyscanner ); |
946 | | |
947 | | void yyset_debug ( int debug_flag , yyscan_t yyscanner ); |
948 | | |
949 | | YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); |
950 | | |
951 | | void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); |
952 | | |
953 | | FILE *yyget_in ( yyscan_t yyscanner ); |
954 | | |
955 | | void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); |
956 | | |
957 | | FILE *yyget_out ( yyscan_t yyscanner ); |
958 | | |
959 | | void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); |
960 | | |
961 | | int yyget_leng ( yyscan_t yyscanner ); |
962 | | |
963 | | char *yyget_text ( yyscan_t yyscanner ); |
964 | | |
965 | | int yyget_lineno ( yyscan_t yyscanner ); |
966 | | |
967 | | void yyset_lineno ( int _line_number , yyscan_t yyscanner ); |
968 | | |
969 | | int yyget_column ( yyscan_t yyscanner ); |
970 | | |
971 | | void yyset_column ( int _column_no , yyscan_t yyscanner ); |
972 | | |
973 | | YYSTYPE * yyget_lval ( yyscan_t yyscanner ); |
974 | | |
975 | | void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); |
976 | | |
977 | | /* Macros after this point can all be overridden by user definitions in |
978 | | * section 1. |
979 | | */ |
980 | | |
981 | | #ifndef YY_SKIP_YYWRAP |
982 | | #ifdef __cplusplus |
983 | | extern "C" int yywrap ( yyscan_t yyscanner ); |
984 | | #else |
985 | | extern int yywrap ( yyscan_t yyscanner ); |
986 | | #endif |
987 | | #endif |
988 | | |
989 | | #ifndef YY_NO_UNPUT |
990 | | |
991 | | static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner); |
992 | | |
993 | | #endif |
994 | | |
995 | | #ifndef yytext_ptr |
996 | | static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); |
997 | | #endif |
998 | | |
999 | | #ifdef YY_NEED_STRLEN |
1000 | | static int yy_flex_strlen ( const char * , yyscan_t yyscanner); |
1001 | | #endif |
1002 | | |
1003 | | #ifndef YY_NO_INPUT |
1004 | | #ifdef __cplusplus |
1005 | | static int yyinput ( yyscan_t yyscanner ); |
1006 | | #else |
1007 | | static int input ( yyscan_t yyscanner ); |
1008 | | #endif |
1009 | | |
1010 | | #endif |
1011 | | |
1012 | | static void yy_push_state ( int _new_state , yyscan_t yyscanner); |
1013 | | |
1014 | | static void yy_pop_state ( yyscan_t yyscanner ); |
1015 | | |
1016 | | static int yy_top_state ( yyscan_t yyscanner ); |
1017 | | |
1018 | | /* Amount of stuff to slurp up with each read. */ |
1019 | | #ifndef YY_READ_BUF_SIZE |
1020 | | #ifdef __ia64__ |
1021 | | /* On IA-64, the buffer size is 16k, not 8k */ |
1022 | | #define YY_READ_BUF_SIZE 16384 |
1023 | | #else |
1024 | 0 | #define YY_READ_BUF_SIZE 8192 |
1025 | | #endif /* __ia64__ */ |
1026 | | #endif |
1027 | | |
1028 | | /* Copy whatever the last rule matched to the standard output. */ |
1029 | | #ifndef ECHO |
1030 | | /* This used to be an fputs(), but since the string might contain NUL's, |
1031 | | * we now use fwrite(). |
1032 | | */ |
1033 | | #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) |
1034 | | #endif |
1035 | | |
1036 | | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
1037 | | * is returned in "result". |
1038 | | */ |
1039 | | #ifndef YY_INPUT |
1040 | | #define YY_INPUT(buf,result,max_size) \ |
1041 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
1042 | 0 | { \ |
1043 | 0 | int c = '*'; \ |
1044 | 0 | int n; \ |
1045 | 0 | for ( n = 0; n < max_size && \ |
1046 | 0 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
1047 | 0 | buf[n] = (char) c; \ |
1048 | 0 | if ( c == '\n' ) \ |
1049 | 0 | buf[n++] = (char) c; \ |
1050 | 0 | if ( c == EOF && ferror( yyin ) ) \ |
1051 | 0 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
1052 | 0 | result = n; \ |
1053 | 0 | } \ |
1054 | 0 | else \ |
1055 | 0 | { \ |
1056 | 0 | errno=0; \ |
1057 | 0 | while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ |
1058 | 0 | { \ |
1059 | 0 | if( errno != EINTR) \ |
1060 | 0 | { \ |
1061 | 0 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
1062 | 0 | break; \ |
1063 | 0 | } \ |
1064 | 0 | errno=0; \ |
1065 | 0 | clearerr(yyin); \ |
1066 | 0 | } \ |
1067 | 0 | }\ |
1068 | | \ |
1069 | | |
1070 | | #endif |
1071 | | |
1072 | | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
1073 | | * we don't want an extra ';' after the "return" because that will cause |
1074 | | * some compilers to complain about unreachable statements. |
1075 | | */ |
1076 | | #ifndef yyterminate |
1077 | | #define yyterminate() return YY_NULL |
1078 | | #endif |
1079 | | |
1080 | | /* Number of entries by which start-condition stack grows. */ |
1081 | | #ifndef YY_START_STACK_INCR |
1082 | 52.9k | #define YY_START_STACK_INCR 25 |
1083 | | #endif |
1084 | | |
1085 | | /* Report a fatal error. */ |
1086 | | #ifndef YY_FATAL_ERROR |
1087 | | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) |
1088 | | #endif |
1089 | | |
1090 | | /* end tables serialization structures and prototypes */ |
1091 | | |
1092 | | /* Default declaration of generated scanner - a define so the user can |
1093 | | * easily add parameters. |
1094 | | */ |
1095 | | #ifndef YY_DECL |
1096 | | #define YY_DECL_IS_OURS 1 |
1097 | | |
1098 | | extern int yylex \ |
1099 | | (YYSTYPE * yylval_param , yyscan_t yyscanner); |
1100 | | |
1101 | | #define YY_DECL int yylex \ |
1102 | | (YYSTYPE * yylval_param , yyscan_t yyscanner) |
1103 | | #endif /* !YY_DECL */ |
1104 | | |
1105 | | /* Code executed at the beginning of each rule, after yytext and yyleng |
1106 | | * have been set up. |
1107 | | */ |
1108 | | #ifndef YY_USER_ACTION |
1109 | | #define YY_USER_ACTION |
1110 | | #endif |
1111 | | |
1112 | | /* Code executed at the end of each rule. */ |
1113 | | #ifndef YY_BREAK |
1114 | 0 | #define YY_BREAK /*LINTED*/break; |
1115 | | #endif |
1116 | | |
1117 | | #define YY_RULE_SETUP \ |
1118 | 15.4M | YY_USER_ACTION |
1119 | | |
1120 | | /** The main scanner function which does all the work. |
1121 | | */ |
1122 | | YY_DECL |
1123 | 15.4M | { |
1124 | 15.4M | yy_state_type yy_current_state; |
1125 | 15.4M | char *yy_cp, *yy_bp; |
1126 | 15.4M | int yy_act; |
1127 | 15.4M | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
1128 | | |
1129 | 15.4M | yylval = yylval_param; |
1130 | | |
1131 | 15.4M | if ( !yyg->yy_init ) |
1132 | 25.1k | { |
1133 | 25.1k | yyg->yy_init = 1; |
1134 | | |
1135 | | #ifdef YY_USER_INIT |
1136 | | YY_USER_INIT; |
1137 | | #endif |
1138 | | |
1139 | 25.1k | if ( ! yyg->yy_start ) |
1140 | 25.1k | yyg->yy_start = 1; /* first start state */ |
1141 | | |
1142 | 25.1k | if ( ! yyin ) |
1143 | 25.1k | yyin = stdin; |
1144 | | |
1145 | 25.1k | if ( ! yyout ) |
1146 | 25.1k | yyout = stdout; |
1147 | | |
1148 | 25.1k | if ( ! YY_CURRENT_BUFFER ) { |
1149 | 0 | yyensure_buffer_stack (yyscanner); |
1150 | 0 | YY_CURRENT_BUFFER_LVALUE = |
1151 | 0 | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
1152 | 0 | } |
1153 | | |
1154 | 25.1k | yy_load_buffer_state( yyscanner ); |
1155 | 25.1k | } |
1156 | | |
1157 | 15.4M | { |
1158 | | |
1159 | 15.4M | if (start_token) |
1160 | 25.1k | { |
1161 | 25.1k | int t = start_token; |
1162 | 25.1k | start_token = 0; |
1163 | 25.1k | return t; |
1164 | 25.1k | } |
1165 | | |
1166 | 15.4M | while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ |
1167 | 15.4M | { |
1168 | 15.4M | yy_cp = yyg->yy_c_buf_p; |
1169 | | |
1170 | | /* Support of yytext. */ |
1171 | 15.4M | *yy_cp = yyg->yy_hold_char; |
1172 | | |
1173 | | /* yy_bp points to the position in yy_ch_buf of the start of |
1174 | | * the current run. |
1175 | | */ |
1176 | 15.4M | yy_bp = yy_cp; |
1177 | | |
1178 | 15.4M | yy_current_state = yyg->yy_start; |
1179 | 19.4M | yy_match: |
1180 | 19.4M | do |
1181 | 39.0M | { |
1182 | 39.0M | YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; |
1183 | 39.0M | if ( yy_accept[yy_current_state] ) |
1184 | 23.6M | { |
1185 | 23.6M | yyg->yy_last_accepting_state = yy_current_state; |
1186 | 23.6M | yyg->yy_last_accepting_cpos = yy_cp; |
1187 | 23.6M | } |
1188 | 71.1M | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
1189 | 32.0M | { |
1190 | 32.0M | yy_current_state = (int) yy_def[yy_current_state]; |
1191 | 32.0M | if ( yy_current_state >= 222 ) |
1192 | 0 | yy_c = yy_meta[yy_c]; |
1193 | 32.0M | } |
1194 | 39.0M | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
1195 | 39.0M | ++yy_cp; |
1196 | 39.0M | } |
1197 | 39.0M | while ( yy_current_state != 221 ); |
1198 | 19.4M | yy_cp = yyg->yy_last_accepting_cpos; |
1199 | 19.4M | yy_current_state = yyg->yy_last_accepting_state; |
1200 | | |
1201 | 23.3M | yy_find_action: |
1202 | 23.3M | yy_act = yy_accept[yy_current_state]; |
1203 | | |
1204 | 23.3M | YY_DO_BEFORE_ACTION; |
1205 | | |
1206 | 23.4M | do_action: /* This label is used only to access EOF actions. */ |
1207 | | |
1208 | 23.4M | switch ( yy_act ) |
1209 | 23.4M | { /* beginning of action switch */ |
1210 | 125 | case 0: /* must back up */ |
1211 | | /* undo the effects of YY_DO_BEFORE_ACTION */ |
1212 | 125 | *yy_cp = yyg->yy_hold_char; |
1213 | 125 | yy_cp = yyg->yy_last_accepting_cpos; |
1214 | 125 | yy_current_state = yyg->yy_last_accepting_state; |
1215 | 125 | goto yy_find_action; |
1216 | | |
1217 | 1.42k | case 1: |
1218 | 1.42k | YY_RULE_SETUP |
1219 | 1.42k | { yylval->chiraltype = Atom::ChiralType::CHI_TETRAHEDRAL; return CHI_CLASS_TOKEN; } |
1220 | 0 | YY_BREAK |
1221 | 210 | case 2: |
1222 | 210 | YY_RULE_SETUP |
1223 | 210 | { yylval->chiraltype = Atom::ChiralType::CHI_ALLENE; return CHI_CLASS_TOKEN; } |
1224 | 0 | YY_BREAK |
1225 | 1.80k | case 3: |
1226 | 1.80k | YY_RULE_SETUP |
1227 | 1.80k | { yylval->chiraltype = Atom::ChiralType::CHI_SQUAREPLANAR; return CHI_CLASS_TOKEN; } |
1228 | 0 | YY_BREAK |
1229 | 300 | case 4: |
1230 | 300 | YY_RULE_SETUP |
1231 | 300 | { yylval->chiraltype = Atom::ChiralType::CHI_TRIGONALBIPYRAMIDAL; return CHI_CLASS_TOKEN; } |
1232 | 0 | YY_BREAK |
1233 | 1.31k | case 5: |
1234 | 1.31k | YY_RULE_SETUP |
1235 | 1.31k | { yylval->chiraltype = Atom::ChiralType::CHI_OCTAHEDRAL; return CHI_CLASS_TOKEN; } |
1236 | 0 | YY_BREAK |
1237 | 93.1k | case 6: |
1238 | 93.1k | YY_RULE_SETUP |
1239 | 93.1k | { return AT_TOKEN; } |
1240 | 0 | YY_BREAK |
1241 | 945 | case 7: |
1242 | 1.22k | case 8: |
1243 | 3.23k | case 9: |
1244 | 4.73k | case 10: |
1245 | 5.84k | case 11: |
1246 | 6.41k | case 12: |
1247 | 7.17k | case 13: |
1248 | 9.03k | case 14: |
1249 | 10.7k | case 15: |
1250 | 15.8k | case 16: |
1251 | 19.0k | case 17: |
1252 | 21.1k | case 18: |
1253 | 24.2k | case 19: |
1254 | 31.4k | case 20: |
1255 | 32.4k | case 21: |
1256 | 34.3k | case 22: |
1257 | 36.8k | case 23: |
1258 | 37.3k | case 24: |
1259 | 38.3k | case 25: |
1260 | 40.2k | case 26: |
1261 | 41.1k | case 27: |
1262 | 43.1k | case 28: |
1263 | 44.2k | case 29: |
1264 | 44.7k | case 30: |
1265 | 47.3k | case 31: |
1266 | 49.1k | case 32: |
1267 | 50.1k | case 33: |
1268 | 51.0k | case 34: |
1269 | 57.8k | case 35: |
1270 | 57.9k | case 36: |
1271 | 60.1k | case 37: |
1272 | 60.5k | case 38: |
1273 | 62.1k | case 39: |
1274 | 62.8k | case 40: |
1275 | 62.9k | case 41: |
1276 | 64.7k | case 42: |
1277 | 65.1k | case 43: |
1278 | 73.9k | case 44: |
1279 | 75.9k | case 45: |
1280 | 76.6k | case 46: |
1281 | 77.2k | case 47: |
1282 | 79.1k | case 48: |
1283 | 79.4k | case 49: |
1284 | 79.8k | case 50: |
1285 | 83.3k | case 51: |
1286 | 83.7k | case 52: |
1287 | 86.8k | case 53: |
1288 | 86.9k | case 54: |
1289 | 87.7k | case 55: |
1290 | 88.6k | case 56: |
1291 | 90.9k | case 57: |
1292 | 91.8k | case 58: |
1293 | 97.0k | case 59: |
1294 | 98.0k | case 60: |
1295 | 98.1k | case 61: |
1296 | 99.7k | case 62: |
1297 | 100k | case 63: |
1298 | 103k | case 64: |
1299 | 103k | case 65: |
1300 | 104k | case 66: |
1301 | 105k | case 67: |
1302 | 109k | case 68: |
1303 | 110k | case 69: |
1304 | 113k | case 70: |
1305 | 114k | case 71: |
1306 | 114k | case 72: |
1307 | 115k | case 73: |
1308 | 116k | case 74: |
1309 | 117k | case 75: |
1310 | 120k | case 76: |
1311 | 121k | case 77: |
1312 | 122k | case 78: |
1313 | 123k | case 79: |
1314 | 124k | case 80: |
1315 | 125k | case 81: |
1316 | 125k | case 82: |
1317 | 126k | case 83: |
1318 | 128k | case 84: |
1319 | 129k | case 85: |
1320 | 129k | case 86: |
1321 | 142k | case 87: |
1322 | 143k | case 88: |
1323 | 143k | case 89: |
1324 | 144k | case 90: |
1325 | 144k | case 91: |
1326 | 149k | case 92: |
1327 | 150k | case 93: |
1328 | 151k | case 94: |
1329 | 151k | case 95: |
1330 | 152k | case 96: |
1331 | 154k | case 97: |
1332 | 154k | case 98: |
1333 | 155k | case 99: |
1334 | 155k | case 100: |
1335 | 160k | case 101: |
1336 | 161k | case 102: |
1337 | 162k | case 103: |
1338 | 165k | case 104: |
1339 | 166k | case 105: |
1340 | 167k | case 106: |
1341 | 168k | case 107: |
1342 | 168k | case 108: |
1343 | 168k | case 109: |
1344 | 170k | case 110: |
1345 | 170k | case 111: |
1346 | 170k | YY_RULE_SETUP |
1347 | 170k | { yylval->atom = new QueryAtom( PeriodicTable::getTable()->getAtomicNumber( yytext ) ); |
1348 | 170k | return ATOM_TOKEN; |
1349 | 170k | } |
1350 | 0 | YY_BREAK |
1351 | 17.2k | case 112: |
1352 | 17.2k | YY_RULE_SETUP |
1353 | 17.2k | { |
1354 | 17.2k | yylval->atom = new QueryAtom(); |
1355 | 17.2k | yylval->atom->setQuery(makeAtomExplicitDegreeQuery(1)); |
1356 | 17.2k | return COMPLEX_ATOM_QUERY_TOKEN; |
1357 | 170k | } |
1358 | 0 | YY_BREAK |
1359 | 31.3k | case 113: |
1360 | 31.3k | YY_RULE_SETUP |
1361 | 31.3k | { |
1362 | 31.3k | yylval->atom = new QueryAtom(); |
1363 | 31.3k | yylval->atom->setQuery(makeAtomNonHydrogenDegreeQuery(1)); |
1364 | 31.3k | return COMPLEX_ATOM_QUERY_TOKEN; |
1365 | 170k | } |
1366 | 0 | YY_BREAK |
1367 | 44.8k | case 114: |
1368 | 44.8k | YY_RULE_SETUP |
1369 | 44.8k | { |
1370 | 44.8k | yylval->atom = new QueryAtom(); |
1371 | 44.8k | yylval->atom->setQuery(makeAtomTotalDegreeQuery(1)); |
1372 | 44.8k | return COMPLEX_ATOM_QUERY_TOKEN; |
1373 | 170k | } |
1374 | 0 | YY_BREAK |
1375 | 6.55k | case 115: |
1376 | 6.55k | YY_RULE_SETUP |
1377 | 6.55k | { |
1378 | 6.55k | yylval->atom = new QueryAtom(); |
1379 | 6.55k | yylval->atom->setQuery(makeAtomHasRingBondQuery()); |
1380 | 6.55k | return RINGBOND_ATOM_QUERY_TOKEN; |
1381 | 170k | } |
1382 | 0 | YY_BREAK |
1383 | 942 | case 116: |
1384 | 942 | YY_RULE_SETUP |
1385 | 942 | { |
1386 | 942 | yylval->atom = new QueryAtom(); |
1387 | 942 | yylval->atom->setQuery(makeAtomTotalValenceQuery(1)); |
1388 | 942 | return COMPLEX_ATOM_QUERY_TOKEN; |
1389 | 170k | } |
1390 | 0 | YY_BREAK |
1391 | 9.41k | case 117: |
1392 | 9.41k | YY_RULE_SETUP |
1393 | 9.41k | { |
1394 | 9.41k | yylval->atom = new QueryAtom(); |
1395 | 9.41k | yylval->atom->setQuery(makeAtomHasHeteroatomNbrsQuery()); |
1396 | 9.41k | return HETERONEIGHBOR_ATOM_QUERY_TOKEN; |
1397 | 170k | } |
1398 | 0 | YY_BREAK |
1399 | 50.7k | case 118: |
1400 | 50.7k | YY_RULE_SETUP |
1401 | 50.7k | { |
1402 | 50.7k | yylval->atom = new QueryAtom(); |
1403 | 50.7k | yylval->atom->setQuery(makeAtomHasAliphaticHeteroatomNbrsQuery()); |
1404 | 50.7k | return ALIPHATICHETERONEIGHBOR_ATOM_QUERY_TOKEN; |
1405 | 170k | } |
1406 | 0 | YY_BREAK |
1407 | 3.73k | case 119: |
1408 | 3.73k | YY_RULE_SETUP |
1409 | 3.73k | { |
1410 | 3.73k | yylval->atom = new QueryAtom(); |
1411 | 3.73k | yylval->atom->setQuery(makeAtomHasImplicitHQuery()); |
1412 | 3.73k | return IMPLICIT_H_ATOM_QUERY_TOKEN; |
1413 | 170k | } |
1414 | 0 | YY_BREAK |
1415 | 14.8k | case 120: |
1416 | 14.8k | YY_RULE_SETUP |
1417 | 14.8k | { |
1418 | 14.8k | yylval->atom = new QueryAtom(); |
1419 | 14.8k | yylval->atom->setQuery(new AtomRingQuery(-1)); |
1420 | 14.8k | return COMPLEX_ATOM_QUERY_TOKEN; |
1421 | 170k | } |
1422 | 0 | YY_BREAK |
1423 | 15.6k | case 121: |
1424 | 15.6k | YY_RULE_SETUP |
1425 | 15.6k | { |
1426 | 15.6k | yylval->atom = new QueryAtom(); |
1427 | 15.6k | yylval->atom->setQuery(makeAtomInRingQuery()); |
1428 | 15.6k | return MIN_RINGSIZE_ATOM_QUERY_TOKEN; |
1429 | 170k | } |
1430 | 0 | YY_BREAK |
1431 | 7.44k | case 122: |
1432 | 7.44k | YY_RULE_SETUP |
1433 | 7.44k | { |
1434 | 7.44k | yylval->atom = new QueryAtom(); |
1435 | 7.44k | yylval->atom->setQuery(makeAtomInRingQuery()); |
1436 | 7.44k | return RINGSIZE_ATOM_QUERY_TOKEN; |
1437 | 170k | } |
1438 | 0 | YY_BREAK |
1439 | 301k | case 123: |
1440 | 301k | YY_RULE_SETUP |
1441 | 301k | { return H_TOKEN; } |
1442 | 0 | YY_BREAK |
1443 | 24.3k | case 124: |
1444 | 24.3k | YY_RULE_SETUP |
1445 | 24.3k | { yylval->ival = 5; return ORGANIC_ATOM_TOKEN; } |
1446 | 0 | YY_BREAK |
1447 | 84.1k | case 125: |
1448 | 84.1k | YY_RULE_SETUP |
1449 | 84.1k | { yylval->ival = 6; return ORGANIC_ATOM_TOKEN; } |
1450 | 0 | YY_BREAK |
1451 | 31.7k | case 126: |
1452 | 31.7k | YY_RULE_SETUP |
1453 | 31.7k | { yylval->ival = 7; return ORGANIC_ATOM_TOKEN; } |
1454 | 0 | YY_BREAK |
1455 | 23.7k | case 127: |
1456 | 23.7k | YY_RULE_SETUP |
1457 | 23.7k | { yylval->ival = 8; return ORGANIC_ATOM_TOKEN; } |
1458 | 0 | YY_BREAK |
1459 | 6.96k | case 128: |
1460 | 6.96k | YY_RULE_SETUP |
1461 | 6.96k | { yylval->ival = 9; return ORGANIC_ATOM_TOKEN; } |
1462 | 0 | YY_BREAK |
1463 | 45.3k | case 129: |
1464 | 45.3k | YY_RULE_SETUP |
1465 | 45.3k | { yylval->ival = 15; return ORGANIC_ATOM_TOKEN; } |
1466 | 0 | YY_BREAK |
1467 | 78.6k | case 130: |
1468 | 78.6k | YY_RULE_SETUP |
1469 | 78.6k | { yylval->ival = 16; return ORGANIC_ATOM_TOKEN; } |
1470 | 0 | YY_BREAK |
1471 | 1.50k | case 131: |
1472 | 1.50k | YY_RULE_SETUP |
1473 | 1.50k | { yylval->ival = 17; return ORGANIC_ATOM_TOKEN; } |
1474 | 0 | YY_BREAK |
1475 | 1.53k | case 132: |
1476 | 1.53k | YY_RULE_SETUP |
1477 | 1.53k | { yylval->ival = 35; return ORGANIC_ATOM_TOKEN; } |
1478 | 0 | YY_BREAK |
1479 | 18.9k | case 133: |
1480 | 18.9k | YY_RULE_SETUP |
1481 | 18.9k | { yylval->ival = 53; return ORGANIC_ATOM_TOKEN; } |
1482 | 0 | YY_BREAK |
1483 | 12.1k | case 134: |
1484 | 12.1k | YY_RULE_SETUP |
1485 | 12.1k | { yylval->ival = 5; return AROMATIC_ATOM_TOKEN; } |
1486 | 0 | YY_BREAK |
1487 | 70.8k | case 135: |
1488 | 70.8k | YY_RULE_SETUP |
1489 | 70.8k | { yylval->ival = 6; return AROMATIC_ATOM_TOKEN; } |
1490 | 0 | YY_BREAK |
1491 | 15.8k | case 136: |
1492 | 15.8k | YY_RULE_SETUP |
1493 | 15.8k | { yylval->ival = 7; return AROMATIC_ATOM_TOKEN; } |
1494 | 0 | YY_BREAK |
1495 | 88.7k | case 137: |
1496 | 88.7k | YY_RULE_SETUP |
1497 | 88.7k | { yylval->ival = 8; return AROMATIC_ATOM_TOKEN; } |
1498 | 0 | YY_BREAK |
1499 | 36.2k | case 138: |
1500 | 36.2k | YY_RULE_SETUP |
1501 | 36.2k | { yylval->ival = 15; return AROMATIC_ATOM_TOKEN; } |
1502 | 0 | YY_BREAK |
1503 | 12.5k | case 139: |
1504 | 12.5k | YY_RULE_SETUP |
1505 | 12.5k | { yylval->ival = 16; return AROMATIC_ATOM_TOKEN; } |
1506 | 0 | YY_BREAK |
1507 | 2.45k | case 140: |
1508 | 2.45k | YY_RULE_SETUP |
1509 | 2.45k | { yylval->ival = 14; return AROMATIC_ATOM_TOKEN; } |
1510 | 0 | YY_BREAK |
1511 | 252 | case 141: |
1512 | 252 | YY_RULE_SETUP |
1513 | 252 | { yylval->ival = 33; return AROMATIC_ATOM_TOKEN; } |
1514 | 0 | YY_BREAK |
1515 | 683 | case 142: |
1516 | 683 | YY_RULE_SETUP |
1517 | 683 | { yylval->ival = 34; return AROMATIC_ATOM_TOKEN; } |
1518 | 0 | YY_BREAK |
1519 | 325 | case 143: |
1520 | 325 | YY_RULE_SETUP |
1521 | 325 | { yylval->ival = 52; return AROMATIC_ATOM_TOKEN; } |
1522 | 0 | YY_BREAK |
1523 | 72.7k | case 144: |
1524 | 72.7k | YY_RULE_SETUP |
1525 | 72.7k | { |
1526 | 72.7k | yylval->atom = new QueryAtom(); |
1527 | 72.7k | yylval->atom->setQuery(makeAtomNullQuery()); |
1528 | 72.7k | return SIMPLE_ATOM_QUERY_TOKEN; |
1529 | 170k | } |
1530 | 0 | YY_BREAK |
1531 | 2.34M | case 145: |
1532 | 2.34M | YY_RULE_SETUP |
1533 | 2.34M | { |
1534 | 2.34M | yylval->atom = new QueryAtom(); |
1535 | 2.34M | yylval->atom->setQuery(makeAtomAromaticQuery()); |
1536 | 2.34M | yylval->atom->setIsAromatic(true); |
1537 | 2.34M | return SIMPLE_ATOM_QUERY_TOKEN; |
1538 | 170k | } |
1539 | 0 | YY_BREAK |
1540 | 33.4k | case 146: |
1541 | 33.4k | YY_RULE_SETUP |
1542 | 33.4k | { |
1543 | 33.4k | yylval->atom = new QueryAtom(); |
1544 | 33.4k | yylval->atom->setQuery(makeAtomAliphaticQuery()); |
1545 | 33.4k | return SIMPLE_ATOM_QUERY_TOKEN; |
1546 | 170k | } |
1547 | 0 | YY_BREAK |
1548 | 30.8k | case 147: |
1549 | 30.8k | YY_RULE_SETUP |
1550 | 30.8k | { return COLON_TOKEN; } |
1551 | 0 | YY_BREAK |
1552 | 358k | case 148: |
1553 | 358k | YY_RULE_SETUP |
1554 | 358k | { return UNDERSCORE_TOKEN; } |
1555 | 0 | YY_BREAK |
1556 | 9.32k | case 149: |
1557 | 9.32k | YY_RULE_SETUP |
1558 | 9.32k | { return HASH_TOKEN; } |
1559 | 0 | YY_BREAK |
1560 | 22.0k | case 150: |
1561 | 22.0k | YY_RULE_SETUP |
1562 | 22.0k | { yylval->bond = new QueryBond(Bond::DOUBLE); |
1563 | 22.0k | yylval->bond->setQuery(makeBondOrderEqualsQuery(Bond::DOUBLE)); |
1564 | 22.0k | return BOND_TOKEN; } |
1565 | 0 | YY_BREAK |
1566 | 29.5k | case 151: |
1567 | 29.5k | YY_RULE_SETUP |
1568 | 29.5k | { yylval->bond = new QueryBond(); |
1569 | 29.5k | yylval->bond->setQuery(makeBondNullQuery()); |
1570 | 29.5k | return BOND_TOKEN; } |
1571 | 0 | YY_BREAK |
1572 | 1.29M | case 152: |
1573 | 1.29M | YY_RULE_SETUP |
1574 | 1.29M | { yylval->bond = new QueryBond(Bond::QUADRUPLE); |
1575 | 1.29M | yylval->bond->setQuery(makeBondOrderEqualsQuery(Bond::QUADRUPLE)); |
1576 | 1.29M | return BOND_TOKEN; } |
1577 | 0 | YY_BREAK |
1578 | 5.09k | case 153: |
1579 | 5.09k | YY_RULE_SETUP |
1580 | 5.09k | { yylval->bond = new QueryBond(Bond::SINGLE); |
1581 | 5.09k | yylval->bond->setBondDir(Bond::ENDDOWNRIGHT); |
1582 | 5.09k | yylval->bond->setQuery(makeSingleOrAromaticBondQuery()); |
1583 | 5.09k | return BOND_TOKEN; } |
1584 | 0 | YY_BREAK |
1585 | 12.6k | case 154: |
1586 | 12.6k | YY_RULE_SETUP |
1587 | 12.6k | { yylval->bond = new QueryBond(Bond::SINGLE); |
1588 | 12.6k | yylval->bond->setBondDir(Bond::ENDUPRIGHT); |
1589 | 12.6k | yylval->bond->setQuery(makeSingleOrAromaticBondQuery()); |
1590 | 12.6k | return BOND_TOKEN; } |
1591 | 0 | YY_BREAK |
1592 | 8.91k | case 155: |
1593 | 8.91k | YY_RULE_SETUP |
1594 | 8.91k | { |
1595 | 8.91k | yylval->bond = new QueryBond(Bond::DATIVER); |
1596 | 8.91k | return BOND_TOKEN; |
1597 | 170k | } |
1598 | 0 | YY_BREAK |
1599 | 5.89k | case 156: |
1600 | 5.89k | YY_RULE_SETUP |
1601 | 5.89k | { |
1602 | 5.89k | yylval->bond = new QueryBond(Bond::DATIVEL); |
1603 | 5.89k | return BOND_TOKEN; |
1604 | 170k | } |
1605 | 0 | YY_BREAK |
1606 | 56.7k | case 157: |
1607 | 56.7k | YY_RULE_SETUP |
1608 | 56.7k | { return MINUS_TOKEN; } |
1609 | 0 | YY_BREAK |
1610 | 28.8k | case 158: |
1611 | 28.8k | YY_RULE_SETUP |
1612 | 28.8k | { return PLUS_TOKEN; } |
1613 | 0 | YY_BREAK |
1614 | 41.4k | case 159: |
1615 | 41.4k | YY_RULE_SETUP |
1616 | 41.4k | { yy_push_state(IN_RECURSION_STATE,yyscanner); return BEGIN_RECURSE; } |
1617 | 0 | YY_BREAK |
1618 | 1.34M | case 160: |
1619 | 1.34M | YY_RULE_SETUP |
1620 | 1.34M | { yy_push_state(IN_BRANCH_STATE,yyscanner); return GROUP_OPEN_TOKEN; } |
1621 | 0 | YY_BREAK |
1622 | 395k | case 161: |
1623 | 395k | YY_RULE_SETUP |
1624 | 395k | { yy_pop_state(yyscanner); return GROUP_CLOSE_TOKEN; } |
1625 | 0 | YY_BREAK |
1626 | 3.26k | case 162: |
1627 | 3.26k | YY_RULE_SETUP |
1628 | 3.26k | { yy_pop_state(yyscanner); return END_RECURSE; } |
1629 | 0 | YY_BREAK |
1630 | 4.15k | case 163: |
1631 | 4.15k | YY_RULE_SETUP |
1632 | 4.15k | { return RANGE_OPEN_TOKEN; } |
1633 | 0 | YY_BREAK |
1634 | 2.73k | case 164: |
1635 | 2.73k | YY_RULE_SETUP |
1636 | 2.73k | { return RANGE_CLOSE_TOKEN; } |
1637 | 0 | YY_BREAK |
1638 | 72.8k | case 165: |
1639 | 72.8k | YY_RULE_SETUP |
1640 | 72.8k | { yy_push_state(IN_ATOM_STATE,yyscanner); return ATOM_OPEN_TOKEN; } |
1641 | 0 | YY_BREAK |
1642 | 26.0k | case 166: |
1643 | 26.0k | YY_RULE_SETUP |
1644 | 26.0k | { yy_pop_state(yyscanner); return ATOM_CLOSE_TOKEN; } |
1645 | 0 | YY_BREAK |
1646 | 843 | case 167: |
1647 | 843 | YY_RULE_SETUP |
1648 | 843 | { /* FIX: ??? |
1649 | | This rule is here because otherwise recursive SMARTS queries like: |
1650 | | [$(C(=O)[O,N])] lex improperly (no ATOM_CLOSE token is returned). |
1651 | | I am not 100% sure that the approach we're using here will work |
1652 | | all the time, but I'm hoping that any problems caused here in |
1653 | | the lexer will get caught in the parser. |
1654 | | */ |
1655 | 843 | return ATOM_CLOSE_TOKEN; } |
1656 | 0 | YY_BREAK |
1657 | 275k | case 168: |
1658 | 275k | YY_RULE_SETUP |
1659 | 275k | { return SEPARATOR_TOKEN; } |
1660 | 0 | YY_BREAK |
1661 | 6.91k | case 169: |
1662 | 6.91k | YY_RULE_SETUP |
1663 | 6.91k | { return PERCENT_TOKEN; } |
1664 | 0 | YY_BREAK |
1665 | 285k | case 170: |
1666 | 285k | YY_RULE_SETUP |
1667 | 285k | { yylval->ival = 0; return ZERO_TOKEN; } |
1668 | 0 | YY_BREAK |
1669 | 1.58M | case 171: |
1670 | 1.58M | YY_RULE_SETUP |
1671 | 1.58M | { yylval->ival = yytext[0]-'0'; return NONZERO_DIGIT_TOKEN; } |
1672 | 0 | YY_BREAK |
1673 | 58.8k | case 172: |
1674 | 58.8k | YY_RULE_SETUP |
1675 | 58.8k | { return NOT_TOKEN; } |
1676 | 0 | YY_BREAK |
1677 | 22.6k | case 173: |
1678 | 22.6k | YY_RULE_SETUP |
1679 | 22.6k | { return SEMI_TOKEN; } |
1680 | 0 | YY_BREAK |
1681 | 16.0k | case 174: |
1682 | 16.0k | YY_RULE_SETUP |
1683 | 16.0k | { return AND_TOKEN; } |
1684 | 0 | YY_BREAK |
1685 | 71.4k | case 175: |
1686 | 71.4k | YY_RULE_SETUP |
1687 | 71.4k | { return OR_TOKEN; } |
1688 | 0 | YY_BREAK |
1689 | 111 | case 176: |
1690 | 111 | YY_RULE_SETUP |
1691 | 111 | { |
1692 | 111 | yylval->atom = new QueryAtom(); |
1693 | 111 | yylval->atom->setQuery(makeAtomHybridizationQuery(Atom::S)); |
1694 | 111 | return HYB_TOKEN; |
1695 | 170k | } |
1696 | 0 | YY_BREAK |
1697 | 206 | case 177: |
1698 | 206 | YY_RULE_SETUP |
1699 | 206 | { |
1700 | 206 | yylval->atom = new QueryAtom(); |
1701 | 206 | yylval->atom->setQuery(makeAtomHybridizationQuery(Atom::SP)); |
1702 | 206 | return HYB_TOKEN; |
1703 | 170k | } |
1704 | 0 | YY_BREAK |
1705 | 4.26k | case 178: |
1706 | 4.26k | YY_RULE_SETUP |
1707 | 4.26k | { |
1708 | 4.26k | yylval->atom = new QueryAtom(); |
1709 | 4.26k | yylval->atom->setQuery(makeAtomHybridizationQuery(Atom::SP2)); |
1710 | 4.26k | return HYB_TOKEN; |
1711 | 170k | } |
1712 | 0 | YY_BREAK |
1713 | 19.7k | case 179: |
1714 | 19.7k | YY_RULE_SETUP |
1715 | 19.7k | { |
1716 | 19.7k | yylval->atom = new QueryAtom(); |
1717 | 19.7k | yylval->atom->setQuery(makeAtomHybridizationQuery(Atom::SP3)); |
1718 | 19.7k | return HYB_TOKEN; |
1719 | 170k | } |
1720 | 0 | YY_BREAK |
1721 | 380 | case 180: |
1722 | 380 | YY_RULE_SETUP |
1723 | 380 | { |
1724 | 380 | yylval->atom = new QueryAtom(); |
1725 | 380 | yylval->atom->setQuery(makeAtomHybridizationQuery(Atom::SP3D)); |
1726 | 380 | return HYB_TOKEN; |
1727 | 170k | } |
1728 | 0 | YY_BREAK |
1729 | 351 | case 181: |
1730 | 351 | YY_RULE_SETUP |
1731 | 351 | { |
1732 | 351 | yylval->atom = new QueryAtom(); |
1733 | 351 | yylval->atom->setQuery(makeAtomHybridizationQuery(Atom::SP3D2)); |
1734 | 351 | return HYB_TOKEN; |
1735 | 170k | } |
1736 | 0 | YY_BREAK |
1737 | 0 | case 182: |
1738 | | /* rule 182 can match eol */ |
1739 | 0 | YY_RULE_SETUP |
1740 | 0 | return EOS_TOKEN; |
1741 | 0 | YY_BREAK |
1742 | 23.5k | case YY_STATE_EOF(INITIAL): |
1743 | 24.7k | case YY_STATE_EOF(IN_ATOM_STATE): |
1744 | 24.9k | case YY_STATE_EOF(IN_BRANCH_STATE): |
1745 | 24.9k | case YY_STATE_EOF(IN_RECURSION_STATE): |
1746 | 24.9k | { return EOS_TOKEN; } |
1747 | 0 | YY_BREAK |
1748 | 5.55M | case 183: |
1749 | 5.55M | YY_RULE_SETUP |
1750 | 5.55M | return BAD_CHARACTER; |
1751 | 0 | YY_BREAK |
1752 | 0 | case 184: |
1753 | 0 | YY_RULE_SETUP |
1754 | 0 | YY_FATAL_ERROR( "flex scanner jammed" ); |
1755 | 0 | YY_BREAK |
1756 | | |
1757 | 7.94M | case YY_END_OF_BUFFER: |
1758 | 7.94M | { |
1759 | | /* Amount of text matched not including the EOB char. */ |
1760 | 7.94M | int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; |
1761 | | |
1762 | | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
1763 | 7.94M | *yy_cp = yyg->yy_hold_char; |
1764 | 7.94M | YY_RESTORE_YY_MORE_OFFSET |
1765 | | |
1766 | 7.94M | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) |
1767 | 24.9k | { |
1768 | | /* We're scanning a new file or input source. It's |
1769 | | * possible that this happened because the user |
1770 | | * just pointed yyin at a new source and called |
1771 | | * yylex(). If so, then we have to assure |
1772 | | * consistency between YY_CURRENT_BUFFER and our |
1773 | | * globals. Here is the right place to do so, because |
1774 | | * this is the first action (other than possibly a |
1775 | | * back-up) that will match for the new input source. |
1776 | | */ |
1777 | 24.9k | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
1778 | 24.9k | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; |
1779 | 24.9k | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; |
1780 | 24.9k | } |
1781 | | |
1782 | | /* Note that here we test for yy_c_buf_p "<=" to the position |
1783 | | * of the first EOB in the buffer, since yy_c_buf_p will |
1784 | | * already have been incremented past the NUL character |
1785 | | * (since all states make transitions on EOB to the |
1786 | | * end-of-buffer state). Contrast this with the test |
1787 | | * in input(). |
1788 | | */ |
1789 | 7.94M | if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) |
1790 | 7.89M | { /* This was really a NUL. */ |
1791 | 7.89M | yy_state_type yy_next_state; |
1792 | | |
1793 | 7.89M | yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; |
1794 | | |
1795 | 7.89M | yy_current_state = yy_get_previous_state( yyscanner ); |
1796 | | |
1797 | | /* Okay, we're now positioned to make the NUL |
1798 | | * transition. We couldn't have |
1799 | | * yy_get_previous_state() go ahead and do it |
1800 | | * for us because it doesn't know how to deal |
1801 | | * with the possibility of jamming (and we don't |
1802 | | * want to build jamming into it because then it |
1803 | | * will run more slowly). |
1804 | | */ |
1805 | | |
1806 | 7.89M | yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); |
1807 | | |
1808 | 7.89M | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
1809 | | |
1810 | 7.89M | if ( yy_next_state ) |
1811 | 3.94M | { |
1812 | | /* Consume the NUL. */ |
1813 | 3.94M | yy_cp = ++yyg->yy_c_buf_p; |
1814 | 3.94M | yy_current_state = yy_next_state; |
1815 | 3.94M | goto yy_match; |
1816 | 3.94M | } |
1817 | | |
1818 | 3.94M | else |
1819 | 3.94M | { |
1820 | 3.94M | yy_cp = yyg->yy_last_accepting_cpos; |
1821 | 3.94M | yy_current_state = yyg->yy_last_accepting_state; |
1822 | 3.94M | goto yy_find_action; |
1823 | 3.94M | } |
1824 | 7.89M | } |
1825 | | |
1826 | 50.0k | else switch ( yy_get_next_buffer( yyscanner ) ) |
1827 | 50.0k | { |
1828 | 24.9k | case EOB_ACT_END_OF_FILE: |
1829 | 24.9k | { |
1830 | 24.9k | yyg->yy_did_buffer_switch_on_eof = 0; |
1831 | | |
1832 | 24.9k | if ( yywrap( yyscanner ) ) |
1833 | 24.9k | { |
1834 | | /* Note: because we've taken care in |
1835 | | * yy_get_next_buffer() to have set up |
1836 | | * yytext, we can now set up |
1837 | | * yy_c_buf_p so that if some total |
1838 | | * hoser (like flex itself) wants to |
1839 | | * call the scanner after we return the |
1840 | | * YY_NULL, it'll still work - another |
1841 | | * YY_NULL will get returned. |
1842 | | */ |
1843 | 24.9k | yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; |
1844 | | |
1845 | 24.9k | yy_act = YY_STATE_EOF(YY_START); |
1846 | 24.9k | goto do_action; |
1847 | 24.9k | } |
1848 | | |
1849 | 0 | else |
1850 | 0 | { |
1851 | 0 | if ( ! yyg->yy_did_buffer_switch_on_eof ) |
1852 | 0 | YY_NEW_FILE; |
1853 | 0 | } |
1854 | 0 | break; |
1855 | 24.9k | } |
1856 | | |
1857 | 0 | case EOB_ACT_CONTINUE_SCAN: |
1858 | 0 | yyg->yy_c_buf_p = |
1859 | 0 | yyg->yytext_ptr + yy_amount_of_matched_text; |
1860 | |
|
1861 | 0 | yy_current_state = yy_get_previous_state( yyscanner ); |
1862 | |
|
1863 | 0 | yy_cp = yyg->yy_c_buf_p; |
1864 | 0 | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
1865 | 0 | goto yy_match; |
1866 | | |
1867 | 25.0k | case EOB_ACT_LAST_MATCH: |
1868 | 25.0k | yyg->yy_c_buf_p = |
1869 | 25.0k | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; |
1870 | | |
1871 | 25.0k | yy_current_state = yy_get_previous_state( yyscanner ); |
1872 | | |
1873 | 25.0k | yy_cp = yyg->yy_c_buf_p; |
1874 | 25.0k | yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
1875 | 25.0k | goto yy_find_action; |
1876 | 50.0k | } |
1877 | 0 | break; |
1878 | 7.94M | } |
1879 | | |
1880 | 0 | default: |
1881 | 0 | YY_FATAL_ERROR( |
1882 | 23.4M | "fatal flex scanner internal error--no action found" ); |
1883 | 23.4M | } /* end of action switch */ |
1884 | 23.4M | } /* end of scanning one token */ |
1885 | 15.4M | } /* end of user's declarations */ |
1886 | 15.4M | } /* end of yylex */ |
1887 | | |
1888 | | /* yy_get_next_buffer - try to read in a new buffer |
1889 | | * |
1890 | | * Returns a code representing an action: |
1891 | | * EOB_ACT_LAST_MATCH - |
1892 | | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
1893 | | * EOB_ACT_END_OF_FILE - end of file |
1894 | | */ |
1895 | | static int yy_get_next_buffer (yyscan_t yyscanner) |
1896 | 50.0k | { |
1897 | 50.0k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
1898 | 50.0k | char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
1899 | 50.0k | char *source = yyg->yytext_ptr; |
1900 | 50.0k | int number_to_move, i; |
1901 | 50.0k | int ret_val; |
1902 | | |
1903 | 50.0k | if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) |
1904 | 0 | YY_FATAL_ERROR( |
1905 | 50.0k | "fatal flex scanner internal error--end of buffer missed" ); |
1906 | | |
1907 | 50.0k | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) |
1908 | 50.0k | { /* Don't try to fill the buffer, so this is an EOF. */ |
1909 | 50.0k | if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) |
1910 | 24.9k | { |
1911 | | /* We matched a single character, the EOB, so |
1912 | | * treat this as a final EOF. |
1913 | | */ |
1914 | 24.9k | return EOB_ACT_END_OF_FILE; |
1915 | 24.9k | } |
1916 | | |
1917 | 25.0k | else |
1918 | 25.0k | { |
1919 | | /* We matched some text prior to the EOB, first |
1920 | | * process it. |
1921 | | */ |
1922 | 25.0k | return EOB_ACT_LAST_MATCH; |
1923 | 25.0k | } |
1924 | 50.0k | } |
1925 | | |
1926 | | /* Try to read more data. */ |
1927 | | |
1928 | | /* First move last chars to start of buffer. */ |
1929 | 0 | number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); |
1930 | |
|
1931 | 0 | for ( i = 0; i < number_to_move; ++i ) |
1932 | 0 | *(dest++) = *(source++); |
1933 | |
|
1934 | 0 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
1935 | | /* don't do the read, it's not guaranteed to return an EOF, |
1936 | | * just force an EOF |
1937 | | */ |
1938 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; |
1939 | | |
1940 | 0 | else |
1941 | 0 | { |
1942 | 0 | int num_to_read = |
1943 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
1944 | |
|
1945 | 0 | while ( num_to_read <= 0 ) |
1946 | 0 | { /* Not enough room in the buffer - grow it. */ |
1947 | | |
1948 | | /* just a shorter name for the current buffer */ |
1949 | 0 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
1950 | |
|
1951 | 0 | int yy_c_buf_p_offset = |
1952 | 0 | (int) (yyg->yy_c_buf_p - b->yy_ch_buf); |
1953 | |
|
1954 | 0 | if ( b->yy_is_our_buffer ) |
1955 | 0 | { |
1956 | 0 | int new_size = b->yy_buf_size * 2; |
1957 | |
|
1958 | 0 | if ( new_size <= 0 ) |
1959 | 0 | b->yy_buf_size += b->yy_buf_size / 8; |
1960 | 0 | else |
1961 | 0 | b->yy_buf_size *= 2; |
1962 | |
|
1963 | 0 | b->yy_ch_buf = (char *) |
1964 | | /* Include room in for 2 EOB chars. */ |
1965 | 0 | yyrealloc( (void *) b->yy_ch_buf, |
1966 | 0 | (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
1967 | 0 | } |
1968 | 0 | else |
1969 | | /* Can't grow it, we don't own it. */ |
1970 | 0 | b->yy_ch_buf = NULL; |
1971 | |
|
1972 | 0 | if ( ! b->yy_ch_buf ) |
1973 | 0 | YY_FATAL_ERROR( |
1974 | 0 | "fatal error - scanner input buffer overflow" ); |
1975 | |
|
1976 | 0 | yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
1977 | |
|
1978 | 0 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - |
1979 | 0 | number_to_move - 1; |
1980 | |
|
1981 | 0 | } |
1982 | |
|
1983 | 0 | if ( num_to_read > YY_READ_BUF_SIZE ) |
1984 | 0 | num_to_read = YY_READ_BUF_SIZE; |
1985 | | |
1986 | | /* Read in more data. */ |
1987 | 0 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), |
1988 | 0 | yyg->yy_n_chars, num_to_read ); |
1989 | |
|
1990 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
1991 | 0 | } |
1992 | |
|
1993 | 0 | if ( yyg->yy_n_chars == 0 ) |
1994 | 0 | { |
1995 | 0 | if ( number_to_move == YY_MORE_ADJ ) |
1996 | 0 | { |
1997 | 0 | ret_val = EOB_ACT_END_OF_FILE; |
1998 | 0 | yyrestart( yyin , yyscanner); |
1999 | 0 | } |
2000 | | |
2001 | 0 | else |
2002 | 0 | { |
2003 | 0 | ret_val = EOB_ACT_LAST_MATCH; |
2004 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = |
2005 | 0 | YY_BUFFER_EOF_PENDING; |
2006 | 0 | } |
2007 | 0 | } |
2008 | | |
2009 | 0 | else |
2010 | 0 | ret_val = EOB_ACT_CONTINUE_SCAN; |
2011 | |
|
2012 | 0 | if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
2013 | | /* Extend the array by 50%, plus the number we really need. */ |
2014 | 0 | int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); |
2015 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( |
2016 | 0 | (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); |
2017 | 0 | if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
2018 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); |
2019 | | /* "- 2" to take care of EOB's */ |
2020 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); |
2021 | 0 | } |
2022 | |
|
2023 | 0 | yyg->yy_n_chars += number_to_move; |
2024 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
2025 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
2026 | |
|
2027 | 0 | yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
2028 | |
|
2029 | 0 | return ret_val; |
2030 | 50.0k | } |
2031 | | |
2032 | | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
2033 | | |
2034 | | static yy_state_type yy_get_previous_state (yyscan_t yyscanner) |
2035 | 7.91M | { |
2036 | 7.91M | yy_state_type yy_current_state; |
2037 | 7.91M | char *yy_cp; |
2038 | 7.91M | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2039 | | |
2040 | 7.91M | yy_current_state = yyg->yy_start; |
2041 | | |
2042 | 11.8M | for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) |
2043 | 3.97M | { |
2044 | 3.97M | YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
2045 | 3.97M | if ( yy_accept[yy_current_state] ) |
2046 | 1.34k | { |
2047 | 1.34k | yyg->yy_last_accepting_state = yy_current_state; |
2048 | 1.34k | yyg->yy_last_accepting_cpos = yy_cp; |
2049 | 1.34k | } |
2050 | 7.91M | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
2051 | 3.94M | { |
2052 | 3.94M | yy_current_state = (int) yy_def[yy_current_state]; |
2053 | 3.94M | if ( yy_current_state >= 222 ) |
2054 | 0 | yy_c = yy_meta[yy_c]; |
2055 | 3.94M | } |
2056 | 3.97M | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
2057 | 3.97M | } |
2058 | | |
2059 | 7.91M | return yy_current_state; |
2060 | 7.91M | } |
2061 | | |
2062 | | /* yy_try_NUL_trans - try to make a transition on the NUL character |
2063 | | * |
2064 | | * synopsis |
2065 | | * next_state = yy_try_NUL_trans( current_state ); |
2066 | | */ |
2067 | | static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) |
2068 | 7.89M | { |
2069 | 7.89M | int yy_is_jam; |
2070 | 7.89M | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ |
2071 | 7.89M | char *yy_cp = yyg->yy_c_buf_p; |
2072 | | |
2073 | 7.89M | YY_CHAR yy_c = 1; |
2074 | 7.89M | if ( yy_accept[yy_current_state] ) |
2075 | 3.94M | { |
2076 | 3.94M | yyg->yy_last_accepting_state = yy_current_state; |
2077 | 3.94M | yyg->yy_last_accepting_cpos = yy_cp; |
2078 | 3.94M | } |
2079 | 15.7M | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
2080 | 7.88M | { |
2081 | 7.88M | yy_current_state = (int) yy_def[yy_current_state]; |
2082 | 7.88M | if ( yy_current_state >= 222 ) |
2083 | 0 | yy_c = yy_meta[yy_c]; |
2084 | 7.88M | } |
2085 | 7.89M | yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
2086 | 7.89M | yy_is_jam = (yy_current_state == 221); |
2087 | | |
2088 | 7.89M | (void)yyg; |
2089 | 7.89M | return yy_is_jam ? 0 : yy_current_state; |
2090 | 7.89M | } |
2091 | | |
2092 | | #ifndef YY_NO_UNPUT |
2093 | | |
2094 | | static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) |
2095 | 0 | { |
2096 | 0 | char *yy_cp; |
2097 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2098 | 0 |
|
2099 | 0 | yy_cp = yyg->yy_c_buf_p; |
2100 | 0 |
|
2101 | 0 | /* undo effects of setting up yytext */ |
2102 | 0 | *yy_cp = yyg->yy_hold_char; |
2103 | 0 |
|
2104 | 0 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) |
2105 | 0 | { /* need to shift things up to make room */ |
2106 | 0 | /* +2 for EOB chars. */ |
2107 | 0 | int number_to_move = yyg->yy_n_chars + 2; |
2108 | 0 | char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ |
2109 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; |
2110 | 0 | char *source = |
2111 | 0 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; |
2112 | 0 |
|
2113 | 0 | while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
2114 | 0 | *--dest = *--source; |
2115 | 0 |
|
2116 | 0 | yy_cp += (int) (dest - source); |
2117 | 0 | yy_bp += (int) (dest - source); |
2118 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = |
2119 | 0 | yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; |
2120 | 0 |
|
2121 | 0 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) |
2122 | 0 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
2123 | 0 | } |
2124 | 0 |
|
2125 | 0 | *--yy_cp = (char) c; |
2126 | 0 |
|
2127 | 0 | yyg->yytext_ptr = yy_bp; |
2128 | 0 | yyg->yy_hold_char = *yy_cp; |
2129 | 0 | yyg->yy_c_buf_p = yy_cp; |
2130 | 0 | } |
2131 | | |
2132 | | #endif |
2133 | | |
2134 | | #ifndef YY_NO_INPUT |
2135 | | #ifdef __cplusplus |
2136 | | static int yyinput (yyscan_t yyscanner) |
2137 | | #else |
2138 | | static int input (yyscan_t yyscanner) |
2139 | | #endif |
2140 | | |
2141 | 0 | { |
2142 | 0 | int c; |
2143 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2144 | 0 |
|
2145 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2146 | 0 |
|
2147 | 0 | if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
2148 | 0 | { |
2149 | 0 | /* yy_c_buf_p now points to the character we want to return. |
2150 | 0 | * If this occurs *before* the EOB characters, then it's a |
2151 | 0 | * valid NUL; if not, then we've hit the end of the buffer. |
2152 | 0 | */ |
2153 | 0 | if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) |
2154 | 0 | /* This was really a NUL. */ |
2155 | 0 | *yyg->yy_c_buf_p = '\0'; |
2156 | 0 |
|
2157 | 0 | else |
2158 | 0 | { /* need more input */ |
2159 | 0 | int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); |
2160 | 0 | ++yyg->yy_c_buf_p; |
2161 | 0 |
|
2162 | 0 | switch ( yy_get_next_buffer( yyscanner ) ) |
2163 | 0 | { |
2164 | 0 | case EOB_ACT_LAST_MATCH: |
2165 | 0 | /* This happens because yy_g_n_b() |
2166 | 0 | * sees that we've accumulated a |
2167 | 0 | * token and flags that we need to |
2168 | 0 | * try matching the token before |
2169 | 0 | * proceeding. But for input(), |
2170 | 0 | * there's no matching to consider. |
2171 | 0 | * So convert the EOB_ACT_LAST_MATCH |
2172 | 0 | * to EOB_ACT_END_OF_FILE. |
2173 | 0 | */ |
2174 | 0 |
|
2175 | 0 | /* Reset buffer status. */ |
2176 | 0 | yyrestart( yyin , yyscanner); |
2177 | 0 |
|
2178 | 0 | /*FALLTHROUGH*/ |
2179 | 0 |
|
2180 | 0 | case EOB_ACT_END_OF_FILE: |
2181 | 0 | { |
2182 | 0 | if ( yywrap( yyscanner ) ) |
2183 | 0 | return 0; |
2184 | 0 |
|
2185 | 0 | if ( ! yyg->yy_did_buffer_switch_on_eof ) |
2186 | 0 | YY_NEW_FILE; |
2187 | 0 | #ifdef __cplusplus |
2188 | 0 | return yyinput(yyscanner); |
2189 | 0 | #else |
2190 | 0 | return input(yyscanner); |
2191 | 0 | #endif |
2192 | 0 | } |
2193 | 0 |
|
2194 | 0 | case EOB_ACT_CONTINUE_SCAN: |
2195 | 0 | yyg->yy_c_buf_p = yyg->yytext_ptr + offset; |
2196 | 0 | break; |
2197 | 0 | } |
2198 | 0 | } |
2199 | 0 | } |
2200 | 0 |
|
2201 | 0 | c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ |
2202 | 0 | *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ |
2203 | 0 | yyg->yy_hold_char = *++yyg->yy_c_buf_p; |
2204 | 0 |
|
2205 | 0 | return c; |
2206 | 0 | } |
2207 | | #endif /* ifndef YY_NO_INPUT */ |
2208 | | |
2209 | | /** Immediately switch to a different input stream. |
2210 | | * @param input_file A readable stream. |
2211 | | * @param yyscanner The scanner object. |
2212 | | * @note This function does not reset the start condition to @c INITIAL . |
2213 | | */ |
2214 | | void yyrestart (FILE * input_file , yyscan_t yyscanner) |
2215 | 0 | { |
2216 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2217 | |
|
2218 | 0 | if ( ! YY_CURRENT_BUFFER ){ |
2219 | 0 | yyensure_buffer_stack (yyscanner); |
2220 | 0 | YY_CURRENT_BUFFER_LVALUE = |
2221 | 0 | yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
2222 | 0 | } |
2223 | |
|
2224 | 0 | yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); |
2225 | 0 | yy_load_buffer_state( yyscanner ); |
2226 | 0 | } |
2227 | | |
2228 | | /** Switch to a different input buffer. |
2229 | | * @param new_buffer The new input buffer. |
2230 | | * @param yyscanner The scanner object. |
2231 | | */ |
2232 | | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
2233 | 25.1k | { |
2234 | 25.1k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2235 | | |
2236 | | /* TODO. We should be able to replace this entire function body |
2237 | | * with |
2238 | | * yypop_buffer_state(); |
2239 | | * yypush_buffer_state(new_buffer); |
2240 | | */ |
2241 | 25.1k | yyensure_buffer_stack (yyscanner); |
2242 | 25.1k | if ( YY_CURRENT_BUFFER == new_buffer ) |
2243 | 0 | return; |
2244 | | |
2245 | 25.1k | if ( YY_CURRENT_BUFFER ) |
2246 | 0 | { |
2247 | | /* Flush out information for old buffer. */ |
2248 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2249 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
2250 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
2251 | 0 | } |
2252 | | |
2253 | 25.1k | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
2254 | 25.1k | yy_load_buffer_state( yyscanner ); |
2255 | | |
2256 | | /* We don't actually know whether we did this switch during |
2257 | | * EOF (yywrap()) processing, but the only time this flag |
2258 | | * is looked at is after yywrap() is called, so it's safe |
2259 | | * to go ahead and always set it. |
2260 | | */ |
2261 | 25.1k | yyg->yy_did_buffer_switch_on_eof = 1; |
2262 | 25.1k | } |
2263 | | |
2264 | | static void yy_load_buffer_state (yyscan_t yyscanner) |
2265 | 50.3k | { |
2266 | 50.3k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2267 | 50.3k | yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
2268 | 50.3k | yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
2269 | 50.3k | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
2270 | 50.3k | yyg->yy_hold_char = *yyg->yy_c_buf_p; |
2271 | 50.3k | } |
2272 | | |
2273 | | /** Allocate and initialize an input buffer state. |
2274 | | * @param file A readable stream. |
2275 | | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. |
2276 | | * @param yyscanner The scanner object. |
2277 | | * @return the allocated buffer state. |
2278 | | */ |
2279 | | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) |
2280 | 0 | { |
2281 | 0 | YY_BUFFER_STATE b; |
2282 | | |
2283 | 0 | b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
2284 | 0 | if ( ! b ) |
2285 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
2286 | |
|
2287 | 0 | b->yy_buf_size = size; |
2288 | | |
2289 | | /* yy_ch_buf has to be 2 characters longer than the size given because |
2290 | | * we need to put in 2 end-of-buffer characters. |
2291 | | */ |
2292 | 0 | b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
2293 | 0 | if ( ! b->yy_ch_buf ) |
2294 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
2295 | |
|
2296 | 0 | b->yy_is_our_buffer = 1; |
2297 | |
|
2298 | 0 | yy_init_buffer( b, file , yyscanner); |
2299 | |
|
2300 | 0 | return b; |
2301 | 0 | } |
2302 | | |
2303 | | /** Destroy the buffer. |
2304 | | * @param b a buffer created with yy_create_buffer() |
2305 | | * @param yyscanner The scanner object. |
2306 | | */ |
2307 | | void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
2308 | 25.1k | { |
2309 | 25.1k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2310 | | |
2311 | 25.1k | if ( ! b ) |
2312 | 0 | return; |
2313 | | |
2314 | 25.1k | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ |
2315 | 25.1k | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
2316 | | |
2317 | 25.1k | if ( b->yy_is_our_buffer ) |
2318 | 25.1k | yyfree( (void *) b->yy_ch_buf , yyscanner ); |
2319 | | |
2320 | 25.1k | yyfree( (void *) b , yyscanner ); |
2321 | 25.1k | } |
2322 | | |
2323 | | /* Initializes or reinitializes a buffer. |
2324 | | * This function is sometimes called more than once on the same buffer, |
2325 | | * such as during a yyrestart() or at EOF. |
2326 | | */ |
2327 | | static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) |
2328 | | |
2329 | 0 | { |
2330 | 0 | int oerrno = errno; |
2331 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2332 | |
|
2333 | 0 | yy_flush_buffer( b , yyscanner); |
2334 | |
|
2335 | 0 | b->yy_input_file = file; |
2336 | 0 | b->yy_fill_buffer = 1; |
2337 | | |
2338 | | /* If b is the current buffer, then yy_init_buffer was _probably_ |
2339 | | * called from yyrestart() or through yy_get_next_buffer. |
2340 | | * In that case, we don't want to reset the lineno or column. |
2341 | | */ |
2342 | 0 | if (b != YY_CURRENT_BUFFER){ |
2343 | 0 | b->yy_bs_lineno = 1; |
2344 | 0 | b->yy_bs_column = 0; |
2345 | 0 | } |
2346 | |
|
2347 | 0 | b->yy_is_interactive = 0; |
2348 | | |
2349 | 0 | errno = oerrno; |
2350 | 0 | } |
2351 | | |
2352 | | /** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
2353 | | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
2354 | | * @param yyscanner The scanner object. |
2355 | | */ |
2356 | | void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
2357 | 0 | { |
2358 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2359 | 0 | if ( ! b ) |
2360 | 0 | return; |
2361 | | |
2362 | 0 | b->yy_n_chars = 0; |
2363 | | |
2364 | | /* We always need two end-of-buffer characters. The first causes |
2365 | | * a transition to the end-of-buffer state. The second causes |
2366 | | * a jam in that state. |
2367 | | */ |
2368 | 0 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
2369 | 0 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
2370 | |
|
2371 | 0 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
2372 | |
|
2373 | 0 | b->yy_at_bol = 1; |
2374 | 0 | b->yy_buffer_status = YY_BUFFER_NEW; |
2375 | |
|
2376 | 0 | if ( b == YY_CURRENT_BUFFER ) |
2377 | 0 | yy_load_buffer_state( yyscanner ); |
2378 | 0 | } |
2379 | | |
2380 | | /** Pushes the new state onto the stack. The new state becomes |
2381 | | * the current state. This function will allocate the stack |
2382 | | * if necessary. |
2383 | | * @param new_buffer The new state. |
2384 | | * @param yyscanner The scanner object. |
2385 | | */ |
2386 | | void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
2387 | 0 | { |
2388 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2389 | 0 | if (new_buffer == NULL) |
2390 | 0 | return; |
2391 | | |
2392 | 0 | yyensure_buffer_stack(yyscanner); |
2393 | | |
2394 | | /* This block is copied from yy_switch_to_buffer. */ |
2395 | 0 | if ( YY_CURRENT_BUFFER ) |
2396 | 0 | { |
2397 | | /* Flush out information for old buffer. */ |
2398 | 0 | *yyg->yy_c_buf_p = yyg->yy_hold_char; |
2399 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
2400 | 0 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
2401 | 0 | } |
2402 | | |
2403 | | /* Only push if top exists. Otherwise, replace top. */ |
2404 | 0 | if (YY_CURRENT_BUFFER) |
2405 | 0 | yyg->yy_buffer_stack_top++; |
2406 | 0 | YY_CURRENT_BUFFER_LVALUE = new_buffer; |
2407 | | |
2408 | | /* copied from yy_switch_to_buffer. */ |
2409 | 0 | yy_load_buffer_state( yyscanner ); |
2410 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
2411 | 0 | } |
2412 | | |
2413 | | /** Removes and deletes the top of the stack, if present. |
2414 | | * The next element becomes the new top. |
2415 | | * @param yyscanner The scanner object. |
2416 | | */ |
2417 | | void yypop_buffer_state (yyscan_t yyscanner) |
2418 | 25.1k | { |
2419 | 25.1k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2420 | 25.1k | if (!YY_CURRENT_BUFFER) |
2421 | 25.1k | return; |
2422 | | |
2423 | 0 | yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); |
2424 | 0 | YY_CURRENT_BUFFER_LVALUE = NULL; |
2425 | 0 | if (yyg->yy_buffer_stack_top > 0) |
2426 | 0 | --yyg->yy_buffer_stack_top; |
2427 | |
|
2428 | 0 | if (YY_CURRENT_BUFFER) { |
2429 | 0 | yy_load_buffer_state( yyscanner ); |
2430 | 0 | yyg->yy_did_buffer_switch_on_eof = 1; |
2431 | 0 | } |
2432 | 0 | } |
2433 | | |
2434 | | /* Allocates the stack if it does not exist. |
2435 | | * Guarantees space for at least one push. |
2436 | | */ |
2437 | | static void yyensure_buffer_stack (yyscan_t yyscanner) |
2438 | 25.1k | { |
2439 | 25.1k | yy_size_t num_to_alloc; |
2440 | 25.1k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2441 | | |
2442 | 25.1k | if (!yyg->yy_buffer_stack) { |
2443 | | |
2444 | | /* First allocation is just for 2 elements, since we don't know if this |
2445 | | * scanner will even need a stack. We use 2 instead of 1 to avoid an |
2446 | | * immediate realloc on the next call. |
2447 | | */ |
2448 | 25.1k | num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ |
2449 | 25.1k | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc |
2450 | 25.1k | (num_to_alloc * sizeof(struct yy_buffer_state*) |
2451 | 25.1k | , yyscanner); |
2452 | 25.1k | if ( ! yyg->yy_buffer_stack ) |
2453 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
2454 | | |
2455 | 25.1k | memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
2456 | | |
2457 | 25.1k | yyg->yy_buffer_stack_max = num_to_alloc; |
2458 | 25.1k | yyg->yy_buffer_stack_top = 0; |
2459 | 25.1k | return; |
2460 | 25.1k | } |
2461 | | |
2462 | 0 | if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ |
2463 | | |
2464 | | /* Increase the buffer to prepare for a possible push. */ |
2465 | 0 | yy_size_t grow_size = 8 /* arbitrary grow size */; |
2466 | |
|
2467 | 0 | num_to_alloc = yyg->yy_buffer_stack_max + grow_size; |
2468 | 0 | yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc |
2469 | 0 | (yyg->yy_buffer_stack, |
2470 | 0 | num_to_alloc * sizeof(struct yy_buffer_state*) |
2471 | 0 | , yyscanner); |
2472 | 0 | if ( ! yyg->yy_buffer_stack ) |
2473 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
2474 | | |
2475 | | /* zero only the new slots.*/ |
2476 | 0 | memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); |
2477 | 0 | yyg->yy_buffer_stack_max = num_to_alloc; |
2478 | 0 | } |
2479 | 0 | } |
2480 | | |
2481 | | /** Setup the input buffer state to scan directly from a user-specified character buffer. |
2482 | | * @param base the character buffer |
2483 | | * @param size the size in bytes of the character buffer |
2484 | | * @param yyscanner The scanner object. |
2485 | | * @return the newly allocated buffer state object. |
2486 | | */ |
2487 | | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) |
2488 | 25.1k | { |
2489 | 25.1k | YY_BUFFER_STATE b; |
2490 | | |
2491 | 25.1k | if ( size < 2 || |
2492 | 25.1k | base[size-2] != YY_END_OF_BUFFER_CHAR || |
2493 | 25.1k | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
2494 | | /* They forgot to leave room for the EOB's. */ |
2495 | 0 | return NULL; |
2496 | | |
2497 | 25.1k | b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
2498 | 25.1k | if ( ! b ) |
2499 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
2500 | | |
2501 | 25.1k | b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ |
2502 | 25.1k | b->yy_buf_pos = b->yy_ch_buf = base; |
2503 | 25.1k | b->yy_is_our_buffer = 0; |
2504 | 25.1k | b->yy_input_file = NULL; |
2505 | 25.1k | b->yy_n_chars = b->yy_buf_size; |
2506 | 25.1k | b->yy_is_interactive = 0; |
2507 | 25.1k | b->yy_at_bol = 1; |
2508 | 25.1k | b->yy_fill_buffer = 0; |
2509 | 25.1k | b->yy_buffer_status = YY_BUFFER_NEW; |
2510 | | |
2511 | 25.1k | yy_switch_to_buffer( b , yyscanner ); |
2512 | | |
2513 | 25.1k | return b; |
2514 | 25.1k | } |
2515 | | |
2516 | | /** Setup the input buffer state to scan a string. The next call to yylex() will |
2517 | | * scan from a @e copy of @a str. |
2518 | | * @param yystr a NUL-terminated string to scan |
2519 | | * @param yyscanner The scanner object. |
2520 | | * @return the newly allocated buffer state object. |
2521 | | * @note If you want to scan bytes that may contain NUL values, then use |
2522 | | * yy_scan_bytes() instead. |
2523 | | */ |
2524 | | YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) |
2525 | 0 | { |
2526 | | |
2527 | 0 | return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); |
2528 | 0 | } |
2529 | | |
2530 | | /** Setup the input buffer state to scan the given bytes. The next call to yylex() will |
2531 | | * scan from a @e copy of @a bytes. |
2532 | | * @param yybytes the byte buffer to scan |
2533 | | * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
2534 | | * @param yyscanner The scanner object. |
2535 | | * @return the newly allocated buffer state object. |
2536 | | */ |
2537 | | YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) |
2538 | 0 | { |
2539 | 0 | YY_BUFFER_STATE b; |
2540 | 0 | char *buf; |
2541 | 0 | yy_size_t n; |
2542 | 0 | int i; |
2543 | | |
2544 | | /* Get memory for full buffer, including space for trailing EOB's. */ |
2545 | 0 | n = (yy_size_t) (_yybytes_len + 2); |
2546 | 0 | buf = (char *) yyalloc( n , yyscanner ); |
2547 | 0 | if ( ! buf ) |
2548 | 0 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
2549 | |
|
2550 | 0 | for ( i = 0; i < _yybytes_len; ++i ) |
2551 | 0 | buf[i] = yybytes[i]; |
2552 | |
|
2553 | 0 | buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
2554 | |
|
2555 | 0 | b = yy_scan_buffer( buf, n , yyscanner); |
2556 | 0 | if ( ! b ) |
2557 | 0 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
2558 | | |
2559 | | /* It's okay to grow etc. this buffer, and we should throw it |
2560 | | * away when we're done. |
2561 | | */ |
2562 | 0 | b->yy_is_our_buffer = 1; |
2563 | |
|
2564 | 0 | return b; |
2565 | 0 | } |
2566 | | |
2567 | | static void yy_push_state (int _new_state , yyscan_t yyscanner) |
2568 | 1.45M | { |
2569 | 1.45M | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2570 | 1.45M | if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) |
2571 | 52.9k | { |
2572 | 52.9k | yy_size_t new_size; |
2573 | | |
2574 | 52.9k | yyg->yy_start_stack_depth += YY_START_STACK_INCR; |
2575 | 52.9k | new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int ); |
2576 | | |
2577 | 52.9k | if ( ! yyg->yy_start_stack ) |
2578 | 9.82k | yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner ); |
2579 | | |
2580 | 43.1k | else |
2581 | 43.1k | yyg->yy_start_stack = (int *) yyrealloc( |
2582 | 43.1k | (void *) yyg->yy_start_stack, new_size , yyscanner ); |
2583 | | |
2584 | 52.9k | if ( ! yyg->yy_start_stack ) |
2585 | 0 | YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); |
2586 | 52.9k | } |
2587 | | |
2588 | 1.45M | yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; |
2589 | | |
2590 | 1.45M | BEGIN(_new_state); |
2591 | 1.45M | } |
2592 | | |
2593 | | static void yy_pop_state (yyscan_t yyscanner) |
2594 | 424k | { |
2595 | 424k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2596 | 424k | if ( --yyg->yy_start_stack_ptr < 0 ) |
2597 | 0 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
2598 | | |
2599 | 424k | BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]); |
2600 | 424k | } |
2601 | | |
2602 | | static int yy_top_state (yyscan_t yyscanner) |
2603 | 0 | { |
2604 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2605 | 0 | return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1]; |
2606 | 0 | } |
2607 | | |
2608 | | #ifndef YY_EXIT_FAILURE |
2609 | | #define YY_EXIT_FAILURE 2 |
2610 | | #endif |
2611 | | |
2612 | | static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) |
2613 | 0 | { |
2614 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2615 | 0 | (void)yyg; |
2616 | 0 | fprintf( stderr, "%s\n", msg ); |
2617 | 0 | exit( YY_EXIT_FAILURE ); |
2618 | 0 | } |
2619 | | |
2620 | | /* Redefine yyless() so it works in section 3 code. */ |
2621 | | |
2622 | | #undef yyless |
2623 | | #define yyless(n) \ |
2624 | | do \ |
2625 | | { \ |
2626 | | /* Undo effects of setting up yytext. */ \ |
2627 | | int yyless_macro_arg = (n); \ |
2628 | | YY_LESS_LINENO(yyless_macro_arg);\ |
2629 | | yytext[yyleng] = yyg->yy_hold_char; \ |
2630 | | yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ |
2631 | | yyg->yy_hold_char = *yyg->yy_c_buf_p; \ |
2632 | | *yyg->yy_c_buf_p = '\0'; \ |
2633 | | yyleng = yyless_macro_arg; \ |
2634 | | } \ |
2635 | | while ( 0 ) |
2636 | | |
2637 | | /* Accessor methods (get/set functions) to struct members. */ |
2638 | | |
2639 | | /** Get the user-defined data for this scanner. |
2640 | | * @param yyscanner The scanner object. |
2641 | | */ |
2642 | | YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) |
2643 | 0 | { |
2644 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2645 | 0 | return yyextra; |
2646 | 0 | } |
2647 | | |
2648 | | /** Get the current line number. |
2649 | | * @param yyscanner The scanner object. |
2650 | | */ |
2651 | | int yyget_lineno (yyscan_t yyscanner) |
2652 | 0 | { |
2653 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2654 | |
|
2655 | 0 | if (! YY_CURRENT_BUFFER) |
2656 | 0 | return 0; |
2657 | | |
2658 | 0 | return yylineno; |
2659 | 0 | } |
2660 | | |
2661 | | /** Get the current column number. |
2662 | | * @param yyscanner The scanner object. |
2663 | | */ |
2664 | | int yyget_column (yyscan_t yyscanner) |
2665 | 0 | { |
2666 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2667 | |
|
2668 | 0 | if (! YY_CURRENT_BUFFER) |
2669 | 0 | return 0; |
2670 | | |
2671 | 0 | return yycolumn; |
2672 | 0 | } |
2673 | | |
2674 | | /** Get the input stream. |
2675 | | * @param yyscanner The scanner object. |
2676 | | */ |
2677 | | FILE *yyget_in (yyscan_t yyscanner) |
2678 | 0 | { |
2679 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2680 | 0 | return yyin; |
2681 | 0 | } |
2682 | | |
2683 | | /** Get the output stream. |
2684 | | * @param yyscanner The scanner object. |
2685 | | */ |
2686 | | FILE *yyget_out (yyscan_t yyscanner) |
2687 | 0 | { |
2688 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2689 | 0 | return yyout; |
2690 | 0 | } |
2691 | | |
2692 | | /** Get the length of the current token. |
2693 | | * @param yyscanner The scanner object. |
2694 | | */ |
2695 | | int yyget_leng (yyscan_t yyscanner) |
2696 | 0 | { |
2697 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2698 | 0 | return yyleng; |
2699 | 0 | } |
2700 | | |
2701 | | /** Get the current token. |
2702 | | * @param yyscanner The scanner object. |
2703 | | */ |
2704 | | |
2705 | | char *yyget_text (yyscan_t yyscanner) |
2706 | 0 | { |
2707 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2708 | 0 | return yytext; |
2709 | 0 | } |
2710 | | |
2711 | | /** Set the user-defined data. This data is never touched by the scanner. |
2712 | | * @param user_defined The data to be associated with this scanner. |
2713 | | * @param yyscanner The scanner object. |
2714 | | */ |
2715 | | void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) |
2716 | 0 | { |
2717 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2718 | 0 | yyextra = user_defined ; |
2719 | 0 | } |
2720 | | |
2721 | | /** Set the current line number. |
2722 | | * @param _line_number line number |
2723 | | * @param yyscanner The scanner object. |
2724 | | */ |
2725 | | void yyset_lineno (int _line_number , yyscan_t yyscanner) |
2726 | 0 | { |
2727 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2728 | | |
2729 | | /* lineno is only valid if an input buffer exists. */ |
2730 | 0 | if (! YY_CURRENT_BUFFER ) |
2731 | 0 | YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); |
2732 | | |
2733 | 0 | yylineno = _line_number; |
2734 | 0 | } |
2735 | | |
2736 | | /** Set the current column. |
2737 | | * @param _column_no column number |
2738 | | * @param yyscanner The scanner object. |
2739 | | */ |
2740 | | void yyset_column (int _column_no , yyscan_t yyscanner) |
2741 | 0 | { |
2742 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2743 | | |
2744 | | /* column is only valid if an input buffer exists. */ |
2745 | 0 | if (! YY_CURRENT_BUFFER ) |
2746 | 0 | YY_FATAL_ERROR( "yyset_column called with no buffer" ); |
2747 | | |
2748 | 0 | yycolumn = _column_no; |
2749 | 0 | } |
2750 | | |
2751 | | /** Set the input stream. This does not discard the current |
2752 | | * input buffer. |
2753 | | * @param _in_str A readable stream. |
2754 | | * @param yyscanner The scanner object. |
2755 | | * @see yy_switch_to_buffer |
2756 | | */ |
2757 | | void yyset_in (FILE * _in_str , yyscan_t yyscanner) |
2758 | 0 | { |
2759 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2760 | 0 | yyin = _in_str ; |
2761 | 0 | } |
2762 | | |
2763 | | void yyset_out (FILE * _out_str , yyscan_t yyscanner) |
2764 | 0 | { |
2765 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2766 | 0 | yyout = _out_str ; |
2767 | 0 | } |
2768 | | |
2769 | | int yyget_debug (yyscan_t yyscanner) |
2770 | 0 | { |
2771 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2772 | 0 | return yy_flex_debug; |
2773 | 0 | } |
2774 | | |
2775 | | void yyset_debug (int _bdebug , yyscan_t yyscanner) |
2776 | 0 | { |
2777 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2778 | 0 | yy_flex_debug = _bdebug ; |
2779 | 0 | } |
2780 | | |
2781 | | /* Accessor methods for yylval and yylloc */ |
2782 | | |
2783 | | YYSTYPE * yyget_lval (yyscan_t yyscanner) |
2784 | 0 | { |
2785 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2786 | 0 | return yylval; |
2787 | 0 | } |
2788 | | |
2789 | | void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) |
2790 | 0 | { |
2791 | 0 | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2792 | 0 | yylval = yylval_param; |
2793 | 0 | } |
2794 | | |
2795 | | /* User-visible API */ |
2796 | | |
2797 | | /* yylex_init is special because it creates the scanner itself, so it is |
2798 | | * the ONLY reentrant function that doesn't take the scanner as the last argument. |
2799 | | * That's why we explicitly handle the declaration, instead of using our macros. |
2800 | | */ |
2801 | | int yylex_init(yyscan_t* ptr_yy_globals) |
2802 | 25.1k | { |
2803 | 25.1k | if (ptr_yy_globals == NULL){ |
2804 | 0 | errno = EINVAL; |
2805 | 0 | return 1; |
2806 | 0 | } |
2807 | | |
2808 | 25.1k | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); |
2809 | | |
2810 | 25.1k | if (*ptr_yy_globals == NULL){ |
2811 | 0 | errno = ENOMEM; |
2812 | 0 | return 1; |
2813 | 0 | } |
2814 | | |
2815 | | /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ |
2816 | 25.1k | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
2817 | | |
2818 | 25.1k | return yy_init_globals ( *ptr_yy_globals ); |
2819 | 25.1k | } |
2820 | | |
2821 | | /* yylex_init_extra has the same functionality as yylex_init, but follows the |
2822 | | * convention of taking the scanner as the last argument. Note however, that |
2823 | | * this is a *pointer* to a scanner, as it will be allocated by this call (and |
2824 | | * is the reason, too, why this function also must handle its own declaration). |
2825 | | * The user defined value in the first argument will be available to yyalloc in |
2826 | | * the yyextra field. |
2827 | | */ |
2828 | | int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) |
2829 | 0 | { |
2830 | 0 | struct yyguts_t dummy_yyguts; |
2831 | |
|
2832 | 0 | yyset_extra (yy_user_defined, &dummy_yyguts); |
2833 | |
|
2834 | 0 | if (ptr_yy_globals == NULL){ |
2835 | 0 | errno = EINVAL; |
2836 | 0 | return 1; |
2837 | 0 | } |
2838 | | |
2839 | 0 | *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); |
2840 | |
|
2841 | 0 | if (*ptr_yy_globals == NULL){ |
2842 | 0 | errno = ENOMEM; |
2843 | 0 | return 1; |
2844 | 0 | } |
2845 | | |
2846 | | /* By setting to 0xAA, we expose bugs in |
2847 | | yy_init_globals. Leave at 0x00 for releases. */ |
2848 | 0 | memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
2849 | |
|
2850 | 0 | yyset_extra (yy_user_defined, *ptr_yy_globals); |
2851 | |
|
2852 | 0 | return yy_init_globals ( *ptr_yy_globals ); |
2853 | 0 | } |
2854 | | |
2855 | | static int yy_init_globals (yyscan_t yyscanner) |
2856 | 50.3k | { |
2857 | 50.3k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2858 | | /* Initialization is the same as for the non-reentrant scanner. |
2859 | | * This function is called from yylex_destroy(), so don't allocate here. |
2860 | | */ |
2861 | | |
2862 | 50.3k | yyg->yy_buffer_stack = NULL; |
2863 | 50.3k | yyg->yy_buffer_stack_top = 0; |
2864 | 50.3k | yyg->yy_buffer_stack_max = 0; |
2865 | 50.3k | yyg->yy_c_buf_p = NULL; |
2866 | 50.3k | yyg->yy_init = 0; |
2867 | 50.3k | yyg->yy_start = 0; |
2868 | | |
2869 | 50.3k | yyg->yy_start_stack_ptr = 0; |
2870 | 50.3k | yyg->yy_start_stack_depth = 0; |
2871 | 50.3k | yyg->yy_start_stack = NULL; |
2872 | | |
2873 | | /* Defined in main.c */ |
2874 | | #ifdef YY_STDINIT |
2875 | | yyin = stdin; |
2876 | | yyout = stdout; |
2877 | | #else |
2878 | 50.3k | yyin = NULL; |
2879 | 50.3k | yyout = NULL; |
2880 | 50.3k | #endif |
2881 | | |
2882 | | /* For future reference: Set errno on error, since we are called by |
2883 | | * yylex_init() |
2884 | | */ |
2885 | 50.3k | return 0; |
2886 | 50.3k | } |
2887 | | |
2888 | | /* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
2889 | | int yylex_destroy (yyscan_t yyscanner) |
2890 | 25.1k | { |
2891 | 25.1k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2892 | | |
2893 | | /* Pop the buffer stack, destroying each element. */ |
2894 | 50.3k | while(YY_CURRENT_BUFFER){ |
2895 | 25.1k | yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); |
2896 | 25.1k | YY_CURRENT_BUFFER_LVALUE = NULL; |
2897 | 25.1k | yypop_buffer_state(yyscanner); |
2898 | 25.1k | } |
2899 | | |
2900 | | /* Destroy the stack itself. */ |
2901 | 25.1k | yyfree(yyg->yy_buffer_stack , yyscanner); |
2902 | 25.1k | yyg->yy_buffer_stack = NULL; |
2903 | | |
2904 | | /* Destroy the start condition stack. */ |
2905 | 25.1k | yyfree( yyg->yy_start_stack , yyscanner ); |
2906 | 25.1k | yyg->yy_start_stack = NULL; |
2907 | | |
2908 | | /* Reset the globals. This is important in a non-reentrant scanner so the next time |
2909 | | * yylex() is called, initialization will occur. */ |
2910 | 25.1k | yy_init_globals( yyscanner); |
2911 | | |
2912 | | /* Destroy the main struct (reentrant only). */ |
2913 | 25.1k | yyfree ( yyscanner , yyscanner ); |
2914 | 25.1k | yyscanner = NULL; |
2915 | 25.1k | return 0; |
2916 | 25.1k | } |
2917 | | |
2918 | | /* |
2919 | | * Internal utility routines. |
2920 | | */ |
2921 | | |
2922 | | #ifndef yytext_ptr |
2923 | | static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) |
2924 | | { |
2925 | | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2926 | | (void)yyg; |
2927 | | |
2928 | | int i; |
2929 | | for ( i = 0; i < n; ++i ) |
2930 | | s1[i] = s2[i]; |
2931 | | } |
2932 | | #endif |
2933 | | |
2934 | | #ifdef YY_NEED_STRLEN |
2935 | | static int yy_flex_strlen (const char * s , yyscan_t yyscanner) |
2936 | | { |
2937 | | int n; |
2938 | | for ( n = 0; s[n]; ++n ) |
2939 | | ; |
2940 | | |
2941 | | return n; |
2942 | | } |
2943 | | #endif |
2944 | | |
2945 | | void *yyalloc (yy_size_t size , yyscan_t yyscanner) |
2946 | 110k | { |
2947 | 110k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2948 | 110k | (void)yyg; |
2949 | 110k | return malloc(size); |
2950 | 110k | } |
2951 | | |
2952 | | void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) |
2953 | 43.1k | { |
2954 | 43.1k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2955 | 43.1k | (void)yyg; |
2956 | | |
2957 | | /* The cast to (char *) in the following accommodates both |
2958 | | * implementations that use char* generic pointers, and those |
2959 | | * that use void* generic pointers. It works with the latter |
2960 | | * because both ANSI C and C++ allow castless assignment from |
2961 | | * any pointer type to void*, and deal with argument conversions |
2962 | | * as though doing an assignment. |
2963 | | */ |
2964 | 43.1k | return realloc(ptr, size); |
2965 | 43.1k | } |
2966 | | |
2967 | | void yyfree (void * ptr , yyscan_t yyscanner) |
2968 | 125k | { |
2969 | 125k | struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
2970 | 125k | (void)yyg; |
2971 | 125k | free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ |
2972 | 125k | } |
2973 | | |
2974 | | #define YYTABLES_NAME "yytables" |
2975 | | |
2976 | | #undef yysmarts_wrap |
2977 | 0 | int yysmarts_wrap( void ) { return 1; } |
2978 | | |