3 #if !defined _gmx_sel_yyIN_HEADER
7 // Required before flex definitions, since it includes <stdint.h>.
8 // Otherwise, compilers not strictly C99 get macro redefinition errors,
9 // since flex defines INT32_MAX etc. in such cases.
10 #include "gromacs/utility/basedefinitions.h"
14 #line 15 "scanner.cpp"
16 #define YY_INT_ALIGNED short int
18 /* A lexical scanner generated by flex */
21 #define YY_FLEX_MAJOR_VERSION 2
22 #define YY_FLEX_MINOR_VERSION 6
23 #define YY_FLEX_SUBMINOR_VERSION 0
24 #if YY_FLEX_SUBMINOR_VERSION > 0
28 /* First, we deal with platform-specific or compiler-specific issues. */
30 /* begin standard C headers. */
36 /* end standard C headers. */
38 /* flex integer type definitions */
43 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
45 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
47 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
48 * if you want the limit (max/min) macros for int types.
50 #ifndef __STDC_LIMIT_MACROS
51 #define __STDC_LIMIT_MACROS 1
55 typedef int8_t flex_int8_t
;
56 typedef uint8_t flex_uint8_t
;
57 typedef int16_t flex_int16_t
;
58 typedef uint16_t flex_uint16_t
;
59 typedef int32_t flex_int32_t
;
60 typedef uint32_t flex_uint32_t
;
62 typedef signed char flex_int8_t
;
63 typedef short int flex_int16_t
;
64 typedef int flex_int32_t
;
65 typedef unsigned char flex_uint8_t
;
66 typedef unsigned short int flex_uint16_t
;
67 typedef unsigned int flex_uint32_t
;
69 /* Limits of integral types. */
71 #define INT8_MIN (-128)
74 #define INT16_MIN (-32767-1)
77 #define INT32_MIN (-2147483647-1)
80 #define INT8_MAX (127)
83 #define INT16_MAX (32767)
86 #define INT32_MAX (2147483647)
89 #define UINT8_MAX (255U)
92 #define UINT16_MAX (65535U)
95 #define UINT32_MAX (4294967295U)
100 #endif /* ! FLEXINT_H */
104 /* The "const" storage-class-modifier is valid. */
107 #else /* ! __cplusplus */
109 /* C99 requires __STDC__ to be defined as 1. */
110 #if defined (__STDC__)
114 #endif /* defined (__STDC__) */
115 #endif /* ! __cplusplus */
118 #define yyconst const
123 /* Returned upon end-of-file. */
126 /* Promotes a possibly negative, possibly signed char to an unsigned
127 * integer for use as an array index. If the signed char is negative,
128 * we want to instead treat it as an 8-bit unsigned char, hence the
131 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
133 /* An opaque pointer. */
134 #ifndef YY_TYPEDEF_YY_SCANNER_T
135 #define YY_TYPEDEF_YY_SCANNER_T
136 typedef void* yyscan_t
;
139 /* For convenience, these vars (plus the bison vars far below)
140 are macros in the reentrant scanner. */
141 #define yyin yyg->yyin_r
142 #define yyout yyg->yyout_r
143 #define yyextra yyg->yyextra_r
144 #define yyleng yyg->yyleng_r
145 #define yytext yyg->yytext_r
146 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
147 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
148 #define yy_flex_debug yyg->yy_flex_debug_r
150 /* Enter a start condition. This macro really ought to take a parameter,
151 * but we do it the disgusting crufty way forced on us by the ()-less
152 * definition of BEGIN.
154 #define BEGIN yyg->yy_start = 1 + 2 *
156 /* Translate the current start state into a value that can be later handed
157 * to BEGIN to return to the state. The YYSTATE alias is for lex
160 #define YY_START ((yyg->yy_start - 1) / 2)
161 #define YYSTATE YY_START
163 /* Action number for EOF rule of a given start state. */
164 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
166 /* Special action meaning "start processing a new file". */
167 #define YY_NEW_FILE _gmx_sel_yyrestart(yyin ,yyscanner )
169 #define YY_END_OF_BUFFER_CHAR 0
171 /* Size of default input buffer. */
174 /* On IA-64, the buffer size is 16k, not 8k.
175 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
176 * Ditto for the __ia64__ case accordingly.
178 #define YY_BUF_SIZE 32768
180 #define YY_BUF_SIZE 16384
181 #endif /* __ia64__ */
184 /* The state buf must be large enough to hold one state per character in the main buffer.
186 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
188 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
189 #define YY_TYPEDEF_YY_BUFFER_STATE
190 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
193 #ifndef YY_TYPEDEF_YY_SIZE_T
194 #define YY_TYPEDEF_YY_SIZE_T
195 typedef size_t yy_size_t
;
198 #define EOB_ACT_CONTINUE_SCAN 0
199 #define EOB_ACT_END_OF_FILE 1
200 #define EOB_ACT_LAST_MATCH 2
202 #define YY_LESS_LINENO(n)
203 #define YY_LINENO_REWIND_TO(ptr)
205 /* Return all but the first "n" matched characters back to the input stream. */
209 /* Undo effects of setting up yytext. */ \
210 int yyless_macro_arg = (n); \
211 YY_LESS_LINENO(yyless_macro_arg);\
212 *yy_cp = yyg->yy_hold_char; \
213 YY_RESTORE_YY_MORE_OFFSET \
214 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
215 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
219 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
221 #ifndef YY_STRUCT_YY_BUFFER_STATE
222 #define YY_STRUCT_YY_BUFFER_STATE
223 struct yy_buffer_state
227 char *yy_ch_buf
; /* input buffer */
228 char *yy_buf_pos
; /* current position in input buffer */
230 /* Size of input buffer in bytes, not including room for EOB
233 yy_size_t yy_buf_size
;
235 /* Number of characters read into yy_ch_buf, not including EOB
238 yy_size_t yy_n_chars
;
240 /* Whether we "own" the buffer - i.e., we know we created it,
241 * and can realloc() it to grow it, and should free() it to
244 int yy_is_our_buffer
;
246 /* Whether this is an "interactive" input source; if so, and
247 * if we're using stdio for input, then we want to use getc()
248 * instead of fread(), to make sure we stop fetching input after
251 int yy_is_interactive
;
253 /* Whether we're considered to be at the beginning of a line.
254 * If so, '^' rules will be active on the next match, otherwise
259 int yy_bs_lineno
; /**< The line count. */
260 int yy_bs_column
; /**< The column count. */
262 /* Whether to try to fill the input buffer when we reach the
267 int yy_buffer_status
;
269 #define YY_BUFFER_NEW 0
270 #define YY_BUFFER_NORMAL 1
271 /* When an EOF's been seen but there's still some text to process
272 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
273 * shouldn't try reading from the input source any more. We might
274 * still have a bunch of tokens to match, though, because of
275 * possible backing-up.
277 * When we actually see the EOF, we change the status to "new"
278 * (via _gmx_sel_yyrestart()), so that the user can continue scanning by
279 * just pointing yyin at a new input file.
281 #define YY_BUFFER_EOF_PENDING 2
284 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
286 /* We provide macros for accessing buffer states in case in the
287 * future we want to put the buffer states in a more general
290 * Returns the top of the stack, or NULL.
292 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
293 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
296 /* Same as previous macro, but useful when we know that the buffer stack is not
297 * NULL or when we need an lvalue. For internal use only.
299 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
301 void _gmx_sel_yyrestart (FILE *input_file
,yyscan_t yyscanner
);
302 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
303 YY_BUFFER_STATE
_gmx_sel_yy_create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
304 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
305 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
306 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
307 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner
);
309 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner
);
310 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner
);
311 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
313 #define YY_FLUSH_BUFFER _gmx_sel_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
315 YY_BUFFER_STATE
_gmx_sel_yy_scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
316 YY_BUFFER_STATE
_gmx_sel_yy_scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
317 YY_BUFFER_STATE
_gmx_sel_yy_scan_bytes (yyconst
char *bytes
,yy_size_t len
,yyscan_t yyscanner
);
319 void *_gmx_sel_yyalloc (yy_size_t
,yyscan_t yyscanner
);
320 void *_gmx_sel_yyrealloc (void *,yy_size_t
,yyscan_t yyscanner
);
321 void _gmx_sel_yyfree (void * ,yyscan_t yyscanner
);
323 #define yy_new_buffer _gmx_sel_yy_create_buffer
325 #define yy_set_interactive(is_interactive) \
327 if ( ! YY_CURRENT_BUFFER ){ \
328 _gmx_sel_yyensure_buffer_stack (yyscanner); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
332 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
335 #define yy_set_bol(at_bol) \
337 if ( ! YY_CURRENT_BUFFER ){\
338 _gmx_sel_yyensure_buffer_stack (yyscanner); \
339 YY_CURRENT_BUFFER_LVALUE = \
340 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
342 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
345 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
347 static inline int _gmx_sel_yywrap(yyscan_t yyscanner
) { return 1; }
348 #define YY_SKIP_YYWRAP
350 typedef unsigned char YY_CHAR
;
352 typedef int yy_state_type
;
354 #define yytext_ptr yytext_r
356 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
357 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
358 static int yy_get_next_buffer (yyscan_t yyscanner
);
359 #if defined(__GNUC__) && __GNUC__ >= 3
360 __attribute__((__noreturn__
))
362 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
364 /* Done after the current pattern has been matched and before the
365 * corresponding action - sets up yytext.
367 #define YY_DO_BEFORE_ACTION \
368 yyg->yytext_ptr = yy_bp; \
369 yyleng = (size_t) (yy_cp - yy_bp); \
370 yyg->yy_hold_char = *yy_cp; \
372 yyg->yy_c_buf_p = yy_cp;
374 #define YY_NUM_RULES 21
375 #define YY_END_OF_BUFFER 22
376 /* This struct is not used in this scanner,
377 but its presence is necessary. */
380 flex_int32_t yy_verify
;
383 static yyconst flex_int16_t yy_accept
[76] =
385 0, 0, 0, 0, 0, 0, 0, 0, 22, 20,
386 18, 6, 15, 20, 1, 20, 20, 2, 6, 16,
387 20, 17, 20, 19, 17, 17, 17, 17, 17, 17,
388 20, 17, 17, 17, 17, 18, 16, 0, 4, 0,
389 1, 12, 3, 3, 2, 19, 19, 17, 5, 17,
390 17, 17, 13, 10, 17, 13, 11, 8, 17, 7,
391 17, 0, 0, 3, 12, 17, 15, 14, 8, 0,
395 static yyconst YY_CHAR yy_ec
[256] =
397 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
398 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 2, 4, 5, 6, 1, 1, 7, 1, 1,
401 1, 1, 8, 1, 8, 9, 1, 10, 10, 10,
402 10, 10, 10, 10, 10, 10, 10, 1, 11, 12,
403 13, 12, 1, 1, 14, 14, 14, 14, 15, 14,
404 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
405 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
406 1, 16, 1, 1, 17, 1, 18, 14, 14, 19,
408 20, 21, 22, 14, 14, 14, 14, 14, 14, 23,
409 24, 25, 14, 26, 27, 28, 29, 14, 14, 30,
410 31, 14, 1, 32, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 static yyconst YY_CHAR yy_meta
[33] =
429 1, 1, 2, 1, 1, 1, 1, 1, 3, 4,
430 1, 1, 1, 4, 4, 1, 4, 4, 4, 4,
431 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
435 static yyconst flex_uint16_t yy_base
[80] =
437 0, 0, 93, 92, 10, 12, 0, 0, 115, 118,
438 35, 37, 101, 37, 0, 106, 102, 35, 118, 98,
439 97, 0, 106, 99, 84, 80, 81, 78, 79, 78,
440 69, 25, 76, 26, 79, 54, 118, 43, 118, 93,
441 0, 118, 48, 50, 52, 88, 65, 0, 118, 77,
442 71, 66, 0, 0, 67, 118, 0, 64, 70, 0,
443 63, 56, 79, 67, 0, 59, 0, 0, 0, 73,
444 69, 61, 44, 0, 118, 77, 81, 83, 50
447 static yyconst flex_int16_t yy_def
[80] =
449 75, 1, 1, 1, 1, 1, 1, 1, 75, 75,
450 75, 75, 75, 76, 77, 75, 75, 78, 75, 75,
451 75, 79, 75, 78, 79, 79, 79, 79, 79, 79,
452 75, 79, 79, 79, 79, 75, 75, 76, 75, 75,
453 77, 75, 75, 75, 78, 78, 78, 79, 75, 79,
454 79, 79, 79, 79, 79, 75, 79, 79, 79, 79,
455 79, 75, 75, 78, 79, 79, 79, 79, 79, 75,
456 75, 75, 79, 79, 0, 75, 75, 75, 75
459 static yyconst flex_uint16_t yy_nxt
[151] =
461 10, 11, 12, 13, 14, 15, 16, 10, 17, 18,
462 19, 20, 21, 22, 22, 23, 24, 25, 22, 22,
463 22, 26, 27, 28, 22, 22, 22, 29, 22, 30,
464 22, 31, 33, 34, 33, 34, 36, 36, 36, 36,
465 35, 39, 35, 44, 45, 57, 59, 39, 60, 47,
466 53, 53, 40, 48, 47, 36, 36, 43, 40, 43,
467 44, 45, 62, 70, 62, 71, 47, 62, 74, 62,
468 72, 47, 63, 75, 64, 75, 64, 38, 71, 38,
469 38, 41, 71, 41, 41, 46, 46, 73, 72, 60,
470 69, 67, 68, 67, 66, 65, 75, 38, 61, 58,
472 56, 55, 54, 53, 52, 51, 50, 75, 49, 37,
473 37, 43, 42, 37, 75, 32, 32, 9, 75, 75,
474 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
475 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
476 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
479 static yyconst flex_int16_t yy_chk
[151] =
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 5, 5, 6, 6, 11, 11, 12, 12,
485 5, 14, 6, 18, 18, 32, 34, 38, 34, 18,
486 32, 34, 14, 79, 18, 36, 36, 43, 38, 44,
487 45, 45, 43, 62, 44, 62, 45, 43, 73, 44,
488 72, 45, 47, 47, 47, 64, 64, 76, 71, 76,
489 76, 77, 70, 77, 77, 78, 78, 66, 63, 61,
490 59, 58, 55, 52, 51, 50, 46, 40, 35, 33,
492 31, 30, 29, 28, 27, 26, 25, 24, 23, 21,
493 20, 17, 16, 13, 9, 4, 3, 75, 75, 75,
494 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
495 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
496 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
499 /* The intent behind this definition is that it'll catch
500 * any uses of REJECT which flex missed.
502 #define REJECT reject_used_but_not_detected
503 #define yymore() yymore_used_but_not_detected
504 #define YY_MORE_ADJ 0
505 #define YY_RESTORE_YY_MORE_OFFSET
508 * This file is part of the GROMACS molecular simulation package.
510 * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
511 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
512 * and including many others, as listed in the AUTHORS file in the
513 * top-level source directory and at http://www.gromacs.org.
515 * GROMACS is free software; you can redistribute it and/or
516 * modify it under the terms of the GNU Lesser General Public License
517 * as published by the Free Software Foundation; either version 2.1
518 * of the License, or (at your option) any later version.
520 * GROMACS is distributed in the hope that it will be useful,
521 * but WITHOUT ANY WARRANTY; without even the implied warranty of
522 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
523 * Lesser General Public License for more details.
525 * You should have received a copy of the GNU Lesser General Public
526 * License along with GROMACS; if not, see
527 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
528 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
530 * If you want to redistribute modifications to GROMACS, please
531 * consider that scientific software is very special. Version
532 * control is crucial - bugs must be traceable. We will be happy to
533 * consider code for inclusion in the official distribution, but
534 * derived work must not be called official GROMACS. Details are found
535 * in the README & COPYING files - if they are missing, get the
536 * official version at http://www.gromacs.org.
538 * To help us fund GROMACS development, we humbly ask that you cite
539 * the research papers on the package. Check out http://www.gromacs.org.
541 /*! \cond \internal \file scanner.l
543 * Tokenizer for the selection language.
545 * \author Teemu Murtola <teemu.murtola@gmail.com>
546 * \ingroup module_selection
549 /*! \internal \file scanner.cpp
551 * Generated (from scanner.l by Flex) tokenizer for the selection language.
553 * \ingroup module_selection
557 #include "gromacs/utility/cstringutil.h"
558 #include "gromacs/utility/stringutil.h"
562 #include "scanner_internal.h"
564 // This macro makes the actions a bit shorter, since nearly every action needs
566 #define ADD_TOKEN _gmx_sel_lexer_add_token(yylloc, yytext, yyleng, state)
568 // Set YY_BREAK to an empty value to avoid warnings (for the PGI compiler)
569 // when we have return statements followed by break. Instead, we add breaks
573 #ifdef __INTEL_COMPILER
574 // Ignore unused variables in generated code.
575 #pragma warning(disable:593)
577 #define YY_NO_UNISTD_H 1
581 #line 582 "scanner.cpp"
588 #ifndef YY_NO_UNISTD_H
589 /* Special case for "unistd.h", since it is non-ANSI. We include it way
590 * down here because we want the user's section 1 to have been scanned first.
591 * The user has a chance to override it with an option.
596 #ifndef YY_EXTRA_TYPE
597 #define YY_EXTRA_TYPE void *
600 /* Holds the entire state of the reentrant scanner. */
604 /* User-defined. Not touched by flex. */
605 YY_EXTRA_TYPE yyextra_r
;
607 /* The rest are the same as the globals declared in the non-reentrant scanner. */
608 FILE *yyin_r
, *yyout_r
;
609 size_t yy_buffer_stack_top
; /**< index of top of stack. */
610 size_t yy_buffer_stack_max
; /**< capacity of stack. */
611 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
613 yy_size_t yy_n_chars
;
618 int yy_did_buffer_switch_on_eof
;
619 int yy_start_stack_ptr
;
620 int yy_start_stack_depth
;
622 yy_state_type yy_last_accepting_state
;
623 char* yy_last_accepting_cpos
;
632 }; /* end struct yyguts_t */
634 static int yy_init_globals (yyscan_t yyscanner
);
636 int _gmx_sel_yylex_init (yyscan_t
* scanner
);
638 int _gmx_sel_yylex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
640 /* Accessor methods to globals.
641 These are made visible to non-reentrant scanners for convenience. */
643 int _gmx_sel_yylex_destroy (yyscan_t yyscanner
);
645 int _gmx_sel_yyget_debug (yyscan_t yyscanner
);
647 void _gmx_sel_yyset_debug (int debug_flag
,yyscan_t yyscanner
);
649 YY_EXTRA_TYPE
_gmx_sel_yyget_extra (yyscan_t yyscanner
);
651 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
653 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner
);
655 void _gmx_sel_yyset_in (FILE * _in_str
,yyscan_t yyscanner
);
657 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner
);
659 void _gmx_sel_yyset_out (FILE * _out_str
,yyscan_t yyscanner
);
661 yy_size_t
_gmx_sel_yyget_leng (yyscan_t yyscanner
);
663 char *_gmx_sel_yyget_text (yyscan_t yyscanner
);
665 int _gmx_sel_yyget_lineno (yyscan_t yyscanner
);
667 void _gmx_sel_yyset_lineno (int _line_number
,yyscan_t yyscanner
);
669 int _gmx_sel_yyget_column (yyscan_t yyscanner
);
671 void _gmx_sel_yyset_column (int _column_no
,yyscan_t yyscanner
);
673 /* Macros after this point can all be overridden by user definitions in
677 #ifndef YY_SKIP_YYWRAP
679 extern "C" int _gmx_sel_yywrap (yyscan_t yyscanner
);
681 extern int _gmx_sel_yywrap (yyscan_t yyscanner
);
687 static void yyunput (int c
,char *buf_ptr
,yyscan_t yyscanner
);
692 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
695 #ifdef YY_NEED_STRLEN
696 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
702 static int yyinput (yyscan_t yyscanner
);
704 static int input (yyscan_t yyscanner
);
709 /* Amount of stuff to slurp up with each read. */
710 #ifndef YY_READ_BUF_SIZE
712 /* On IA-64, the buffer size is 16k, not 8k */
713 #define YY_READ_BUF_SIZE 16384
715 #define YY_READ_BUF_SIZE 8192
716 #endif /* __ia64__ */
719 /* Copy whatever the last rule matched to the standard output. */
721 /* This used to be an fputs(), but since the string might contain NUL's,
722 * we now use fwrite().
724 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
727 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
728 * is returned in "result".
731 #define YY_INPUT(buf,result,max_size) \
732 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
736 for ( n = 0; n < max_size && \
737 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
740 buf[n++] = (char) c; \
741 if ( c == EOF && ferror( yyin ) ) \
742 YY_FATAL_ERROR( "input in flex scanner failed" ); \
748 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
750 if( errno != EINTR) \
752 YY_FATAL_ERROR( "input in flex scanner failed" ); \
763 /* No semi-colon after return; correct usage is to write "yyterminate();" -
764 * we don't want an extra ';' after the "return" because that will cause
765 * some compilers to complain about unreachable statements.
768 #define yyterminate() return YY_NULL
771 /* Number of entries by which start-condition stack grows. */
772 #ifndef YY_START_STACK_INCR
773 #define YY_START_STACK_INCR 25
776 /* Report a fatal error. */
777 #ifndef YY_FATAL_ERROR
778 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
781 /* end tables serialization structures and prototypes */
783 /* Default declaration of generated scanner - a define so the user can
784 * easily add parameters.
787 #define YY_DECL_IS_OURS 1
789 extern int _gmx_sel_yylex (yyscan_t yyscanner
);
791 #define YY_DECL int _gmx_sel_yylex (yyscan_t yyscanner)
792 #endif /* !YY_DECL */
794 /* Code executed at the beginning of each rule, after yytext and yyleng
797 #ifndef YY_USER_ACTION
798 #define YY_USER_ACTION
801 /* Code executed at the end of each rule. */
803 #define YY_BREAK /*LINTED*/break;
806 #define YY_RULE_SETUP \
809 /** The main scanner function which does all the work.
813 yy_state_type yy_current_state
;
816 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
826 if ( ! yyg
->yy_start
)
827 yyg
->yy_start
= 1; /* first start state */
835 if ( ! YY_CURRENT_BUFFER
) {
836 _gmx_sel_yyensure_buffer_stack (yyscanner
);
837 YY_CURRENT_BUFFER_LVALUE
=
838 _gmx_sel_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
841 _gmx_sel_yy_load_buffer_state(yyscanner
);
845 #line 104 "scanner.l"
849 gmx_sel_lexer_t
*state
= _gmx_sel_yyget_extra(yyscanner
);
851 /* Return a token if one is pending */
852 retval
= _gmx_sel_lexer_process_pending(yylval
, yylloc
, state
);
857 /* Handle the start conditions for 'of' matching */
861 state
->bMatchOf
= false;
863 else if (state
->bMatchBool
)
866 state
->bMatchBool
= false;
868 else if (state
->bCmdStart
)
871 state
->bCmdStart
= false;
879 #line 880 "scanner.cpp"
881 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
883 yy_cp
= yyg
->yy_c_buf_p
;
885 /* Support of yytext. */
886 *yy_cp
= yyg
->yy_hold_char
;
888 /* yy_bp points to the position in yy_ch_buf of the start of
893 yy_current_state
= yyg
->yy_start
;
897 YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)] ;
898 if ( yy_accept
[yy_current_state
] )
900 yyg
->yy_last_accepting_state
= yy_current_state
;
901 yyg
->yy_last_accepting_cpos
= yy_cp
;
903 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
905 yy_current_state
= (int) yy_def
[yy_current_state
];
906 if ( yy_current_state
>= 76 )
907 yy_c
= yy_meta
[(unsigned int) yy_c
];
909 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
912 while ( yy_current_state
!= 75 );
913 yy_cp
= yyg
->yy_last_accepting_cpos
;
914 yy_current_state
= yyg
->yy_last_accepting_state
;
917 yy_act
= yy_accept
[yy_current_state
];
921 do_action
: /* This label is used only to access EOF actions. */
924 { /* beginning of action switch */
925 case 0: /* must back up */
926 /* undo the effects of YY_DO_BEFORE_ACTION */
927 *yy_cp
= yyg
->yy_hold_char
;
928 yy_cp
= yyg
->yy_last_accepting_cpos
;
929 yy_current_state
= yyg
->yy_last_accepting_state
;
934 #line 137 "scanner.l"
939 #line 138 "scanner.l"
940 { yylval
->i
= strtol(yytext
, NULL
, 10); ADD_TOKEN
; return TOK_INT
; }
944 #line 139 "scanner.l"
945 { yylval
->r
= strtod(yytext
, NULL
); ADD_TOKEN
; return TOK_REAL
; }
949 #line 140 "scanner.l"
950 { yylval
->str
= gmx_strndup(yytext
+1, yyleng
-2); ADD_TOKEN
; return STR
; }
953 /* rule 5 can match eol */
955 #line 142 "scanner.l"
956 { _gmx_sel_lexer_add_token(yylloc
, " ", 1, state
); break; }
959 /* rule 6 can match eol */
961 #line 143 "scanner.l"
963 if (yytext
[0] == ';' || state
->statusWriter
!= NULL
)
965 state
->pselstr
= gmx::stripString(state
->pselstr
);
966 state
->bCmdStart
= true;
971 _gmx_sel_lexer_add_token(yylloc
, " ", 1, state
);
976 case YY_STATE_EOF(cmdstart
):
977 #line 157 "scanner.l"
978 { state
->bCmdStart
= true; yyterminate(); }
980 case YY_STATE_EOF(INITIAL
):
981 case YY_STATE_EOF(matchof
):
982 case YY_STATE_EOF(matchbool
):
983 #line 158 "scanner.l"
984 { state
->bCmdStart
= true; return CMD_SEP
; }
989 #line 161 "scanner.l"
990 { ADD_TOKEN
; yylval
->i
= 1; return TOK_INT
; }
994 #line 162 "scanner.l"
995 { ADD_TOKEN
; yylval
->i
= 0; return TOK_INT
; }
1000 #line 164 "scanner.l"
1001 { ADD_TOKEN
; return GROUP
; }
1005 #line 165 "scanner.l"
1006 { ADD_TOKEN
; return TO
; }
1010 #line 166 "scanner.l"
1011 { ADD_TOKEN
; BEGIN(0); return OF
; }
1015 #line 167 "scanner.l"
1016 { ADD_TOKEN
; return AND
; }
1020 #line 168 "scanner.l"
1021 { ADD_TOKEN
; return OR
; }
1025 #line 169 "scanner.l"
1026 { ADD_TOKEN
; return XOR
; }
1030 #line 170 "scanner.l"
1031 { ADD_TOKEN
; return NOT
; }
1035 #line 171 "scanner.l"
1036 { yylval
->str
= gmx_strndup(yytext
, yyleng
); ADD_TOKEN
; return CMP_OP
; }
1040 #line 173 "scanner.l"
1041 { return _gmx_sel_lexer_process_identifier(yylval
, yylloc
, yytext
, yyleng
, state
); }
1044 /* rule 18 can match eol */
1046 #line 175 "scanner.l"
1047 { _gmx_sel_lexer_add_token(yylloc
, " ", 1, state
); break; }
1051 #line 176 "scanner.l"
1052 { yylval
->str
= gmx_strndup(yytext
, yyleng
); ADD_TOKEN
; return STR
; }
1056 #line 177 "scanner.l"
1057 { ADD_TOKEN
; return yytext
[0]; }
1061 #line 178 "scanner.l"
1062 YY_FATAL_ERROR( "flex scanner jammed" );
1064 #line 1065 "scanner.cpp"
1066 case YY_END_OF_BUFFER
:
1068 /* Amount of text matched not including the EOB char. */
1069 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
1071 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1072 *yy_cp
= yyg
->yy_hold_char
;
1073 YY_RESTORE_YY_MORE_OFFSET
1075 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1077 /* We're scanning a new file or input source. It's
1078 * possible that this happened because the user
1079 * just pointed yyin at a new source and called
1080 * _gmx_sel_yylex(). If so, then we have to assure
1081 * consistency between YY_CURRENT_BUFFER and our
1082 * globals. Here is the right place to do so, because
1083 * this is the first action (other than possibly a
1084 * back-up) that will match for the new input source.
1086 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1087 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1088 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1091 /* Note that here we test for yy_c_buf_p "<=" to the position
1092 * of the first EOB in the buffer, since yy_c_buf_p will
1093 * already have been incremented past the NUL character
1094 * (since all states make transitions on EOB to the
1095 * end-of-buffer state). Contrast this with the test
1098 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1099 { /* This was really a NUL. */
1100 yy_state_type yy_next_state
;
1102 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1104 yy_current_state
= yy_get_previous_state( yyscanner
);
1106 /* Okay, we're now positioned to make the NUL
1107 * transition. We couldn't have
1108 * yy_get_previous_state() go ahead and do it
1109 * for us because it doesn't know how to deal
1110 * with the possibility of jamming (and we don't
1111 * want to build jamming into it because then it
1112 * will run more slowly).
1115 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
1117 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1119 if ( yy_next_state
)
1121 /* Consume the NUL. */
1122 yy_cp
= ++yyg
->yy_c_buf_p
;
1123 yy_current_state
= yy_next_state
;
1129 yy_cp
= yyg
->yy_last_accepting_cpos
;
1130 yy_current_state
= yyg
->yy_last_accepting_state
;
1131 goto yy_find_action
;
1135 else switch ( yy_get_next_buffer( yyscanner
) )
1137 case EOB_ACT_END_OF_FILE
:
1139 yyg
->yy_did_buffer_switch_on_eof
= 0;
1141 if ( _gmx_sel_yywrap(yyscanner
) )
1143 /* Note: because we've taken care in
1144 * yy_get_next_buffer() to have set up
1145 * yytext, we can now set up
1146 * yy_c_buf_p so that if some total
1147 * hoser (like flex itself) wants to
1148 * call the scanner after we return the
1149 * YY_NULL, it'll still work - another
1150 * YY_NULL will get returned.
1152 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1154 yy_act
= YY_STATE_EOF(YY_START
);
1160 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1166 case EOB_ACT_CONTINUE_SCAN
:
1168 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1170 yy_current_state
= yy_get_previous_state( yyscanner
);
1172 yy_cp
= yyg
->yy_c_buf_p
;
1173 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1176 case EOB_ACT_LAST_MATCH
:
1178 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1180 yy_current_state
= yy_get_previous_state( yyscanner
);
1182 yy_cp
= yyg
->yy_c_buf_p
;
1183 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1184 goto yy_find_action
;
1191 "fatal flex scanner internal error--no action found" );
1192 } /* end of action switch */
1193 } /* end of scanning one token */
1194 } /* end of user's declarations */
1195 } /* end of _gmx_sel_yylex */
1197 /* yy_get_next_buffer - try to read in a new buffer
1199 * Returns a code representing an action:
1200 * EOB_ACT_LAST_MATCH -
1201 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1202 * EOB_ACT_END_OF_FILE - end of file
1204 static int yy_get_next_buffer (yyscan_t yyscanner
)
1206 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1207 char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1208 char *source
= yyg
->yytext_ptr
;
1209 yy_size_t number_to_move
, i
;
1212 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1214 "fatal flex scanner internal error--end of buffer missed" );
1216 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1217 { /* Don't try to fill the buffer, so this is an EOF. */
1218 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1220 /* We matched a single character, the EOB, so
1221 * treat this as a final EOF.
1223 return EOB_ACT_END_OF_FILE
;
1228 /* We matched some text prior to the EOB, first
1231 return EOB_ACT_LAST_MATCH
;
1235 /* Try to read more data. */
1237 /* First move last chars to start of buffer. */
1238 number_to_move
= (yy_size_t
) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1240 for ( i
= 0; i
< number_to_move
; ++i
)
1241 *(dest
++) = *(source
++);
1243 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1244 /* don't do the read, it's not guaranteed to return an EOF,
1247 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1251 yy_size_t num_to_read
=
1252 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1254 while ( num_to_read
<= 0 )
1255 { /* Not enough room in the buffer - grow it. */
1257 /* just a shorter name for the current buffer */
1258 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER_LVALUE
;
1260 int yy_c_buf_p_offset
=
1261 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1263 if ( b
->yy_is_our_buffer
)
1265 yy_size_t new_size
= b
->yy_buf_size
* 2;
1267 if ( new_size
<= 0 )
1268 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1270 b
->yy_buf_size
*= 2;
1272 b
->yy_ch_buf
= (char *)
1273 /* Include room in for 2 EOB chars. */
1274 _gmx_sel_yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1277 /* Can't grow it, we don't own it. */
1280 if ( ! b
->yy_ch_buf
)
1282 "fatal error - scanner input buffer overflow" );
1284 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1286 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1291 if ( num_to_read
> YY_READ_BUF_SIZE
)
1292 num_to_read
= YY_READ_BUF_SIZE
;
1294 /* Read in more data. */
1295 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1296 yyg
->yy_n_chars
, num_to_read
);
1298 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1301 if ( yyg
->yy_n_chars
== 0 )
1303 if ( number_to_move
== YY_MORE_ADJ
)
1305 ret_val
= EOB_ACT_END_OF_FILE
;
1306 _gmx_sel_yyrestart(yyin
,yyscanner
);
1311 ret_val
= EOB_ACT_LAST_MATCH
;
1312 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1313 YY_BUFFER_EOF_PENDING
;
1318 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1320 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1321 /* Extend the array by 50%, plus the number we really need. */
1322 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
1323 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) _gmx_sel_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
1324 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1325 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1328 yyg
->yy_n_chars
+= number_to_move
;
1329 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1330 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1332 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1337 /* yy_get_previous_state - get the state just before the EOB char was reached */
1339 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1341 yy_state_type yy_current_state
;
1343 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1345 yy_current_state
= yyg
->yy_start
;
1347 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1349 YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1350 if ( yy_accept
[yy_current_state
] )
1352 yyg
->yy_last_accepting_state
= yy_current_state
;
1353 yyg
->yy_last_accepting_cpos
= yy_cp
;
1355 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1357 yy_current_state
= (int) yy_def
[yy_current_state
];
1358 if ( yy_current_state
>= 76 )
1359 yy_c
= yy_meta
[(unsigned int) yy_c
];
1361 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1364 return yy_current_state
;
1367 /* yy_try_NUL_trans - try to make a transition on the NUL character
1370 * next_state = yy_try_NUL_trans( current_state );
1372 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1375 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1376 char *yy_cp
= yyg
->yy_c_buf_p
;
1379 if ( yy_accept
[yy_current_state
] )
1381 yyg
->yy_last_accepting_state
= yy_current_state
;
1382 yyg
->yy_last_accepting_cpos
= yy_cp
;
1384 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1386 yy_current_state
= (int) yy_def
[yy_current_state
];
1387 if ( yy_current_state
>= 76 )
1388 yy_c
= yy_meta
[(unsigned int) yy_c
];
1390 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1391 yy_is_jam
= (yy_current_state
== 75);
1394 return yy_is_jam
? 0 : yy_current_state
;
1399 static void yyunput (int c
, char * yy_bp
, yyscan_t yyscanner
)
1402 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1404 yy_cp
= yyg
->yy_c_buf_p
;
1406 /* undo effects of setting up yytext */
1407 *yy_cp
= yyg
->yy_hold_char
;
1409 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1410 { /* need to shift things up to make room */
1411 /* +2 for EOB chars. */
1412 yy_size_t number_to_move
= yyg
->yy_n_chars
+ 2;
1413 char *dest
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[
1414 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
+ 2];
1416 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
];
1418 while ( source
> YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1419 *--dest
= *--source
;
1421 yy_cp
+= (int) (dest
- source
);
1422 yy_bp
+= (int) (dest
- source
);
1423 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
=
1424 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
;
1426 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1427 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1430 *--yy_cp
= (char) c
;
1432 yyg
->yytext_ptr
= yy_bp
;
1433 yyg
->yy_hold_char
= *yy_cp
;
1434 yyg
->yy_c_buf_p
= yy_cp
;
1441 static int yyinput (yyscan_t yyscanner
)
1443 static int input (yyscan_t yyscanner
)
1448 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1450 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1452 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1454 /* yy_c_buf_p now points to the character we want to return.
1455 * If this occurs *before* the EOB characters, then it's a
1456 * valid NUL; if not, then we've hit the end of the buffer.
1458 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1459 /* This was really a NUL. */
1460 *yyg
->yy_c_buf_p
= '\0';
1463 { /* need more input */
1464 yy_size_t offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1467 switch ( yy_get_next_buffer( yyscanner
) )
1469 case EOB_ACT_LAST_MATCH
:
1470 /* This happens because yy_g_n_b()
1471 * sees that we've accumulated a
1472 * token and flags that we need to
1473 * try matching the token before
1474 * proceeding. But for input(),
1475 * there's no matching to consider.
1476 * So convert the EOB_ACT_LAST_MATCH
1477 * to EOB_ACT_END_OF_FILE.
1480 /* Reset buffer status. */
1481 _gmx_sel_yyrestart(yyin
,yyscanner
);
1485 case EOB_ACT_END_OF_FILE
:
1487 if ( _gmx_sel_yywrap(yyscanner
) )
1490 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1493 return yyinput(yyscanner
);
1495 return input(yyscanner
);
1499 case EOB_ACT_CONTINUE_SCAN
:
1500 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1506 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1507 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1508 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1512 #endif /* ifndef YY_NO_INPUT */
1514 /** Immediately switch to a different input stream.
1515 * @param input_file A readable stream.
1516 * @param yyscanner The scanner object.
1517 * @note This function does not reset the start condition to @c INITIAL .
1519 void _gmx_sel_yyrestart (FILE * input_file
, yyscan_t yyscanner
)
1521 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1523 if ( ! YY_CURRENT_BUFFER
){
1524 _gmx_sel_yyensure_buffer_stack (yyscanner
);
1525 YY_CURRENT_BUFFER_LVALUE
=
1526 _gmx_sel_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1529 _gmx_sel_yy_init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1530 _gmx_sel_yy_load_buffer_state(yyscanner
);
1533 /** Switch to a different input buffer.
1534 * @param new_buffer The new input buffer.
1535 * @param yyscanner The scanner object.
1537 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1539 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1541 /* TODO. We should be able to replace this entire function body
1543 * _gmx_sel_yypop_buffer_state();
1544 * _gmx_sel_yypush_buffer_state(new_buffer);
1546 _gmx_sel_yyensure_buffer_stack (yyscanner
);
1547 if ( YY_CURRENT_BUFFER
== new_buffer
)
1550 if ( YY_CURRENT_BUFFER
)
1552 /* Flush out information for old buffer. */
1553 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1554 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1555 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1558 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1559 _gmx_sel_yy_load_buffer_state(yyscanner
);
1561 /* We don't actually know whether we did this switch during
1562 * EOF (_gmx_sel_yywrap()) processing, but the only time this flag
1563 * is looked at is after _gmx_sel_yywrap() is called, so it's safe
1564 * to go ahead and always set it.
1566 yyg
->yy_did_buffer_switch_on_eof
= 1;
1569 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner
)
1571 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1572 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1573 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1574 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1575 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1578 /** Allocate and initialize an input buffer state.
1579 * @param file A readable stream.
1580 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1581 * @param yyscanner The scanner object.
1582 * @return the allocated buffer state.
1584 YY_BUFFER_STATE
_gmx_sel_yy_create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1588 b
= (YY_BUFFER_STATE
) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1590 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1592 b
->yy_buf_size
= (yy_size_t
)size
;
1594 /* yy_ch_buf has to be 2 characters longer than the size given because
1595 * we need to put in 2 end-of-buffer characters.
1597 b
->yy_ch_buf
= (char *) _gmx_sel_yyalloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1598 if ( ! b
->yy_ch_buf
)
1599 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1601 b
->yy_is_our_buffer
= 1;
1603 _gmx_sel_yy_init_buffer(b
,file
,yyscanner
);
1608 /** Destroy the buffer.
1609 * @param b a buffer created with _gmx_sel_yy_create_buffer()
1610 * @param yyscanner The scanner object.
1612 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1614 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1619 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1620 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1622 if ( b
->yy_is_our_buffer
)
1623 _gmx_sel_yyfree((void *) b
->yy_ch_buf
,yyscanner
);
1625 _gmx_sel_yyfree((void *) b
,yyscanner
);
1628 /* Initializes or reinitializes a buffer.
1629 * This function is sometimes called more than once on the same buffer,
1630 * such as during a _gmx_sel_yyrestart() or at EOF.
1632 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1636 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1638 _gmx_sel_yy_flush_buffer(b
,yyscanner
);
1640 b
->yy_input_file
= file
;
1641 b
->yy_fill_buffer
= 1;
1643 /* If b is the current buffer, then _gmx_sel_yy_init_buffer was _probably_
1644 * called from _gmx_sel_yyrestart() or through yy_get_next_buffer.
1645 * In that case, we don't want to reset the lineno or column.
1647 if (b
!= YY_CURRENT_BUFFER
){
1648 b
->yy_bs_lineno
= 1;
1649 b
->yy_bs_column
= 0;
1652 b
->yy_is_interactive
= 0;
1657 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1658 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1659 * @param yyscanner The scanner object.
1661 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1663 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1669 /* We always need two end-of-buffer characters. The first causes
1670 * a transition to the end-of-buffer state. The second causes
1671 * a jam in that state.
1673 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1674 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1676 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1679 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1681 if ( b
== YY_CURRENT_BUFFER
)
1682 _gmx_sel_yy_load_buffer_state(yyscanner
);
1685 /** Pushes the new state onto the stack. The new state becomes
1686 * the current state. This function will allocate the stack
1688 * @param new_buffer The new state.
1689 * @param yyscanner The scanner object.
1691 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1693 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1694 if (new_buffer
== NULL
)
1697 _gmx_sel_yyensure_buffer_stack(yyscanner
);
1699 /* This block is copied from _gmx_sel_yy_switch_to_buffer. */
1700 if ( YY_CURRENT_BUFFER
)
1702 /* Flush out information for old buffer. */
1703 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1704 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1705 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1708 /* Only push if top exists. Otherwise, replace top. */
1709 if (YY_CURRENT_BUFFER
)
1710 yyg
->yy_buffer_stack_top
++;
1711 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1713 /* copied from _gmx_sel_yy_switch_to_buffer. */
1714 _gmx_sel_yy_load_buffer_state(yyscanner
);
1715 yyg
->yy_did_buffer_switch_on_eof
= 1;
1718 /** Removes and deletes the top of the stack, if present.
1719 * The next element becomes the new top.
1720 * @param yyscanner The scanner object.
1722 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner
)
1724 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1725 if (!YY_CURRENT_BUFFER
)
1728 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1729 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1730 if (yyg
->yy_buffer_stack_top
> 0)
1731 --yyg
->yy_buffer_stack_top
;
1733 if (YY_CURRENT_BUFFER
) {
1734 _gmx_sel_yy_load_buffer_state(yyscanner
);
1735 yyg
->yy_did_buffer_switch_on_eof
= 1;
1739 /* Allocates the stack if it does not exist.
1740 * Guarantees space for at least one push.
1742 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner
)
1744 yy_size_t num_to_alloc
;
1745 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1747 if (!yyg
->yy_buffer_stack
) {
1749 /* First allocation is just for 2 elements, since we don't know if this
1750 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1751 * immediate realloc on the next call.
1753 num_to_alloc
= 1; // After all that talk, this was set to 1 anyways...
1754 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_gmx_sel_yyalloc
1755 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1757 if ( ! yyg
->yy_buffer_stack
)
1758 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1760 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1762 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1763 yyg
->yy_buffer_stack_top
= 0;
1767 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1769 /* Increase the buffer to prepare for a possible push. */
1770 yy_size_t grow_size
= 8 /* arbitrary grow size */;
1772 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1773 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_gmx_sel_yyrealloc
1774 (yyg
->yy_buffer_stack
,
1775 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1777 if ( ! yyg
->yy_buffer_stack
)
1778 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1780 /* zero only the new slots.*/
1781 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1782 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1786 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1787 * @param base the character buffer
1788 * @param size the size in bytes of the character buffer
1789 * @param yyscanner The scanner object.
1790 * @return the newly allocated buffer state object.
1792 YY_BUFFER_STATE
_gmx_sel_yy_scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1797 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1798 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1799 /* They forgot to leave room for the EOB's. */
1802 b
= (YY_BUFFER_STATE
) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1804 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_buffer()" );
1806 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1807 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1808 b
->yy_is_our_buffer
= 0;
1809 b
->yy_input_file
= 0;
1810 b
->yy_n_chars
= b
->yy_buf_size
;
1811 b
->yy_is_interactive
= 0;
1813 b
->yy_fill_buffer
= 0;
1814 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1816 _gmx_sel_yy_switch_to_buffer(b
,yyscanner
);
1821 /** Setup the input buffer state to scan a string. The next call to _gmx_sel_yylex() will
1822 * scan from a @e copy of @a str.
1823 * @param yystr a NUL-terminated string to scan
1824 * @param yyscanner The scanner object.
1825 * @return the newly allocated buffer state object.
1826 * @note If you want to scan bytes that may contain NUL values, then use
1827 * _gmx_sel_yy_scan_bytes() instead.
1829 YY_BUFFER_STATE
_gmx_sel_yy_scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1832 return _gmx_sel_yy_scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1835 /** Setup the input buffer state to scan the given bytes. The next call to _gmx_sel_yylex() will
1836 * scan from a @e copy of @a bytes.
1837 * @param yybytes the byte buffer to scan
1838 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1839 * @param yyscanner The scanner object.
1840 * @return the newly allocated buffer state object.
1842 YY_BUFFER_STATE
_gmx_sel_yy_scan_bytes (yyconst
char * yybytes
, yy_size_t _yybytes_len
, yyscan_t yyscanner
)
1849 /* Get memory for full buffer, including space for trailing EOB's. */
1850 n
= _yybytes_len
+ 2;
1851 buf
= (char *) _gmx_sel_yyalloc(n
,yyscanner
);
1853 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_bytes()" );
1855 for ( i
= 0; i
< _yybytes_len
; ++i
)
1856 buf
[i
] = yybytes
[i
];
1858 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1860 b
= _gmx_sel_yy_scan_buffer(buf
,n
,yyscanner
);
1862 YY_FATAL_ERROR( "bad buffer in _gmx_sel_yy_scan_bytes()" );
1864 /* It's okay to grow etc. this buffer, and we should throw it
1865 * away when we're done.
1867 b
->yy_is_our_buffer
= 1;
1872 #ifndef YY_EXIT_FAILURE
1873 #define YY_EXIT_FAILURE 2
1876 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
1878 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1880 (void) fprintf( stderr
, "%s\n", msg
);
1881 exit( YY_EXIT_FAILURE
);
1884 /* Redefine yyless() so it works in section 3 code. */
1890 /* Undo effects of setting up yytext. */ \
1891 int yyless_macro_arg = (n); \
1892 YY_LESS_LINENO(yyless_macro_arg);\
1893 yytext[yyleng] = yyg->yy_hold_char; \
1894 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1895 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1896 *yyg->yy_c_buf_p = '\0'; \
1897 yyleng = yyless_macro_arg; \
1901 /* Accessor methods (get/set functions) to struct members. */
1903 /** Get the user-defined data for this scanner.
1904 * @param yyscanner The scanner object.
1906 YY_EXTRA_TYPE
_gmx_sel_yyget_extra (yyscan_t yyscanner
)
1908 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1912 /** Get the current line number.
1913 * @param yyscanner The scanner object.
1915 int _gmx_sel_yyget_lineno (yyscan_t yyscanner
)
1917 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1919 if (! YY_CURRENT_BUFFER
)
1925 /** Get the current column number.
1926 * @param yyscanner The scanner object.
1928 int _gmx_sel_yyget_column (yyscan_t yyscanner
)
1930 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1932 if (! YY_CURRENT_BUFFER
)
1938 /** Get the input stream.
1939 * @param yyscanner The scanner object.
1941 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner
)
1943 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1947 /** Get the output stream.
1948 * @param yyscanner The scanner object.
1950 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner
)
1952 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1956 /** Get the length of the current token.
1957 * @param yyscanner The scanner object.
1959 yy_size_t
_gmx_sel_yyget_leng (yyscan_t yyscanner
)
1961 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1965 /** Get the current token.
1966 * @param yyscanner The scanner object.
1969 char *_gmx_sel_yyget_text (yyscan_t yyscanner
)
1971 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1975 /** Set the user-defined data. This data is never touched by the scanner.
1976 * @param user_defined The data to be associated with this scanner.
1977 * @param yyscanner The scanner object.
1979 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
1981 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1982 yyextra
= user_defined
;
1985 /** Set the current line number.
1986 * @param _line_number line number
1987 * @param yyscanner The scanner object.
1989 void _gmx_sel_yyset_lineno (int _line_number
, yyscan_t yyscanner
)
1991 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1993 /* lineno is only valid if an input buffer exists. */
1994 if (! YY_CURRENT_BUFFER
)
1995 YY_FATAL_ERROR( "_gmx_sel_yyset_lineno called with no buffer" );
1997 yylineno
= _line_number
;
2000 /** Set the current column.
2001 * @param _column_no column number
2002 * @param yyscanner The scanner object.
2004 void _gmx_sel_yyset_column (int _column_no
, yyscan_t yyscanner
)
2006 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2008 /* column is only valid if an input buffer exists. */
2009 if (! YY_CURRENT_BUFFER
)
2010 YY_FATAL_ERROR( "_gmx_sel_yyset_column called with no buffer" );
2012 yycolumn
= _column_no
;
2015 /** Set the input stream. This does not discard the current
2017 * @param _in_str A readable stream.
2018 * @param yyscanner The scanner object.
2019 * @see _gmx_sel_yy_switch_to_buffer
2021 void _gmx_sel_yyset_in (FILE * _in_str
, yyscan_t yyscanner
)
2023 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2027 void _gmx_sel_yyset_out (FILE * _out_str
, yyscan_t yyscanner
)
2029 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2033 int _gmx_sel_yyget_debug (yyscan_t yyscanner
)
2035 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2036 return yy_flex_debug
;
2039 void _gmx_sel_yyset_debug (int _bdebug
, yyscan_t yyscanner
)
2041 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2042 yy_flex_debug
= _bdebug
;
2045 /* Accessor methods for yylval and yylloc */
2047 /* User-visible API */
2049 /* _gmx_sel_yylex_init is special because it creates the scanner itself, so it is
2050 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2051 * That's why we explicitly handle the declaration, instead of using our macros.
2054 int _gmx_sel_yylex_init(yyscan_t
* ptr_yy_globals
)
2057 if (ptr_yy_globals
== NULL
){
2062 *ptr_yy_globals
= (yyscan_t
) _gmx_sel_yyalloc ( sizeof( struct yyguts_t
), NULL
);
2064 if (*ptr_yy_globals
== NULL
){
2069 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2070 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2072 return yy_init_globals ( *ptr_yy_globals
);
2075 /* _gmx_sel_yylex_init_extra has the same functionality as _gmx_sel_yylex_init, but follows the
2076 * convention of taking the scanner as the last argument. Note however, that
2077 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2078 * is the reason, too, why this function also must handle its own declaration).
2079 * The user defined value in the first argument will be available to _gmx_sel_yyalloc in
2080 * the yyextra field.
2083 int _gmx_sel_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
2086 struct yyguts_t dummy_yyguts
;
2088 _gmx_sel_yyset_extra (yy_user_defined
, &dummy_yyguts
);
2090 if (ptr_yy_globals
== NULL
){
2095 *ptr_yy_globals
= (yyscan_t
) _gmx_sel_yyalloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
2097 if (*ptr_yy_globals
== NULL
){
2102 /* By setting to 0xAA, we expose bugs in
2103 yy_init_globals. Leave at 0x00 for releases. */
2104 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2106 _gmx_sel_yyset_extra (yy_user_defined
, *ptr_yy_globals
);
2108 return yy_init_globals ( *ptr_yy_globals
);
2111 static int yy_init_globals (yyscan_t yyscanner
)
2113 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2114 /* Initialization is the same as for the non-reentrant scanner.
2115 * This function is called from _gmx_sel_yylex_destroy(), so don't allocate here.
2118 yyg
->yy_buffer_stack
= 0;
2119 yyg
->yy_buffer_stack_top
= 0;
2120 yyg
->yy_buffer_stack_max
= 0;
2121 yyg
->yy_c_buf_p
= (char *) 0;
2125 yyg
->yy_start_stack_ptr
= 0;
2126 yyg
->yy_start_stack_depth
= 0;
2127 yyg
->yy_start_stack
= NULL
;
2129 /* Defined in main.c */
2138 /* For future reference: Set errno on error, since we are called by
2139 * _gmx_sel_yylex_init()
2144 /* _gmx_sel_yylex_destroy is for both reentrant and non-reentrant scanners. */
2145 int _gmx_sel_yylex_destroy (yyscan_t yyscanner
)
2147 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2149 /* Pop the buffer stack, destroying each element. */
2150 while(YY_CURRENT_BUFFER
){
2151 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
2152 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2153 _gmx_sel_yypop_buffer_state(yyscanner
);
2156 /* Destroy the stack itself. */
2157 _gmx_sel_yyfree(yyg
->yy_buffer_stack
,yyscanner
);
2158 yyg
->yy_buffer_stack
= NULL
;
2160 /* Destroy the start condition stack. */
2161 _gmx_sel_yyfree(yyg
->yy_start_stack
,yyscanner
);
2162 yyg
->yy_start_stack
= NULL
;
2164 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2165 * _gmx_sel_yylex() is called, initialization will occur. */
2166 yy_init_globals( yyscanner
);
2168 /* Destroy the main struct (reentrant only). */
2169 _gmx_sel_yyfree ( yyscanner
, yyscanner
);
2175 * Internal utility routines.
2179 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
2181 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2185 for ( i
= 0; i
< n
; ++i
)
2190 #ifdef YY_NEED_STRLEN
2191 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
2194 for ( n
= 0; s
[n
]; ++n
)
2201 void *_gmx_sel_yyalloc (yy_size_t size
, yyscan_t yyscanner
)
2203 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2205 return (void *) malloc( size
);
2208 void *_gmx_sel_yyrealloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
2210 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2213 /* The cast to (char *) in the following accommodates both
2214 * implementations that use char* generic pointers, and those
2215 * that use void* generic pointers. It works with the latter
2216 * because both ANSI C and C++ allow castless assignment from
2217 * any pointer type to void*, and deal with argument conversions
2218 * as though doing an assignment.
2220 return (void *) realloc( (char *) ptr
, size
);
2223 void _gmx_sel_yyfree (void * ptr
, yyscan_t yyscanner
)
2225 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2227 free( (char *) ptr
); /* see _gmx_sel_yyrealloc() for (char *) cast */
2230 #define YYTABLES_NAME "yytables"
2232 #line 178 "scanner.l"