5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t
;
45 typedef uint8_t flex_uint8_t
;
46 typedef int16_t flex_int16_t
;
47 typedef uint16_t flex_uint16_t
;
48 typedef int32_t flex_int32_t
;
49 typedef uint32_t flex_uint32_t
;
51 typedef signed char flex_int8_t
;
52 typedef short int flex_int16_t
;
53 typedef int flex_int32_t
;
54 typedef unsigned char flex_uint8_t
;
55 typedef unsigned short int flex_uint16_t
;
56 typedef unsigned int flex_uint32_t
;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
89 #endif /* ! FLEXINT_H */
93 /* The "const" storage-class-modifier is valid. */
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
107 #define yyconst const
112 /* Returned upon end-of-file. */
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 /* An opaque pointer. */
123 #ifndef YY_TYPEDEF_YY_SCANNER_T
124 #define YY_TYPEDEF_YY_SCANNER_T
125 typedef void* yyscan_t
;
128 /* For convenience, these vars (plus the bison vars far below)
129 are macros in the reentrant scanner. */
130 #define yyin yyg->yyin_r
131 #define yyout yyg->yyout_r
132 #define yyextra yyg->yyextra_r
133 #define yyleng yyg->yyleng_r
134 #define yytext yyg->yytext_r
135 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
136 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
137 #define yy_flex_debug yyg->yy_flex_debug_r
139 /* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
143 #define BEGIN yyg->yy_start = 1 + 2 *
145 /* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE _gmx_sel_yyrestart(yyin ,yyscanner )
158 #define YY_END_OF_BUFFER_CHAR 0
160 /* Size of default input buffer. */
163 /* On IA-64, the buffer size is 16k, not 8k.
164 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165 * Ditto for the __ia64__ case accordingly.
167 #define YY_BUF_SIZE 32768
169 #define YY_BUF_SIZE 16384
170 #endif /* __ia64__ */
173 /* The state buf must be large enough to hold one state per character in the main buffer.
175 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
177 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
178 #define YY_TYPEDEF_YY_BUFFER_STATE
179 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
182 #define EOB_ACT_CONTINUE_SCAN 0
183 #define EOB_ACT_END_OF_FILE 1
184 #define EOB_ACT_LAST_MATCH 2
186 #define YY_LESS_LINENO(n)
188 /* Return all but the first "n" matched characters back to the input stream. */
192 /* Undo effects of setting up yytext. */ \
193 int yyless_macro_arg = (n); \
194 YY_LESS_LINENO(yyless_macro_arg);\
195 *yy_cp = yyg->yy_hold_char; \
196 YY_RESTORE_YY_MORE_OFFSET \
197 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
202 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef size_t yy_size_t
;
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
215 char *yy_ch_buf
; /* input buffer */
216 char *yy_buf_pos
; /* current position in input buffer */
218 /* Size of input buffer in bytes, not including room for EOB
221 yy_size_t yy_buf_size
;
223 /* Number of characters read into yy_ch_buf, not including EOB
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
232 int yy_is_our_buffer
;
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
239 int yy_is_interactive
;
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
247 int yy_bs_lineno
; /**< The line count. */
248 int yy_bs_column
; /**< The column count. */
250 /* Whether to try to fill the input buffer when we reach the
255 int yy_buffer_status
;
257 #define YY_BUFFER_NEW 0
258 #define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
265 * When we actually see the EOF, we change the status to "new"
266 * (via _gmx_sel_yyrestart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
269 #define YY_BUFFER_EOF_PENDING 2
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
274 /* We provide macros for accessing buffer states in case in the
275 * future we want to put the buffer states in a more general
278 * Returns the top of the stack, or NULL.
280 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
284 /* Same as previous macro, but useful when we know that the buffer stack is not
285 * NULL or when we need an lvalue. For internal use only.
287 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
289 void _gmx_sel_yyrestart (FILE *input_file
,yyscan_t yyscanner
);
290 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
291 YY_BUFFER_STATE
_gmx_sel_yy_create_buffer (FILE *file
,int size
,yyscan_t yyscanner
);
292 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
293 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b
,yyscan_t yyscanner
);
294 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer
,yyscan_t yyscanner
);
295 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner
);
297 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner
);
298 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner
);
299 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b
,FILE *file
,yyscan_t yyscanner
);
301 #define YY_FLUSH_BUFFER _gmx_sel_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
303 YY_BUFFER_STATE
_gmx_sel_yy_scan_buffer (char *base
,yy_size_t size
,yyscan_t yyscanner
);
304 YY_BUFFER_STATE
_gmx_sel_yy_scan_string (yyconst
char *yy_str
,yyscan_t yyscanner
);
305 YY_BUFFER_STATE
_gmx_sel_yy_scan_bytes (yyconst
char *bytes
,int len
,yyscan_t yyscanner
);
307 void *_gmx_sel_yyalloc (yy_size_t
,yyscan_t yyscanner
);
308 void *_gmx_sel_yyrealloc (void *,yy_size_t
,yyscan_t yyscanner
);
309 void _gmx_sel_yyfree (void * ,yyscan_t yyscanner
);
311 #define yy_new_buffer _gmx_sel_yy_create_buffer
313 #define yy_set_interactive(is_interactive) \
315 if ( ! YY_CURRENT_BUFFER ){ \
316 _gmx_sel_yyensure_buffer_stack (yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE = \
318 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
323 #define yy_set_bol(at_bol) \
325 if ( ! YY_CURRENT_BUFFER ){\
326 _gmx_sel_yyensure_buffer_stack (yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE = \
328 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
330 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
333 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
335 #define _gmx_sel_yywrap(n) 1
336 #define YY_SKIP_YYWRAP
338 typedef unsigned char YY_CHAR
;
340 typedef int yy_state_type
;
342 #define yytext_ptr yytext_r
344 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
);
345 static yy_state_type
yy_try_NUL_trans (yy_state_type current_state
,yyscan_t yyscanner
);
346 static int yy_get_next_buffer (yyscan_t yyscanner
);
347 static void yy_fatal_error (yyconst
char msg
[] ,yyscan_t yyscanner
);
349 /* Done after the current pattern has been matched and before the
350 * corresponding action - sets up yytext.
352 #define YY_DO_BEFORE_ACTION \
353 yyg->yytext_ptr = yy_bp; \
354 yyleng = (size_t) (yy_cp - yy_bp); \
355 yyg->yy_hold_char = *yy_cp; \
357 yyg->yy_c_buf_p = yy_cp;
359 #define YY_NUM_RULES 26
360 #define YY_END_OF_BUFFER 27
361 /* This struct is not used in this scanner,
362 but its presence is necessary. */
365 flex_int32_t yy_verify
;
368 static yyconst flex_int16_t yy_accept
[93] =
370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
371 27, 25, 23, 6, 20, 25, 1, 25, 25, 25,
372 2, 6, 21, 25, 22, 25, 24, 22, 22, 22,
373 22, 22, 22, 25, 22, 22, 22, 22, 22, 11,
374 8, 10, 10, 9, 23, 21, 0, 4, 0, 1,
375 17, 0, 0, 3, 3, 2, 24, 24, 22, 5,
376 22, 22, 22, 18, 15, 22, 18, 16, 13, 22,
377 12, 22, 22, 8, 9, 0, 0, 0, 3, 17,
378 22, 20, 19, 13, 22, 3, 0, 3, 22, 7,
383 static yyconst flex_int32_t yy_ec
[256] =
385 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
386 1, 1, 1, 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, 9, 10, 1, 11, 11, 11,
390 11, 11, 11, 11, 11, 11, 11, 1, 12, 13,
391 14, 13, 1, 1, 15, 15, 15, 15, 16, 15,
392 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
393 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
394 1, 17, 1, 1, 18, 1, 19, 15, 15, 20,
396 21, 22, 23, 24, 15, 15, 15, 25, 15, 26,
397 27, 28, 15, 29, 30, 31, 32, 15, 15, 33,
398 34, 15, 1, 35, 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
[36] =
417 1, 1, 2, 1, 1, 1, 1, 1, 1, 3,
418 4, 1, 1, 1, 4, 4, 1, 4, 4, 4,
419 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
423 static yyconst flex_int16_t yy_base
[98] =
425 0, 0, 144, 143, 10, 12, 145, 144, 46, 0,
426 167, 172, 164, 172, 151, 77, 0, 157, 30, 152,
427 74, 172, 148, 147, 0, 157, 149, 132, 128, 129,
428 126, 127, 126, 117, 64, 124, 70, 129, 128, 172,
429 146, 172, 172, 0, 145, 172, 83, 172, 141, 0,
430 172, 134, 87, 90, 91, 94, 134, 108, 0, 172,
431 123, 115, 110, 0, 0, 111, 172, 0, 108, 116,
432 0, 107, 111, 133, 0, 34, 112, 123, 103, 0,
433 97, 0, 0, 0, 97, 111, 98, 80, 61, 0,
434 0, 172, 123, 127, 129, 83, 79
438 static yyconst flex_int16_t yy_def
[98] =
440 92, 1, 1, 1, 1, 1, 1, 1, 92, 9,
441 92, 92, 92, 92, 92, 93, 94, 92, 92, 92,
442 95, 92, 92, 92, 96, 92, 95, 96, 96, 96,
443 96, 96, 96, 92, 96, 96, 96, 96, 96, 92,
444 92, 92, 92, 97, 92, 92, 93, 92, 92, 94,
445 92, 92, 92, 92, 92, 95, 95, 95, 96, 92,
446 96, 96, 96, 96, 96, 96, 92, 96, 96, 96,
447 96, 96, 96, 92, 97, 92, 92, 92, 95, 96,
448 96, 96, 96, 96, 96, 92, 92, 92, 96, 96,
449 96, 0, 92, 92, 92, 92, 92
453 static yyconst flex_int16_t yy_nxt
[208] =
455 12, 13, 14, 15, 16, 17, 18, 12, 19, 20,
456 21, 22, 23, 24, 25, 25, 26, 27, 28, 25,
457 25, 25, 29, 25, 25, 30, 31, 25, 25, 25,
458 32, 25, 33, 25, 34, 36, 37, 36, 37, 52,
459 53, 78, 78, 38, 86, 38, 40, 41, 42, 40,
460 40, 40, 40, 40, 40, 40, 40, 43, 40, 40,
461 44, 44, 40, 40, 44, 44, 44, 44, 44, 44,
462 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
463 40, 48, 75, 55, 56, 68, 59, 48, 91, 58,
464 88, 70, 64, 49, 58, 71, 55, 53, 64, 49,
466 54, 54, 76, 55, 56, 77, 77, 76, 88, 58,
467 77, 77, 92, 79, 58, 78, 78, 92, 79, 87,
468 87, 86, 88, 47, 90, 47, 47, 50, 89, 50,
469 50, 57, 57, 86, 74, 85, 71, 84, 82, 83,
470 82, 81, 80, 92, 54, 47, 45, 74, 73, 72,
471 69, 67, 66, 65, 64, 63, 62, 61, 92, 60,
472 46, 46, 54, 51, 46, 45, 92, 39, 39, 35,
473 35, 11, 92, 92, 92, 92, 92, 92, 92, 92,
474 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
475 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
477 92, 92, 92, 92, 92, 92, 92
480 static yyconst flex_int16_t yy_chk
[208] =
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, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 5, 5, 6, 6, 19,
486 19, 76, 76, 5, 76, 6, 9, 9, 9, 9,
487 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
488 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
489 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
490 9, 16, 97, 21, 21, 35, 96, 47, 89, 21,
491 88, 37, 35, 16, 21, 37, 53, 53, 37, 47,
493 54, 55, 53, 56, 56, 54, 55, 53, 87, 56,
494 54, 55, 79, 79, 56, 58, 58, 58, 58, 77,
495 77, 86, 77, 93, 85, 93, 93, 94, 81, 94,
496 94, 95, 95, 78, 74, 73, 72, 70, 69, 66,
497 63, 62, 61, 57, 52, 49, 45, 41, 39, 38,
498 36, 34, 33, 32, 31, 30, 29, 28, 27, 26,
499 24, 23, 20, 18, 15, 13, 11, 8, 7, 4,
500 3, 92, 92, 92, 92, 92, 92, 92, 92, 92,
501 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
502 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
504 92, 92, 92, 92, 92, 92, 92
507 /* The intent behind this definition is that it'll catch
508 * any uses of REJECT which flex missed.
510 #define REJECT reject_used_but_not_detected
511 #define yymore() yymore_used_but_not_detected
512 #define YY_MORE_ADJ 0
513 #define YY_RESTORE_YY_MORE_OFFSET
517 * This source code is part of
521 * GROningen MAchine for Chemical Simulations
523 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
524 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
525 * Copyright (c) 2001-2009, The GROMACS development team,
526 * check out http://www.gromacs.org for more information.
528 * This program is free software; you can redistribute it and/or
529 * modify it under the terms of the GNU General Public License
530 * as published by the Free Software Foundation; either version 2
531 * of the License, or (at your option) any later version.
533 * If you want to redistribute modifications, please consider that
534 * scientific software is very special. Version control is crucial -
535 * bugs must be traceable. We will be happy to consider code for
536 * inclusion in the official distribution, but derived work must not
537 * be called official GROMACS. Details are found in the README & COPYING
538 * files - if they are missing, get the official version at www.gromacs.org.
540 * To help us fund GROMACS development, we humbly ask that you cite
541 * the papers on the package - you can find them in the top README file.
543 * For more info, check our website at http://www.gromacs.org
545 /*! \cond \internal \file scanner.l
547 * Tokenizer for the selection language.
550 /*! \internal \file scanner.c
552 * Generated (from scanner.l by Flex) tokenizer for the selection language.
563 #include "scanner_internal.h"
565 /* This macro is here to make the actions a bit shorter, since nearly every
566 * action needs this call. */
567 #define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state)
569 #define YY_NO_UNISTD_H 1
574 #line 575 "scanner.c"
582 #ifndef YY_NO_UNISTD_H
583 /* Special case for "unistd.h", since it is non-ANSI. We include it way
584 * down here because we want the user's section 1 to have been scanned first.
585 * The user has a chance to override it with an option.
590 #ifndef YY_EXTRA_TYPE
591 #define YY_EXTRA_TYPE void *
594 /* Holds the entire state of the reentrant scanner. */
598 /* User-defined. Not touched by flex. */
599 YY_EXTRA_TYPE yyextra_r
;
601 /* The rest are the same as the globals declared in the non-reentrant scanner. */
602 FILE *yyin_r
, *yyout_r
;
603 size_t yy_buffer_stack_top
; /**< index of top of stack. */
604 size_t yy_buffer_stack_max
; /**< capacity of stack. */
605 YY_BUFFER_STATE
* yy_buffer_stack
; /**< Stack as an array. */
612 int yy_did_buffer_switch_on_eof
;
613 int yy_start_stack_ptr
;
614 int yy_start_stack_depth
;
616 yy_state_type yy_last_accepting_state
;
617 char* yy_last_accepting_cpos
;
626 }; /* end struct yyguts_t */
628 static int yy_init_globals (yyscan_t yyscanner
);
630 int _gmx_sel_yylex_init (yyscan_t
* scanner
);
632 int _gmx_sel_yylex_init_extra (YY_EXTRA_TYPE user_defined
,yyscan_t
* scanner
);
634 /* Accessor methods to globals.
635 These are made visible to non-reentrant scanners for convenience. */
637 int _gmx_sel_yylex_destroy (yyscan_t yyscanner
);
639 int _gmx_sel_yyget_debug (yyscan_t yyscanner
);
641 void _gmx_sel_yyset_debug (int debug_flag
,yyscan_t yyscanner
);
643 YY_EXTRA_TYPE
_gmx_sel_yyget_extra (yyscan_t yyscanner
);
645 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined
,yyscan_t yyscanner
);
647 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner
);
649 void _gmx_sel_yyset_in (FILE * in_str
,yyscan_t yyscanner
);
651 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner
);
653 void _gmx_sel_yyset_out (FILE * out_str
,yyscan_t yyscanner
);
655 int _gmx_sel_yyget_leng (yyscan_t yyscanner
);
657 char *_gmx_sel_yyget_text (yyscan_t yyscanner
);
659 int _gmx_sel_yyget_lineno (yyscan_t yyscanner
);
661 void _gmx_sel_yyset_lineno (int line_number
,yyscan_t yyscanner
);
663 /* Macros after this point can all be overridden by user definitions in
667 #ifndef YY_SKIP_YYWRAP
669 extern "C" int _gmx_sel_yywrap (yyscan_t yyscanner
);
671 extern int _gmx_sel_yywrap (yyscan_t yyscanner
);
675 static void yyunput (int c
,char *buf_ptr
,yyscan_t yyscanner
);
678 static void yy_flex_strncpy (char *,yyconst
char *,int ,yyscan_t yyscanner
);
681 #ifdef YY_NEED_STRLEN
682 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner
);
688 static int yyinput (yyscan_t yyscanner
);
690 static int input (yyscan_t yyscanner
);
695 /* Amount of stuff to slurp up with each read. */
696 #ifndef YY_READ_BUF_SIZE
698 /* On IA-64, the buffer size is 16k, not 8k */
699 #define YY_READ_BUF_SIZE 16384
701 #define YY_READ_BUF_SIZE 8192
702 #endif /* __ia64__ */
705 /* Copy whatever the last rule matched to the standard output. */
707 /* This used to be an fputs(), but since the string might contain NUL's,
708 * we now use fwrite().
710 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
713 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
714 * is returned in "result".
717 #define YY_INPUT(buf,result,max_size) \
718 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
722 for ( n = 0; n < max_size && \
723 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
726 buf[n++] = (char) c; \
727 if ( c == EOF && ferror( yyin ) ) \
728 YY_FATAL_ERROR( "input in flex scanner failed" ); \
734 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
736 if( errno != EINTR) \
738 YY_FATAL_ERROR( "input in flex scanner failed" ); \
749 /* No semi-colon after return; correct usage is to write "yyterminate();" -
750 * we don't want an extra ';' after the "return" because that will cause
751 * some compilers to complain about unreachable statements.
754 #define yyterminate() return YY_NULL
757 /* Number of entries by which start-condition stack grows. */
758 #ifndef YY_START_STACK_INCR
759 #define YY_START_STACK_INCR 25
762 /* Report a fatal error. */
763 #ifndef YY_FATAL_ERROR
764 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
767 /* end tables serialization structures and prototypes */
769 /* Default declaration of generated scanner - a define so the user can
770 * easily add parameters.
773 #define YY_DECL_IS_OURS 1
775 extern int _gmx_sel_yylex (yyscan_t yyscanner
);
777 #define YY_DECL int _gmx_sel_yylex (yyscan_t yyscanner)
778 #endif /* !YY_DECL */
780 /* Code executed at the beginning of each rule, after yytext and yyleng
783 #ifndef YY_USER_ACTION
784 #define YY_USER_ACTION
787 /* Code executed at the end of each rule. */
789 #define YY_BREAK break;
792 #define YY_RULE_SETUP \
795 /** The main scanner function which does all the work.
799 register yy_state_type yy_current_state
;
800 register char *yy_cp
, *yy_bp
;
802 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
808 gmx_sel_lexer_t
*state
= _gmx_sel_yyget_extra(yyscanner
);
810 /* Return a token if one is pending */
811 retval
= _gmx_sel_lexer_process_pending(yylval
, state
);
816 /* Handle the start conditions for 'of' matching */
820 state
->bMatchOf
= FALSE
;
822 else if (state
->bMatchBool
)
825 state
->bMatchBool
= FALSE
;
827 else if (state
->bCmdStart
)
830 state
->bCmdStart
= FALSE
;
832 else if (YYSTATE
!= help
)
838 #line 839 "scanner.c"
848 if ( ! yyg
->yy_start
)
849 yyg
->yy_start
= 1; /* first start state */
857 if ( ! YY_CURRENT_BUFFER
) {
858 _gmx_sel_yyensure_buffer_stack (yyscanner
);
859 YY_CURRENT_BUFFER_LVALUE
=
860 _gmx_sel_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
863 _gmx_sel_yy_load_buffer_state(yyscanner
);
866 while ( 1 ) /* loops until end-of-file is reached */
868 yy_cp
= yyg
->yy_c_buf_p
;
870 /* Support of yytext. */
871 *yy_cp
= yyg
->yy_hold_char
;
873 /* yy_bp points to the position in yy_ch_buf of the start of
878 yy_current_state
= yyg
->yy_start
;
882 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
883 if ( yy_accept
[yy_current_state
] )
885 yyg
->yy_last_accepting_state
= yy_current_state
;
886 yyg
->yy_last_accepting_cpos
= yy_cp
;
888 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
890 yy_current_state
= (int) yy_def
[yy_current_state
];
891 if ( yy_current_state
>= 93 )
892 yy_c
= yy_meta
[(unsigned int) yy_c
];
894 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
897 while ( yy_current_state
!= 92 );
898 yy_cp
= yyg
->yy_last_accepting_cpos
;
899 yy_current_state
= yyg
->yy_last_accepting_state
;
902 yy_act
= yy_accept
[yy_current_state
];
906 do_action
: /* This label is used only to access EOF actions. */
909 { /* beginning of action switch */
910 case 0: /* must back up */
911 /* undo the effects of YY_DO_BEFORE_ACTION */
912 *yy_cp
= yyg
->yy_hold_char
;
913 yy_cp
= yyg
->yy_last_accepting_cpos
;
914 yy_current_state
= yyg
->yy_last_accepting_state
;
919 #line 113 "scanner.l"
924 #line 114 "scanner.l"
925 { yylval
->i
= strtol(yytext
, NULL
, 10); ADD_TOKEN
; return TOK_INT
; }
929 #line 115 "scanner.l"
930 { yylval
->r
= strtod(yytext
, NULL
); ADD_TOKEN
; return TOK_REAL
; }
934 #line 116 "scanner.l"
935 { yylval
->str
= strndup(yytext
+1, yyleng
-2); ADD_TOKEN
; return STR
; }
938 /* rule 5 can match eol */
940 #line 118 "scanner.l"
944 /* rule 6 can match eol */
946 #line 119 "scanner.l"
948 if (yytext
[0] == ';' || state
->bInteractive
)
950 state
->bCmdStart
= TRUE
;
951 rtrim(state
->pselstr
);
956 case YY_STATE_EOF(cmdstart
):
957 #line 127 "scanner.l"
960 case YY_STATE_EOF(INITIAL
):
961 case YY_STATE_EOF(matchof
):
962 case YY_STATE_EOF(matchbool
):
963 case YY_STATE_EOF(help
):
964 #line 128 "scanner.l"
965 { state
->bCmdStart
= TRUE
; return CMD_SEP
; }
969 #line 130 "scanner.l"
970 { BEGIN(help
); return HELP
; }
975 #line 132 "scanner.l"
980 #line 133 "scanner.l"
981 { yylval
->str
= strndup(yytext
, yyleng
); return HELP_TOPIC
; }
984 /* rule 10 can match eol */
986 #line 134 "scanner.l"
987 { state
->bCmdStart
= TRUE
; return CMD_SEP
; }
991 #line 135 "scanner.l"
998 #line 139 "scanner.l"
999 { ADD_TOKEN
; yylval
->i
= 1; return TOK_INT
; }
1003 #line 140 "scanner.l"
1004 { ADD_TOKEN
; yylval
->i
= 0; return TOK_INT
; }
1009 #line 142 "scanner.l"
1010 { ADD_TOKEN
; return GROUP
; }
1014 #line 143 "scanner.l"
1015 { ADD_TOKEN
; return TO
; }
1019 #line 144 "scanner.l"
1020 { ADD_TOKEN
; BEGIN(0); return OF
; }
1024 #line 145 "scanner.l"
1025 { ADD_TOKEN
; return AND
; }
1029 #line 146 "scanner.l"
1030 { ADD_TOKEN
; return OR
; }
1034 #line 147 "scanner.l"
1035 { ADD_TOKEN
; return XOR
; }
1039 #line 148 "scanner.l"
1040 { ADD_TOKEN
; return NOT
; }
1044 #line 149 "scanner.l"
1045 { yylval
->str
= strndup(yytext
, yyleng
); ADD_TOKEN
; return CMP_OP
; }
1049 #line 151 "scanner.l"
1050 { return _gmx_sel_lexer_process_identifier(yylval
, yytext
, yyleng
, state
); }
1054 #line 153 "scanner.l"
1055 { _gmx_sel_lexer_add_token(" ", 1, state
); }
1059 #line 154 "scanner.l"
1060 { yylval
->str
= strndup(yytext
, yyleng
); ADD_TOKEN
; return STR
; }
1064 #line 155 "scanner.l"
1065 { _gmx_sel_lexer_add_token(yytext
, 1, state
); return yytext
[0]; }
1069 #line 156 "scanner.l"
1070 YY_FATAL_ERROR( "flex scanner jammed" );
1072 #line 1073 "scanner.c"
1074 case YY_END_OF_BUFFER
:
1076 /* Amount of text matched not including the EOB char. */
1077 int yy_amount_of_matched_text
= (int) (yy_cp
- yyg
->yytext_ptr
) - 1;
1079 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1080 *yy_cp
= yyg
->yy_hold_char
;
1081 YY_RESTORE_YY_MORE_OFFSET
1083 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_NEW
)
1085 /* We're scanning a new file or input source. It's
1086 * possible that this happened because the user
1087 * just pointed yyin at a new source and called
1088 * _gmx_sel_yylex(). If so, then we have to assure
1089 * consistency between YY_CURRENT_BUFFER and our
1090 * globals. Here is the right place to do so, because
1091 * this is the first action (other than possibly a
1092 * back-up) that will match for the new input source.
1094 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1095 YY_CURRENT_BUFFER_LVALUE
->yy_input_file
= yyin
;
1096 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1099 /* Note that here we test for yy_c_buf_p "<=" to the position
1100 * of the first EOB in the buffer, since yy_c_buf_p will
1101 * already have been incremented past the NUL character
1102 * (since all states make transitions on EOB to the
1103 * end-of-buffer state). Contrast this with the test
1106 if ( yyg
->yy_c_buf_p
<= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1107 { /* This was really a NUL. */
1108 yy_state_type yy_next_state
;
1110 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1112 yy_current_state
= yy_get_previous_state( yyscanner
);
1114 /* Okay, we're now positioned to make the NUL
1115 * transition. We couldn't have
1116 * yy_get_previous_state() go ahead and do it
1117 * for us because it doesn't know how to deal
1118 * with the possibility of jamming (and we don't
1119 * want to build jamming into it because then it
1120 * will run more slowly).
1123 yy_next_state
= yy_try_NUL_trans( yy_current_state
, yyscanner
);
1125 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1127 if ( yy_next_state
)
1129 /* Consume the NUL. */
1130 yy_cp
= ++yyg
->yy_c_buf_p
;
1131 yy_current_state
= yy_next_state
;
1137 yy_cp
= yyg
->yy_last_accepting_cpos
;
1138 yy_current_state
= yyg
->yy_last_accepting_state
;
1139 goto yy_find_action
;
1143 else switch ( yy_get_next_buffer( yyscanner
) )
1145 case EOB_ACT_END_OF_FILE
:
1147 yyg
->yy_did_buffer_switch_on_eof
= 0;
1149 if ( _gmx_sel_yywrap(yyscanner
) )
1151 /* Note: because we've taken care in
1152 * yy_get_next_buffer() to have set up
1153 * yytext, we can now set up
1154 * yy_c_buf_p so that if some total
1155 * hoser (like flex itself) wants to
1156 * call the scanner after we return the
1157 * YY_NULL, it'll still work - another
1158 * YY_NULL will get returned.
1160 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1162 yy_act
= YY_STATE_EOF(YY_START
);
1168 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1174 case EOB_ACT_CONTINUE_SCAN
:
1176 yyg
->yytext_ptr
+ yy_amount_of_matched_text
;
1178 yy_current_state
= yy_get_previous_state( yyscanner
);
1180 yy_cp
= yyg
->yy_c_buf_p
;
1181 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1184 case EOB_ACT_LAST_MATCH
:
1186 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
];
1188 yy_current_state
= yy_get_previous_state( yyscanner
);
1190 yy_cp
= yyg
->yy_c_buf_p
;
1191 yy_bp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
;
1192 goto yy_find_action
;
1199 "fatal flex scanner internal error--no action found" );
1200 } /* end of action switch */
1201 } /* end of scanning one token */
1202 } /* end of _gmx_sel_yylex */
1204 /* yy_get_next_buffer - try to read in a new buffer
1206 * Returns a code representing an action:
1207 * EOB_ACT_LAST_MATCH -
1208 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1209 * EOB_ACT_END_OF_FILE - end of file
1211 static int yy_get_next_buffer (yyscan_t yyscanner
)
1213 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1214 register char *dest
= YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
;
1215 register char *source
= yyg
->yytext_ptr
;
1216 register int number_to_move
, i
;
1219 if ( yyg
->yy_c_buf_p
> &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] )
1221 "fatal flex scanner internal error--end of buffer missed" );
1223 if ( YY_CURRENT_BUFFER_LVALUE
->yy_fill_buffer
== 0 )
1224 { /* Don't try to fill the buffer, so this is an EOF. */
1225 if ( yyg
->yy_c_buf_p
- yyg
->yytext_ptr
- YY_MORE_ADJ
== 1 )
1227 /* We matched a single character, the EOB, so
1228 * treat this as a final EOF.
1230 return EOB_ACT_END_OF_FILE
;
1235 /* We matched some text prior to the EOB, first
1238 return EOB_ACT_LAST_MATCH
;
1242 /* Try to read more data. */
1244 /* First move last chars to start of buffer. */
1245 number_to_move
= (int) (yyg
->yy_c_buf_p
- yyg
->yytext_ptr
) - 1;
1247 for ( i
= 0; i
< number_to_move
; ++i
)
1248 *(dest
++) = *(source
++);
1250 if ( YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
1251 /* don't do the read, it's not guaranteed to return an EOF,
1254 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
= 0;
1259 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
- number_to_move
- 1;
1261 while ( num_to_read
<= 0 )
1262 { /* Not enough room in the buffer - grow it. */
1264 /* just a shorter name for the current buffer */
1265 YY_BUFFER_STATE b
= YY_CURRENT_BUFFER
;
1267 int yy_c_buf_p_offset
=
1268 (int) (yyg
->yy_c_buf_p
- b
->yy_ch_buf
);
1270 if ( b
->yy_is_our_buffer
)
1272 int new_size
= b
->yy_buf_size
* 2;
1274 if ( new_size
<= 0 )
1275 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
1277 b
->yy_buf_size
*= 2;
1279 b
->yy_ch_buf
= (char *)
1280 /* Include room in for 2 EOB chars. */
1281 _gmx_sel_yyrealloc((void *) b
->yy_ch_buf
,b
->yy_buf_size
+ 2 ,yyscanner
);
1284 /* Can't grow it, we don't own it. */
1287 if ( ! b
->yy_ch_buf
)
1289 "fatal error - scanner input buffer overflow" );
1291 yyg
->yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
1293 num_to_read
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
-
1298 if ( num_to_read
> YY_READ_BUF_SIZE
)
1299 num_to_read
= YY_READ_BUF_SIZE
;
1301 /* Read in more data. */
1302 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
]),
1303 yyg
->yy_n_chars
, (size_t) num_to_read
);
1305 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1308 if ( yyg
->yy_n_chars
== 0 )
1310 if ( number_to_move
== YY_MORE_ADJ
)
1312 ret_val
= EOB_ACT_END_OF_FILE
;
1313 _gmx_sel_yyrestart(yyin
,yyscanner
);
1318 ret_val
= EOB_ACT_LAST_MATCH
;
1319 YY_CURRENT_BUFFER_LVALUE
->yy_buffer_status
=
1320 YY_BUFFER_EOF_PENDING
;
1325 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1327 if ((yy_size_t
) (yyg
->yy_n_chars
+ number_to_move
) > YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
) {
1328 /* Extend the array by 50%, plus the number we really need. */
1329 yy_size_t new_size
= yyg
->yy_n_chars
+ number_to_move
+ (yyg
->yy_n_chars
>> 1);
1330 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
= (char *) _gmx_sel_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
,new_size
,yyscanner
);
1331 if ( ! YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1332 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1335 yyg
->yy_n_chars
+= number_to_move
;
1336 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1337 YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1339 yyg
->yytext_ptr
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[0];
1344 /* yy_get_previous_state - get the state just before the EOB char was reached */
1346 static yy_state_type
yy_get_previous_state (yyscan_t yyscanner
)
1348 register yy_state_type yy_current_state
;
1349 register char *yy_cp
;
1350 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1352 yy_current_state
= yyg
->yy_start
;
1354 for ( yy_cp
= yyg
->yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yyg
->yy_c_buf_p
; ++yy_cp
)
1356 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1357 if ( yy_accept
[yy_current_state
] )
1359 yyg
->yy_last_accepting_state
= yy_current_state
;
1360 yyg
->yy_last_accepting_cpos
= yy_cp
;
1362 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1364 yy_current_state
= (int) yy_def
[yy_current_state
];
1365 if ( yy_current_state
>= 93 )
1366 yy_c
= yy_meta
[(unsigned int) yy_c
];
1368 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1371 return yy_current_state
;
1374 /* yy_try_NUL_trans - try to make a transition on the NUL character
1377 * next_state = yy_try_NUL_trans( current_state );
1379 static yy_state_type
yy_try_NUL_trans (yy_state_type yy_current_state
, yyscan_t yyscanner
)
1381 register int yy_is_jam
;
1382 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
; /* This var may be unused depending upon options. */
1383 register char *yy_cp
= yyg
->yy_c_buf_p
;
1385 register YY_CHAR yy_c
= 1;
1386 if ( yy_accept
[yy_current_state
] )
1388 yyg
->yy_last_accepting_state
= yy_current_state
;
1389 yyg
->yy_last_accepting_cpos
= yy_cp
;
1391 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1393 yy_current_state
= (int) yy_def
[yy_current_state
];
1394 if ( yy_current_state
>= 93 )
1395 yy_c
= yy_meta
[(unsigned int) yy_c
];
1397 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1398 yy_is_jam
= (yy_current_state
== 92);
1400 return yy_is_jam
? 0 : yy_current_state
;
1403 static void yyunput (int c
, register char * yy_bp
, yyscan_t yyscanner
)
1405 register char *yy_cp
;
1406 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1408 yy_cp
= yyg
->yy_c_buf_p
;
1410 /* undo effects of setting up yytext */
1411 *yy_cp
= yyg
->yy_hold_char
;
1413 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1414 { /* need to shift things up to make room */
1415 /* +2 for EOB chars. */
1416 register int number_to_move
= yyg
->yy_n_chars
+ 2;
1417 register char *dest
= &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[
1418 YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
+ 2];
1419 register char *source
=
1420 &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[number_to_move
];
1422 while ( source
> YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
)
1423 *--dest
= *--source
;
1425 yy_cp
+= (int) (dest
- source
);
1426 yy_bp
+= (int) (dest
- source
);
1427 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
=
1428 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_size
;
1430 if ( yy_cp
< YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
+ 2 )
1431 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1434 *--yy_cp
= (char) c
;
1436 yyg
->yytext_ptr
= yy_bp
;
1437 yyg
->yy_hold_char
= *yy_cp
;
1438 yyg
->yy_c_buf_p
= yy_cp
;
1443 static int yyinput (yyscan_t yyscanner
)
1445 static int input (yyscan_t yyscanner
)
1450 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1452 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1454 if ( *yyg
->yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1456 /* yy_c_buf_p now points to the character we want to return.
1457 * If this occurs *before* the EOB characters, then it's a
1458 * valid NUL; if not, then we've hit the end of the buffer.
1460 if ( yyg
->yy_c_buf_p
< &YY_CURRENT_BUFFER_LVALUE
->yy_ch_buf
[yyg
->yy_n_chars
] )
1461 /* This was really a NUL. */
1462 *yyg
->yy_c_buf_p
= '\0';
1465 { /* need more input */
1466 int offset
= yyg
->yy_c_buf_p
- yyg
->yytext_ptr
;
1469 switch ( yy_get_next_buffer( yyscanner
) )
1471 case EOB_ACT_LAST_MATCH
:
1472 /* This happens because yy_g_n_b()
1473 * sees that we've accumulated a
1474 * token and flags that we need to
1475 * try matching the token before
1476 * proceeding. But for input(),
1477 * there's no matching to consider.
1478 * So convert the EOB_ACT_LAST_MATCH
1479 * to EOB_ACT_END_OF_FILE.
1482 /* Reset buffer status. */
1483 _gmx_sel_yyrestart(yyin
,yyscanner
);
1487 case EOB_ACT_END_OF_FILE
:
1489 if ( _gmx_sel_yywrap(yyscanner
) )
1492 if ( ! yyg
->yy_did_buffer_switch_on_eof
)
1495 return yyinput(yyscanner
);
1497 return input(yyscanner
);
1501 case EOB_ACT_CONTINUE_SCAN
:
1502 yyg
->yy_c_buf_p
= yyg
->yytext_ptr
+ offset
;
1508 c
= *(unsigned char *) yyg
->yy_c_buf_p
; /* cast for 8-bit char's */
1509 *yyg
->yy_c_buf_p
= '\0'; /* preserve yytext */
1510 yyg
->yy_hold_char
= *++yyg
->yy_c_buf_p
;
1514 #endif /* ifndef YY_NO_INPUT */
1516 /** Immediately switch to a different input stream.
1517 * @param input_file A readable stream.
1518 * @param yyscanner The scanner object.
1519 * @note This function does not reset the start condition to @c INITIAL .
1521 void _gmx_sel_yyrestart (FILE * input_file
, yyscan_t yyscanner
)
1523 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1525 if ( ! YY_CURRENT_BUFFER
){
1526 _gmx_sel_yyensure_buffer_stack (yyscanner
);
1527 YY_CURRENT_BUFFER_LVALUE
=
1528 _gmx_sel_yy_create_buffer(yyin
,YY_BUF_SIZE
,yyscanner
);
1531 _gmx_sel_yy_init_buffer(YY_CURRENT_BUFFER
,input_file
,yyscanner
);
1532 _gmx_sel_yy_load_buffer_state(yyscanner
);
1535 /** Switch to a different input buffer.
1536 * @param new_buffer The new input buffer.
1537 * @param yyscanner The scanner object.
1539 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1541 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1543 /* TODO. We should be able to replace this entire function body
1545 * _gmx_sel_yypop_buffer_state();
1546 * _gmx_sel_yypush_buffer_state(new_buffer);
1548 _gmx_sel_yyensure_buffer_stack (yyscanner
);
1549 if ( YY_CURRENT_BUFFER
== new_buffer
)
1552 if ( YY_CURRENT_BUFFER
)
1554 /* Flush out information for old buffer. */
1555 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1556 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1557 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1560 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1561 _gmx_sel_yy_load_buffer_state(yyscanner
);
1563 /* We don't actually know whether we did this switch during
1564 * EOF (_gmx_sel_yywrap()) processing, but the only time this flag
1565 * is looked at is after _gmx_sel_yywrap() is called, so it's safe
1566 * to go ahead and always set it.
1568 yyg
->yy_did_buffer_switch_on_eof
= 1;
1571 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner
)
1573 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1574 yyg
->yy_n_chars
= YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
;
1575 yyg
->yytext_ptr
= yyg
->yy_c_buf_p
= YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
;
1576 yyin
= YY_CURRENT_BUFFER_LVALUE
->yy_input_file
;
1577 yyg
->yy_hold_char
= *yyg
->yy_c_buf_p
;
1580 /** Allocate and initialize an input buffer state.
1581 * @param file A readable stream.
1582 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1583 * @param yyscanner The scanner object.
1584 * @return the allocated buffer state.
1586 YY_BUFFER_STATE
_gmx_sel_yy_create_buffer (FILE * file
, int size
, yyscan_t yyscanner
)
1590 b
= (YY_BUFFER_STATE
) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1592 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1594 b
->yy_buf_size
= size
;
1596 /* yy_ch_buf has to be 2 characters longer than the size given because
1597 * we need to put in 2 end-of-buffer characters.
1599 b
->yy_ch_buf
= (char *) _gmx_sel_yyalloc(b
->yy_buf_size
+ 2 ,yyscanner
);
1600 if ( ! b
->yy_ch_buf
)
1601 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1603 b
->yy_is_our_buffer
= 1;
1605 _gmx_sel_yy_init_buffer(b
,file
,yyscanner
);
1610 /** Destroy the buffer.
1611 * @param b a buffer created with _gmx_sel_yy_create_buffer()
1612 * @param yyscanner The scanner object.
1614 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1616 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1621 if ( b
== YY_CURRENT_BUFFER
) /* Not sure if we should pop here. */
1622 YY_CURRENT_BUFFER_LVALUE
= (YY_BUFFER_STATE
) 0;
1624 if ( b
->yy_is_our_buffer
)
1625 _gmx_sel_yyfree((void *) b
->yy_ch_buf
,yyscanner
);
1627 _gmx_sel_yyfree((void *) b
,yyscanner
);
1630 /* Initializes or reinitializes a buffer.
1631 * This function is sometimes called more than once on the same buffer,
1632 * such as during a _gmx_sel_yyrestart() or at EOF.
1634 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b
, FILE * file
, yyscan_t yyscanner
)
1638 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1640 _gmx_sel_yy_flush_buffer(b
,yyscanner
);
1642 b
->yy_input_file
= file
;
1643 b
->yy_fill_buffer
= 1;
1645 /* If b is the current buffer, then _gmx_sel_yy_init_buffer was _probably_
1646 * called from _gmx_sel_yyrestart() or through yy_get_next_buffer.
1647 * In that case, we don't want to reset the lineno or column.
1649 if (b
!= YY_CURRENT_BUFFER
){
1650 b
->yy_bs_lineno
= 1;
1651 b
->yy_bs_column
= 0;
1654 b
->yy_is_interactive
= 0;
1659 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1660 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1661 * @param yyscanner The scanner object.
1663 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b
, yyscan_t yyscanner
)
1665 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1671 /* We always need two end-of-buffer characters. The first causes
1672 * a transition to the end-of-buffer state. The second causes
1673 * a jam in that state.
1675 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1676 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1678 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1681 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1683 if ( b
== YY_CURRENT_BUFFER
)
1684 _gmx_sel_yy_load_buffer_state(yyscanner
);
1687 /** Pushes the new state onto the stack. The new state becomes
1688 * the current state. This function will allocate the stack
1690 * @param new_buffer The new state.
1691 * @param yyscanner The scanner object.
1693 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer
, yyscan_t yyscanner
)
1695 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1696 if (new_buffer
== NULL
)
1699 _gmx_sel_yyensure_buffer_stack(yyscanner
);
1701 /* This block is copied from _gmx_sel_yy_switch_to_buffer. */
1702 if ( YY_CURRENT_BUFFER
)
1704 /* Flush out information for old buffer. */
1705 *yyg
->yy_c_buf_p
= yyg
->yy_hold_char
;
1706 YY_CURRENT_BUFFER_LVALUE
->yy_buf_pos
= yyg
->yy_c_buf_p
;
1707 YY_CURRENT_BUFFER_LVALUE
->yy_n_chars
= yyg
->yy_n_chars
;
1710 /* Only push if top exists. Otherwise, replace top. */
1711 if (YY_CURRENT_BUFFER
)
1712 yyg
->yy_buffer_stack_top
++;
1713 YY_CURRENT_BUFFER_LVALUE
= new_buffer
;
1715 /* copied from _gmx_sel_yy_switch_to_buffer. */
1716 _gmx_sel_yy_load_buffer_state(yyscanner
);
1717 yyg
->yy_did_buffer_switch_on_eof
= 1;
1720 /** Removes and deletes the top of the stack, if present.
1721 * The next element becomes the new top.
1722 * @param yyscanner The scanner object.
1724 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner
)
1726 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1727 if (!YY_CURRENT_BUFFER
)
1730 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER
,yyscanner
);
1731 YY_CURRENT_BUFFER_LVALUE
= NULL
;
1732 if (yyg
->yy_buffer_stack_top
> 0)
1733 --yyg
->yy_buffer_stack_top
;
1735 if (YY_CURRENT_BUFFER
) {
1736 _gmx_sel_yy_load_buffer_state(yyscanner
);
1737 yyg
->yy_did_buffer_switch_on_eof
= 1;
1741 /* Allocates the stack if it does not exist.
1742 * Guarantees space for at least one push.
1744 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner
)
1747 struct yyguts_t
* yyg
= (struct yyguts_t
*)yyscanner
;
1749 if (!yyg
->yy_buffer_stack
) {
1751 /* First allocation is just for 2 elements, since we don't know if this
1752 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1753 * immediate realloc on the next call.
1756 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_gmx_sel_yyalloc
1757 (num_to_alloc
* sizeof(struct yy_buffer_state
*)
1759 if ( ! yyg
->yy_buffer_stack
)
1760 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1762 memset(yyg
->yy_buffer_stack
, 0, num_to_alloc
* sizeof(struct yy_buffer_state
*));
1764 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1765 yyg
->yy_buffer_stack_top
= 0;
1769 if (yyg
->yy_buffer_stack_top
>= (yyg
->yy_buffer_stack_max
) - 1){
1771 /* Increase the buffer to prepare for a possible push. */
1772 int grow_size
= 8 /* arbitrary grow size */;
1774 num_to_alloc
= yyg
->yy_buffer_stack_max
+ grow_size
;
1775 yyg
->yy_buffer_stack
= (struct yy_buffer_state
**)_gmx_sel_yyrealloc
1776 (yyg
->yy_buffer_stack
,
1777 num_to_alloc
* sizeof(struct yy_buffer_state
*)
1779 if ( ! yyg
->yy_buffer_stack
)
1780 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1782 /* zero only the new slots.*/
1783 memset(yyg
->yy_buffer_stack
+ yyg
->yy_buffer_stack_max
, 0, grow_size
* sizeof(struct yy_buffer_state
*));
1784 yyg
->yy_buffer_stack_max
= num_to_alloc
;
1788 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1789 * @param base the character buffer
1790 * @param size the size in bytes of the character buffer
1791 * @param yyscanner The scanner object.
1792 * @return the newly allocated buffer state object.
1794 YY_BUFFER_STATE
_gmx_sel_yy_scan_buffer (char * base
, yy_size_t size
, yyscan_t yyscanner
)
1799 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1800 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1801 /* They forgot to leave room for the EOB's. */
1804 b
= (YY_BUFFER_STATE
) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state
) ,yyscanner
);
1806 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_buffer()" );
1808 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1809 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1810 b
->yy_is_our_buffer
= 0;
1811 b
->yy_input_file
= 0;
1812 b
->yy_n_chars
= b
->yy_buf_size
;
1813 b
->yy_is_interactive
= 0;
1815 b
->yy_fill_buffer
= 0;
1816 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1818 _gmx_sel_yy_switch_to_buffer(b
,yyscanner
);
1823 /** Setup the input buffer state to scan a string. The next call to _gmx_sel_yylex() will
1824 * scan from a @e copy of @a str.
1825 * @param yystr a NUL-terminated string to scan
1826 * @param yyscanner The scanner object.
1827 * @return the newly allocated buffer state object.
1828 * @note If you want to scan bytes that may contain NUL values, then use
1829 * _gmx_sel_yy_scan_bytes() instead.
1831 YY_BUFFER_STATE
_gmx_sel_yy_scan_string (yyconst
char * yystr
, yyscan_t yyscanner
)
1834 return _gmx_sel_yy_scan_bytes(yystr
,strlen(yystr
) ,yyscanner
);
1837 /** Setup the input buffer state to scan the given bytes. The next call to _gmx_sel_yylex() will
1838 * scan from a @e copy of @a bytes.
1839 * @param yybytes the byte buffer to scan
1840 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1841 * @param yyscanner The scanner object.
1842 * @return the newly allocated buffer state object.
1844 YY_BUFFER_STATE
_gmx_sel_yy_scan_bytes (yyconst
char * yybytes
, int _yybytes_len
, yyscan_t yyscanner
)
1851 /* Get memory for full buffer, including space for trailing EOB's. */
1852 n
= _yybytes_len
+ 2;
1853 buf
= (char *) _gmx_sel_yyalloc(n
,yyscanner
);
1855 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_bytes()" );
1857 for ( i
= 0; i
< _yybytes_len
; ++i
)
1858 buf
[i
] = yybytes
[i
];
1860 buf
[_yybytes_len
] = buf
[_yybytes_len
+1] = YY_END_OF_BUFFER_CHAR
;
1862 b
= _gmx_sel_yy_scan_buffer(buf
,n
,yyscanner
);
1864 YY_FATAL_ERROR( "bad buffer in _gmx_sel_yy_scan_bytes()" );
1866 /* It's okay to grow etc. this buffer, and we should throw it
1867 * away when we're done.
1869 b
->yy_is_our_buffer
= 1;
1874 #ifndef YY_EXIT_FAILURE
1875 #define YY_EXIT_FAILURE 2
1878 static void yy_fatal_error (yyconst
char* msg
, yyscan_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 int _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
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" , yyscanner
);
1997 yylineno
= line_number
;
2000 /** Set the current column.
2001 * @param line_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" , yyscanner
);
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
)
2182 for ( i
= 0; i
< n
; ++i
)
2187 #ifdef YY_NEED_STRLEN
2188 static int yy_flex_strlen (yyconst
char * s
, yyscan_t yyscanner
)
2191 for ( n
= 0; s
[n
]; ++n
)
2198 void *_gmx_sel_yyalloc (yy_size_t size
, yyscan_t yyscanner
)
2200 return (void *) malloc( size
);
2203 void *_gmx_sel_yyrealloc (void * ptr
, yy_size_t size
, yyscan_t yyscanner
)
2205 /* The cast to (char *) in the following accommodates both
2206 * implementations that use char* generic pointers, and those
2207 * that use void* generic pointers. It works with the latter
2208 * because both ANSI C and C++ allow castless assignment from
2209 * any pointer type to void*, and deal with argument conversions
2210 * as though doing an assignment.
2212 return (void *) realloc( (char *) ptr
, size
);
2215 void _gmx_sel_yyfree (void * ptr
, yyscan_t yyscanner
)
2217 free( (char *) ptr
); /* see _gmx_sel_yyrealloc() for (char *) cast */
2220 #define YYTABLES_NAME "yytables"
2222 #line 156 "scanner.l"