A bit more modular selection position handling.
[gromacs/qmmm-gamess-us.git] / src / gmxlib / selection / scanner.c
blob053ee6bc279c33a4932ca86596d842392587617d
1 #line 2 "scanner.c"
3 #line 4 "scanner.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define FLEX_SCANNER
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
14 #define FLEX_BETA
15 #endif
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
25 /* end standard C headers. */
27 /* flex integer type definitions */
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
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
41 #endif
43 #include <inttypes.h>
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;
50 #else
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. */
59 #ifndef INT8_MIN
60 #define INT8_MIN (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX (4294967295U)
85 #endif
87 #endif /* ! C99 */
89 #endif /* ! FLEXINT_H */
91 #ifdef __cplusplus
93 /* The "const" storage-class-modifier is valid. */
94 #define YY_USE_CONST
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
101 #define YY_USE_CONST
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
106 #ifdef YY_USE_CONST
107 #define yyconst const
108 #else
109 #define yyconst
110 #endif
112 /* Returned upon end-of-file. */
113 #define YY_NULL 0
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
118 * double cast.
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;
126 #endif
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
147 * compatibility.
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. */
161 #ifndef YY_BUF_SIZE
162 #ifdef __ia64__
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
168 #else
169 #define YY_BUF_SIZE 16384
170 #endif /* __ia64__ */
171 #endif
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;
180 #endif
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. */
189 #define yyless(n) \
190 do \
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 */ \
200 while ( 0 )
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;
207 #endif
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
213 FILE *yy_input_file;
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
219 * characters.
221 yy_size_t yy_buf_size;
223 /* Number of characters read into yy_ch_buf, not including EOB
224 * characters.
226 int yy_n_chars;
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
230 * delete it.
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
237 * each newline.
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
243 * not.
245 int yy_at_bol;
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
251 * end of it.
253 int yy_fill_buffer;
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
276 * "scanner state".
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] \
282 : NULL)
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; \
356 *yy_cp = '\0'; \
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. */
363 struct yy_trans_info
365 flex_int32_t yy_verify;
366 flex_int32_t yy_nxt;
368 static yyconst flex_int16_t yy_accept[93] =
369 { 0,
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,
379 14, 0
383 static yyconst flex_int32_t yy_ec[256] =
384 { 0,
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,
412 1, 1, 1, 1, 1
415 static yyconst flex_int32_t yy_meta[36] =
416 { 0,
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,
420 4, 4, 4, 4, 1
423 static yyconst flex_int16_t yy_base[98] =
424 { 0,
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] =
439 { 0,
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] =
454 { 0,
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] =
481 { 0,
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
514 #line 1 "scanner.l"
517 * This source code is part of
519 * G R O M A C S
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
546 * \brief
547 * Tokenizer for the selection language.
548 * \endcond
550 /*! \internal \file scanner.c
551 * \brief
552 * Generated (from scanner.l by Flex) tokenizer for the selection language.
554 #line 41 "scanner.l"
555 #ifdef HAVE_CONFIG_H
556 #include <config.h>
557 #endif
559 #include <string2.h>
561 #include "parser.h"
562 #include "scanner.h"
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 /*! \brief
570 * Macro to read input into a buffer for the tokenizer.
572 * This macro is a modified version of the standard implementation in Flex.
573 * The only changes are the calls to _gmx_sel_lexer_*() functions to show a
574 * prompt.
576 #define YY_INPUT(buf,result,max_size) \
578 gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(yyscanner); \
579 int c = '*'; \
580 size_t n; \
581 _gmx_sel_lexer_prompt_print(state); \
582 for (n = 0; n < max_size && \
583 (c = getc(yyin)) != EOF && c != '\n'; ++n) \
585 buf[n] = (char)c; \
587 if (c == '\n') \
589 buf[n++] = (char)c; \
590 _gmx_sel_lexer_prompt_newline(FALSE, state); \
592 if (c == EOF && ferror(yyin)) \
594 YY_FATAL_ERROR("input in flex scanner failed"); \
596 result = n; \
598 #define YY_NO_UNISTD_H 1
603 #line 604 "scanner.c"
605 #define INITIAL 0
606 #define matchof 1
607 #define matchbool 2
608 #define cmdstart 3
609 #define help 4
611 #ifndef YY_NO_UNISTD_H
612 /* Special case for "unistd.h", since it is non-ANSI. We include it way
613 * down here because we want the user's section 1 to have been scanned first.
614 * The user has a chance to override it with an option.
616 #include <unistd.h>
617 #endif
619 #ifndef YY_EXTRA_TYPE
620 #define YY_EXTRA_TYPE void *
621 #endif
623 /* Holds the entire state of the reentrant scanner. */
624 struct yyguts_t
627 /* User-defined. Not touched by flex. */
628 YY_EXTRA_TYPE yyextra_r;
630 /* The rest are the same as the globals declared in the non-reentrant scanner. */
631 FILE *yyin_r, *yyout_r;
632 size_t yy_buffer_stack_top; /**< index of top of stack. */
633 size_t yy_buffer_stack_max; /**< capacity of stack. */
634 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
635 char yy_hold_char;
636 int yy_n_chars;
637 int yyleng_r;
638 char *yy_c_buf_p;
639 int yy_init;
640 int yy_start;
641 int yy_did_buffer_switch_on_eof;
642 int yy_start_stack_ptr;
643 int yy_start_stack_depth;
644 int *yy_start_stack;
645 yy_state_type yy_last_accepting_state;
646 char* yy_last_accepting_cpos;
648 int yylineno_r;
649 int yy_flex_debug_r;
651 char *yytext_r;
652 int yy_more_flag;
653 int yy_more_len;
655 }; /* end struct yyguts_t */
657 static int yy_init_globals (yyscan_t yyscanner );
659 int _gmx_sel_yylex_init (yyscan_t* scanner);
661 int _gmx_sel_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
663 /* Accessor methods to globals.
664 These are made visible to non-reentrant scanners for convenience. */
666 int _gmx_sel_yylex_destroy (yyscan_t yyscanner );
668 int _gmx_sel_yyget_debug (yyscan_t yyscanner );
670 void _gmx_sel_yyset_debug (int debug_flag ,yyscan_t yyscanner );
672 YY_EXTRA_TYPE _gmx_sel_yyget_extra (yyscan_t yyscanner );
674 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
676 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner );
678 void _gmx_sel_yyset_in (FILE * in_str ,yyscan_t yyscanner );
680 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner );
682 void _gmx_sel_yyset_out (FILE * out_str ,yyscan_t yyscanner );
684 int _gmx_sel_yyget_leng (yyscan_t yyscanner );
686 char *_gmx_sel_yyget_text (yyscan_t yyscanner );
688 int _gmx_sel_yyget_lineno (yyscan_t yyscanner );
690 void _gmx_sel_yyset_lineno (int line_number ,yyscan_t yyscanner );
692 /* Macros after this point can all be overridden by user definitions in
693 * section 1.
696 #ifndef YY_SKIP_YYWRAP
697 #ifdef __cplusplus
698 extern "C" int _gmx_sel_yywrap (yyscan_t yyscanner );
699 #else
700 extern int _gmx_sel_yywrap (yyscan_t yyscanner );
701 #endif
702 #endif
704 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
706 #ifndef yytext_ptr
707 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
708 #endif
710 #ifdef YY_NEED_STRLEN
711 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
712 #endif
714 #ifndef YY_NO_INPUT
716 #ifdef __cplusplus
717 static int yyinput (yyscan_t yyscanner );
718 #else
719 static int input (yyscan_t yyscanner );
720 #endif
722 #endif
724 /* Amount of stuff to slurp up with each read. */
725 #ifndef YY_READ_BUF_SIZE
726 #ifdef __ia64__
727 /* On IA-64, the buffer size is 16k, not 8k */
728 #define YY_READ_BUF_SIZE 16384
729 #else
730 #define YY_READ_BUF_SIZE 8192
731 #endif /* __ia64__ */
732 #endif
734 /* Copy whatever the last rule matched to the standard output. */
735 #ifndef ECHO
736 /* This used to be an fputs(), but since the string might contain NUL's,
737 * we now use fwrite().
739 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
740 #endif
742 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
743 * is returned in "result".
745 #ifndef YY_INPUT
746 #define YY_INPUT(buf,result,max_size) \
747 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
749 int c = '*'; \
750 size_t n; \
751 for ( n = 0; n < max_size && \
752 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
753 buf[n] = (char) c; \
754 if ( c == '\n' ) \
755 buf[n++] = (char) c; \
756 if ( c == EOF && ferror( yyin ) ) \
757 YY_FATAL_ERROR( "input in flex scanner failed" ); \
758 result = n; \
760 else \
762 errno=0; \
763 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
765 if( errno != EINTR) \
767 YY_FATAL_ERROR( "input in flex scanner failed" ); \
768 break; \
770 errno=0; \
771 clearerr(yyin); \
776 #endif
778 /* No semi-colon after return; correct usage is to write "yyterminate();" -
779 * we don't want an extra ';' after the "return" because that will cause
780 * some compilers to complain about unreachable statements.
782 #ifndef yyterminate
783 #define yyterminate() return YY_NULL
784 #endif
786 /* Number of entries by which start-condition stack grows. */
787 #ifndef YY_START_STACK_INCR
788 #define YY_START_STACK_INCR 25
789 #endif
791 /* Report a fatal error. */
792 #ifndef YY_FATAL_ERROR
793 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
794 #endif
796 /* end tables serialization structures and prototypes */
798 /* Default declaration of generated scanner - a define so the user can
799 * easily add parameters.
801 #ifndef YY_DECL
802 #define YY_DECL_IS_OURS 1
804 extern int _gmx_sel_yylex (yyscan_t yyscanner);
806 #define YY_DECL int _gmx_sel_yylex (yyscan_t yyscanner)
807 #endif /* !YY_DECL */
809 /* Code executed at the beginning of each rule, after yytext and yyleng
810 * have been set up.
812 #ifndef YY_USER_ACTION
813 #define YY_USER_ACTION
814 #endif
816 /* Code executed at the end of each rule. */
817 #ifndef YY_BREAK
818 #define YY_BREAK break;
819 #endif
821 #define YY_RULE_SETUP \
822 YY_USER_ACTION
824 /** The main scanner function which does all the work.
826 YY_DECL
828 register yy_state_type yy_current_state;
829 register char *yy_cp, *yy_bp;
830 register int yy_act;
831 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
833 #line 109 "scanner.l"
837 gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(yyscanner);
838 /* Return END_OF_METHOD/PARAM_* immediately if necessary */
839 if (state->nextparam)
841 return _gmx_sel_lexer_process_next_param(yylval, state);
843 /* Handle the start conditions for 'of' matching */
844 if (state->bMatchOf)
846 BEGIN(matchof);
847 state->bMatchOf = FALSE;
849 else if (state->bMatchBool)
851 BEGIN(matchbool);
852 state->bMatchBool = FALSE;
854 else if (state->bCmdStart)
856 BEGIN(cmdstart);
857 state->bCmdStart = FALSE;
859 else if (YYSTATE != help)
861 BEGIN(0);
865 #line 866 "scanner.c"
867 if ( !yyg->yy_init )
869 yyg->yy_init = 1;
871 #ifdef YY_USER_INIT
872 YY_USER_INIT;
873 #endif
875 if ( ! yyg->yy_start )
876 yyg->yy_start = 1; /* first start state */
878 if ( ! yyin )
879 yyin = stdin;
881 if ( ! yyout )
882 yyout = stdout;
884 if ( ! YY_CURRENT_BUFFER ) {
885 _gmx_sel_yyensure_buffer_stack (yyscanner);
886 YY_CURRENT_BUFFER_LVALUE =
887 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
890 _gmx_sel_yy_load_buffer_state(yyscanner );
893 while ( 1 ) /* loops until end-of-file is reached */
895 yy_cp = yyg->yy_c_buf_p;
897 /* Support of yytext. */
898 *yy_cp = yyg->yy_hold_char;
900 /* yy_bp points to the position in yy_ch_buf of the start of
901 * the current run.
903 yy_bp = yy_cp;
905 yy_current_state = yyg->yy_start;
906 yy_match:
909 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
910 if ( yy_accept[yy_current_state] )
912 yyg->yy_last_accepting_state = yy_current_state;
913 yyg->yy_last_accepting_cpos = yy_cp;
915 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
917 yy_current_state = (int) yy_def[yy_current_state];
918 if ( yy_current_state >= 93 )
919 yy_c = yy_meta[(unsigned int) yy_c];
921 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
922 ++yy_cp;
924 while ( yy_base[yy_current_state] != 172 );
926 yy_find_action:
927 yy_act = yy_accept[yy_current_state];
928 if ( yy_act == 0 )
929 { /* have to back up */
930 yy_cp = yyg->yy_last_accepting_cpos;
931 yy_current_state = yyg->yy_last_accepting_state;
932 yy_act = yy_accept[yy_current_state];
935 YY_DO_BEFORE_ACTION;
937 do_action: /* This label is used only to access EOF actions. */
939 switch ( yy_act )
940 { /* beginning of action switch */
941 case 0: /* must back up */
942 /* undo the effects of YY_DO_BEFORE_ACTION */
943 *yy_cp = yyg->yy_hold_char;
944 yy_cp = yyg->yy_last_accepting_cpos;
945 yy_current_state = yyg->yy_last_accepting_state;
946 goto yy_find_action;
948 case 1:
949 YY_RULE_SETUP
950 #line 140 "scanner.l"
952 YY_BREAK
953 case 2:
954 YY_RULE_SETUP
955 #line 141 "scanner.l"
956 { yylval->i = strtol(yytext, NULL, 10); ADD_TOKEN; return INTEGER; }
957 YY_BREAK
958 case 3:
959 YY_RULE_SETUP
960 #line 142 "scanner.l"
961 { yylval->r = strtod(yytext, NULL); ADD_TOKEN; return REAL; }
962 YY_BREAK
963 case 4:
964 YY_RULE_SETUP
965 #line 143 "scanner.l"
966 { yylval->str = strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR; }
967 YY_BREAK
968 case 5:
969 /* rule 5 can match eol */
970 YY_RULE_SETUP
971 #line 145 "scanner.l"
972 { _gmx_sel_lexer_prompt_newline(TRUE, state); }
973 YY_BREAK
974 case 6:
975 /* rule 6 can match eol */
976 YY_RULE_SETUP
977 #line 146 "scanner.l"
979 if (yytext[0] == ';' || state->prompt)
981 state->bCmdStart = TRUE;
982 rtrim(state->pselstr);
983 return CMD_SEP;
986 YY_BREAK
987 case YY_STATE_EOF(cmdstart):
988 #line 154 "scanner.l"
989 { yyterminate(); }
990 YY_BREAK
991 case YY_STATE_EOF(INITIAL):
992 case YY_STATE_EOF(matchof):
993 case YY_STATE_EOF(matchbool):
994 case YY_STATE_EOF(help):
995 #line 155 "scanner.l"
996 { state->bCmdStart = TRUE; return CMD_SEP; }
997 YY_BREAK
998 case 7:
999 YY_RULE_SETUP
1000 #line 157 "scanner.l"
1001 { BEGIN(help); return HELP; }
1002 YY_BREAK
1004 case 8:
1005 YY_RULE_SETUP
1006 #line 159 "scanner.l"
1008 YY_BREAK
1009 case 9:
1010 YY_RULE_SETUP
1011 #line 160 "scanner.l"
1012 { yylval->str = strndup(yytext, yyleng); return HELP_TOPIC; }
1013 YY_BREAK
1014 case 10:
1015 /* rule 10 can match eol */
1016 YY_RULE_SETUP
1017 #line 161 "scanner.l"
1018 { state->bCmdStart = TRUE; return CMD_SEP; }
1019 YY_BREAK
1020 case 11:
1021 YY_RULE_SETUP
1022 #line 162 "scanner.l"
1023 { return INVALID; }
1024 YY_BREAK
1027 case 12:
1028 YY_RULE_SETUP
1029 #line 165 "scanner.l"
1030 { ADD_TOKEN; yylval->i = 1; return INTEGER; }
1031 YY_BREAK
1032 case 13:
1033 YY_RULE_SETUP
1034 #line 166 "scanner.l"
1035 { ADD_TOKEN; yylval->i = 0; return INTEGER; }
1036 YY_BREAK
1038 case 14:
1039 YY_RULE_SETUP
1040 #line 168 "scanner.l"
1041 { ADD_TOKEN; return GROUP; }
1042 YY_BREAK
1043 case 15:
1044 YY_RULE_SETUP
1045 #line 169 "scanner.l"
1046 { ADD_TOKEN; return TO; }
1047 YY_BREAK
1048 case 16:
1049 YY_RULE_SETUP
1050 #line 170 "scanner.l"
1051 { ADD_TOKEN; BEGIN(0); return OF; }
1052 YY_BREAK
1053 case 17:
1054 YY_RULE_SETUP
1055 #line 171 "scanner.l"
1056 { ADD_TOKEN; return AND; }
1057 YY_BREAK
1058 case 18:
1059 YY_RULE_SETUP
1060 #line 172 "scanner.l"
1061 { ADD_TOKEN; return OR; }
1062 YY_BREAK
1063 case 19:
1064 YY_RULE_SETUP
1065 #line 173 "scanner.l"
1066 { ADD_TOKEN; return XOR; }
1067 YY_BREAK
1068 case 20:
1069 YY_RULE_SETUP
1070 #line 174 "scanner.l"
1071 { ADD_TOKEN; return NOT; }
1072 YY_BREAK
1073 case 21:
1074 YY_RULE_SETUP
1075 #line 175 "scanner.l"
1076 { yylval->str = strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
1077 YY_BREAK
1078 case 22:
1079 YY_RULE_SETUP
1080 #line 177 "scanner.l"
1081 { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
1082 YY_BREAK
1083 case 23:
1084 YY_RULE_SETUP
1085 #line 179 "scanner.l"
1086 { _gmx_sel_lexer_add_token(" ", 1, state); }
1087 YY_BREAK
1088 case 24:
1089 YY_RULE_SETUP
1090 #line 180 "scanner.l"
1091 { yylval->str = strndup(yytext, yyleng); ADD_TOKEN; return STR; }
1092 YY_BREAK
1093 case 25:
1094 YY_RULE_SETUP
1095 #line 181 "scanner.l"
1096 { _gmx_sel_lexer_add_token(yytext, 1, state); return yytext[0]; }
1097 YY_BREAK
1098 case 26:
1099 YY_RULE_SETUP
1100 #line 182 "scanner.l"
1101 YY_FATAL_ERROR( "flex scanner jammed" );
1102 YY_BREAK
1103 #line 1104 "scanner.c"
1105 case YY_END_OF_BUFFER:
1107 /* Amount of text matched not including the EOB char. */
1108 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1110 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1111 *yy_cp = yyg->yy_hold_char;
1112 YY_RESTORE_YY_MORE_OFFSET
1114 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1116 /* We're scanning a new file or input source. It's
1117 * possible that this happened because the user
1118 * just pointed yyin at a new source and called
1119 * _gmx_sel_yylex(). If so, then we have to assure
1120 * consistency between YY_CURRENT_BUFFER and our
1121 * globals. Here is the right place to do so, because
1122 * this is the first action (other than possibly a
1123 * back-up) that will match for the new input source.
1125 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1126 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1127 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1130 /* Note that here we test for yy_c_buf_p "<=" to the position
1131 * of the first EOB in the buffer, since yy_c_buf_p will
1132 * already have been incremented past the NUL character
1133 * (since all states make transitions on EOB to the
1134 * end-of-buffer state). Contrast this with the test
1135 * in input().
1137 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1138 { /* This was really a NUL. */
1139 yy_state_type yy_next_state;
1141 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1143 yy_current_state = yy_get_previous_state( yyscanner );
1145 /* Okay, we're now positioned to make the NUL
1146 * transition. We couldn't have
1147 * yy_get_previous_state() go ahead and do it
1148 * for us because it doesn't know how to deal
1149 * with the possibility of jamming (and we don't
1150 * want to build jamming into it because then it
1151 * will run more slowly).
1154 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1156 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1158 if ( yy_next_state )
1160 /* Consume the NUL. */
1161 yy_cp = ++yyg->yy_c_buf_p;
1162 yy_current_state = yy_next_state;
1163 goto yy_match;
1166 else
1168 yy_cp = yyg->yy_c_buf_p;
1169 goto yy_find_action;
1173 else switch ( yy_get_next_buffer( yyscanner ) )
1175 case EOB_ACT_END_OF_FILE:
1177 yyg->yy_did_buffer_switch_on_eof = 0;
1179 if ( _gmx_sel_yywrap(yyscanner ) )
1181 /* Note: because we've taken care in
1182 * yy_get_next_buffer() to have set up
1183 * yytext, we can now set up
1184 * yy_c_buf_p so that if some total
1185 * hoser (like flex itself) wants to
1186 * call the scanner after we return the
1187 * YY_NULL, it'll still work - another
1188 * YY_NULL will get returned.
1190 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1192 yy_act = YY_STATE_EOF(YY_START);
1193 goto do_action;
1196 else
1198 if ( ! yyg->yy_did_buffer_switch_on_eof )
1199 YY_NEW_FILE;
1201 break;
1204 case EOB_ACT_CONTINUE_SCAN:
1205 yyg->yy_c_buf_p =
1206 yyg->yytext_ptr + yy_amount_of_matched_text;
1208 yy_current_state = yy_get_previous_state( yyscanner );
1210 yy_cp = yyg->yy_c_buf_p;
1211 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1212 goto yy_match;
1214 case EOB_ACT_LAST_MATCH:
1215 yyg->yy_c_buf_p =
1216 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1218 yy_current_state = yy_get_previous_state( yyscanner );
1220 yy_cp = yyg->yy_c_buf_p;
1221 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1222 goto yy_find_action;
1224 break;
1227 default:
1228 YY_FATAL_ERROR(
1229 "fatal flex scanner internal error--no action found" );
1230 } /* end of action switch */
1231 } /* end of scanning one token */
1232 } /* end of _gmx_sel_yylex */
1234 /* yy_get_next_buffer - try to read in a new buffer
1236 * Returns a code representing an action:
1237 * EOB_ACT_LAST_MATCH -
1238 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1239 * EOB_ACT_END_OF_FILE - end of file
1241 static int yy_get_next_buffer (yyscan_t yyscanner)
1243 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1244 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1245 register char *source = yyg->yytext_ptr;
1246 register int number_to_move, i;
1247 int ret_val;
1249 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1250 YY_FATAL_ERROR(
1251 "fatal flex scanner internal error--end of buffer missed" );
1253 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1254 { /* Don't try to fill the buffer, so this is an EOF. */
1255 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1257 /* We matched a single character, the EOB, so
1258 * treat this as a final EOF.
1260 return EOB_ACT_END_OF_FILE;
1263 else
1265 /* We matched some text prior to the EOB, first
1266 * process it.
1268 return EOB_ACT_LAST_MATCH;
1272 /* Try to read more data. */
1274 /* First move last chars to start of buffer. */
1275 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1277 for ( i = 0; i < number_to_move; ++i )
1278 *(dest++) = *(source++);
1280 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1281 /* don't do the read, it's not guaranteed to return an EOF,
1282 * just force an EOF
1284 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1286 else
1288 int num_to_read =
1289 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1291 while ( num_to_read <= 0 )
1292 { /* Not enough room in the buffer - grow it. */
1294 /* just a shorter name for the current buffer */
1295 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1297 int yy_c_buf_p_offset =
1298 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1300 if ( b->yy_is_our_buffer )
1302 int new_size = b->yy_buf_size * 2;
1304 if ( new_size <= 0 )
1305 b->yy_buf_size += b->yy_buf_size / 8;
1306 else
1307 b->yy_buf_size *= 2;
1309 b->yy_ch_buf = (char *)
1310 /* Include room in for 2 EOB chars. */
1311 _gmx_sel_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1313 else
1314 /* Can't grow it, we don't own it. */
1315 b->yy_ch_buf = 0;
1317 if ( ! b->yy_ch_buf )
1318 YY_FATAL_ERROR(
1319 "fatal error - scanner input buffer overflow" );
1321 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1323 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1324 number_to_move - 1;
1328 if ( num_to_read > YY_READ_BUF_SIZE )
1329 num_to_read = YY_READ_BUF_SIZE;
1331 /* Read in more data. */
1332 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1333 yyg->yy_n_chars, (size_t) num_to_read );
1335 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1338 if ( yyg->yy_n_chars == 0 )
1340 if ( number_to_move == YY_MORE_ADJ )
1342 ret_val = EOB_ACT_END_OF_FILE;
1343 _gmx_sel_yyrestart(yyin ,yyscanner);
1346 else
1348 ret_val = EOB_ACT_LAST_MATCH;
1349 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1350 YY_BUFFER_EOF_PENDING;
1354 else
1355 ret_val = EOB_ACT_CONTINUE_SCAN;
1357 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1358 /* Extend the array by 50%, plus the number we really need. */
1359 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1360 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _gmx_sel_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1361 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1362 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1365 yyg->yy_n_chars += number_to_move;
1366 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1367 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1369 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1371 return ret_val;
1374 /* yy_get_previous_state - get the state just before the EOB char was reached */
1376 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1378 register yy_state_type yy_current_state;
1379 register char *yy_cp;
1380 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1382 yy_current_state = yyg->yy_start;
1384 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1386 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1387 if ( yy_accept[yy_current_state] )
1389 yyg->yy_last_accepting_state = yy_current_state;
1390 yyg->yy_last_accepting_cpos = yy_cp;
1392 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1394 yy_current_state = (int) yy_def[yy_current_state];
1395 if ( yy_current_state >= 93 )
1396 yy_c = yy_meta[(unsigned int) yy_c];
1398 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1401 return yy_current_state;
1404 /* yy_try_NUL_trans - try to make a transition on the NUL character
1406 * synopsis
1407 * next_state = yy_try_NUL_trans( current_state );
1409 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1411 register int yy_is_jam;
1412 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1413 register char *yy_cp = yyg->yy_c_buf_p;
1415 register YY_CHAR yy_c = 1;
1416 if ( yy_accept[yy_current_state] )
1418 yyg->yy_last_accepting_state = yy_current_state;
1419 yyg->yy_last_accepting_cpos = yy_cp;
1421 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1423 yy_current_state = (int) yy_def[yy_current_state];
1424 if ( yy_current_state >= 93 )
1425 yy_c = yy_meta[(unsigned int) yy_c];
1427 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1428 yy_is_jam = (yy_current_state == 92);
1430 return yy_is_jam ? 0 : yy_current_state;
1433 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
1435 register char *yy_cp;
1436 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1438 yy_cp = yyg->yy_c_buf_p;
1440 /* undo effects of setting up yytext */
1441 *yy_cp = yyg->yy_hold_char;
1443 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1444 { /* need to shift things up to make room */
1445 /* +2 for EOB chars. */
1446 register int number_to_move = yyg->yy_n_chars + 2;
1447 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1448 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1449 register char *source =
1450 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1452 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1453 *--dest = *--source;
1455 yy_cp += (int) (dest - source);
1456 yy_bp += (int) (dest - source);
1457 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1458 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1460 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1461 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1464 *--yy_cp = (char) c;
1466 yyg->yytext_ptr = yy_bp;
1467 yyg->yy_hold_char = *yy_cp;
1468 yyg->yy_c_buf_p = yy_cp;
1471 #ifndef YY_NO_INPUT
1472 #ifdef __cplusplus
1473 static int yyinput (yyscan_t yyscanner)
1474 #else
1475 static int input (yyscan_t yyscanner)
1476 #endif
1479 int c;
1480 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1482 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1484 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1486 /* yy_c_buf_p now points to the character we want to return.
1487 * If this occurs *before* the EOB characters, then it's a
1488 * valid NUL; if not, then we've hit the end of the buffer.
1490 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1491 /* This was really a NUL. */
1492 *yyg->yy_c_buf_p = '\0';
1494 else
1495 { /* need more input */
1496 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1497 ++yyg->yy_c_buf_p;
1499 switch ( yy_get_next_buffer( yyscanner ) )
1501 case EOB_ACT_LAST_MATCH:
1502 /* This happens because yy_g_n_b()
1503 * sees that we've accumulated a
1504 * token and flags that we need to
1505 * try matching the token before
1506 * proceeding. But for input(),
1507 * there's no matching to consider.
1508 * So convert the EOB_ACT_LAST_MATCH
1509 * to EOB_ACT_END_OF_FILE.
1512 /* Reset buffer status. */
1513 _gmx_sel_yyrestart(yyin ,yyscanner);
1515 /*FALLTHROUGH*/
1517 case EOB_ACT_END_OF_FILE:
1519 if ( _gmx_sel_yywrap(yyscanner ) )
1520 return EOF;
1522 if ( ! yyg->yy_did_buffer_switch_on_eof )
1523 YY_NEW_FILE;
1524 #ifdef __cplusplus
1525 return yyinput(yyscanner);
1526 #else
1527 return input(yyscanner);
1528 #endif
1531 case EOB_ACT_CONTINUE_SCAN:
1532 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1533 break;
1538 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1539 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1540 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1542 return c;
1544 #endif /* ifndef YY_NO_INPUT */
1546 /** Immediately switch to a different input stream.
1547 * @param input_file A readable stream.
1548 * @param yyscanner The scanner object.
1549 * @note This function does not reset the start condition to @c INITIAL .
1551 void _gmx_sel_yyrestart (FILE * input_file , yyscan_t yyscanner)
1553 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1555 if ( ! YY_CURRENT_BUFFER ){
1556 _gmx_sel_yyensure_buffer_stack (yyscanner);
1557 YY_CURRENT_BUFFER_LVALUE =
1558 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1561 _gmx_sel_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1562 _gmx_sel_yy_load_buffer_state(yyscanner );
1565 /** Switch to a different input buffer.
1566 * @param new_buffer The new input buffer.
1567 * @param yyscanner The scanner object.
1569 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1571 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1573 /* TODO. We should be able to replace this entire function body
1574 * with
1575 * _gmx_sel_yypop_buffer_state();
1576 * _gmx_sel_yypush_buffer_state(new_buffer);
1578 _gmx_sel_yyensure_buffer_stack (yyscanner);
1579 if ( YY_CURRENT_BUFFER == new_buffer )
1580 return;
1582 if ( YY_CURRENT_BUFFER )
1584 /* Flush out information for old buffer. */
1585 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1586 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1587 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1590 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1591 _gmx_sel_yy_load_buffer_state(yyscanner );
1593 /* We don't actually know whether we did this switch during
1594 * EOF (_gmx_sel_yywrap()) processing, but the only time this flag
1595 * is looked at is after _gmx_sel_yywrap() is called, so it's safe
1596 * to go ahead and always set it.
1598 yyg->yy_did_buffer_switch_on_eof = 1;
1601 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner)
1603 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1604 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1605 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1606 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1607 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1610 /** Allocate and initialize an input buffer state.
1611 * @param file A readable stream.
1612 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1613 * @param yyscanner The scanner object.
1614 * @return the allocated buffer state.
1616 YY_BUFFER_STATE _gmx_sel_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1618 YY_BUFFER_STATE b;
1620 b = (YY_BUFFER_STATE) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1621 if ( ! b )
1622 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1624 b->yy_buf_size = size;
1626 /* yy_ch_buf has to be 2 characters longer than the size given because
1627 * we need to put in 2 end-of-buffer characters.
1629 b->yy_ch_buf = (char *) _gmx_sel_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1630 if ( ! b->yy_ch_buf )
1631 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1633 b->yy_is_our_buffer = 1;
1635 _gmx_sel_yy_init_buffer(b,file ,yyscanner);
1637 return b;
1640 /** Destroy the buffer.
1641 * @param b a buffer created with _gmx_sel_yy_create_buffer()
1642 * @param yyscanner The scanner object.
1644 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1646 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1648 if ( ! b )
1649 return;
1651 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1652 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1654 if ( b->yy_is_our_buffer )
1655 _gmx_sel_yyfree((void *) b->yy_ch_buf ,yyscanner );
1657 _gmx_sel_yyfree((void *) b ,yyscanner );
1660 /* Initializes or reinitializes a buffer.
1661 * This function is sometimes called more than once on the same buffer,
1662 * such as during a _gmx_sel_yyrestart() or at EOF.
1664 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1667 int oerrno = errno;
1668 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1670 _gmx_sel_yy_flush_buffer(b ,yyscanner);
1672 b->yy_input_file = file;
1673 b->yy_fill_buffer = 1;
1675 /* If b is the current buffer, then _gmx_sel_yy_init_buffer was _probably_
1676 * called from _gmx_sel_yyrestart() or through yy_get_next_buffer.
1677 * In that case, we don't want to reset the lineno or column.
1679 if (b != YY_CURRENT_BUFFER){
1680 b->yy_bs_lineno = 1;
1681 b->yy_bs_column = 0;
1684 b->yy_is_interactive = 1;
1686 errno = oerrno;
1689 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1690 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1691 * @param yyscanner The scanner object.
1693 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1695 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1696 if ( ! b )
1697 return;
1699 b->yy_n_chars = 0;
1701 /* We always need two end-of-buffer characters. The first causes
1702 * a transition to the end-of-buffer state. The second causes
1703 * a jam in that state.
1705 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1706 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1708 b->yy_buf_pos = &b->yy_ch_buf[0];
1710 b->yy_at_bol = 1;
1711 b->yy_buffer_status = YY_BUFFER_NEW;
1713 if ( b == YY_CURRENT_BUFFER )
1714 _gmx_sel_yy_load_buffer_state(yyscanner );
1717 /** Pushes the new state onto the stack. The new state becomes
1718 * the current state. This function will allocate the stack
1719 * if necessary.
1720 * @param new_buffer The new state.
1721 * @param yyscanner The scanner object.
1723 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1725 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1726 if (new_buffer == NULL)
1727 return;
1729 _gmx_sel_yyensure_buffer_stack(yyscanner);
1731 /* This block is copied from _gmx_sel_yy_switch_to_buffer. */
1732 if ( YY_CURRENT_BUFFER )
1734 /* Flush out information for old buffer. */
1735 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1736 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1737 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1740 /* Only push if top exists. Otherwise, replace top. */
1741 if (YY_CURRENT_BUFFER)
1742 yyg->yy_buffer_stack_top++;
1743 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1745 /* copied from _gmx_sel_yy_switch_to_buffer. */
1746 _gmx_sel_yy_load_buffer_state(yyscanner );
1747 yyg->yy_did_buffer_switch_on_eof = 1;
1750 /** Removes and deletes the top of the stack, if present.
1751 * The next element becomes the new top.
1752 * @param yyscanner The scanner object.
1754 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner)
1756 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1757 if (!YY_CURRENT_BUFFER)
1758 return;
1760 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1761 YY_CURRENT_BUFFER_LVALUE = NULL;
1762 if (yyg->yy_buffer_stack_top > 0)
1763 --yyg->yy_buffer_stack_top;
1765 if (YY_CURRENT_BUFFER) {
1766 _gmx_sel_yy_load_buffer_state(yyscanner );
1767 yyg->yy_did_buffer_switch_on_eof = 1;
1771 /* Allocates the stack if it does not exist.
1772 * Guarantees space for at least one push.
1774 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner)
1776 int num_to_alloc;
1777 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1779 if (!yyg->yy_buffer_stack) {
1781 /* First allocation is just for 2 elements, since we don't know if this
1782 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1783 * immediate realloc on the next call.
1785 num_to_alloc = 1;
1786 yyg->yy_buffer_stack = (struct yy_buffer_state**)_gmx_sel_yyalloc
1787 (num_to_alloc * sizeof(struct yy_buffer_state*)
1788 , yyscanner);
1789 if ( ! yyg->yy_buffer_stack )
1790 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1792 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1794 yyg->yy_buffer_stack_max = num_to_alloc;
1795 yyg->yy_buffer_stack_top = 0;
1796 return;
1799 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1801 /* Increase the buffer to prepare for a possible push. */
1802 int grow_size = 8 /* arbitrary grow size */;
1804 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1805 yyg->yy_buffer_stack = (struct yy_buffer_state**)_gmx_sel_yyrealloc
1806 (yyg->yy_buffer_stack,
1807 num_to_alloc * sizeof(struct yy_buffer_state*)
1808 , yyscanner);
1809 if ( ! yyg->yy_buffer_stack )
1810 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1812 /* zero only the new slots.*/
1813 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1814 yyg->yy_buffer_stack_max = num_to_alloc;
1818 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1819 * @param base the character buffer
1820 * @param size the size in bytes of the character buffer
1821 * @param yyscanner The scanner object.
1822 * @return the newly allocated buffer state object.
1824 YY_BUFFER_STATE _gmx_sel_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1826 YY_BUFFER_STATE b;
1828 if ( size < 2 ||
1829 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1830 base[size-1] != YY_END_OF_BUFFER_CHAR )
1831 /* They forgot to leave room for the EOB's. */
1832 return 0;
1834 b = (YY_BUFFER_STATE) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1835 if ( ! b )
1836 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_buffer()" );
1838 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1839 b->yy_buf_pos = b->yy_ch_buf = base;
1840 b->yy_is_our_buffer = 0;
1841 b->yy_input_file = 0;
1842 b->yy_n_chars = b->yy_buf_size;
1843 b->yy_is_interactive = 0;
1844 b->yy_at_bol = 1;
1845 b->yy_fill_buffer = 0;
1846 b->yy_buffer_status = YY_BUFFER_NEW;
1848 _gmx_sel_yy_switch_to_buffer(b ,yyscanner );
1850 return b;
1853 /** Setup the input buffer state to scan a string. The next call to _gmx_sel_yylex() will
1854 * scan from a @e copy of @a str.
1855 * @param yystr a NUL-terminated string to scan
1856 * @param yyscanner The scanner object.
1857 * @return the newly allocated buffer state object.
1858 * @note If you want to scan bytes that may contain NUL values, then use
1859 * _gmx_sel_yy_scan_bytes() instead.
1861 YY_BUFFER_STATE _gmx_sel_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1864 return _gmx_sel_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1867 /** Setup the input buffer state to scan the given bytes. The next call to _gmx_sel_yylex() will
1868 * scan from a @e copy of @a bytes.
1869 * @param yybytes the byte buffer to scan
1870 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1871 * @param yyscanner The scanner object.
1872 * @return the newly allocated buffer state object.
1874 YY_BUFFER_STATE _gmx_sel_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1876 YY_BUFFER_STATE b;
1877 char *buf;
1878 yy_size_t n;
1879 int i;
1881 /* Get memory for full buffer, including space for trailing EOB's. */
1882 n = _yybytes_len + 2;
1883 buf = (char *) _gmx_sel_yyalloc(n ,yyscanner );
1884 if ( ! buf )
1885 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_bytes()" );
1887 for ( i = 0; i < _yybytes_len; ++i )
1888 buf[i] = yybytes[i];
1890 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1892 b = _gmx_sel_yy_scan_buffer(buf,n ,yyscanner);
1893 if ( ! b )
1894 YY_FATAL_ERROR( "bad buffer in _gmx_sel_yy_scan_bytes()" );
1896 /* It's okay to grow etc. this buffer, and we should throw it
1897 * away when we're done.
1899 b->yy_is_our_buffer = 1;
1901 return b;
1904 #ifndef YY_EXIT_FAILURE
1905 #define YY_EXIT_FAILURE 2
1906 #endif
1908 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1910 (void) fprintf( stderr, "%s\n", msg );
1911 exit( YY_EXIT_FAILURE );
1914 /* Redefine yyless() so it works in section 3 code. */
1916 #undef yyless
1917 #define yyless(n) \
1918 do \
1920 /* Undo effects of setting up yytext. */ \
1921 int yyless_macro_arg = (n); \
1922 YY_LESS_LINENO(yyless_macro_arg);\
1923 yytext[yyleng] = yyg->yy_hold_char; \
1924 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1925 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1926 *yyg->yy_c_buf_p = '\0'; \
1927 yyleng = yyless_macro_arg; \
1929 while ( 0 )
1931 /* Accessor methods (get/set functions) to struct members. */
1933 /** Get the user-defined data for this scanner.
1934 * @param yyscanner The scanner object.
1936 YY_EXTRA_TYPE _gmx_sel_yyget_extra (yyscan_t yyscanner)
1938 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1939 return yyextra;
1942 /** Get the current line number.
1943 * @param yyscanner The scanner object.
1945 int _gmx_sel_yyget_lineno (yyscan_t yyscanner)
1947 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1949 if (! YY_CURRENT_BUFFER)
1950 return 0;
1952 return yylineno;
1955 /** Get the current column number.
1956 * @param yyscanner The scanner object.
1958 int _gmx_sel_yyget_column (yyscan_t yyscanner)
1960 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1962 if (! YY_CURRENT_BUFFER)
1963 return 0;
1965 return yycolumn;
1968 /** Get the input stream.
1969 * @param yyscanner The scanner object.
1971 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner)
1973 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1974 return yyin;
1977 /** Get the output stream.
1978 * @param yyscanner The scanner object.
1980 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner)
1982 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1983 return yyout;
1986 /** Get the length of the current token.
1987 * @param yyscanner The scanner object.
1989 int _gmx_sel_yyget_leng (yyscan_t yyscanner)
1991 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1992 return yyleng;
1995 /** Get the current token.
1996 * @param yyscanner The scanner object.
1999 char *_gmx_sel_yyget_text (yyscan_t yyscanner)
2001 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2002 return yytext;
2005 /** Set the user-defined data. This data is never touched by the scanner.
2006 * @param user_defined The data to be associated with this scanner.
2007 * @param yyscanner The scanner object.
2009 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2011 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2012 yyextra = user_defined ;
2015 /** Set the current line number.
2016 * @param line_number
2017 * @param yyscanner The scanner object.
2019 void _gmx_sel_yyset_lineno (int line_number , yyscan_t yyscanner)
2021 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2023 /* lineno is only valid if an input buffer exists. */
2024 if (! YY_CURRENT_BUFFER )
2025 yy_fatal_error( "_gmx_sel_yyset_lineno called with no buffer" , yyscanner);
2027 yylineno = line_number;
2030 /** Set the current column.
2031 * @param line_number
2032 * @param yyscanner The scanner object.
2034 void _gmx_sel_yyset_column (int column_no , yyscan_t yyscanner)
2036 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2038 /* column is only valid if an input buffer exists. */
2039 if (! YY_CURRENT_BUFFER )
2040 yy_fatal_error( "_gmx_sel_yyset_column called with no buffer" , yyscanner);
2042 yycolumn = column_no;
2045 /** Set the input stream. This does not discard the current
2046 * input buffer.
2047 * @param in_str A readable stream.
2048 * @param yyscanner The scanner object.
2049 * @see _gmx_sel_yy_switch_to_buffer
2051 void _gmx_sel_yyset_in (FILE * in_str , yyscan_t yyscanner)
2053 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2054 yyin = in_str ;
2057 void _gmx_sel_yyset_out (FILE * out_str , yyscan_t yyscanner)
2059 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2060 yyout = out_str ;
2063 int _gmx_sel_yyget_debug (yyscan_t yyscanner)
2065 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2066 return yy_flex_debug;
2069 void _gmx_sel_yyset_debug (int bdebug , yyscan_t yyscanner)
2071 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2072 yy_flex_debug = bdebug ;
2075 /* Accessor methods for yylval and yylloc */
2077 /* User-visible API */
2079 /* _gmx_sel_yylex_init is special because it creates the scanner itself, so it is
2080 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2081 * That's why we explicitly handle the declaration, instead of using our macros.
2084 int _gmx_sel_yylex_init(yyscan_t* ptr_yy_globals)
2087 if (ptr_yy_globals == NULL){
2088 errno = EINVAL;
2089 return 1;
2092 *ptr_yy_globals = (yyscan_t) _gmx_sel_yyalloc ( sizeof( struct yyguts_t ), NULL );
2094 if (*ptr_yy_globals == NULL){
2095 errno = ENOMEM;
2096 return 1;
2099 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2100 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2102 return yy_init_globals ( *ptr_yy_globals );
2105 /* _gmx_sel_yylex_init_extra has the same functionality as _gmx_sel_yylex_init, but follows the
2106 * convention of taking the scanner as the last argument. Note however, that
2107 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2108 * is the reason, too, why this function also must handle its own declaration).
2109 * The user defined value in the first argument will be available to _gmx_sel_yyalloc in
2110 * the yyextra field.
2113 int _gmx_sel_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2116 struct yyguts_t dummy_yyguts;
2118 _gmx_sel_yyset_extra (yy_user_defined, &dummy_yyguts);
2120 if (ptr_yy_globals == NULL){
2121 errno = EINVAL;
2122 return 1;
2125 *ptr_yy_globals = (yyscan_t) _gmx_sel_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2127 if (*ptr_yy_globals == NULL){
2128 errno = ENOMEM;
2129 return 1;
2132 /* By setting to 0xAA, we expose bugs in
2133 yy_init_globals. Leave at 0x00 for releases. */
2134 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2136 _gmx_sel_yyset_extra (yy_user_defined, *ptr_yy_globals);
2138 return yy_init_globals ( *ptr_yy_globals );
2141 static int yy_init_globals (yyscan_t yyscanner)
2143 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2144 /* Initialization is the same as for the non-reentrant scanner.
2145 * This function is called from _gmx_sel_yylex_destroy(), so don't allocate here.
2148 yyg->yy_buffer_stack = 0;
2149 yyg->yy_buffer_stack_top = 0;
2150 yyg->yy_buffer_stack_max = 0;
2151 yyg->yy_c_buf_p = (char *) 0;
2152 yyg->yy_init = 0;
2153 yyg->yy_start = 0;
2155 yyg->yy_start_stack_ptr = 0;
2156 yyg->yy_start_stack_depth = 0;
2157 yyg->yy_start_stack = NULL;
2159 /* Defined in main.c */
2160 #ifdef YY_STDINIT
2161 yyin = stdin;
2162 yyout = stdout;
2163 #else
2164 yyin = (FILE *) 0;
2165 yyout = (FILE *) 0;
2166 #endif
2168 /* For future reference: Set errno on error, since we are called by
2169 * _gmx_sel_yylex_init()
2171 return 0;
2174 /* _gmx_sel_yylex_destroy is for both reentrant and non-reentrant scanners. */
2175 int _gmx_sel_yylex_destroy (yyscan_t yyscanner)
2177 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2179 /* Pop the buffer stack, destroying each element. */
2180 while(YY_CURRENT_BUFFER){
2181 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2182 YY_CURRENT_BUFFER_LVALUE = NULL;
2183 _gmx_sel_yypop_buffer_state(yyscanner);
2186 /* Destroy the stack itself. */
2187 _gmx_sel_yyfree(yyg->yy_buffer_stack ,yyscanner);
2188 yyg->yy_buffer_stack = NULL;
2190 /* Destroy the start condition stack. */
2191 _gmx_sel_yyfree(yyg->yy_start_stack ,yyscanner );
2192 yyg->yy_start_stack = NULL;
2194 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2195 * _gmx_sel_yylex() is called, initialization will occur. */
2196 yy_init_globals( yyscanner);
2198 /* Destroy the main struct (reentrant only). */
2199 _gmx_sel_yyfree ( yyscanner , yyscanner );
2200 yyscanner = NULL;
2201 return 0;
2205 * Internal utility routines.
2208 #ifndef yytext_ptr
2209 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2211 register int i;
2212 for ( i = 0; i < n; ++i )
2213 s1[i] = s2[i];
2215 #endif
2217 #ifdef YY_NEED_STRLEN
2218 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2220 register int n;
2221 for ( n = 0; s[n]; ++n )
2224 return n;
2226 #endif
2228 void *_gmx_sel_yyalloc (yy_size_t size , yyscan_t yyscanner)
2230 return (void *) malloc( size );
2233 void *_gmx_sel_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2235 /* The cast to (char *) in the following accommodates both
2236 * implementations that use char* generic pointers, and those
2237 * that use void* generic pointers. It works with the latter
2238 * because both ANSI C and C++ allow castless assignment from
2239 * any pointer type to void*, and deal with argument conversions
2240 * as though doing an assignment.
2242 return (void *) realloc( (char *) ptr, size );
2245 void _gmx_sel_yyfree (void * ptr , yyscan_t yyscanner)
2247 free( (char *) ptr ); /* see _gmx_sel_yyrealloc() for (char *) cast */
2250 #define YYTABLES_NAME "yytables"
2252 #line 182 "scanner.l"