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 5
23 #define YY_FLEX_SUBMINOR_VERSION 37
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. */
173 #define YY_BUF_SIZE 16384
176 /* The state buf must be large enough to hold one state per character in the main buffer.
178 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
180 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
181 #define YY_TYPEDEF_YY_BUFFER_STATE
182 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
185 #ifndef YY_TYPEDEF_YY_SIZE_T
186 #define YY_TYPEDEF_YY_SIZE_T
187 typedef size_t yy_size_t
;
190 #define EOB_ACT_CONTINUE_SCAN 0
191 #define EOB_ACT_END_OF_FILE 1
192 #define EOB_ACT_LAST_MATCH 2
194 #define YY_LESS_LINENO(n)
196 /* Return all but the first "n" matched characters back to the input stream. */
200 /* Undo effects of setting up yytext. */ \
201 int yyless_macro_arg = (n); \
202 YY_LESS_LINENO(yyless_macro_arg);\
203 *yy_cp = yyg->yy_hold_char; \
204 YY_RESTORE_YY_MORE_OFFSET \
205 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
206 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
210 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
212 #ifndef YY_STRUCT_YY_BUFFER_STATE
213 #define YY_STRUCT_YY_BUFFER_STATE
214 struct yy_buffer_state
218 char *yy_ch_buf
; /* input buffer */
219 char *yy_buf_pos
; /* current position in input buffer */
221 /* Size of input buffer in bytes, not including room for EOB
224 yy_size_t yy_buf_size
;
226 /* Number of characters read into yy_ch_buf, not including EOB
229 yy_size_t yy_n_chars
;
231 /* Whether we "own" the buffer - i.e., we know we created it,
232 * and can realloc() it to grow it, and should free() it to
235 int yy_is_our_buffer
;
237 /* Whether this is an "interactive" input source; if so, and
238 * if we're using stdio for input, then we want to use getc()
239 * instead of fread(), to make sure we stop fetching input after
242 int yy_is_interactive
;
244 /* Whether we're considered to be at the beginning of a line.
245 * If so, '^' rules will be active on the next match, otherwise
250 int yy_bs_lineno
; /**< The line count. */
251 int yy_bs_column
; /**< The column count. */
253 /* Whether to try to fill the input buffer when we reach the
258 int yy_buffer_status
;
260 #define YY_BUFFER_NEW 0
261 #define YY_BUFFER_NORMAL 1
262 /* When an EOF's been seen but there's still some text to process
263 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
264 * shouldn't try reading from the input source any more. We might
265 * still have a bunch of tokens to match, though, because of
266 * possible backing-up.
268 * When we actually see the EOF, we change the status to "new"
269 * (via _gmx_sel_yyrestart()), so that the user can continue scanning by
270 * just pointing yyin at a new input file.
272 #define YY_BUFFER_EOF_PENDING 2
275 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
277 /* We provide macros for accessing buffer states in case in the
278 * future we want to put the buffer states in a more general
281 * Returns the top of the stack, or NULL.
283 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
284 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
287 /* Same as previous macro, but useful when we know that the buffer stack is not
288 * NULL or when we need an lvalue. For internal use only.
290 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
292 void _gmx_sel_yyrestart (FILE *input_file
,yyscan_t yyscanner
);
293 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
294 YY_BUFFER_STATE
_gmx_sel_yy_create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
295 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
296 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
297 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
298 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner
);
300 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner
);
301 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner
);
302 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
304 #define YY_FLUSH_BUFFER _gmx_sel_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
306 YY_BUFFER_STATE
_gmx_sel_yy_scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
307 YY_BUFFER_STATE
_gmx_sel_yy_scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
308 YY_BUFFER_STATE
_gmx_sel_yy_scan_bytes (yyconst
char *bytes
,yy_size_t len
,yyscan_t yyscanner
);
310 void *_gmx_sel_yyalloc (yy_size_t
,yyscan_t yyscanner
);
311 void *_gmx_sel_yyrealloc (void *,yy_size_t
,yyscan_t yyscanner
);
312 void _gmx_sel_yyfree (void * ,yyscan_t yyscanner
);
314 #define yy_new_buffer _gmx_sel_yy_create_buffer
316 #define yy_set_interactive(is_interactive) \
318 if ( ! YY_CURRENT_BUFFER ){ \
319 _gmx_sel_yyensure_buffer_stack (yyscanner); \
320 YY_CURRENT_BUFFER_LVALUE = \
321 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
323 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
326 #define yy_set_bol(at_bol) \
328 if ( ! YY_CURRENT_BUFFER ){\
329 _gmx_sel_yyensure_buffer_stack (yyscanner); \
330 YY_CURRENT_BUFFER_LVALUE = \
331 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
333 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
336 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
338 static inline int _gmx_sel_yywrap(yyscan_t yyscanner
) { return 1; }
339 #define YY_SKIP_YYWRAP
341 typedef unsigned char YY_CHAR
;
343 typedef int yy_state_type
;
345 #define yytext_ptr yytext_r
347 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
348 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
349 static int yy_get_next_buffer (yyscan_t yyscanner
);
350 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
352 /* Done after the current pattern has been matched and before the
353 * corresponding action - sets up yytext.
355 #define YY_DO_BEFORE_ACTION \
356 yyg->yytext_ptr = yy_bp; \
357 yyleng = (size_t) (yy_cp - yy_bp); \
358 yyg->yy_hold_char = *yy_cp; \
360 yyg->yy_c_buf_p = yy_cp;
362 #define YY_NUM_RULES 21
363 #define YY_END_OF_BUFFER 22
364 /* This struct is not used in this scanner,
365 but its presence is necessary. */
368 flex_int32_t yy_verify
;
371 static yyconst flex_int16_t yy_accept
[76] =
373 0, 0, 0, 0, 0, 0, 0, 0, 22, 20,
374 18, 6, 15, 20, 1, 20, 20, 2, 6, 16,
375 20, 17, 20, 19, 17, 17, 17, 17, 17, 17,
376 20, 17, 17, 17, 17, 18, 16, 0, 4, 0,
377 1, 12, 3, 3, 2, 19, 19, 17, 5, 17,
378 17, 17, 13, 10, 17, 13, 11, 8, 17, 7,
379 17, 0, 0, 3, 12, 17, 15, 14, 8, 0,
383 static yyconst flex_int32_t yy_ec
[256] =
385 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
386 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 2, 4, 5, 6, 1, 1, 7, 1, 1,
389 1, 1, 8, 1, 8, 9, 1, 10, 10, 10,
390 10, 10, 10, 10, 10, 10, 10, 1, 11, 12,
391 13, 12, 1, 1, 14, 14, 14, 14, 15, 14,
392 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
393 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
394 1, 16, 1, 1, 17, 1, 18, 14, 14, 19,
396 20, 21, 22, 14, 14, 14, 14, 14, 14, 23,
397 24, 25, 14, 26, 27, 28, 29, 14, 14, 30,
398 31, 14, 1, 32, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 static yyconst flex_int32_t yy_meta
[33] =
417 1, 1, 2, 1, 1, 1, 1, 1, 3, 4,
418 1, 1, 1, 4, 4, 1, 4, 4, 4, 4,
419 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
423 static yyconst flex_int16_t yy_base
[80] =
425 0, 0, 93, 92, 10, 12, 0, 0, 115, 118,
426 35, 37, 101, 37, 0, 106, 102, 35, 118, 98,
427 97, 0, 106, 99, 84, 80, 81, 78, 79, 78,
428 69, 25, 76, 26, 79, 54, 118, 43, 118, 93,
429 0, 118, 48, 50, 52, 88, 65, 0, 118, 77,
430 71, 66, 0, 0, 67, 118, 0, 64, 70, 0,
431 63, 56, 79, 67, 0, 59, 0, 0, 0, 73,
432 69, 61, 44, 0, 118, 77, 81, 83, 50
435 static yyconst flex_int16_t yy_def
[80] =
437 75, 1, 1, 1, 1, 1, 1, 1, 75, 75,
438 75, 75, 75, 76, 77, 75, 75, 78, 75, 75,
439 75, 79, 75, 78, 79, 79, 79, 79, 79, 79,
440 75, 79, 79, 79, 79, 75, 75, 76, 75, 75,
441 77, 75, 75, 75, 78, 78, 78, 79, 75, 79,
442 79, 79, 79, 79, 79, 75, 79, 79, 79, 79,
443 79, 75, 75, 78, 79, 79, 79, 79, 79, 75,
444 75, 75, 79, 79, 0, 75, 75, 75, 75
447 static yyconst flex_int16_t yy_nxt
[151] =
449 10, 11, 12, 13, 14, 15, 16, 10, 17, 18,
450 19, 20, 21, 22, 22, 23, 24, 25, 22, 22,
451 22, 26, 27, 28, 22, 22, 22, 29, 22, 30,
452 22, 31, 33, 34, 33, 34, 36, 36, 36, 36,
453 35, 39, 35, 44, 45, 57, 59, 39, 60, 47,
454 53, 53, 40, 48, 47, 36, 36, 43, 40, 43,
455 44, 45, 62, 70, 62, 71, 47, 62, 74, 62,
456 72, 47, 63, 75, 64, 75, 64, 38, 71, 38,
457 38, 41, 71, 41, 41, 46, 46, 73, 72, 60,
458 69, 67, 68, 67, 66, 65, 75, 38, 61, 58,
460 56, 55, 54, 53, 52, 51, 50, 75, 49, 37,
461 37, 43, 42, 37, 75, 32, 32, 9, 75, 75,
462 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
463 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
464 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
467 static yyconst flex_int16_t yy_chk
[151] =
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 5, 5, 6, 6, 11, 11, 12, 12,
473 5, 14, 6, 18, 18, 32, 34, 38, 34, 18,
474 32, 34, 14, 79, 18, 36, 36, 43, 38, 44,
475 45, 45, 43, 62, 44, 62, 45, 43, 73, 44,
476 72, 45, 47, 47, 47, 64, 64, 76, 71, 76,
477 76, 77, 70, 77, 77, 78, 78, 66, 63, 61,
478 59, 58, 55, 52, 51, 50, 46, 40, 35, 33,
480 31, 30, 29, 28, 27, 26, 25, 24, 23, 21,
481 20, 17, 16, 13, 9, 4, 3, 75, 75, 75,
482 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
483 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
484 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
487 /* The intent behind this definition is that it'll catch
488 * any uses of REJECT which flex missed.
490 #define REJECT reject_used_but_not_detected
491 #define yymore() yymore_used_but_not_detected
492 #define YY_MORE_ADJ 0
493 #define YY_RESTORE_YY_MORE_OFFSET
496 * This file is part of the GROMACS molecular simulation package.
498 * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
499 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
500 * and including many others, as listed in the AUTHORS file in the
501 * top-level source directory and at http://www.gromacs.org.
503 * GROMACS is free software; you can redistribute it and/or
504 * modify it under the terms of the GNU Lesser General Public License
505 * as published by the Free Software Foundation; either version 2.1
506 * of the License, or (at your option) any later version.
508 * GROMACS is distributed in the hope that it will be useful,
509 * but WITHOUT ANY WARRANTY; without even the implied warranty of
510 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
511 * Lesser General Public License for more details.
513 * You should have received a copy of the GNU Lesser General Public
514 * License along with GROMACS; if not, see
515 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
516 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
518 * If you want to redistribute modifications to GROMACS, please
519 * consider that scientific software is very special. Version
520 * control is crucial - bugs must be traceable. We will be happy to
521 * consider code for inclusion in the official distribution, but
522 * derived work must not be called official GROMACS. Details are found
523 * in the README & COPYING files - if they are missing, get the
524 * official version at http://www.gromacs.org.
526 * To help us fund GROMACS development, we humbly ask that you cite
527 * the research papers on the package. Check out http://www.gromacs.org.
529 /*! \cond \internal \file scanner.l
531 * Tokenizer for the selection language.
533 * \author Teemu Murtola <teemu.murtola@gmail.com>
534 * \ingroup module_selection
537 /*! \internal \file scanner.cpp
539 * Generated (from scanner.l by Flex) tokenizer for the selection language.
541 * \ingroup module_selection
545 #include "gromacs/utility/cstringutil.h"
549 #include "scanner_internal.h"
551 // This macro makes the actions a bit shorter, since nearly every action needs
553 #define ADD_TOKEN _gmx_sel_lexer_add_token(yylloc, yytext, yyleng, state)
555 // Set YY_BREAK to an empty value to avoid warnings (for the PGI compiler)
556 // when we have return statements followed by break. Instead, we add breaks
559 #define YY_NO_UNISTD_H 1
563 #line 564 "scanner.cpp"
570 #ifndef YY_NO_UNISTD_H
571 /* Special case for "unistd.h", since it is non-ANSI. We include it way
572 * down here because we want the user's section 1 to have been scanned first.
573 * The user has a chance to override it with an option.
578 #ifndef YY_EXTRA_TYPE
579 #define YY_EXTRA_TYPE void *
582 /* Holds the entire state of the reentrant scanner. */
586 /* User-defined. Not touched by flex. */
587 YY_EXTRA_TYPE yyextra_r
;
589 /* The rest are the same as the globals declared in the non-reentrant scanner. */
590 FILE *yyin_r
, *yyout_r
;
591 size_t yy_buffer_stack_top
; /**< index of top of stack. */
592 size_t yy_buffer_stack_max
; /**< capacity of stack. */
593 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
595 yy_size_t yy_n_chars
;
600 int yy_did_buffer_switch_on_eof
;
601 int yy_start_stack_ptr
;
602 int yy_start_stack_depth
;
604 yy_state_type yy_last_accepting_state
;
605 char* yy_last_accepting_cpos
;
614 }; /* end struct yyguts_t */
616 static int yy_init_globals (yyscan_t yyscanner
);
618 int _gmx_sel_yylex_init (yyscan_t
* scanner
);
620 int _gmx_sel_yylex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
622 /* Accessor methods to globals.
623 These are made visible to non-reentrant scanners for convenience. */
625 int _gmx_sel_yylex_destroy (yyscan_t yyscanner
);
627 int _gmx_sel_yyget_debug (yyscan_t yyscanner
);
629 void _gmx_sel_yyset_debug (int debug_flag
,yyscan_t yyscanner
);
631 YY_EXTRA_TYPE
_gmx_sel_yyget_extra (yyscan_t yyscanner
);
633 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
635 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner
);
637 void _gmx_sel_yyset_in (FILE * in_str
,yyscan_t yyscanner
);
639 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner
);
641 void _gmx_sel_yyset_out (FILE * out_str
,yyscan_t yyscanner
);
643 yy_size_t
_gmx_sel_yyget_leng (yyscan_t yyscanner
);
645 char *_gmx_sel_yyget_text (yyscan_t yyscanner
);
647 int _gmx_sel_yyget_lineno (yyscan_t yyscanner
);
649 void _gmx_sel_yyset_lineno (int line_number
,yyscan_t yyscanner
);
651 int _gmx_sel_yyget_column (yyscan_t yyscanner
);
653 void _gmx_sel_yyset_column (int column_no
,yyscan_t yyscanner
);
655 /* Macros after this point can all be overridden by user definitions in
659 #ifndef YY_SKIP_YYWRAP
661 extern "C" int _gmx_sel_yywrap (yyscan_t yyscanner
);
663 extern int _gmx_sel_yywrap (yyscan_t yyscanner
);
667 static void yyunput (int c
,char *buf_ptr
,yyscan_t yyscanner
);
670 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
673 #ifdef YY_NEED_STRLEN
674 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
680 static int yyinput (yyscan_t yyscanner
);
682 static int input (yyscan_t yyscanner
);
687 /* Amount of stuff to slurp up with each read. */
688 #ifndef YY_READ_BUF_SIZE
689 #define YY_READ_BUF_SIZE 8192
692 /* Copy whatever the last rule matched to the standard output. */
694 /* This used to be an fputs(), but since the string might contain NUL's,
695 * we now use fwrite().
697 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
700 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
701 * is returned in "result".
704 #define YY_INPUT(buf,result,max_size) \
705 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
709 for ( n = 0; n < max_size && \
710 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
713 buf[n++] = (char) c; \
714 if ( c == EOF && ferror( yyin ) ) \
715 YY_FATAL_ERROR( "input in flex scanner failed" ); \
721 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
723 if( errno != EINTR) \
725 YY_FATAL_ERROR( "input in flex scanner failed" ); \
736 /* No semi-colon after return; correct usage is to write "yyterminate();" -
737 * we don't want an extra ';' after the "return" because that will cause
738 * some compilers to complain about unreachable statements.
741 #define yyterminate() return YY_NULL
744 /* Number of entries by which start-condition stack grows. */
745 #ifndef YY_START_STACK_INCR
746 #define YY_START_STACK_INCR 25
749 /* Report a fatal error. */
750 #ifndef YY_FATAL_ERROR
751 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
754 /* end tables serialization structures and prototypes */
756 /* Default declaration of generated scanner - a define so the user can
757 * easily add parameters.
760 #define YY_DECL_IS_OURS 1
762 extern int _gmx_sel_yylex (yyscan_t yyscanner
);
764 #define YY_DECL int _gmx_sel_yylex (yyscan_t yyscanner)
765 #endif /* !YY_DECL */
767 /* Code executed at the beginning of each rule, after yytext and yyleng
770 #ifndef YY_USER_ACTION
771 #define YY_USER_ACTION
774 /* Code executed at the end of each rule. */
776 #define YY_BREAK break;
779 #define YY_RULE_SETUP \
782 /** The main scanner function which does all the work.
786 register yy_state_type yy_current_state
;
787 register char *yy_cp
, *yy_bp
;
789 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
795 gmx_sel_lexer_t
*state
= _gmx_sel_yyget_extra(yyscanner
);
797 /* Return a token if one is pending */
798 retval
= _gmx_sel_lexer_process_pending(yylval
, yylloc
, state
);
803 /* Handle the start conditions for 'of' matching */
807 state
->bMatchOf
= false;
809 else if (state
->bMatchBool
)
812 state
->bMatchBool
= false;
814 else if (state
->bCmdStart
)
817 state
->bCmdStart
= false;
825 #line 826 "scanner.cpp"
835 if ( ! yyg
->yy_start
)
836 yyg
->yy_start
= 1; /* first start state */
844 if ( ! YY_CURRENT_BUFFER
) {
845 _gmx_sel_yyensure_buffer_stack (yyscanner
);
846 YY_CURRENT_BUFFER_LVALUE
=
847 _gmx_sel_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
850 _gmx_sel_yy_load_buffer_state(yyscanner
);
853 while ( 1 ) /* loops until end-of-file is reached */
855 yy_cp
= yyg
->yy_c_buf_p
;
857 /* Support of yytext. */
858 *yy_cp
= yyg
->yy_hold_char
;
860 /* yy_bp points to the position in yy_ch_buf of the start of
865 yy_current_state
= yyg
->yy_start
;
869 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
870 if ( yy_accept
[yy_current_state
] )
872 yyg
->yy_last_accepting_state
= yy_current_state
;
873 yyg
->yy_last_accepting_cpos
= yy_cp
;
875 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
877 yy_current_state
= (int) yy_def
[yy_current_state
];
878 if ( yy_current_state
>= 76 )
879 yy_c
= yy_meta
[(unsigned int) yy_c
];
881 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
884 while ( yy_current_state
!= 75 );
885 yy_cp
= yyg
->yy_last_accepting_cpos
;
886 yy_current_state
= yyg
->yy_last_accepting_state
;
889 yy_act
= yy_accept
[yy_current_state
];
893 do_action
: /* This label is used only to access EOF actions. */
896 { /* beginning of action switch */
897 case 0: /* must back up */
898 /* undo the effects of YY_DO_BEFORE_ACTION */
899 *yy_cp
= yyg
->yy_hold_char
;
900 yy_cp
= yyg
->yy_last_accepting_cpos
;
901 yy_current_state
= yyg
->yy_last_accepting_state
;
906 #line 131 "scanner.l"
911 #line 132 "scanner.l"
912 { yylval
->i
= strtol(yytext
, NULL
, 10); ADD_TOKEN
; return TOK_INT
; }
916 #line 133 "scanner.l"
917 { yylval
->r
= strtod(yytext
, NULL
); ADD_TOKEN
; return TOK_REAL
; }
921 #line 134 "scanner.l"
922 { yylval
->str
= gmx_strndup(yytext
+1, yyleng
-2); ADD_TOKEN
; return STR
; }
925 /* rule 5 can match eol */
927 #line 136 "scanner.l"
928 { _gmx_sel_lexer_add_token(yylloc
, " ", 1, state
); break; }
931 /* rule 6 can match eol */
933 #line 137 "scanner.l"
935 if (yytext
[0] == ';' || state
->statusWriter
!= NULL
)
937 rtrim(state
->pselstr
);
938 state
->bCmdStart
= true;
943 _gmx_sel_lexer_add_token(yylloc
, " ", 1, state
);
948 case YY_STATE_EOF(cmdstart
):
949 #line 151 "scanner.l"
950 { state
->bCmdStart
= true; yyterminate(); }
952 case YY_STATE_EOF(INITIAL
):
953 case YY_STATE_EOF(matchof
):
954 case YY_STATE_EOF(matchbool
):
955 #line 152 "scanner.l"
956 { state
->bCmdStart
= true; return CMD_SEP
; }
961 #line 155 "scanner.l"
962 { ADD_TOKEN
; yylval
->i
= 1; return TOK_INT
; }
966 #line 156 "scanner.l"
967 { ADD_TOKEN
; yylval
->i
= 0; return TOK_INT
; }
972 #line 158 "scanner.l"
973 { ADD_TOKEN
; return GROUP
; }
977 #line 159 "scanner.l"
978 { ADD_TOKEN
; return TO
; }
982 #line 160 "scanner.l"
983 { ADD_TOKEN
; BEGIN(0); return OF
; }
987 #line 161 "scanner.l"
988 { ADD_TOKEN
; return AND
; }
992 #line 162 "scanner.l"
993 { ADD_TOKEN
; return OR
; }
997 #line 163 "scanner.l"
998 { ADD_TOKEN
; return XOR
; }
1002 #line 164 "scanner.l"
1003 { ADD_TOKEN
; return NOT
; }
1007 #line 165 "scanner.l"
1008 { yylval
->str
= gmx_strndup(yytext
, yyleng
); ADD_TOKEN
; return CMP_OP
; }
1012 #line 167 "scanner.l"
1013 { return _gmx_sel_lexer_process_identifier(yylval
, yylloc
, yytext
, yyleng
, state
); }
1016 /* rule 18 can match eol */
1018 #line 169 "scanner.l"
1019 { _gmx_sel_lexer_add_token(yylloc
, " ", 1, state
); break; }
1023 #line 170 "scanner.l"
1024 { yylval
->str
= gmx_strndup(yytext
, yyleng
); ADD_TOKEN
; return STR
; }
1028 #line 171 "scanner.l"
1029 { ADD_TOKEN
; return yytext
[0]; }
1033 #line 172 "scanner.l"
1034 YY_FATAL_ERROR( "flex scanner jammed" );
1036 #line 1037 "scanner.cpp"
1038 case YY_END_OF_BUFFER
:
1040 /* Amount of text matched not including the EOB char. */
1041 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
1043 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1044 *yy_cp
= yyg
->yy_hold_char
;
1045 YY_RESTORE_YY_MORE_OFFSET
1047 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1049 /* We're scanning a new file or input source. It's
1050 * possible that this happened because the user
1051 * just pointed yyin at a new source and called
1052 * _gmx_sel_yylex(). If so, then we have to assure
1053 * consistency between YY_CURRENT_BUFFER and our
1054 * globals. Here is the right place to do so, because
1055 * this is the first action (other than possibly a
1056 * back-up) that will match for the new input source.
1058 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1059 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1060 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1063 /* Note that here we test for yy_c_buf_p "<=" to the position
1064 * of the first EOB in the buffer, since yy_c_buf_p will
1065 * already have been incremented past the NUL character
1066 * (since all states make transitions on EOB to the
1067 * end-of-buffer state). Contrast this with the test
1070 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1071 { /* This was really a NUL. */
1072 yy_state_type yy_next_state
;
1074 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1076 yy_current_state
= yy_get_previous_state( yyscanner
);
1078 /* Okay, we're now positioned to make the NUL
1079 * transition. We couldn't have
1080 * yy_get_previous_state() go ahead and do it
1081 * for us because it doesn't know how to deal
1082 * with the possibility of jamming (and we don't
1083 * want to build jamming into it because then it
1084 * will run more slowly).
1087 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
1089 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1091 if ( yy_next_state
)
1093 /* Consume the NUL. */
1094 yy_cp
= ++yyg
->yy_c_buf_p
;
1095 yy_current_state
= yy_next_state
;
1101 yy_cp
= yyg
->yy_last_accepting_cpos
;
1102 yy_current_state
= yyg
->yy_last_accepting_state
;
1103 goto yy_find_action
;
1107 else switch ( yy_get_next_buffer( yyscanner
) )
1109 case EOB_ACT_END_OF_FILE
:
1111 yyg
->yy_did_buffer_switch_on_eof
= 0;
1113 if ( _gmx_sel_yywrap(yyscanner
) )
1115 /* Note: because we've taken care in
1116 * yy_get_next_buffer() to have set up
1117 * yytext, we can now set up
1118 * yy_c_buf_p so that if some total
1119 * hoser (like flex itself) wants to
1120 * call the scanner after we return the
1121 * YY_NULL, it'll still work - another
1122 * YY_NULL will get returned.
1124 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1126 yy_act
= YY_STATE_EOF(YY_START
);
1132 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1138 case EOB_ACT_CONTINUE_SCAN
:
1140 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1142 yy_current_state
= yy_get_previous_state( yyscanner
);
1144 yy_cp
= yyg
->yy_c_buf_p
;
1145 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1148 case EOB_ACT_LAST_MATCH
:
1150 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1152 yy_current_state
= yy_get_previous_state( yyscanner
);
1154 yy_cp
= yyg
->yy_c_buf_p
;
1155 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1156 goto yy_find_action
;
1163 "fatal flex scanner internal error--no action found" );
1164 } /* end of action switch */
1165 } /* end of scanning one token */
1166 } /* end of _gmx_sel_yylex */
1168 /* yy_get_next_buffer - try to read in a new buffer
1170 * Returns a code representing an action:
1171 * EOB_ACT_LAST_MATCH -
1172 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1173 * EOB_ACT_END_OF_FILE - end of file
1175 static int yy_get_next_buffer (yyscan_t yyscanner
)
1177 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1178 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1179 register char *source
= yyg
->yytext_ptr
;
1180 register int number_to_move
, i
;
1183 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1185 "fatal flex scanner internal error--end of buffer missed" );
1187 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1188 { /* Don't try to fill the buffer, so this is an EOF. */
1189 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1191 /* We matched a single character, the EOB, so
1192 * treat this as a final EOF.
1194 return EOB_ACT_END_OF_FILE
;
1199 /* We matched some text prior to the EOB, first
1202 return EOB_ACT_LAST_MATCH
;
1206 /* Try to read more data. */
1208 /* First move last chars to start of buffer. */
1209 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1211 for ( i
= 0; i
< number_to_move
; ++i
)
1212 *(dest
++) = *(source
++);
1214 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1215 /* don't do the read, it's not guaranteed to return an EOF,
1218 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1222 yy_size_t num_to_read
=
1223 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1225 while ( num_to_read
<= 0 )
1226 { /* Not enough room in the buffer - grow it. */
1228 /* just a shorter name for the current buffer */
1229 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER_LVALUE
;
1231 int yy_c_buf_p_offset
=
1232 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1234 if ( b
->yy_is_our_buffer
)
1236 yy_size_t new_size
= b
->yy_buf_size
* 2;
1238 if ( new_size
<= 0 )
1239 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1241 b
->yy_buf_size
*= 2;
1243 b
->yy_ch_buf
= (char *)
1244 /* Include room in for 2 EOB chars. */
1245 _gmx_sel_yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1248 /* Can't grow it, we don't own it. */
1251 if ( ! b
->yy_ch_buf
)
1253 "fatal error - scanner input buffer overflow" );
1255 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1257 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1262 if ( num_to_read
> YY_READ_BUF_SIZE
)
1263 num_to_read
= YY_READ_BUF_SIZE
;
1265 /* Read in more data. */
1266 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1267 yyg
->yy_n_chars
, num_to_read
);
1269 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1272 if ( yyg
->yy_n_chars
== 0 )
1274 if ( number_to_move
== YY_MORE_ADJ
)
1276 ret_val
= EOB_ACT_END_OF_FILE
;
1277 _gmx_sel_yyrestart(yyin
,yyscanner
);
1282 ret_val
= EOB_ACT_LAST_MATCH
;
1283 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1284 YY_BUFFER_EOF_PENDING
;
1289 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1291 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1292 /* Extend the array by 50%, plus the number we really need. */
1293 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
1294 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) _gmx_sel_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
1295 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1296 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1299 yyg
->yy_n_chars
+= number_to_move
;
1300 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1301 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1303 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1308 /* yy_get_previous_state - get the state just before the EOB char was reached */
1310 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1312 register yy_state_type yy_current_state
;
1313 register char *yy_cp
;
1314 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1316 yy_current_state
= yyg
->yy_start
;
1318 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1320 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1321 if ( yy_accept
[yy_current_state
] )
1323 yyg
->yy_last_accepting_state
= yy_current_state
;
1324 yyg
->yy_last_accepting_cpos
= yy_cp
;
1326 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1328 yy_current_state
= (int) yy_def
[yy_current_state
];
1329 if ( yy_current_state
>= 76 )
1330 yy_c
= yy_meta
[(unsigned int) yy_c
];
1332 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1335 return yy_current_state
;
1338 /* yy_try_NUL_trans - try to make a transition on the NUL character
1341 * next_state = yy_try_NUL_trans( current_state );
1343 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1345 register int yy_is_jam
;
1346 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1347 register char *yy_cp
= yyg
->yy_c_buf_p
;
1349 register YY_CHAR yy_c
= 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
];
1362 yy_is_jam
= (yy_current_state
== 75);
1365 return yy_is_jam
? 0 : yy_current_state
;
1368 static void yyunput (int c
, register char * yy_bp
, yyscan_t yyscanner
)
1370 register char *yy_cp
;
1371 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1373 yy_cp
= yyg
->yy_c_buf_p
;
1375 /* undo effects of setting up yytext */
1376 *yy_cp
= yyg
->yy_hold_char
;
1378 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1379 { /* need to shift things up to make room */
1380 /* +2 for EOB chars. */
1381 register yy_size_t number_to_move
= yyg
->yy_n_chars
+ 2;
1382 register char *dest
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[
1383 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
+ 2];
1384 register char *source
=
1385 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
];
1387 while ( source
> YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1388 *--dest
= *--source
;
1390 yy_cp
+= (int) (dest
- source
);
1391 yy_bp
+= (int) (dest
- source
);
1392 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
=
1393 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
;
1395 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1396 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1399 *--yy_cp
= (char) c
;
1401 yyg
->yytext_ptr
= yy_bp
;
1402 yyg
->yy_hold_char
= *yy_cp
;
1403 yyg
->yy_c_buf_p
= yy_cp
;
1408 static int yyinput (yyscan_t yyscanner
)
1410 static int input (yyscan_t yyscanner
)
1415 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1417 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1419 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1421 /* yy_c_buf_p now points to the character we want to return.
1422 * If this occurs *before* the EOB characters, then it's a
1423 * valid NUL; if not, then we've hit the end of the buffer.
1425 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1426 /* This was really a NUL. */
1427 *yyg
->yy_c_buf_p
= '\0';
1430 { /* need more input */
1431 yy_size_t offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1434 switch ( yy_get_next_buffer( yyscanner
) )
1436 case EOB_ACT_LAST_MATCH
:
1437 /* This happens because yy_g_n_b()
1438 * sees that we've accumulated a
1439 * token and flags that we need to
1440 * try matching the token before
1441 * proceeding. But for input(),
1442 * there's no matching to consider.
1443 * So convert the EOB_ACT_LAST_MATCH
1444 * to EOB_ACT_END_OF_FILE.
1447 /* Reset buffer status. */
1448 _gmx_sel_yyrestart(yyin
,yyscanner
);
1452 case EOB_ACT_END_OF_FILE
:
1454 if ( _gmx_sel_yywrap(yyscanner
) )
1457 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1460 return yyinput(yyscanner
);
1462 return input(yyscanner
);
1466 case EOB_ACT_CONTINUE_SCAN
:
1467 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1473 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1474 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1475 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1479 #endif /* ifndef YY_NO_INPUT */
1481 /** Immediately switch to a different input stream.
1482 * @param input_file A readable stream.
1483 * @param yyscanner The scanner object.
1484 * @note This function does not reset the start condition to @c INITIAL .
1486 void _gmx_sel_yyrestart (FILE * input_file
, yyscan_t yyscanner
)
1488 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1490 if ( ! YY_CURRENT_BUFFER
){
1491 _gmx_sel_yyensure_buffer_stack (yyscanner
);
1492 YY_CURRENT_BUFFER_LVALUE
=
1493 _gmx_sel_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1496 _gmx_sel_yy_init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1497 _gmx_sel_yy_load_buffer_state(yyscanner
);
1500 /** Switch to a different input buffer.
1501 * @param new_buffer The new input buffer.
1502 * @param yyscanner The scanner object.
1504 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1506 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1508 /* TODO. We should be able to replace this entire function body
1510 * _gmx_sel_yypop_buffer_state();
1511 * _gmx_sel_yypush_buffer_state(new_buffer);
1513 _gmx_sel_yyensure_buffer_stack (yyscanner
);
1514 if ( YY_CURRENT_BUFFER
== new_buffer
)
1517 if ( YY_CURRENT_BUFFER
)
1519 /* Flush out information for old buffer. */
1520 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1521 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1522 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1525 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1526 _gmx_sel_yy_load_buffer_state(yyscanner
);
1528 /* We don't actually know whether we did this switch during
1529 * EOF (_gmx_sel_yywrap()) processing, but the only time this flag
1530 * is looked at is after _gmx_sel_yywrap() is called, so it's safe
1531 * to go ahead and always set it.
1533 yyg
->yy_did_buffer_switch_on_eof
= 1;
1536 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner
)
1538 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1539 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1540 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1541 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1542 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1545 /** Allocate and initialize an input buffer state.
1546 * @param file A readable stream.
1547 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1548 * @param yyscanner The scanner object.
1549 * @return the allocated buffer state.
1551 YY_BUFFER_STATE
_gmx_sel_yy_create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1555 b
= (YY_BUFFER_STATE
) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1557 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1559 b
->yy_buf_size
= size
;
1561 /* yy_ch_buf has to be 2 characters longer than the size given because
1562 * we need to put in 2 end-of-buffer characters.
1564 b
->yy_ch_buf
= (char *) _gmx_sel_yyalloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1565 if ( ! b
->yy_ch_buf
)
1566 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1568 b
->yy_is_our_buffer
= 1;
1570 _gmx_sel_yy_init_buffer(b
,file
,yyscanner
);
1575 /** Destroy the buffer.
1576 * @param b a buffer created with _gmx_sel_yy_create_buffer()
1577 * @param yyscanner The scanner object.
1579 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1581 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1586 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1587 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1589 if ( b
->yy_is_our_buffer
)
1590 _gmx_sel_yyfree((void *) b
->yy_ch_buf
,yyscanner
);
1592 _gmx_sel_yyfree((void *) b
,yyscanner
);
1595 /* Initializes or reinitializes a buffer.
1596 * This function is sometimes called more than once on the same buffer,
1597 * such as during a _gmx_sel_yyrestart() or at EOF.
1599 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1603 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1605 _gmx_sel_yy_flush_buffer(b
,yyscanner
);
1607 b
->yy_input_file
= file
;
1608 b
->yy_fill_buffer
= 1;
1610 /* If b is the current buffer, then _gmx_sel_yy_init_buffer was _probably_
1611 * called from _gmx_sel_yyrestart() or through yy_get_next_buffer.
1612 * In that case, we don't want to reset the lineno or column.
1614 if (b
!= YY_CURRENT_BUFFER
){
1615 b
->yy_bs_lineno
= 1;
1616 b
->yy_bs_column
= 0;
1619 b
->yy_is_interactive
= 0;
1624 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1625 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1626 * @param yyscanner The scanner object.
1628 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1630 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1636 /* We always need two end-of-buffer characters. The first causes
1637 * a transition to the end-of-buffer state. The second causes
1638 * a jam in that state.
1640 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1641 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1643 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1646 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1648 if ( b
== YY_CURRENT_BUFFER
)
1649 _gmx_sel_yy_load_buffer_state(yyscanner
);
1652 /** Pushes the new state onto the stack. The new state becomes
1653 * the current state. This function will allocate the stack
1655 * @param new_buffer The new state.
1656 * @param yyscanner The scanner object.
1658 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1660 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1661 if (new_buffer
== NULL
)
1664 _gmx_sel_yyensure_buffer_stack(yyscanner
);
1666 /* This block is copied from _gmx_sel_yy_switch_to_buffer. */
1667 if ( YY_CURRENT_BUFFER
)
1669 /* Flush out information for old buffer. */
1670 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1671 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1672 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1675 /* Only push if top exists. Otherwise, replace top. */
1676 if (YY_CURRENT_BUFFER
)
1677 yyg
->yy_buffer_stack_top
++;
1678 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1680 /* copied from _gmx_sel_yy_switch_to_buffer. */
1681 _gmx_sel_yy_load_buffer_state(yyscanner
);
1682 yyg
->yy_did_buffer_switch_on_eof
= 1;
1685 /** Removes and deletes the top of the stack, if present.
1686 * The next element becomes the new top.
1687 * @param yyscanner The scanner object.
1689 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner
)
1691 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1692 if (!YY_CURRENT_BUFFER
)
1695 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1696 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1697 if (yyg
->yy_buffer_stack_top
> 0)
1698 --yyg
->yy_buffer_stack_top
;
1700 if (YY_CURRENT_BUFFER
) {
1701 _gmx_sel_yy_load_buffer_state(yyscanner
);
1702 yyg
->yy_did_buffer_switch_on_eof
= 1;
1706 /* Allocates the stack if it does not exist.
1707 * Guarantees space for at least one push.
1709 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner
)
1711 yy_size_t num_to_alloc
;
1712 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1714 if (!yyg
->yy_buffer_stack
) {
1716 /* First allocation is just for 2 elements, since we don't know if this
1717 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1718 * immediate realloc on the next call.
1721 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_gmx_sel_yyalloc
1722 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1724 if ( ! yyg
->yy_buffer_stack
)
1725 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1727 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1729 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1730 yyg
->yy_buffer_stack_top
= 0;
1734 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1736 /* Increase the buffer to prepare for a possible push. */
1737 int grow_size
= 8 /* arbitrary grow size */;
1739 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1740 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_gmx_sel_yyrealloc
1741 (yyg
->yy_buffer_stack
,
1742 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1744 if ( ! yyg
->yy_buffer_stack
)
1745 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1747 /* zero only the new slots.*/
1748 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1749 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1753 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1754 * @param base the character buffer
1755 * @param size the size in bytes of the character buffer
1756 * @param yyscanner The scanner object.
1757 * @return the newly allocated buffer state object.
1759 YY_BUFFER_STATE
_gmx_sel_yy_scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1764 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1765 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1766 /* They forgot to leave room for the EOB's. */
1769 b
= (YY_BUFFER_STATE
) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1771 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_buffer()" );
1773 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1774 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1775 b
->yy_is_our_buffer
= 0;
1776 b
->yy_input_file
= 0;
1777 b
->yy_n_chars
= b
->yy_buf_size
;
1778 b
->yy_is_interactive
= 0;
1780 b
->yy_fill_buffer
= 0;
1781 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1783 _gmx_sel_yy_switch_to_buffer(b
,yyscanner
);
1788 /** Setup the input buffer state to scan a string. The next call to _gmx_sel_yylex() will
1789 * scan from a @e copy of @a str.
1790 * @param yystr a NUL-terminated string to scan
1791 * @param yyscanner The scanner object.
1792 * @return the newly allocated buffer state object.
1793 * @note If you want to scan bytes that may contain NUL values, then use
1794 * _gmx_sel_yy_scan_bytes() instead.
1796 YY_BUFFER_STATE
_gmx_sel_yy_scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1799 return _gmx_sel_yy_scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1802 /** Setup the input buffer state to scan the given bytes. The next call to _gmx_sel_yylex() will
1803 * scan from a @e copy of @a bytes.
1804 * @param yybytes the byte buffer to scan
1805 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1806 * @param yyscanner The scanner object.
1807 * @return the newly allocated buffer state object.
1809 YY_BUFFER_STATE
_gmx_sel_yy_scan_bytes (yyconst
char * yybytes
, yy_size_t _yybytes_len
, yyscan_t yyscanner
)
1816 /* Get memory for full buffer, including space for trailing EOB's. */
1817 n
= _yybytes_len
+ 2;
1818 buf
= (char *) _gmx_sel_yyalloc(n
,yyscanner
);
1820 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_bytes()" );
1822 for ( i
= 0; i
< _yybytes_len
; ++i
)
1823 buf
[i
] = yybytes
[i
];
1825 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1827 b
= _gmx_sel_yy_scan_buffer(buf
,n
,yyscanner
);
1829 YY_FATAL_ERROR( "bad buffer in _gmx_sel_yy_scan_bytes()" );
1831 /* It's okay to grow etc. this buffer, and we should throw it
1832 * away when we're done.
1834 b
->yy_is_our_buffer
= 1;
1839 #ifndef YY_EXIT_FAILURE
1840 #define YY_EXIT_FAILURE 2
1843 static void yy_fatal_error (yyconst
char* msg
, yyscan_t yyscanner
)
1845 (void) fprintf( stderr
, "%s\n", msg
);
1846 exit( YY_EXIT_FAILURE
);
1849 /* Redefine yyless() so it works in section 3 code. */
1855 /* Undo effects of setting up yytext. */ \
1856 int yyless_macro_arg = (n); \
1857 YY_LESS_LINENO(yyless_macro_arg);\
1858 yytext[yyleng] = yyg->yy_hold_char; \
1859 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1860 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1861 *yyg->yy_c_buf_p = '\0'; \
1862 yyleng = yyless_macro_arg; \
1866 /* Accessor methods (get/set functions) to struct members. */
1868 /** Get the user-defined data for this scanner.
1869 * @param yyscanner The scanner object.
1871 YY_EXTRA_TYPE
_gmx_sel_yyget_extra (yyscan_t yyscanner
)
1873 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1877 /** Get the current line number.
1878 * @param yyscanner The scanner object.
1880 int _gmx_sel_yyget_lineno (yyscan_t yyscanner
)
1882 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1884 if (! YY_CURRENT_BUFFER
)
1890 /** Get the current column number.
1891 * @param yyscanner The scanner object.
1893 int _gmx_sel_yyget_column (yyscan_t yyscanner
)
1895 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1897 if (! YY_CURRENT_BUFFER
)
1903 /** Get the input stream.
1904 * @param yyscanner The scanner object.
1906 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner
)
1908 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1912 /** Get the output stream.
1913 * @param yyscanner The scanner object.
1915 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner
)
1917 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1921 /** Get the length of the current token.
1922 * @param yyscanner The scanner object.
1924 yy_size_t
_gmx_sel_yyget_leng (yyscan_t yyscanner
)
1926 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1930 /** Get the current token.
1931 * @param yyscanner The scanner object.
1934 char *_gmx_sel_yyget_text (yyscan_t yyscanner
)
1936 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1940 /** Set the user-defined data. This data is never touched by the scanner.
1941 * @param user_defined The data to be associated with this scanner.
1942 * @param yyscanner The scanner object.
1944 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined
, yyscan_t yyscanner
)
1946 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1947 yyextra
= user_defined
;
1950 /** Set the current line number.
1951 * @param line_number
1952 * @param yyscanner The scanner object.
1954 void _gmx_sel_yyset_lineno (int line_number
, yyscan_t yyscanner
)
1956 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1958 /* lineno is only valid if an input buffer exists. */
1959 if (! YY_CURRENT_BUFFER
)
1960 YY_FATAL_ERROR( "_gmx_sel_yyset_lineno called with no buffer" );
1962 yylineno
= line_number
;
1965 /** Set the current column.
1966 * @param line_number
1967 * @param yyscanner The scanner object.
1969 void _gmx_sel_yyset_column (int column_no
, yyscan_t yyscanner
)
1971 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1973 /* column is only valid if an input buffer exists. */
1974 if (! YY_CURRENT_BUFFER
)
1975 YY_FATAL_ERROR( "_gmx_sel_yyset_column called with no buffer" );
1977 yycolumn
= column_no
;
1980 /** Set the input stream. This does not discard the current
1982 * @param in_str A readable stream.
1983 * @param yyscanner The scanner object.
1984 * @see _gmx_sel_yy_switch_to_buffer
1986 void _gmx_sel_yyset_in (FILE * in_str
, yyscan_t yyscanner
)
1988 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1992 void _gmx_sel_yyset_out (FILE * out_str
, yyscan_t yyscanner
)
1994 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1998 int _gmx_sel_yyget_debug (yyscan_t yyscanner
)
2000 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2001 return yy_flex_debug
;
2004 void _gmx_sel_yyset_debug (int bdebug
, yyscan_t yyscanner
)
2006 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2007 yy_flex_debug
= bdebug
;
2010 /* Accessor methods for yylval and yylloc */
2012 /* User-visible API */
2014 /* _gmx_sel_yylex_init is special because it creates the scanner itself, so it is
2015 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2016 * That's why we explicitly handle the declaration, instead of using our macros.
2019 int _gmx_sel_yylex_init(yyscan_t
* ptr_yy_globals
)
2022 if (ptr_yy_globals
== NULL
){
2027 *ptr_yy_globals
= (yyscan_t
) _gmx_sel_yyalloc ( sizeof( struct yyguts_t
), NULL
);
2029 if (*ptr_yy_globals
== NULL
){
2034 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2035 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2037 return yy_init_globals ( *ptr_yy_globals
);
2040 /* _gmx_sel_yylex_init_extra has the same functionality as _gmx_sel_yylex_init, but follows the
2041 * convention of taking the scanner as the last argument. Note however, that
2042 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2043 * is the reason, too, why this function also must handle its own declaration).
2044 * The user defined value in the first argument will be available to _gmx_sel_yyalloc in
2045 * the yyextra field.
2048 int _gmx_sel_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined
,yyscan_t
* ptr_yy_globals
)
2051 struct yyguts_t dummy_yyguts
;
2053 _gmx_sel_yyset_extra (yy_user_defined
, &dummy_yyguts
);
2055 if (ptr_yy_globals
== NULL
){
2060 *ptr_yy_globals
= (yyscan_t
) _gmx_sel_yyalloc ( sizeof( struct yyguts_t
), &dummy_yyguts
);
2062 if (*ptr_yy_globals
== NULL
){
2067 /* By setting to 0xAA, we expose bugs in
2068 yy_init_globals. Leave at 0x00 for releases. */
2069 memset(*ptr_yy_globals
,0x00,sizeof(struct yyguts_t
));
2071 _gmx_sel_yyset_extra (yy_user_defined
, *ptr_yy_globals
);
2073 return yy_init_globals ( *ptr_yy_globals
);
2076 static int yy_init_globals (yyscan_t yyscanner
)
2078 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2079 /* Initialization is the same as for the non-reentrant scanner.
2080 * This function is called from _gmx_sel_yylex_destroy(), so don't allocate here.
2083 yyg
->yy_buffer_stack
= 0;
2084 yyg
->yy_buffer_stack_top
= 0;
2085 yyg
->yy_buffer_stack_max
= 0;
2086 yyg
->yy_c_buf_p
= (char *) 0;
2090 yyg
->yy_start_stack_ptr
= 0;
2091 yyg
->yy_start_stack_depth
= 0;
2092 yyg
->yy_start_stack
= NULL
;
2094 /* Defined in main.c */
2103 /* For future reference: Set errno on error, since we are called by
2104 * _gmx_sel_yylex_init()
2109 /* _gmx_sel_yylex_destroy is for both reentrant and non-reentrant scanners. */
2110 int _gmx_sel_yylex_destroy (yyscan_t yyscanner
)
2112 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
2114 /* Pop the buffer stack, destroying each element. */
2115 while(YY_CURRENT_BUFFER
){
2116 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
2117 YY_CURRENT_BUFFER_LVALUE
= NULL
;
2118 _gmx_sel_yypop_buffer_state(yyscanner
);
2121 /* Destroy the stack itself. */
2122 _gmx_sel_yyfree(yyg
->yy_buffer_stack
,yyscanner
);
2123 yyg
->yy_buffer_stack
= NULL
;
2125 /* Destroy the start condition stack. */
2126 _gmx_sel_yyfree(yyg
->yy_start_stack
,yyscanner
);
2127 yyg
->yy_start_stack
= NULL
;
2129 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2130 * _gmx_sel_yylex() is called, initialization will occur. */
2131 yy_init_globals( yyscanner
);
2133 /* Destroy the main struct (reentrant only). */
2134 _gmx_sel_yyfree ( yyscanner
, yyscanner
);
2140 * Internal utility routines.
2144 static void yy_flex_strncpy (char* s1
, yyconst
char * s2
, int n
, yyscan_t yyscanner
)
2147 for ( i
= 0; i
< n
; ++i
)
2152 #ifdef YY_NEED_STRLEN
2153 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
2156 for ( n
= 0; s
[n
]; ++n
)
2163 void *_gmx_sel_yyalloc (yy_size_t size
, yyscan_t yyscanner
)
2165 return (void *) malloc( size
);
2168 void *_gmx_sel_yyrealloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
2170 /* The cast to (char *) in the following accommodates both
2171 * implementations that use char* generic pointers, and those
2172 * that use void* generic pointers. It works with the latter
2173 * because both ANSI C and C++ allow castless assignment from
2174 * any pointer type to void*, and deal with argument conversions
2175 * as though doing an assignment.
2177 return (void *) realloc( (char *) ptr
, size
);
2180 void _gmx_sel_yyfree (void * ptr
, yyscan_t yyscanner
)
2182 free( (char *) ptr
); /* see _gmx_sel_yyrealloc() for (char *) cast */
2185 #define YYTABLES_NAME "yytables"
2187 #line 172 "scanner.l"