0d025c9878de062344fa7ce7a1830186bcab0983
[alexxy/gromacs.git] / src / gromacs / selection / scanner.cpp
1 #line 2 "scanner.cpp"
2
3 #line 4 "scanner.cpp"
4
5 #define  YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 37
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16
17 /* First, we deal with  platform-specific or compiler-specific issues. */
18
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24
25 /* end standard C headers. */
26
27 /* flex integer type definitions */
28
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37  * if you want the limit (max/min) macros for int types. 
38  */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42
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;
57
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
86
87 #endif /* ! C99 */
88
89 #endif /* ! FLEXINT_H */
90
91 #ifdef __cplusplus
92
93 /* The "const" storage-class-modifier is valid. */
94 #define YY_USE_CONST
95
96 #else   /* ! __cplusplus */
97
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
100
101 #define YY_USE_CONST
102
103 #endif  /* defined (__STDC__) */
104 #endif  /* ! __cplusplus */
105
106 #ifdef YY_USE_CONST
107 #define yyconst const
108 #else
109 #define yyconst
110 #endif
111
112 /* Returned upon end-of-file. */
113 #define YY_NULL 0
114
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.
119  */
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
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
127
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
138
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.
142  */
143 #define BEGIN yyg->yy_start = 1 + 2 *
144
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.
148  */
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
151
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE _gmx_sel_yyrestart(yyin ,yyscanner )
157
158 #define YY_END_OF_BUFFER_CHAR 0
159
160 /* Size of default input buffer. */
161 #ifndef YY_BUF_SIZE
162 #define YY_BUF_SIZE 16384
163 #endif
164
165 /* The state buf must be large enough to hold one state per character in the main buffer.
166  */
167 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
170 #define YY_TYPEDEF_YY_BUFFER_STATE
171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
172 #endif
173
174 #ifndef YY_TYPEDEF_YY_SIZE_T
175 #define YY_TYPEDEF_YY_SIZE_T
176 typedef size_t yy_size_t;
177 #endif
178
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182
183     #define YY_LESS_LINENO(n)
184     
185 /* Return all but the first "n" matched characters back to the input stream. */
186 #define yyless(n) \
187         do \
188                 { \
189                 /* Undo effects of setting up yytext. */ \
190         int yyless_macro_arg = (n); \
191         YY_LESS_LINENO(yyless_macro_arg);\
192                 *yy_cp = yyg->yy_hold_char; \
193                 YY_RESTORE_YY_MORE_OFFSET \
194                 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
195                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
196                 } \
197         while ( 0 )
198
199 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
200
201 #ifndef YY_STRUCT_YY_BUFFER_STATE
202 #define YY_STRUCT_YY_BUFFER_STATE
203 struct yy_buffer_state
204         {
205         FILE *yy_input_file;
206
207         char *yy_ch_buf;                /* input buffer */
208         char *yy_buf_pos;               /* current position in input buffer */
209
210         /* Size of input buffer in bytes, not including room for EOB
211          * characters.
212          */
213         yy_size_t yy_buf_size;
214
215         /* Number of characters read into yy_ch_buf, not including EOB
216          * characters.
217          */
218         yy_size_t yy_n_chars;
219
220         /* Whether we "own" the buffer - i.e., we know we created it,
221          * and can realloc() it to grow it, and should free() it to
222          * delete it.
223          */
224         int yy_is_our_buffer;
225
226         /* Whether this is an "interactive" input source; if so, and
227          * if we're using stdio for input, then we want to use getc()
228          * instead of fread(), to make sure we stop fetching input after
229          * each newline.
230          */
231         int yy_is_interactive;
232
233         /* Whether we're considered to be at the beginning of a line.
234          * If so, '^' rules will be active on the next match, otherwise
235          * not.
236          */
237         int yy_at_bol;
238
239     int yy_bs_lineno; /**< The line count. */
240     int yy_bs_column; /**< The column count. */
241     
242         /* Whether to try to fill the input buffer when we reach the
243          * end of it.
244          */
245         int yy_fill_buffer;
246
247         int yy_buffer_status;
248
249 #define YY_BUFFER_NEW 0
250 #define YY_BUFFER_NORMAL 1
251         /* When an EOF's been seen but there's still some text to process
252          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
253          * shouldn't try reading from the input source any more.  We might
254          * still have a bunch of tokens to match, though, because of
255          * possible backing-up.
256          *
257          * When we actually see the EOF, we change the status to "new"
258          * (via _gmx_sel_yyrestart()), so that the user can continue scanning by
259          * just pointing yyin at a new input file.
260          */
261 #define YY_BUFFER_EOF_PENDING 2
262
263         };
264 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
265
266 /* We provide macros for accessing buffer states in case in the
267  * future we want to put the buffer states in a more general
268  * "scanner state".
269  *
270  * Returns the top of the stack, or NULL.
271  */
272 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
273                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
274                           : NULL)
275
276 /* Same as previous macro, but useful when we know that the buffer stack is not
277  * NULL or when we need an lvalue. For internal use only.
278  */
279 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
280
281 void _gmx_sel_yyrestart (FILE *input_file ,yyscan_t yyscanner );
282 void _gmx_sel_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
283 YY_BUFFER_STATE _gmx_sel_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
284 void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
285 void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
286 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
287 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner );
288
289 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner );
290 static void _gmx_sel_yy_load_buffer_state (yyscan_t yyscanner );
291 static void _gmx_sel_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
292
293 #define YY_FLUSH_BUFFER _gmx_sel_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
294
295 YY_BUFFER_STATE _gmx_sel_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
296 YY_BUFFER_STATE _gmx_sel_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
297 YY_BUFFER_STATE _gmx_sel_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
298
299 void *_gmx_sel_yyalloc (yy_size_t ,yyscan_t yyscanner );
300 void *_gmx_sel_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
301 void _gmx_sel_yyfree (void * ,yyscan_t yyscanner );
302
303 #define yy_new_buffer _gmx_sel_yy_create_buffer
304
305 #define yy_set_interactive(is_interactive) \
306         { \
307         if ( ! YY_CURRENT_BUFFER ){ \
308         _gmx_sel_yyensure_buffer_stack (yyscanner); \
309                 YY_CURRENT_BUFFER_LVALUE =    \
310             _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
311         } \
312         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
313         }
314
315 #define yy_set_bol(at_bol) \
316         { \
317         if ( ! YY_CURRENT_BUFFER ){\
318         _gmx_sel_yyensure_buffer_stack (yyscanner); \
319                 YY_CURRENT_BUFFER_LVALUE =    \
320             _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
321         } \
322         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
323         }
324
325 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
326
327 #define _gmx_sel_yywrap(yyscanner) 1
328 #define YY_SKIP_YYWRAP
329
330 typedef unsigned char YY_CHAR;
331
332 typedef int yy_state_type;
333
334 #define yytext_ptr yytext_r
335
336 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
337 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
338 static int yy_get_next_buffer (yyscan_t yyscanner );
339 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
340
341 /* Done after the current pattern has been matched and before the
342  * corresponding action - sets up yytext.
343  */
344 #define YY_DO_BEFORE_ACTION \
345         yyg->yytext_ptr = yy_bp; \
346         yyleng = (size_t) (yy_cp - yy_bp); \
347         yyg->yy_hold_char = *yy_cp; \
348         *yy_cp = '\0'; \
349         yyg->yy_c_buf_p = yy_cp;
350
351 #define YY_NUM_RULES 26
352 #define YY_END_OF_BUFFER 27
353 /* This struct is not used in this scanner,
354    but its presence is necessary. */
355 struct yy_trans_info
356         {
357         flex_int32_t yy_verify;
358         flex_int32_t yy_nxt;
359         };
360 static yyconst flex_int16_t yy_accept[89] =
361     {   0,
362         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
363        27,   25,   23,    6,   20,   25,    1,   25,   25,    2,
364         6,   21,   25,   22,   25,   24,   22,   22,   22,   22,
365        22,   22,   22,   25,   22,   22,   22,   22,   11,    8,
366        10,   10,    9,   23,   21,    0,    4,    0,    1,   17,
367         3,    3,    2,   24,   24,   22,    5,   22,   22,   22,
368        22,   18,   15,   22,   18,   16,   13,   22,   12,   22,
369         8,    9,    0,    0,    3,   17,   22,   22,   20,   19,
370        13,    0,    3,    3,   22,    7,   14,    0
371     } ;
372
373 static yyconst flex_int32_t yy_ec[256] =
374     {   0,
375         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
376         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
377         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
378         1,    2,    4,    5,    6,    1,    1,    7,    1,    1,
379         1,    1,    8,    1,    8,    9,    1,   10,   10,   10,
380        10,   10,   10,   10,   10,   10,   10,    1,   11,   12,
381        13,   12,    1,    1,   14,   14,   14,   14,   15,   14,
382        14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
383        14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
384         1,   16,    1,    1,   17,    1,   18,   14,   14,   19,
385
386        20,   21,   22,   23,   14,   14,   14,   24,   14,   25,
387        26,   27,   14,   28,   29,   30,   31,   14,   14,   32,
388        33,   14,    1,   34,    1,    1,    1,    1,    1,    1,
389         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
390         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
391         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
392         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
393         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
394         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
395         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
396
397         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
398         1,    1,    1,    1,    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
403     } ;
404
405 static yyconst flex_int32_t yy_meta[35] =
406     {   0,
407         1,    1,    2,    1,    1,    1,    1,    1,    3,    4,
408         1,    1,    1,    4,    4,    1,    4,    4,    4,    4,
409         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
410         4,    4,    4,    1
411     } ;
412
413 static yyconst flex_int16_t yy_base[94] =
414     {   0,
415         0,    0,  129,  128,   10,   12,    0,    0,   45,    0,
416       153,  156,  150,  156,  138,   75,    0,  143,  139,   72,
417       156,  135,  134,    0,  143,  136,  119,  115,  122,  115,
418       112,  113,  112,  103,   62,  110,   68,  115,  156,  132,
419       156,  156,    0,  131,  156,   79,  156,  127,    0,  156,
420        84,   87,   91,  122,   31,    0,  156,  111,  103,  104,
421        97,    0,    0,   98,  156,    0,   95,  103,    0,   94,
422       120,    0,   34,  107,   76,    0,   82,   83,    0,    0,
423         0,   99,   98,   95,   76,    0,    0,  156,  111,  115,
424       117,   94,   84
425
426     } ;
427
428 static yyconst flex_int16_t yy_def[94] =
429     {   0,
430        88,    1,    1,    1,    1,    1,    1,    1,   88,    9,
431        88,   88,   88,   88,   88,   89,   90,   88,   88,   91,
432        88,   88,   88,   92,   88,   91,   92,   92,   92,   92,
433        92,   92,   92,   88,   92,   92,   92,   92,   88,   88,
434        88,   88,   93,   88,   88,   89,   88,   88,   90,   88,
435        88,   88,   91,   91,   91,   92,   88,   92,   92,   92,
436        92,   92,   92,   92,   88,   92,   92,   92,   92,   92,
437        88,   93,   88,   88,   91,   92,   92,   92,   92,   92,
438        92,   88,   88,   88,   92,   92,   92,    0,   88,   88,
439        88,   88,   88
440
441     } ;
442
443 static yyconst flex_int16_t yy_nxt[191] =
444     {   0,
445        12,   13,   14,   15,   16,   17,   18,   12,   19,   20,
446        21,   22,   23,   24,   24,   25,   26,   27,   24,   24,
447        24,   28,   29,   24,   30,   31,   24,   24,   24,   32,
448        24,   33,   24,   34,   36,   37,   36,   37,   74,   88,
449        75,   82,   38,   83,   38,   39,   40,   41,   39,   39,
450        39,   39,   39,   39,   39,   42,   39,   39,   43,   43,
451        39,   39,   43,   43,   43,   43,   43,   43,   43,   43,
452        43,   43,   43,   43,   43,   43,   43,   43,   39,   47,
453        52,   53,   66,   47,   88,   75,   55,   72,   68,   62,
454        48,   55,   69,   51,   48,   62,   51,   56,   73,   52,
455
456        53,   73,   87,   73,   84,   55,   73,   83,   83,   86,
457        55,   46,   85,   46,   46,   49,   84,   49,   49,   54,
458        54,   71,   69,   81,   79,   80,   79,   78,   77,   76,
459        88,   46,   44,   71,   70,   67,   65,   64,   63,   62,
460        61,   60,   59,   58,   88,   57,   45,   45,   51,   50,
461        45,   44,   88,   35,   35,   11,   88,   88,   88,   88,
462        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
463        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
464        88,   88,   88,   88,   88,   88,   88,   88,   88,   88
465     } ;
466
467 static yyconst flex_int16_t yy_chk[191] =
468     {   0,
469         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
470         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
471         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
472         1,    1,    1,    1,    5,    5,    6,    6,   55,   55,
473        55,   73,    5,   73,    6,    9,    9,    9,    9,    9,
474         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
475         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
476         9,    9,    9,    9,    9,    9,    9,    9,    9,   16,
477        20,   20,   35,   46,   75,   75,   20,   93,   37,   35,
478        16,   20,   37,   51,   46,   37,   52,   92,   51,   53,
479
480        53,   52,   85,   51,   84,   53,   52,   83,   82,   78,
481        53,   89,   77,   89,   89,   90,   74,   90,   90,   91,
482        91,   71,   70,   68,   67,   64,   61,   60,   59,   58,
483        54,   48,   44,   40,   38,   36,   34,   33,   32,   31,
484        30,   29,   28,   27,   26,   25,   23,   22,   19,   18,
485        15,   13,   11,    4,    3,   88,   88,   88,   88,   88,
486        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
487        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
488        88,   88,   88,   88,   88,   88,   88,   88,   88,   88
489     } ;
490
491 /* The intent behind this definition is that it'll catch
492  * any uses of REJECT which flex missed.
493  */
494 #define REJECT reject_used_but_not_detected
495 #define yymore() yymore_used_but_not_detected
496 #define YY_MORE_ADJ 0
497 #define YY_RESTORE_YY_MORE_OFFSET
498 #line 1 "scanner.l"
499 /*
500  * This file is part of the GROMACS molecular simulation package.
501  *
502  * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by
503  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
504  * and including many others, as listed in the AUTHORS file in the
505  * top-level source directory and at http://www.gromacs.org.
506  *
507  * GROMACS is free software; you can redistribute it and/or
508  * modify it under the terms of the GNU Lesser General Public License
509  * as published by the Free Software Foundation; either version 2.1
510  * of the License, or (at your option) any later version.
511  *
512  * GROMACS is distributed in the hope that it will be useful,
513  * but WITHOUT ANY WARRANTY; without even the implied warranty of
514  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
515  * Lesser General Public License for more details.
516  *
517  * You should have received a copy of the GNU Lesser General Public
518  * License along with GROMACS; if not, see
519  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
520  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
521  *
522  * If you want to redistribute modifications to GROMACS, please
523  * consider that scientific software is very special. Version
524  * control is crucial - bugs must be traceable. We will be happy to
525  * consider code for inclusion in the official distribution, but
526  * derived work must not be called official GROMACS. Details are found
527  * in the README & COPYING files - if they are missing, get the
528  * official version at http://www.gromacs.org.
529  *
530  * To help us fund GROMACS development, we humbly ask that you cite
531  * the research papers on the package. Check out http://www.gromacs.org.
532  */
533 /*! \cond \internal \file scanner.l
534  * \brief
535  * Tokenizer for the selection language.
536  *
537  * \author Teemu Murtola <teemu.murtola@gmail.com>
538  * \ingroup module_selection
539  * \endcond
540  */
541 /*! \internal \file scanner.cpp
542  * \brief
543  * Generated (from scanner.l by Flex) tokenizer for the selection language.
544  *
545  * \ingroup module_selection
546  */
547 #line 50 "scanner.l"
548 #include "gromacs/legacyheaders/string2.h"
549
550 #include "parser.h"
551 #include "scanner.h"
552 #include "scanner_internal.h"
553
554 /* This macro is here to make the actions a bit shorter, since nearly every
555  * action needs this call. */
556 #define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state)
557
558 #define YY_NO_UNISTD_H 1
559
560
561
562
563 #line 564 "scanner.cpp"
564
565 #define INITIAL 0
566 #define matchof 1
567 #define matchbool 2
568 #define cmdstart 3
569 #define help 4
570
571 #ifndef YY_NO_UNISTD_H
572 /* Special case for "unistd.h", since it is non-ANSI. We include it way
573  * down here because we want the user's section 1 to have been scanned first.
574  * The user has a chance to override it with an option.
575  */
576 #include <unistd.h>
577 #endif
578
579 #ifndef YY_EXTRA_TYPE
580 #define YY_EXTRA_TYPE void *
581 #endif
582
583 /* Holds the entire state of the reentrant scanner. */
584 struct yyguts_t
585     {
586
587     /* User-defined. Not touched by flex. */
588     YY_EXTRA_TYPE yyextra_r;
589
590     /* The rest are the same as the globals declared in the non-reentrant scanner. */
591     FILE *yyin_r, *yyout_r;
592     size_t yy_buffer_stack_top; /**< index of top of stack. */
593     size_t yy_buffer_stack_max; /**< capacity of stack. */
594     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
595     char yy_hold_char;
596     yy_size_t yy_n_chars;
597     yy_size_t yyleng_r;
598     char *yy_c_buf_p;
599     int yy_init;
600     int yy_start;
601     int yy_did_buffer_switch_on_eof;
602     int yy_start_stack_ptr;
603     int yy_start_stack_depth;
604     int *yy_start_stack;
605     yy_state_type yy_last_accepting_state;
606     char* yy_last_accepting_cpos;
607
608     int yylineno_r;
609     int yy_flex_debug_r;
610
611     char *yytext_r;
612     int yy_more_flag;
613     int yy_more_len;
614
615     }; /* end struct yyguts_t */
616
617 static int yy_init_globals (yyscan_t yyscanner );
618
619 int _gmx_sel_yylex_init (yyscan_t* scanner);
620
621 int _gmx_sel_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
622
623 /* Accessor methods to globals.
624    These are made visible to non-reentrant scanners for convenience. */
625
626 int _gmx_sel_yylex_destroy (yyscan_t yyscanner );
627
628 int _gmx_sel_yyget_debug (yyscan_t yyscanner );
629
630 void _gmx_sel_yyset_debug (int debug_flag ,yyscan_t yyscanner );
631
632 YY_EXTRA_TYPE _gmx_sel_yyget_extra (yyscan_t yyscanner );
633
634 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
635
636 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner );
637
638 void _gmx_sel_yyset_in  (FILE * in_str ,yyscan_t yyscanner );
639
640 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner );
641
642 void _gmx_sel_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
643
644 yy_size_t _gmx_sel_yyget_leng (yyscan_t yyscanner );
645
646 char *_gmx_sel_yyget_text (yyscan_t yyscanner );
647
648 int _gmx_sel_yyget_lineno (yyscan_t yyscanner );
649
650 void _gmx_sel_yyset_lineno (int line_number ,yyscan_t yyscanner );
651
652 int _gmx_sel_yyget_column  (yyscan_t yyscanner );
653
654 void _gmx_sel_yyset_column (int column_no ,yyscan_t yyscanner );
655
656 /* Macros after this point can all be overridden by user definitions in
657  * section 1.
658  */
659
660 #ifndef YY_SKIP_YYWRAP
661 #ifdef __cplusplus
662 extern "C" int _gmx_sel_yywrap (yyscan_t yyscanner );
663 #else
664 extern int _gmx_sel_yywrap (yyscan_t yyscanner );
665 #endif
666 #endif
667
668     static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
669     
670 #ifndef yytext_ptr
671 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
672 #endif
673
674 #ifdef YY_NEED_STRLEN
675 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
676 #endif
677
678 #ifndef YY_NO_INPUT
679
680 #ifdef __cplusplus
681 static int yyinput (yyscan_t yyscanner );
682 #else
683 static int input (yyscan_t yyscanner );
684 #endif
685
686 #endif
687
688 /* Amount of stuff to slurp up with each read. */
689 #ifndef YY_READ_BUF_SIZE
690 #define YY_READ_BUF_SIZE 8192
691 #endif
692
693 /* Copy whatever the last rule matched to the standard output. */
694 #ifndef ECHO
695 /* This used to be an fputs(), but since the string might contain NUL's,
696  * we now use fwrite().
697  */
698 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
699 #endif
700
701 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
702  * is returned in "result".
703  */
704 #ifndef YY_INPUT
705 #define YY_INPUT(buf,result,max_size) \
706         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
707                 { \
708                 int c = '*'; \
709                 size_t n; \
710                 for ( n = 0; n < max_size && \
711                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
712                         buf[n] = (char) c; \
713                 if ( c == '\n' ) \
714                         buf[n++] = (char) c; \
715                 if ( c == EOF && ferror( yyin ) ) \
716                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
717                 result = n; \
718                 } \
719         else \
720                 { \
721                 errno=0; \
722                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
723                         { \
724                         if( errno != EINTR) \
725                                 { \
726                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
727                                 break; \
728                                 } \
729                         errno=0; \
730                         clearerr(yyin); \
731                         } \
732                 }\
733 \
734
735 #endif
736
737 /* No semi-colon after return; correct usage is to write "yyterminate();" -
738  * we don't want an extra ';' after the "return" because that will cause
739  * some compilers to complain about unreachable statements.
740  */
741 #ifndef yyterminate
742 #define yyterminate() return YY_NULL
743 #endif
744
745 /* Number of entries by which start-condition stack grows. */
746 #ifndef YY_START_STACK_INCR
747 #define YY_START_STACK_INCR 25
748 #endif
749
750 /* Report a fatal error. */
751 #ifndef YY_FATAL_ERROR
752 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
753 #endif
754
755 /* end tables serialization structures and prototypes */
756
757 /* Default declaration of generated scanner - a define so the user can
758  * easily add parameters.
759  */
760 #ifndef YY_DECL
761 #define YY_DECL_IS_OURS 1
762
763 extern int _gmx_sel_yylex (yyscan_t yyscanner);
764
765 #define YY_DECL int _gmx_sel_yylex (yyscan_t yyscanner)
766 #endif /* !YY_DECL */
767
768 /* Code executed at the beginning of each rule, after yytext and yyleng
769  * have been set up.
770  */
771 #ifndef YY_USER_ACTION
772 #define YY_USER_ACTION
773 #endif
774
775 /* Code executed at the end of each rule. */
776 #ifndef YY_BREAK
777 #define YY_BREAK break;
778 #endif
779
780 #define YY_RULE_SETUP \
781         YY_USER_ACTION
782
783 /** The main scanner function which does all the work.
784  */
785 YY_DECL
786 {
787         register yy_state_type yy_current_state;
788         register char *yy_cp, *yy_bp;
789         register int yy_act;
790     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
791
792 #line 85 "scanner.l"
793
794
795
796     gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(yyscanner);
797     int              retval;
798     /* Return a token if one is pending */
799     retval = _gmx_sel_lexer_process_pending(yylval, state);
800     if (retval != 0)
801     {
802         return retval;
803     }
804     /* Handle the start conditions for 'of' matching */
805     if (state->bMatchOf)
806     {
807         BEGIN(matchof);
808         state->bMatchOf = false;
809     }
810     else if (state->bMatchBool)
811     {
812         BEGIN(matchbool);
813         state->bMatchBool = false;
814     }
815     else if (state->bCmdStart)
816     {
817         BEGIN(cmdstart);
818         state->bCmdStart = false;
819     }
820     else if (YYSTATE != help)
821     {
822         BEGIN(0);
823     }
824
825
826 #line 827 "scanner.cpp"
827
828         if ( !yyg->yy_init )
829                 {
830                 yyg->yy_init = 1;
831
832 #ifdef YY_USER_INIT
833                 YY_USER_INIT;
834 #endif
835
836                 if ( ! yyg->yy_start )
837                         yyg->yy_start = 1;      /* first start state */
838
839                 if ( ! yyin )
840                         yyin = stdin;
841
842                 if ( ! yyout )
843                         yyout = stdout;
844
845                 if ( ! YY_CURRENT_BUFFER ) {
846                         _gmx_sel_yyensure_buffer_stack (yyscanner);
847                         YY_CURRENT_BUFFER_LVALUE =
848                                 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
849                 }
850
851                 _gmx_sel_yy_load_buffer_state(yyscanner );
852                 }
853
854         while ( 1 )             /* loops until end-of-file is reached */
855                 {
856                 yy_cp = yyg->yy_c_buf_p;
857
858                 /* Support of yytext. */
859                 *yy_cp = yyg->yy_hold_char;
860
861                 /* yy_bp points to the position in yy_ch_buf of the start of
862                  * the current run.
863                  */
864                 yy_bp = yy_cp;
865
866                 yy_current_state = yyg->yy_start;
867 yy_match:
868                 do
869                         {
870                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
871                         if ( yy_accept[yy_current_state] )
872                                 {
873                                 yyg->yy_last_accepting_state = yy_current_state;
874                                 yyg->yy_last_accepting_cpos = yy_cp;
875                                 }
876                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
877                                 {
878                                 yy_current_state = (int) yy_def[yy_current_state];
879                                 if ( yy_current_state >= 89 )
880                                         yy_c = yy_meta[(unsigned int) yy_c];
881                                 }
882                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
883                         ++yy_cp;
884                         }
885                 while ( yy_current_state != 88 );
886                 yy_cp = yyg->yy_last_accepting_cpos;
887                 yy_current_state = yyg->yy_last_accepting_state;
888
889 yy_find_action:
890                 yy_act = yy_accept[yy_current_state];
891
892                 YY_DO_BEFORE_ACTION;
893
894 do_action:      /* This label is used only to access EOF actions. */
895
896                 switch ( yy_act )
897         { /* beginning of action switch */
898                         case 0: /* must back up */
899                         /* undo the effects of YY_DO_BEFORE_ACTION */
900                         *yy_cp = yyg->yy_hold_char;
901                         yy_cp = yyg->yy_last_accepting_cpos;
902                         yy_current_state = yyg->yy_last_accepting_state;
903                         goto yy_find_action;
904
905 case 1:
906 YY_RULE_SETUP
907 #line 118 "scanner.l"
908
909         YY_BREAK
910 case 2:
911 YY_RULE_SETUP
912 #line 119 "scanner.l"
913 { yylval->i   = strtol(yytext, NULL, 10);    ADD_TOKEN; return TOK_INT; }
914         YY_BREAK
915 case 3:
916 YY_RULE_SETUP
917 #line 120 "scanner.l"
918 { yylval->r   = strtod(yytext, NULL);        ADD_TOKEN; return TOK_REAL; }
919         YY_BREAK
920 case 4:
921 YY_RULE_SETUP
922 #line 121 "scanner.l"
923 { yylval->str = gmx_strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR;  }
924         YY_BREAK
925 case 5:
926 /* rule 5 can match eol */
927 YY_RULE_SETUP
928 #line 123 "scanner.l"
929 { _gmx_sel_lexer_add_token(" ", 1, state); }
930         YY_BREAK
931 case 6:
932 /* rule 6 can match eol */
933 YY_RULE_SETUP
934 #line 124 "scanner.l"
935 {
936                     if (yytext[0] == ';' || state->bInteractive)
937                     {
938                         rtrim(state->pselstr);
939                         state->bCmdStart = true;
940                         return CMD_SEP;
941                     }
942                     else
943                     {
944                         _gmx_sel_lexer_add_token(" ", 1, state);
945                     }
946                 }
947         YY_BREAK
948 case YY_STATE_EOF(cmdstart):
949 #line 137 "scanner.l"
950 { state->bCmdStart = true; yyterminate(); }
951         YY_BREAK
952 case YY_STATE_EOF(INITIAL):
953 case YY_STATE_EOF(matchof):
954 case YY_STATE_EOF(matchbool):
955 case YY_STATE_EOF(help):
956 #line 138 "scanner.l"
957 { state->bCmdStart = true; return CMD_SEP; }
958         YY_BREAK
959 case 7:
960 YY_RULE_SETUP
961 #line 140 "scanner.l"
962 { if (YYSTATE == cmdstart) { BEGIN(help); } return HELP; }
963         YY_BREAK
964
965 case 8:
966 YY_RULE_SETUP
967 #line 142 "scanner.l"
968
969         YY_BREAK
970 case 9:
971 YY_RULE_SETUP
972 #line 143 "scanner.l"
973 { yylval->str = gmx_strndup(yytext, yyleng); return HELP_TOPIC; }
974         YY_BREAK
975 case 10:
976 /* rule 10 can match eol */
977 YY_RULE_SETUP
978 #line 144 "scanner.l"
979 { state->bCmdStart = true; return CMD_SEP; }
980         YY_BREAK
981 case 11:
982 YY_RULE_SETUP
983 #line 145 "scanner.l"
984 { return INVALID; }
985         YY_BREAK
986
987
988 case 12:
989 YY_RULE_SETUP
990 #line 149 "scanner.l"
991 { ADD_TOKEN; yylval->i = 1; return TOK_INT; }
992         YY_BREAK
993 case 13:
994 YY_RULE_SETUP
995 #line 150 "scanner.l"
996 { ADD_TOKEN; yylval->i = 0; return TOK_INT; }
997         YY_BREAK
998
999 case 14:
1000 YY_RULE_SETUP
1001 #line 152 "scanner.l"
1002 { ADD_TOKEN; return GROUP; }
1003         YY_BREAK
1004 case 15:
1005 YY_RULE_SETUP
1006 #line 153 "scanner.l"
1007 { ADD_TOKEN; return TO; }
1008         YY_BREAK
1009 case 16:
1010 YY_RULE_SETUP
1011 #line 154 "scanner.l"
1012 { ADD_TOKEN; BEGIN(0); return OF; }
1013         YY_BREAK
1014 case 17:
1015 YY_RULE_SETUP
1016 #line 155 "scanner.l"
1017 { ADD_TOKEN; return AND; }
1018         YY_BREAK
1019 case 18:
1020 YY_RULE_SETUP
1021 #line 156 "scanner.l"
1022 { ADD_TOKEN; return OR; }
1023         YY_BREAK
1024 case 19:
1025 YY_RULE_SETUP
1026 #line 157 "scanner.l"
1027 { ADD_TOKEN; return XOR; }
1028         YY_BREAK
1029 case 20:
1030 YY_RULE_SETUP
1031 #line 158 "scanner.l"
1032 { ADD_TOKEN; return NOT; }
1033         YY_BREAK
1034 case 21:
1035 YY_RULE_SETUP
1036 #line 159 "scanner.l"
1037 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
1038         YY_BREAK
1039 case 22:
1040 YY_RULE_SETUP
1041 #line 161 "scanner.l"
1042 { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
1043         YY_BREAK
1044 case 23:
1045 YY_RULE_SETUP
1046 #line 163 "scanner.l"
1047 { _gmx_sel_lexer_add_token(" ", 1, state); }
1048         YY_BREAK
1049 case 24:
1050 YY_RULE_SETUP
1051 #line 164 "scanner.l"
1052 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
1053         YY_BREAK
1054 case 25:
1055 YY_RULE_SETUP
1056 #line 165 "scanner.l"
1057 { ADD_TOKEN; return yytext[0]; }
1058         YY_BREAK
1059 case 26:
1060 YY_RULE_SETUP
1061 #line 166 "scanner.l"
1062 YY_FATAL_ERROR( "flex scanner jammed" );
1063         YY_BREAK
1064 #line 1065 "scanner.cpp"
1065
1066         case YY_END_OF_BUFFER:
1067                 {
1068                 /* Amount of text matched not including the EOB char. */
1069                 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1070
1071                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1072                 *yy_cp = yyg->yy_hold_char;
1073                 YY_RESTORE_YY_MORE_OFFSET
1074
1075                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1076                         {
1077                         /* We're scanning a new file or input source.  It's
1078                          * possible that this happened because the user
1079                          * just pointed yyin at a new source and called
1080                          * _gmx_sel_yylex().  If so, then we have to assure
1081                          * consistency between YY_CURRENT_BUFFER and our
1082                          * globals.  Here is the right place to do so, because
1083                          * this is the first action (other than possibly a
1084                          * back-up) that will match for the new input source.
1085                          */
1086                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1087                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1088                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1089                         }
1090
1091                 /* Note that here we test for yy_c_buf_p "<=" to the position
1092                  * of the first EOB in the buffer, since yy_c_buf_p will
1093                  * already have been incremented past the NUL character
1094                  * (since all states make transitions on EOB to the
1095                  * end-of-buffer state).  Contrast this with the test
1096                  * in input().
1097                  */
1098                 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1099                         { /* This was really a NUL. */
1100                         yy_state_type yy_next_state;
1101
1102                         yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1103
1104                         yy_current_state = yy_get_previous_state( yyscanner );
1105
1106                         /* Okay, we're now positioned to make the NUL
1107                          * transition.  We couldn't have
1108                          * yy_get_previous_state() go ahead and do it
1109                          * for us because it doesn't know how to deal
1110                          * with the possibility of jamming (and we don't
1111                          * want to build jamming into it because then it
1112                          * will run more slowly).
1113                          */
1114
1115                         yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1116
1117                         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1118
1119                         if ( yy_next_state )
1120                                 {
1121                                 /* Consume the NUL. */
1122                                 yy_cp = ++yyg->yy_c_buf_p;
1123                                 yy_current_state = yy_next_state;
1124                                 goto yy_match;
1125                                 }
1126
1127                         else
1128                                 {
1129                                 yy_cp = yyg->yy_last_accepting_cpos;
1130                                 yy_current_state = yyg->yy_last_accepting_state;
1131                                 goto yy_find_action;
1132                                 }
1133                         }
1134
1135                 else switch ( yy_get_next_buffer( yyscanner ) )
1136                         {
1137                         case EOB_ACT_END_OF_FILE:
1138                                 {
1139                                 yyg->yy_did_buffer_switch_on_eof = 0;
1140
1141                                 if ( _gmx_sel_yywrap(yyscanner ) )
1142                                         {
1143                                         /* Note: because we've taken care in
1144                                          * yy_get_next_buffer() to have set up
1145                                          * yytext, we can now set up
1146                                          * yy_c_buf_p so that if some total
1147                                          * hoser (like flex itself) wants to
1148                                          * call the scanner after we return the
1149                                          * YY_NULL, it'll still work - another
1150                                          * YY_NULL will get returned.
1151                                          */
1152                                         yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1153
1154                                         yy_act = YY_STATE_EOF(YY_START);
1155                                         goto do_action;
1156                                         }
1157
1158                                 else
1159                                         {
1160                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
1161                                                 YY_NEW_FILE;
1162                                         }
1163                                 break;
1164                                 }
1165
1166                         case EOB_ACT_CONTINUE_SCAN:
1167                                 yyg->yy_c_buf_p =
1168                                         yyg->yytext_ptr + yy_amount_of_matched_text;
1169
1170                                 yy_current_state = yy_get_previous_state( yyscanner );
1171
1172                                 yy_cp = yyg->yy_c_buf_p;
1173                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1174                                 goto yy_match;
1175
1176                         case EOB_ACT_LAST_MATCH:
1177                                 yyg->yy_c_buf_p =
1178                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1179
1180                                 yy_current_state = yy_get_previous_state( yyscanner );
1181
1182                                 yy_cp = yyg->yy_c_buf_p;
1183                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1184                                 goto yy_find_action;
1185                         }
1186                 break;
1187                 }
1188
1189         default:
1190                 YY_FATAL_ERROR(
1191                         "fatal flex scanner internal error--no action found" );
1192         } /* end of action switch */
1193                 } /* end of scanning one token */
1194 } /* end of _gmx_sel_yylex */
1195
1196 /* yy_get_next_buffer - try to read in a new buffer
1197  *
1198  * Returns a code representing an action:
1199  *      EOB_ACT_LAST_MATCH -
1200  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1201  *      EOB_ACT_END_OF_FILE - end of file
1202  */
1203 static int yy_get_next_buffer (yyscan_t yyscanner)
1204 {
1205     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1206         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1207         register char *source = yyg->yytext_ptr;
1208         register int number_to_move, i;
1209         int ret_val;
1210
1211         if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1212                 YY_FATAL_ERROR(
1213                 "fatal flex scanner internal error--end of buffer missed" );
1214
1215         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1216                 { /* Don't try to fill the buffer, so this is an EOF. */
1217                 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1218                         {
1219                         /* We matched a single character, the EOB, so
1220                          * treat this as a final EOF.
1221                          */
1222                         return EOB_ACT_END_OF_FILE;
1223                         }
1224
1225                 else
1226                         {
1227                         /* We matched some text prior to the EOB, first
1228                          * process it.
1229                          */
1230                         return EOB_ACT_LAST_MATCH;
1231                         }
1232                 }
1233
1234         /* Try to read more data. */
1235
1236         /* First move last chars to start of buffer. */
1237         number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1238
1239         for ( i = 0; i < number_to_move; ++i )
1240                 *(dest++) = *(source++);
1241
1242         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1243                 /* don't do the read, it's not guaranteed to return an EOF,
1244                  * just force an EOF
1245                  */
1246                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1247
1248         else
1249                 {
1250                         yy_size_t num_to_read =
1251                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1252
1253                 while ( num_to_read <= 0 )
1254                         { /* Not enough room in the buffer - grow it. */
1255
1256                         /* just a shorter name for the current buffer */
1257                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1258
1259                         int yy_c_buf_p_offset =
1260                                 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1261
1262                         if ( b->yy_is_our_buffer )
1263                                 {
1264                                 yy_size_t new_size = b->yy_buf_size * 2;
1265
1266                                 if ( new_size <= 0 )
1267                                         b->yy_buf_size += b->yy_buf_size / 8;
1268                                 else
1269                                         b->yy_buf_size *= 2;
1270
1271                                 b->yy_ch_buf = (char *)
1272                                         /* Include room in for 2 EOB chars. */
1273                                         _gmx_sel_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1274                                 }
1275                         else
1276                                 /* Can't grow it, we don't own it. */
1277                                 b->yy_ch_buf = 0;
1278
1279                         if ( ! b->yy_ch_buf )
1280                                 YY_FATAL_ERROR(
1281                                 "fatal error - scanner input buffer overflow" );
1282
1283                         yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1284
1285                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1286                                                 number_to_move - 1;
1287
1288                         }
1289
1290                 if ( num_to_read > YY_READ_BUF_SIZE )
1291                         num_to_read = YY_READ_BUF_SIZE;
1292
1293                 /* Read in more data. */
1294                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1295                         yyg->yy_n_chars, num_to_read );
1296
1297                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1298                 }
1299
1300         if ( yyg->yy_n_chars == 0 )
1301                 {
1302                 if ( number_to_move == YY_MORE_ADJ )
1303                         {
1304                         ret_val = EOB_ACT_END_OF_FILE;
1305                         _gmx_sel_yyrestart(yyin  ,yyscanner);
1306                         }
1307
1308                 else
1309                         {
1310                         ret_val = EOB_ACT_LAST_MATCH;
1311                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1312                                 YY_BUFFER_EOF_PENDING;
1313                         }
1314                 }
1315
1316         else
1317                 ret_val = EOB_ACT_CONTINUE_SCAN;
1318
1319         if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1320                 /* Extend the array by 50%, plus the number we really need. */
1321                 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1322                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _gmx_sel_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1323                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1324                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1325         }
1326
1327         yyg->yy_n_chars += number_to_move;
1328         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1329         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1330
1331         yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1332
1333         return ret_val;
1334 }
1335
1336 /* yy_get_previous_state - get the state just before the EOB char was reached */
1337
1338     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1339 {
1340         register yy_state_type yy_current_state;
1341         register char *yy_cp;
1342     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1343
1344         yy_current_state = yyg->yy_start;
1345
1346         for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1347                 {
1348                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1349                 if ( yy_accept[yy_current_state] )
1350                         {
1351                         yyg->yy_last_accepting_state = yy_current_state;
1352                         yyg->yy_last_accepting_cpos = yy_cp;
1353                         }
1354                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1355                         {
1356                         yy_current_state = (int) yy_def[yy_current_state];
1357                         if ( yy_current_state >= 89 )
1358                                 yy_c = yy_meta[(unsigned int) yy_c];
1359                         }
1360                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1361                 }
1362
1363         return yy_current_state;
1364 }
1365
1366 /* yy_try_NUL_trans - try to make a transition on the NUL character
1367  *
1368  * synopsis
1369  *      next_state = yy_try_NUL_trans( current_state );
1370  */
1371     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1372 {
1373         register int yy_is_jam;
1374     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1375         register char *yy_cp = yyg->yy_c_buf_p;
1376
1377         register YY_CHAR yy_c = 1;
1378         if ( yy_accept[yy_current_state] )
1379                 {
1380                 yyg->yy_last_accepting_state = yy_current_state;
1381                 yyg->yy_last_accepting_cpos = yy_cp;
1382                 }
1383         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1384                 {
1385                 yy_current_state = (int) yy_def[yy_current_state];
1386                 if ( yy_current_state >= 89 )
1387                         yy_c = yy_meta[(unsigned int) yy_c];
1388                 }
1389         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1390         yy_is_jam = (yy_current_state == 88);
1391
1392         (void)yyg;
1393         return yy_is_jam ? 0 : yy_current_state;
1394 }
1395
1396     static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
1397 {
1398         register char *yy_cp;
1399     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1400
1401     yy_cp = yyg->yy_c_buf_p;
1402
1403         /* undo effects of setting up yytext */
1404         *yy_cp = yyg->yy_hold_char;
1405
1406         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1407                 { /* need to shift things up to make room */
1408                 /* +2 for EOB chars. */
1409                 register yy_size_t number_to_move = yyg->yy_n_chars + 2;
1410                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1411                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1412                 register char *source =
1413                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1414
1415                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1416                         *--dest = *--source;
1417
1418                 yy_cp += (int) (dest - source);
1419                 yy_bp += (int) (dest - source);
1420                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1421                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1422
1423                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1424                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1425                 }
1426
1427         *--yy_cp = (char) c;
1428
1429         yyg->yytext_ptr = yy_bp;
1430         yyg->yy_hold_char = *yy_cp;
1431         yyg->yy_c_buf_p = yy_cp;
1432 }
1433
1434 #ifndef YY_NO_INPUT
1435 #ifdef __cplusplus
1436     static int yyinput (yyscan_t yyscanner)
1437 #else
1438     static int input  (yyscan_t yyscanner)
1439 #endif
1440
1441 {
1442         int c;
1443     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1444
1445         *yyg->yy_c_buf_p = yyg->yy_hold_char;
1446
1447         if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1448                 {
1449                 /* yy_c_buf_p now points to the character we want to return.
1450                  * If this occurs *before* the EOB characters, then it's a
1451                  * valid NUL; if not, then we've hit the end of the buffer.
1452                  */
1453                 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1454                         /* This was really a NUL. */
1455                         *yyg->yy_c_buf_p = '\0';
1456
1457                 else
1458                         { /* need more input */
1459                         yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1460                         ++yyg->yy_c_buf_p;
1461
1462                         switch ( yy_get_next_buffer( yyscanner ) )
1463                                 {
1464                                 case EOB_ACT_LAST_MATCH:
1465                                         /* This happens because yy_g_n_b()
1466                                          * sees that we've accumulated a
1467                                          * token and flags that we need to
1468                                          * try matching the token before
1469                                          * proceeding.  But for input(),
1470                                          * there's no matching to consider.
1471                                          * So convert the EOB_ACT_LAST_MATCH
1472                                          * to EOB_ACT_END_OF_FILE.
1473                                          */
1474
1475                                         /* Reset buffer status. */
1476                                         _gmx_sel_yyrestart(yyin ,yyscanner);
1477
1478                                         /*FALLTHROUGH*/
1479
1480                                 case EOB_ACT_END_OF_FILE:
1481                                         {
1482                                         if ( _gmx_sel_yywrap(yyscanner ) )
1483                                                 return EOF;
1484
1485                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
1486                                                 YY_NEW_FILE;
1487 #ifdef __cplusplus
1488                                         return yyinput(yyscanner);
1489 #else
1490                                         return input(yyscanner);
1491 #endif
1492                                         }
1493
1494                                 case EOB_ACT_CONTINUE_SCAN:
1495                                         yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1496                                         break;
1497                                 }
1498                         }
1499                 }
1500
1501         c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1502         *yyg->yy_c_buf_p = '\0';        /* preserve yytext */
1503         yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1504
1505         return c;
1506 }
1507 #endif  /* ifndef YY_NO_INPUT */
1508
1509 /** Immediately switch to a different input stream.
1510  * @param input_file A readable stream.
1511  * @param yyscanner The scanner object.
1512  * @note This function does not reset the start condition to @c INITIAL .
1513  */
1514     void _gmx_sel_yyrestart  (FILE * input_file , yyscan_t yyscanner)
1515 {
1516     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1517
1518         if ( ! YY_CURRENT_BUFFER ){
1519         _gmx_sel_yyensure_buffer_stack (yyscanner);
1520                 YY_CURRENT_BUFFER_LVALUE =
1521             _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1522         }
1523
1524         _gmx_sel_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1525         _gmx_sel_yy_load_buffer_state(yyscanner );
1526 }
1527
1528 /** Switch to a different input buffer.
1529  * @param new_buffer The new input buffer.
1530  * @param yyscanner The scanner object.
1531  */
1532     void _gmx_sel_yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
1533 {
1534     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1535
1536         /* TODO. We should be able to replace this entire function body
1537          * with
1538          *              _gmx_sel_yypop_buffer_state();
1539          *              _gmx_sel_yypush_buffer_state(new_buffer);
1540      */
1541         _gmx_sel_yyensure_buffer_stack (yyscanner);
1542         if ( YY_CURRENT_BUFFER == new_buffer )
1543                 return;
1544
1545         if ( YY_CURRENT_BUFFER )
1546                 {
1547                 /* Flush out information for old buffer. */
1548                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1549                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1550                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1551                 }
1552
1553         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1554         _gmx_sel_yy_load_buffer_state(yyscanner );
1555
1556         /* We don't actually know whether we did this switch during
1557          * EOF (_gmx_sel_yywrap()) processing, but the only time this flag
1558          * is looked at is after _gmx_sel_yywrap() is called, so it's safe
1559          * to go ahead and always set it.
1560          */
1561         yyg->yy_did_buffer_switch_on_eof = 1;
1562 }
1563
1564 static void _gmx_sel_yy_load_buffer_state  (yyscan_t yyscanner)
1565 {
1566     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1567         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1568         yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1569         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1570         yyg->yy_hold_char = *yyg->yy_c_buf_p;
1571 }
1572
1573 /** Allocate and initialize an input buffer state.
1574  * @param file A readable stream.
1575  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1576  * @param yyscanner The scanner object.
1577  * @return the allocated buffer state.
1578  */
1579     YY_BUFFER_STATE _gmx_sel_yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
1580 {
1581         YY_BUFFER_STATE b;
1582     
1583         b = (YY_BUFFER_STATE) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1584         if ( ! b )
1585                 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1586
1587         b->yy_buf_size = size;
1588
1589         /* yy_ch_buf has to be 2 characters longer than the size given because
1590          * we need to put in 2 end-of-buffer characters.
1591          */
1592         b->yy_ch_buf = (char *) _gmx_sel_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1593         if ( ! b->yy_ch_buf )
1594                 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_create_buffer()" );
1595
1596         b->yy_is_our_buffer = 1;
1597
1598         _gmx_sel_yy_init_buffer(b,file ,yyscanner);
1599
1600         return b;
1601 }
1602
1603 /** Destroy the buffer.
1604  * @param b a buffer created with _gmx_sel_yy_create_buffer()
1605  * @param yyscanner The scanner object.
1606  */
1607     void _gmx_sel_yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1608 {
1609     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1610
1611         if ( ! b )
1612                 return;
1613
1614         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1615                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1616
1617         if ( b->yy_is_our_buffer )
1618                 _gmx_sel_yyfree((void *) b->yy_ch_buf ,yyscanner );
1619
1620         _gmx_sel_yyfree((void *) b ,yyscanner );
1621 }
1622
1623 /* Initializes or reinitializes a buffer.
1624  * This function is sometimes called more than once on the same buffer,
1625  * such as during a _gmx_sel_yyrestart() or at EOF.
1626  */
1627     static void _gmx_sel_yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
1628
1629 {
1630         int oerrno = errno;
1631     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1632
1633         _gmx_sel_yy_flush_buffer(b ,yyscanner);
1634
1635         b->yy_input_file = file;
1636         b->yy_fill_buffer = 1;
1637
1638     /* If b is the current buffer, then _gmx_sel_yy_init_buffer was _probably_
1639      * called from _gmx_sel_yyrestart() or through yy_get_next_buffer.
1640      * In that case, we don't want to reset the lineno or column.
1641      */
1642     if (b != YY_CURRENT_BUFFER){
1643         b->yy_bs_lineno = 1;
1644         b->yy_bs_column = 0;
1645     }
1646
1647         b->yy_is_interactive = 0;
1648     
1649         errno = oerrno;
1650 }
1651
1652 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1653  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1654  * @param yyscanner The scanner object.
1655  */
1656     void _gmx_sel_yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
1657 {
1658     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1659         if ( ! b )
1660                 return;
1661
1662         b->yy_n_chars = 0;
1663
1664         /* We always need two end-of-buffer characters.  The first causes
1665          * a transition to the end-of-buffer state.  The second causes
1666          * a jam in that state.
1667          */
1668         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1669         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1670
1671         b->yy_buf_pos = &b->yy_ch_buf[0];
1672
1673         b->yy_at_bol = 1;
1674         b->yy_buffer_status = YY_BUFFER_NEW;
1675
1676         if ( b == YY_CURRENT_BUFFER )
1677                 _gmx_sel_yy_load_buffer_state(yyscanner );
1678 }
1679
1680 /** Pushes the new state onto the stack. The new state becomes
1681  *  the current state. This function will allocate the stack
1682  *  if necessary.
1683  *  @param new_buffer The new state.
1684  *  @param yyscanner The scanner object.
1685  */
1686 void _gmx_sel_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1687 {
1688     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1689         if (new_buffer == NULL)
1690                 return;
1691
1692         _gmx_sel_yyensure_buffer_stack(yyscanner);
1693
1694         /* This block is copied from _gmx_sel_yy_switch_to_buffer. */
1695         if ( YY_CURRENT_BUFFER )
1696                 {
1697                 /* Flush out information for old buffer. */
1698                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1699                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1700                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1701                 }
1702
1703         /* Only push if top exists. Otherwise, replace top. */
1704         if (YY_CURRENT_BUFFER)
1705                 yyg->yy_buffer_stack_top++;
1706         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1707
1708         /* copied from _gmx_sel_yy_switch_to_buffer. */
1709         _gmx_sel_yy_load_buffer_state(yyscanner );
1710         yyg->yy_did_buffer_switch_on_eof = 1;
1711 }
1712
1713 /** Removes and deletes the top of the stack, if present.
1714  *  The next element becomes the new top.
1715  *  @param yyscanner The scanner object.
1716  */
1717 void _gmx_sel_yypop_buffer_state (yyscan_t yyscanner)
1718 {
1719     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1720         if (!YY_CURRENT_BUFFER)
1721                 return;
1722
1723         _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
1724         YY_CURRENT_BUFFER_LVALUE = NULL;
1725         if (yyg->yy_buffer_stack_top > 0)
1726                 --yyg->yy_buffer_stack_top;
1727
1728         if (YY_CURRENT_BUFFER) {
1729                 _gmx_sel_yy_load_buffer_state(yyscanner );
1730                 yyg->yy_did_buffer_switch_on_eof = 1;
1731         }
1732 }
1733
1734 /* Allocates the stack if it does not exist.
1735  *  Guarantees space for at least one push.
1736  */
1737 static void _gmx_sel_yyensure_buffer_stack (yyscan_t yyscanner)
1738 {
1739         yy_size_t num_to_alloc;
1740     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1741
1742         if (!yyg->yy_buffer_stack) {
1743
1744                 /* First allocation is just for 2 elements, since we don't know if this
1745                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1746                  * immediate realloc on the next call.
1747          */
1748                 num_to_alloc = 1;
1749                 yyg->yy_buffer_stack = (struct yy_buffer_state**)_gmx_sel_yyalloc
1750                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1751                                                                 , yyscanner);
1752                 if ( ! yyg->yy_buffer_stack )
1753                         YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1754                                                                   
1755                 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1756                                 
1757                 yyg->yy_buffer_stack_max = num_to_alloc;
1758                 yyg->yy_buffer_stack_top = 0;
1759                 return;
1760         }
1761
1762         if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1763
1764                 /* Increase the buffer to prepare for a possible push. */
1765                 int grow_size = 8 /* arbitrary grow size */;
1766
1767                 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1768                 yyg->yy_buffer_stack = (struct yy_buffer_state**)_gmx_sel_yyrealloc
1769                                                                 (yyg->yy_buffer_stack,
1770                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1771                                                                 , yyscanner);
1772                 if ( ! yyg->yy_buffer_stack )
1773                         YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yyensure_buffer_stack()" );
1774
1775                 /* zero only the new slots.*/
1776                 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1777                 yyg->yy_buffer_stack_max = num_to_alloc;
1778         }
1779 }
1780
1781 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1782  * @param base the character buffer
1783  * @param size the size in bytes of the character buffer
1784  * @param yyscanner The scanner object.
1785  * @return the newly allocated buffer state object. 
1786  */
1787 YY_BUFFER_STATE _gmx_sel_yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
1788 {
1789         YY_BUFFER_STATE b;
1790     
1791         if ( size < 2 ||
1792              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1793              base[size-1] != YY_END_OF_BUFFER_CHAR )
1794                 /* They forgot to leave room for the EOB's. */
1795                 return 0;
1796
1797         b = (YY_BUFFER_STATE) _gmx_sel_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1798         if ( ! b )
1799                 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_buffer()" );
1800
1801         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1802         b->yy_buf_pos = b->yy_ch_buf = base;
1803         b->yy_is_our_buffer = 0;
1804         b->yy_input_file = 0;
1805         b->yy_n_chars = b->yy_buf_size;
1806         b->yy_is_interactive = 0;
1807         b->yy_at_bol = 1;
1808         b->yy_fill_buffer = 0;
1809         b->yy_buffer_status = YY_BUFFER_NEW;
1810
1811         _gmx_sel_yy_switch_to_buffer(b ,yyscanner );
1812
1813         return b;
1814 }
1815
1816 /** Setup the input buffer state to scan a string. The next call to _gmx_sel_yylex() will
1817  * scan from a @e copy of @a str.
1818  * @param yystr a NUL-terminated string to scan
1819  * @param yyscanner The scanner object.
1820  * @return the newly allocated buffer state object.
1821  * @note If you want to scan bytes that may contain NUL values, then use
1822  *       _gmx_sel_yy_scan_bytes() instead.
1823  */
1824 YY_BUFFER_STATE _gmx_sel_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1825 {
1826     
1827         return _gmx_sel_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1828 }
1829
1830 /** Setup the input buffer state to scan the given bytes. The next call to _gmx_sel_yylex() will
1831  * scan from a @e copy of @a bytes.
1832  * @param yybytes the byte buffer to scan
1833  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1834  * @param yyscanner The scanner object.
1835  * @return the newly allocated buffer state object.
1836  */
1837 YY_BUFFER_STATE _gmx_sel_yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
1838 {
1839         YY_BUFFER_STATE b;
1840         char *buf;
1841         yy_size_t n;
1842         yy_size_t i;
1843     
1844         /* Get memory for full buffer, including space for trailing EOB's. */
1845         n = _yybytes_len + 2;
1846         buf = (char *) _gmx_sel_yyalloc(n ,yyscanner );
1847         if ( ! buf )
1848                 YY_FATAL_ERROR( "out of dynamic memory in _gmx_sel_yy_scan_bytes()" );
1849
1850         for ( i = 0; i < _yybytes_len; ++i )
1851                 buf[i] = yybytes[i];
1852
1853         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1854
1855         b = _gmx_sel_yy_scan_buffer(buf,n ,yyscanner);
1856         if ( ! b )
1857                 YY_FATAL_ERROR( "bad buffer in _gmx_sel_yy_scan_bytes()" );
1858
1859         /* It's okay to grow etc. this buffer, and we should throw it
1860          * away when we're done.
1861          */
1862         b->yy_is_our_buffer = 1;
1863
1864         return b;
1865 }
1866
1867 #ifndef YY_EXIT_FAILURE
1868 #define YY_EXIT_FAILURE 2
1869 #endif
1870
1871 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
1872 {
1873         (void) fprintf( stderr, "%s\n", msg );
1874         exit( YY_EXIT_FAILURE );
1875 }
1876
1877 /* Redefine yyless() so it works in section 3 code. */
1878
1879 #undef yyless
1880 #define yyless(n) \
1881         do \
1882                 { \
1883                 /* Undo effects of setting up yytext. */ \
1884         int yyless_macro_arg = (n); \
1885         YY_LESS_LINENO(yyless_macro_arg);\
1886                 yytext[yyleng] = yyg->yy_hold_char; \
1887                 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
1888                 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
1889                 *yyg->yy_c_buf_p = '\0'; \
1890                 yyleng = yyless_macro_arg; \
1891                 } \
1892         while ( 0 )
1893
1894 /* Accessor  methods (get/set functions) to struct members. */
1895
1896 /** Get the user-defined data for this scanner.
1897  * @param yyscanner The scanner object.
1898  */
1899 YY_EXTRA_TYPE _gmx_sel_yyget_extra  (yyscan_t yyscanner)
1900 {
1901     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1902     return yyextra;
1903 }
1904
1905 /** Get the current line number.
1906  * @param yyscanner The scanner object.
1907  */
1908 int _gmx_sel_yyget_lineno  (yyscan_t yyscanner)
1909 {
1910     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1911     
1912         if (! YY_CURRENT_BUFFER)
1913             return 0;
1914     
1915     return yylineno;
1916 }
1917
1918 /** Get the current column number.
1919  * @param yyscanner The scanner object.
1920  */
1921 int _gmx_sel_yyget_column  (yyscan_t yyscanner)
1922 {
1923     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1924     
1925         if (! YY_CURRENT_BUFFER)
1926             return 0;
1927     
1928     return yycolumn;
1929 }
1930
1931 /** Get the input stream.
1932  * @param yyscanner The scanner object.
1933  */
1934 FILE *_gmx_sel_yyget_in  (yyscan_t yyscanner)
1935 {
1936     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1937     return yyin;
1938 }
1939
1940 /** Get the output stream.
1941  * @param yyscanner The scanner object.
1942  */
1943 FILE *_gmx_sel_yyget_out  (yyscan_t yyscanner)
1944 {
1945     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1946     return yyout;
1947 }
1948
1949 /** Get the length of the current token.
1950  * @param yyscanner The scanner object.
1951  */
1952 yy_size_t _gmx_sel_yyget_leng  (yyscan_t yyscanner)
1953 {
1954     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1955     return yyleng;
1956 }
1957
1958 /** Get the current token.
1959  * @param yyscanner The scanner object.
1960  */
1961
1962 char *_gmx_sel_yyget_text  (yyscan_t yyscanner)
1963 {
1964     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1965     return yytext;
1966 }
1967
1968 /** Set the user-defined data. This data is never touched by the scanner.
1969  * @param user_defined The data to be associated with this scanner.
1970  * @param yyscanner The scanner object.
1971  */
1972 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
1973 {
1974     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1975     yyextra = user_defined ;
1976 }
1977
1978 /** Set the current line number.
1979  * @param line_number
1980  * @param yyscanner The scanner object.
1981  */
1982 void _gmx_sel_yyset_lineno (int  line_number , yyscan_t yyscanner)
1983 {
1984     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1985
1986         /* lineno is only valid if an input buffer exists. */
1987         if (! YY_CURRENT_BUFFER )
1988            YY_FATAL_ERROR( "_gmx_sel_yyset_lineno called with no buffer" );
1989     
1990     yylineno = line_number;
1991 }
1992
1993 /** Set the current column.
1994  * @param line_number
1995  * @param yyscanner The scanner object.
1996  */
1997 void _gmx_sel_yyset_column (int  column_no , yyscan_t yyscanner)
1998 {
1999     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2000
2001         /* column is only valid if an input buffer exists. */
2002         if (! YY_CURRENT_BUFFER )
2003            YY_FATAL_ERROR( "_gmx_sel_yyset_column called with no buffer" );
2004     
2005     yycolumn = column_no;
2006 }
2007
2008 /** Set the input stream. This does not discard the current
2009  * input buffer.
2010  * @param in_str A readable stream.
2011  * @param yyscanner The scanner object.
2012  * @see _gmx_sel_yy_switch_to_buffer
2013  */
2014 void _gmx_sel_yyset_in (FILE *  in_str , yyscan_t yyscanner)
2015 {
2016     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2017     yyin = in_str ;
2018 }
2019
2020 void _gmx_sel_yyset_out (FILE *  out_str , yyscan_t yyscanner)
2021 {
2022     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2023     yyout = out_str ;
2024 }
2025
2026 int _gmx_sel_yyget_debug  (yyscan_t yyscanner)
2027 {
2028     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2029     return yy_flex_debug;
2030 }
2031
2032 void _gmx_sel_yyset_debug (int  bdebug , yyscan_t yyscanner)
2033 {
2034     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2035     yy_flex_debug = bdebug ;
2036 }
2037
2038 /* Accessor methods for yylval and yylloc */
2039
2040 /* User-visible API */
2041
2042 /* _gmx_sel_yylex_init is special because it creates the scanner itself, so it is
2043  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2044  * That's why we explicitly handle the declaration, instead of using our macros.
2045  */
2046
2047 int _gmx_sel_yylex_init(yyscan_t* ptr_yy_globals)
2048
2049 {
2050     if (ptr_yy_globals == NULL){
2051         errno = EINVAL;
2052         return 1;
2053     }
2054
2055     *ptr_yy_globals = (yyscan_t) _gmx_sel_yyalloc ( sizeof( struct yyguts_t ), NULL );
2056
2057     if (*ptr_yy_globals == NULL){
2058         errno = ENOMEM;
2059         return 1;
2060     }
2061
2062     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2063     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2064
2065     return yy_init_globals ( *ptr_yy_globals );
2066 }
2067
2068 /* _gmx_sel_yylex_init_extra has the same functionality as _gmx_sel_yylex_init, but follows the
2069  * convention of taking the scanner as the last argument. Note however, that
2070  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2071  * is the reason, too, why this function also must handle its own declaration).
2072  * The user defined value in the first argument will be available to _gmx_sel_yyalloc in
2073  * the yyextra field.
2074  */
2075
2076 int _gmx_sel_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2077
2078 {
2079     struct yyguts_t dummy_yyguts;
2080
2081     _gmx_sel_yyset_extra (yy_user_defined, &dummy_yyguts);
2082
2083     if (ptr_yy_globals == NULL){
2084         errno = EINVAL;
2085         return 1;
2086     }
2087         
2088     *ptr_yy_globals = (yyscan_t) _gmx_sel_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2089         
2090     if (*ptr_yy_globals == NULL){
2091         errno = ENOMEM;
2092         return 1;
2093     }
2094     
2095     /* By setting to 0xAA, we expose bugs in
2096     yy_init_globals. Leave at 0x00 for releases. */
2097     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2098     
2099     _gmx_sel_yyset_extra (yy_user_defined, *ptr_yy_globals);
2100     
2101     return yy_init_globals ( *ptr_yy_globals );
2102 }
2103
2104 static int yy_init_globals (yyscan_t yyscanner)
2105 {
2106     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2107     /* Initialization is the same as for the non-reentrant scanner.
2108      * This function is called from _gmx_sel_yylex_destroy(), so don't allocate here.
2109      */
2110
2111     yyg->yy_buffer_stack = 0;
2112     yyg->yy_buffer_stack_top = 0;
2113     yyg->yy_buffer_stack_max = 0;
2114     yyg->yy_c_buf_p = (char *) 0;
2115     yyg->yy_init = 0;
2116     yyg->yy_start = 0;
2117
2118     yyg->yy_start_stack_ptr = 0;
2119     yyg->yy_start_stack_depth = 0;
2120     yyg->yy_start_stack =  NULL;
2121
2122 /* Defined in main.c */
2123 #ifdef YY_STDINIT
2124     yyin = stdin;
2125     yyout = stdout;
2126 #else
2127     yyin = (FILE *) 0;
2128     yyout = (FILE *) 0;
2129 #endif
2130
2131     /* For future reference: Set errno on error, since we are called by
2132      * _gmx_sel_yylex_init()
2133      */
2134     return 0;
2135 }
2136
2137 /* _gmx_sel_yylex_destroy is for both reentrant and non-reentrant scanners. */
2138 int _gmx_sel_yylex_destroy  (yyscan_t yyscanner)
2139 {
2140     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2141
2142     /* Pop the buffer stack, destroying each element. */
2143         while(YY_CURRENT_BUFFER){
2144                 _gmx_sel_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2145                 YY_CURRENT_BUFFER_LVALUE = NULL;
2146                 _gmx_sel_yypop_buffer_state(yyscanner);
2147         }
2148
2149         /* Destroy the stack itself. */
2150         _gmx_sel_yyfree(yyg->yy_buffer_stack ,yyscanner);
2151         yyg->yy_buffer_stack = NULL;
2152
2153     /* Destroy the start condition stack. */
2154         _gmx_sel_yyfree(yyg->yy_start_stack ,yyscanner );
2155         yyg->yy_start_stack = NULL;
2156
2157     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2158      * _gmx_sel_yylex() is called, initialization will occur. */
2159     yy_init_globals( yyscanner);
2160
2161     /* Destroy the main struct (reentrant only). */
2162     _gmx_sel_yyfree ( yyscanner , yyscanner );
2163     yyscanner = NULL;
2164     return 0;
2165 }
2166
2167 /*
2168  * Internal utility routines.
2169  */
2170
2171 #ifndef yytext_ptr
2172 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2173 {
2174         register int i;
2175         for ( i = 0; i < n; ++i )
2176                 s1[i] = s2[i];
2177 }
2178 #endif
2179
2180 #ifdef YY_NEED_STRLEN
2181 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2182 {
2183         register int n;
2184         for ( n = 0; s[n]; ++n )
2185                 ;
2186
2187         return n;
2188 }
2189 #endif
2190
2191 void *_gmx_sel_yyalloc (yy_size_t  size , yyscan_t yyscanner)
2192 {
2193         return (void *) malloc( size );
2194 }
2195
2196 void *_gmx_sel_yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
2197 {
2198         /* The cast to (char *) in the following accommodates both
2199          * implementations that use char* generic pointers, and those
2200          * that use void* generic pointers.  It works with the latter
2201          * because both ANSI C and C++ allow castless assignment from
2202          * any pointer type to void*, and deal with argument conversions
2203          * as though doing an assignment.
2204          */
2205         return (void *) realloc( (char *) ptr, size );
2206 }
2207
2208 void _gmx_sel_yyfree (void * ptr , yyscan_t yyscanner)
2209 {
2210         free( (char *) ptr );   /* see _gmx_sel_yyrealloc() for (char *) cast */
2211 }
2212
2213 #define YYTABLES_NAME "yytables"
2214
2215 #line 166 "scanner.l"