de74a3d8a80c6e266a9e3ce43b7960e1988612b6
[alexxy/gromacs.git] / src / gmxlib / selection / scanner.c
1 #line 2 "scanner.c"
2
3 #line 4 "scanner.c"
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 35
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 #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.
166  */
167 #define YY_BUF_SIZE 32768
168 #else
169 #define YY_BUF_SIZE 16384
170 #endif /* __ia64__ */
171 #endif
172
173 /* The state buf must be large enough to hold one state per character in the main buffer.
174  */
175 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
176
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
181
182 #define EOB_ACT_CONTINUE_SCAN 0
183 #define EOB_ACT_END_OF_FILE 1
184 #define EOB_ACT_LAST_MATCH 2
185
186     #define YY_LESS_LINENO(n)
187     
188 /* Return all but the first "n" matched characters back to the input stream. */
189 #define yyless(n) \
190         do \
191                 { \
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 */ \
199                 } \
200         while ( 0 )
201
202 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
203
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef size_t yy_size_t;
207 #endif
208
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
212         {
213         FILE *yy_input_file;
214
215         char *yy_ch_buf;                /* input buffer */
216         char *yy_buf_pos;               /* current position in input buffer */
217
218         /* Size of input buffer in bytes, not including room for EOB
219          * characters.
220          */
221         yy_size_t yy_buf_size;
222
223         /* Number of characters read into yy_ch_buf, not including EOB
224          * characters.
225          */
226         int yy_n_chars;
227
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.
231          */
232         int yy_is_our_buffer;
233
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.
238          */
239         int yy_is_interactive;
240
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.
244          */
245         int yy_at_bol;
246
247     int yy_bs_lineno; /**< The line count. */
248     int yy_bs_column; /**< The column count. */
249     
250         /* Whether to try to fill the input buffer when we reach the
251          * end of it.
252          */
253         int yy_fill_buffer;
254
255         int yy_buffer_status;
256
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.
264          *
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.
268          */
269 #define YY_BUFFER_EOF_PENDING 2
270
271         };
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
273
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".
277  *
278  * Returns the top of the stack, or NULL.
279  */
280 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
281                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
282                           : NULL)
283
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.
286  */
287 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
288
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 );
296
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 );
300
301 #define YY_FLUSH_BUFFER _gmx_sel_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
302
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 );
306
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 );
310
311 #define yy_new_buffer _gmx_sel_yy_create_buffer
312
313 #define yy_set_interactive(is_interactive) \
314         { \
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); \
319         } \
320         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321         }
322
323 #define yy_set_bol(at_bol) \
324         { \
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); \
329         } \
330         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331         }
332
333 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
334
335 #define _gmx_sel_yywrap(n) 1
336 #define YY_SKIP_YYWRAP
337
338 typedef unsigned char YY_CHAR;
339
340 typedef int yy_state_type;
341
342 #define yytext_ptr yytext_r
343
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 );
348
349 /* Done after the current pattern has been matched and before the
350  * corresponding action - sets up yytext.
351  */
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;
358
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
364         {
365         flex_int32_t yy_verify;
366         flex_int32_t yy_nxt;
367         };
368 static yyconst flex_int16_t yy_accept[89] =
369     {   0,
370         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
371        27,   25,   23,    6,   20,   25,    1,   25,   25,    2,
372         6,   21,   25,   22,   25,   24,   22,   22,   22,   22,
373        22,   22,   25,   22,   22,   22,   22,   22,   11,    8,
374        10,   10,    9,   23,   21,    0,    4,    0,    1,   17,
375         3,    3,    2,   24,   24,   22,    5,   22,   22,   22,
376        18,   15,   22,   18,   16,   13,   22,   12,   22,   22,
377         8,    9,    0,    0,    3,   17,   22,   20,   19,   13,
378        22,    0,    3,    3,   22,    7,   14,    0
379     } ;
380
381 static yyconst flex_int32_t yy_ec[256] =
382     {   0,
383         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
384         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
385         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
386         1,    2,    4,    5,    6,    1,    1,    7,    1,    1,
387         1,    1,    8,    1,    8,    9,    1,   10,   10,   10,
388        10,   10,   10,   10,   10,   10,   10,    1,   11,   12,
389        13,   12,    1,    1,   14,   14,   14,   14,   15,   14,
390        14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
391        14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
392         1,   16,    1,    1,   17,    1,   18,   14,   14,   19,
393
394        20,   21,   22,   23,   14,   14,   14,   24,   14,   25,
395        26,   27,   14,   28,   29,   30,   31,   14,   14,   32,
396        33,   14,    1,   34,    1,    1,    1,    1,    1,    1,
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,    1,    1,    1,    1,    1,
403         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
404
405         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
406         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
411     } ;
412
413 static yyconst flex_int32_t yy_meta[35] =
414     {   0,
415         1,    1,    2,    1,    1,    1,    1,    1,    3,    4,
416         1,    1,    1,    4,    4,    1,    4,    4,    4,    4,
417         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
418         4,    4,    4,    1
419     } ;
420
421 static yyconst flex_int16_t yy_base[94] =
422     {   0,
423         0,    0,  131,  130,   10,   12,  132,  131,   45,    0,
424       153,  158,  150,  158,  138,   75,    0,  143,  139,   72,
425       158,  135,  134,    0,  143,  136,  119,  115,  116,  113,
426       114,  113,  104,   62,  111,   68,  116,  115,  158,  132,
427       158,  158,    0,  131,  158,   79,  158,  127,    0,  158,
428        84,   87,   91,  122,   31,    0,  158,  111,  103,   98,
429         0,    0,   99,  158,    0,   96,  104,    0,   95,   99,
430       120,    0,   34,  107,   76,    0,   82,    0,    0,    0,
431        83,   99,   98,   95,   76,    0,    0,  158,  111,  115,
432       117,   94,   84
433
434     } ;
435
436 static yyconst flex_int16_t yy_def[94] =
437     {   0,
438        88,    1,    1,    1,    1,    1,    1,    1,   88,    9,
439        88,   88,   88,   88,   88,   89,   90,   88,   88,   91,
440        88,   88,   88,   92,   88,   91,   92,   92,   92,   92,
441        92,   92,   88,   92,   92,   92,   92,   92,   88,   88,
442        88,   88,   93,   88,   88,   89,   88,   88,   90,   88,
443        88,   88,   91,   91,   91,   92,   88,   92,   92,   92,
444        92,   92,   92,   88,   92,   92,   92,   92,   92,   92,
445        88,   93,   88,   88,   91,   92,   92,   92,   92,   92,
446        92,   88,   88,   88,   92,   92,   92,    0,   88,   88,
447        88,   88,   88
448
449     } ;
450
451 static yyconst flex_int16_t yy_nxt[193] =
452     {   0,
453        12,   13,   14,   15,   16,   17,   18,   12,   19,   20,
454        21,   22,   23,   24,   24,   25,   26,   27,   24,   24,
455        24,   28,   24,   24,   29,   30,   24,   24,   24,   31,
456        24,   32,   24,   33,   35,   36,   35,   36,   74,   88,
457        75,   82,   37,   83,   37,   39,   40,   41,   39,   39,
458        39,   39,   39,   39,   39,   42,   39,   39,   43,   43,
459        39,   39,   43,   43,   43,   43,   43,   43,   43,   43,
460        43,   43,   43,   43,   43,   43,   43,   43,   39,   47,
461        52,   53,   65,   47,   88,   75,   55,   72,   67,   61,
462        48,   55,   68,   51,   48,   61,   51,   56,   73,   52,
463
464        53,   73,   87,   73,   84,   55,   73,   83,   83,   86,
465        55,   46,   85,   46,   46,   49,   84,   49,   49,   54,
466        54,   71,   81,   68,   80,   78,   79,   78,   77,   76,
467        88,   46,   44,   71,   70,   69,   66,   64,   63,   62,
468        61,   60,   59,   58,   88,   57,   45,   45,   51,   50,
469        45,   44,   88,   38,   38,   34,   34,   11,   88,   88,
470        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
471        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
472        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
473        88,   88
474
475     } ;
476
477 static yyconst flex_int16_t yy_chk[193] =
478     {   0,
479         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
480         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
481         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
482         1,    1,    1,    1,    5,    5,    6,    6,   55,   55,
483        55,   73,    5,   73,    6,    9,    9,    9,    9,    9,
484         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
485         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
486         9,    9,    9,    9,    9,    9,    9,    9,    9,   16,
487        20,   20,   34,   46,   75,   75,   20,   93,   36,   34,
488        16,   20,   36,   51,   46,   36,   52,   92,   51,   53,
489
490        53,   52,   85,   51,   84,   53,   52,   83,   82,   81,
491        53,   89,   77,   89,   89,   90,   74,   90,   90,   91,
492        91,   71,   70,   69,   67,   66,   63,   60,   59,   58,
493        54,   48,   44,   40,   38,   37,   35,   33,   32,   31,
494        30,   29,   28,   27,   26,   25,   23,   22,   19,   18,
495        15,   13,   11,    8,    7,    4,    3,   88,   88,   88,
496        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
497        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
498        88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
499        88,   88
500
501     } ;
502
503 /* The intent behind this definition is that it'll catch
504  * any uses of REJECT which flex missed.
505  */
506 #define REJECT reject_used_but_not_detected
507 #define yymore() yymore_used_but_not_detected
508 #define YY_MORE_ADJ 0
509 #define YY_RESTORE_YY_MORE_OFFSET
510 #line 1 "scanner.l"
511 /*
512  *
513  *                This source code is part of
514  *
515  *                 G   R   O   M   A   C   S
516  *
517  *          GROningen MAchine for Chemical Simulations
518  *
519  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
520  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
521  * Copyright (c) 2001-2009, The GROMACS development team,
522  * check out http://www.gromacs.org for more information.
523
524  * This program is free software; you can redistribute it and/or
525  * modify it under the terms of the GNU General Public License
526  * as published by the Free Software Foundation; either version 2
527  * of the License, or (at your option) any later version.
528  *
529  * If you want to redistribute modifications, please consider that
530  * scientific software is very special. Version control is crucial -
531  * bugs must be traceable. We will be happy to consider code for
532  * inclusion in the official distribution, but derived work must not
533  * be called official GROMACS. Details are found in the README & COPYING
534  * files - if they are missing, get the official version at www.gromacs.org.
535  *
536  * To help us fund GROMACS development, we humbly ask that you cite
537  * the papers on the package - you can find them in the top README file.
538  *
539  * For more info, check our website at http://www.gromacs.org
540  */
541 /*! \cond \internal \file scanner.l
542  * \brief
543  * Tokenizer for the selection language.
544  * \endcond
545  */
546 /*! \internal \file scanner.c
547  * \brief
548  * Generated (from scanner.l by Flex) tokenizer for the selection language.
549  */
550 #line 41 "scanner.l"
551 #ifdef HAVE_CONFIG_H
552 #include <config.h>
553 #endif
554
555 #include <string2.h>
556
557 #include "parser.h"
558 #include "scanner.h"
559 #include "scanner_internal.h"
560
561 /* This macro is here to make the actions a bit shorter, since nearly every
562  * action needs this call. */
563 #define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state)
564
565 #define YY_NO_UNISTD_H 1
566
567
568
569
570 #line 571 "scanner.c"
571
572 #define INITIAL 0
573 #define matchof 1
574 #define matchbool 2
575 #define cmdstart 3
576 #define help 4
577
578 #ifndef YY_NO_UNISTD_H
579 /* Special case for "unistd.h", since it is non-ANSI. We include it way
580  * down here because we want the user's section 1 to have been scanned first.
581  * The user has a chance to override it with an option.
582  */
583 #include <unistd.h>
584 #endif
585
586 #ifndef YY_EXTRA_TYPE
587 #define YY_EXTRA_TYPE void *
588 #endif
589
590 /* Holds the entire state of the reentrant scanner. */
591 struct yyguts_t
592     {
593
594     /* User-defined. Not touched by flex. */
595     YY_EXTRA_TYPE yyextra_r;
596
597     /* The rest are the same as the globals declared in the non-reentrant scanner. */
598     FILE *yyin_r, *yyout_r;
599     size_t yy_buffer_stack_top; /**< index of top of stack. */
600     size_t yy_buffer_stack_max; /**< capacity of stack. */
601     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
602     char yy_hold_char;
603     int yy_n_chars;
604     int yyleng_r;
605     char *yy_c_buf_p;
606     int yy_init;
607     int yy_start;
608     int yy_did_buffer_switch_on_eof;
609     int yy_start_stack_ptr;
610     int yy_start_stack_depth;
611     int *yy_start_stack;
612     yy_state_type yy_last_accepting_state;
613     char* yy_last_accepting_cpos;
614
615     int yylineno_r;
616     int yy_flex_debug_r;
617
618     char *yytext_r;
619     int yy_more_flag;
620     int yy_more_len;
621
622     }; /* end struct yyguts_t */
623
624 static int yy_init_globals (yyscan_t yyscanner );
625
626 int _gmx_sel_yylex_init (yyscan_t* scanner);
627
628 int _gmx_sel_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
629
630 /* Accessor methods to globals.
631    These are made visible to non-reentrant scanners for convenience. */
632
633 int _gmx_sel_yylex_destroy (yyscan_t yyscanner );
634
635 int _gmx_sel_yyget_debug (yyscan_t yyscanner );
636
637 void _gmx_sel_yyset_debug (int debug_flag ,yyscan_t yyscanner );
638
639 YY_EXTRA_TYPE _gmx_sel_yyget_extra (yyscan_t yyscanner );
640
641 void _gmx_sel_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
642
643 FILE *_gmx_sel_yyget_in (yyscan_t yyscanner );
644
645 void _gmx_sel_yyset_in  (FILE * in_str ,yyscan_t yyscanner );
646
647 FILE *_gmx_sel_yyget_out (yyscan_t yyscanner );
648
649 void _gmx_sel_yyset_out  (FILE * out_str ,yyscan_t yyscanner );
650
651 int _gmx_sel_yyget_leng (yyscan_t yyscanner );
652
653 char *_gmx_sel_yyget_text (yyscan_t yyscanner );
654
655 int _gmx_sel_yyget_lineno (yyscan_t yyscanner );
656
657 void _gmx_sel_yyset_lineno (int line_number ,yyscan_t yyscanner );
658
659 /* Macros after this point can all be overridden by user definitions in
660  * section 1.
661  */
662
663 #ifndef YY_SKIP_YYWRAP
664 #ifdef __cplusplus
665 extern "C" int _gmx_sel_yywrap (yyscan_t yyscanner );
666 #else
667 extern int _gmx_sel_yywrap (yyscan_t yyscanner );
668 #endif
669 #endif
670
671     static void yyunput (int c,char *buf_ptr  ,yyscan_t yyscanner);
672     
673 #ifndef yytext_ptr
674 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
675 #endif
676
677 #ifdef YY_NEED_STRLEN
678 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
679 #endif
680
681 #ifndef YY_NO_INPUT
682
683 #ifdef __cplusplus
684 static int yyinput (yyscan_t yyscanner );
685 #else
686 static int input (yyscan_t yyscanner );
687 #endif
688
689 #endif
690
691 /* Amount of stuff to slurp up with each read. */
692 #ifndef YY_READ_BUF_SIZE
693 #ifdef __ia64__
694 /* On IA-64, the buffer size is 16k, not 8k */
695 #define YY_READ_BUF_SIZE 16384
696 #else
697 #define YY_READ_BUF_SIZE 8192
698 #endif /* __ia64__ */
699 #endif
700
701 /* Copy whatever the last rule matched to the standard output. */
702 #ifndef ECHO
703 /* This used to be an fputs(), but since the string might contain NUL's,
704  * we now use fwrite().
705  */
706 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
707 #endif
708
709 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
710  * is returned in "result".
711  */
712 #ifndef YY_INPUT
713 #define YY_INPUT(buf,result,max_size) \
714         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
715                 { \
716                 int c = '*'; \
717                 size_t n; \
718                 for ( n = 0; n < max_size && \
719                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
720                         buf[n] = (char) c; \
721                 if ( c == '\n' ) \
722                         buf[n++] = (char) c; \
723                 if ( c == EOF && ferror( yyin ) ) \
724                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
725                 result = n; \
726                 } \
727         else \
728                 { \
729                 errno=0; \
730                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
731                         { \
732                         if( errno != EINTR) \
733                                 { \
734                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
735                                 break; \
736                                 } \
737                         errno=0; \
738                         clearerr(yyin); \
739                         } \
740                 }\
741 \
742
743 #endif
744
745 /* No semi-colon after return; correct usage is to write "yyterminate();" -
746  * we don't want an extra ';' after the "return" because that will cause
747  * some compilers to complain about unreachable statements.
748  */
749 #ifndef yyterminate
750 #define yyterminate() return YY_NULL
751 #endif
752
753 /* Number of entries by which start-condition stack grows. */
754 #ifndef YY_START_STACK_INCR
755 #define YY_START_STACK_INCR 25
756 #endif
757
758 /* Report a fatal error. */
759 #ifndef YY_FATAL_ERROR
760 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
761 #endif
762
763 /* end tables serialization structures and prototypes */
764
765 /* Default declaration of generated scanner - a define so the user can
766  * easily add parameters.
767  */
768 #ifndef YY_DECL
769 #define YY_DECL_IS_OURS 1
770
771 extern int _gmx_sel_yylex (yyscan_t yyscanner);
772
773 #define YY_DECL int _gmx_sel_yylex (yyscan_t yyscanner)
774 #endif /* !YY_DECL */
775
776 /* Code executed at the beginning of each rule, after yytext and yyleng
777  * have been set up.
778  */
779 #ifndef YY_USER_ACTION
780 #define YY_USER_ACTION
781 #endif
782
783 /* Code executed at the end of each rule. */
784 #ifndef YY_BREAK
785 #define YY_BREAK break;
786 #endif
787
788 #define YY_RULE_SETUP \
789         YY_USER_ACTION
790
791 /** The main scanner function which does all the work.
792  */
793 YY_DECL
794 {
795         register yy_state_type yy_current_state;
796         register char *yy_cp, *yy_bp;
797         register int yy_act;
798     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
799
800 #line 80 "scanner.l"
801
802
803
804     gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(yyscanner);
805     int              retval;
806     /* Return a token if one is pending */
807     retval = _gmx_sel_lexer_process_pending(yylval, state);
808     if (retval != 0)
809     {
810         return retval;
811     }
812     /* Handle the start conditions for 'of' matching */
813     if (state->bMatchOf)
814     {
815         BEGIN(matchof);
816         state->bMatchOf = FALSE;
817     }
818     else if (state->bMatchBool)
819     {
820         BEGIN(matchbool);
821         state->bMatchBool = FALSE;
822     }
823     else if (state->bCmdStart)
824     {
825         BEGIN(cmdstart);
826     }
827     else if (YYSTATE != help)
828     {
829         BEGIN(0);
830     }
831
832
833 #line 834 "scanner.c"
834
835         if ( !yyg->yy_init )
836                 {
837                 yyg->yy_init = 1;
838
839 #ifdef YY_USER_INIT
840                 YY_USER_INIT;
841 #endif
842
843                 if ( ! yyg->yy_start )
844                         yyg->yy_start = 1;      /* first start state */
845
846                 if ( ! yyin )
847                         yyin = stdin;
848
849                 if ( ! yyout )
850                         yyout = stdout;
851
852                 if ( ! YY_CURRENT_BUFFER ) {
853                         _gmx_sel_yyensure_buffer_stack (yyscanner);
854                         YY_CURRENT_BUFFER_LVALUE =
855                                 _gmx_sel_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
856                 }
857
858                 _gmx_sel_yy_load_buffer_state(yyscanner );
859                 }
860
861         while ( 1 )             /* loops until end-of-file is reached */
862                 {
863                 yy_cp = yyg->yy_c_buf_p;
864
865                 /* Support of yytext. */
866                 *yy_cp = yyg->yy_hold_char;
867
868                 /* yy_bp points to the position in yy_ch_buf of the start of
869                  * the current run.
870                  */
871                 yy_bp = yy_cp;
872
873                 yy_current_state = yyg->yy_start;
874 yy_match:
875                 do
876                         {
877                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
878                         if ( yy_accept[yy_current_state] )
879                                 {
880                                 yyg->yy_last_accepting_state = yy_current_state;
881                                 yyg->yy_last_accepting_cpos = yy_cp;
882                                 }
883                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
884                                 {
885                                 yy_current_state = (int) yy_def[yy_current_state];
886                                 if ( yy_current_state >= 89 )
887                                         yy_c = yy_meta[(unsigned int) yy_c];
888                                 }
889                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
890                         ++yy_cp;
891                         }
892                 while ( yy_current_state != 88 );
893                 yy_cp = yyg->yy_last_accepting_cpos;
894                 yy_current_state = yyg->yy_last_accepting_state;
895
896 yy_find_action:
897                 yy_act = yy_accept[yy_current_state];
898
899                 YY_DO_BEFORE_ACTION;
900
901 do_action:      /* This label is used only to access EOF actions. */
902
903                 switch ( yy_act )
904         { /* beginning of action switch */
905                         case 0: /* must back up */
906                         /* undo the effects of YY_DO_BEFORE_ACTION */
907                         *yy_cp = yyg->yy_hold_char;
908                         yy_cp = yyg->yy_last_accepting_cpos;
909                         yy_current_state = yyg->yy_last_accepting_state;
910                         goto yy_find_action;
911
912 case 1:
913 YY_RULE_SETUP
914 #line 112 "scanner.l"
915
916         YY_BREAK
917 case 2:
918 YY_RULE_SETUP
919 #line 113 "scanner.l"
920 { yylval->i   = strtol(yytext, NULL, 10);    ADD_TOKEN; return TOK_INT; }
921         YY_BREAK
922 case 3:
923 YY_RULE_SETUP
924 #line 114 "scanner.l"
925 { yylval->r   = strtod(yytext, NULL);        ADD_TOKEN; return TOK_REAL; }
926         YY_BREAK
927 case 4:
928 YY_RULE_SETUP
929 #line 115 "scanner.l"
930 { yylval->str = gmx_strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR;  }
931         YY_BREAK
932 case 5:
933 /* rule 5 can match eol */
934 YY_RULE_SETUP
935 #line 117 "scanner.l"
936 { _gmx_sel_lexer_add_token(" ", 1, state); }
937         YY_BREAK
938 case 6:
939 /* rule 6 can match eol */
940 YY_RULE_SETUP
941 #line 118 "scanner.l"
942 {
943                     if (yytext[0] == ';' || state->bInteractive)
944                     {
945                         rtrim(state->pselstr);
946                         return CMD_SEP;
947                     }
948                     else
949                     {
950                         _gmx_sel_lexer_add_token(" ", 1, state);
951                     }
952                 }
953         YY_BREAK
954 case 7:
955 YY_RULE_SETUP
956 #line 130 "scanner.l"
957 { BEGIN(help); return HELP; }
958         YY_BREAK
959
960 case 8:
961 YY_RULE_SETUP
962 #line 132 "scanner.l"
963
964         YY_BREAK
965 case 9:
966 YY_RULE_SETUP
967 #line 133 "scanner.l"
968 { yylval->str = gmx_strndup(yytext, yyleng); return HELP_TOPIC; }
969         YY_BREAK
970 case 10:
971 /* rule 10 can match eol */
972 YY_RULE_SETUP
973 #line 134 "scanner.l"
974 { return CMD_SEP; }
975         YY_BREAK
976 case 11:
977 YY_RULE_SETUP
978 #line 135 "scanner.l"
979 { return INVALID; }
980         YY_BREAK
981
982
983 case 12:
984 YY_RULE_SETUP
985 #line 139 "scanner.l"
986 { ADD_TOKEN; yylval->i = 1; return TOK_INT; }
987         YY_BREAK
988 case 13:
989 YY_RULE_SETUP
990 #line 140 "scanner.l"
991 { ADD_TOKEN; yylval->i = 0; return TOK_INT; }
992         YY_BREAK
993
994 case 14:
995 YY_RULE_SETUP
996 #line 142 "scanner.l"
997 { ADD_TOKEN; return GROUP; }
998         YY_BREAK
999 case 15:
1000 YY_RULE_SETUP
1001 #line 143 "scanner.l"
1002 { ADD_TOKEN; return TO; }
1003         YY_BREAK
1004 case 16:
1005 YY_RULE_SETUP
1006 #line 144 "scanner.l"
1007 { ADD_TOKEN; BEGIN(0); return OF; }
1008         YY_BREAK
1009 case 17:
1010 YY_RULE_SETUP
1011 #line 145 "scanner.l"
1012 { ADD_TOKEN; return AND; }
1013         YY_BREAK
1014 case 18:
1015 YY_RULE_SETUP
1016 #line 146 "scanner.l"
1017 { ADD_TOKEN; return OR; }
1018         YY_BREAK
1019 case 19:
1020 YY_RULE_SETUP
1021 #line 147 "scanner.l"
1022 { ADD_TOKEN; return XOR; }
1023         YY_BREAK
1024 case 20:
1025 YY_RULE_SETUP
1026 #line 148 "scanner.l"
1027 { ADD_TOKEN; return NOT; }
1028         YY_BREAK
1029 case 21:
1030 YY_RULE_SETUP
1031 #line 149 "scanner.l"
1032 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
1033         YY_BREAK
1034 case 22:
1035 YY_RULE_SETUP
1036 #line 151 "scanner.l"
1037 { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
1038         YY_BREAK
1039 case 23:
1040 YY_RULE_SETUP
1041 #line 153 "scanner.l"
1042 { _gmx_sel_lexer_add_token(" ", 1, state); }
1043         YY_BREAK
1044 case 24:
1045 YY_RULE_SETUP
1046 #line 154 "scanner.l"
1047 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
1048         YY_BREAK
1049 case 25:
1050 YY_RULE_SETUP
1051 #line 155 "scanner.l"
1052 { ADD_TOKEN; return yytext[0]; }
1053         YY_BREAK
1054 case 26:
1055 YY_RULE_SETUP
1056 #line 156 "scanner.l"
1057 YY_FATAL_ERROR( "flex scanner jammed" );
1058         YY_BREAK
1059 #line 1060 "scanner.c"
1060 case YY_STATE_EOF(INITIAL):
1061 case YY_STATE_EOF(matchof):
1062 case YY_STATE_EOF(matchbool):
1063 case YY_STATE_EOF(cmdstart):
1064 case YY_STATE_EOF(help):
1065         yyterminate();
1066
1067         case YY_END_OF_BUFFER:
1068                 {
1069                 /* Amount of text matched not including the EOB char. */
1070                 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1071
1072                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1073                 *yy_cp = yyg->yy_hold_char;
1074                 YY_RESTORE_YY_MORE_OFFSET
1075
1076                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1077                         {
1078                         /* We're scanning a new file or input source.  It's
1079                          * possible that this happened because the user
1080                          * just pointed yyin at a new source and called
1081                          * _gmx_sel_yylex().  If so, then we have to assure
1082                          * consistency between YY_CURRENT_BUFFER and our
1083                          * globals.  Here is the right place to do so, because
1084                          * this is the first action (other than possibly a
1085                          * back-up) that will match for the new input source.
1086                          */
1087                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1088                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1089                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1090                         }
1091
1092                 /* Note that here we test for yy_c_buf_p "<=" to the position
1093                  * of the first EOB in the buffer, since yy_c_buf_p will
1094                  * already have been incremented past the NUL character
1095                  * (since all states make transitions on EOB to the
1096                  * end-of-buffer state).  Contrast this with the test
1097                  * in input().
1098                  */
1099                 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1100                         { /* This was really a NUL. */
1101                         yy_state_type yy_next_state;
1102
1103                         yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1104
1105                         yy_current_state = yy_get_previous_state( yyscanner );
1106
1107                         /* Okay, we're now positioned to make the NUL
1108                          * transition.  We couldn't have
1109                          * yy_get_previous_state() go ahead and do it
1110                          * for us because it doesn't know how to deal
1111                          * with the possibility of jamming (and we don't
1112                          * want to build jamming into it because then it
1113                          * will run more slowly).
1114                          */
1115
1116                         yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1117
1118                         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1119
1120                         if ( yy_next_state )
1121                                 {
1122                                 /* Consume the NUL. */
1123                                 yy_cp = ++yyg->yy_c_buf_p;
1124                                 yy_current_state = yy_next_state;
1125                                 goto yy_match;
1126                                 }
1127
1128                         else
1129                                 {
1130                                 yy_cp = yyg->yy_last_accepting_cpos;
1131                                 yy_current_state = yyg->yy_last_accepting_state;
1132                                 goto yy_find_action;
1133                                 }
1134                         }
1135
1136                 else switch ( yy_get_next_buffer( yyscanner ) )
1137                         {
1138                         case EOB_ACT_END_OF_FILE:
1139                                 {
1140                                 yyg->yy_did_buffer_switch_on_eof = 0;
1141
1142                                 if ( _gmx_sel_yywrap(yyscanner ) )
1143                                         {
1144                                         /* Note: because we've taken care in
1145                                          * yy_get_next_buffer() to have set up
1146                                          * yytext, we can now set up
1147                                          * yy_c_buf_p so that if some total
1148                                          * hoser (like flex itself) wants to
1149                                          * call the scanner after we return the
1150                                          * YY_NULL, it'll still work - another
1151                                          * YY_NULL will get returned.
1152                                          */
1153                                         yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1154
1155                                         yy_act = YY_STATE_EOF(YY_START);
1156                                         goto do_action;
1157                                         }
1158
1159                                 else
1160                                         {
1161                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
1162                                                 YY_NEW_FILE;
1163                                         }
1164                                 break;
1165                                 }
1166
1167                         case EOB_ACT_CONTINUE_SCAN:
1168                                 yyg->yy_c_buf_p =
1169                                         yyg->yytext_ptr + yy_amount_of_matched_text;
1170
1171                                 yy_current_state = yy_get_previous_state( yyscanner );
1172
1173                                 yy_cp = yyg->yy_c_buf_p;
1174                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1175                                 goto yy_match;
1176
1177                         case EOB_ACT_LAST_MATCH:
1178                                 yyg->yy_c_buf_p =
1179                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1180
1181                                 yy_current_state = yy_get_previous_state( yyscanner );
1182
1183                                 yy_cp = yyg->yy_c_buf_p;
1184                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1185                                 goto yy_find_action;
1186                         }
1187                 break;
1188                 }
1189
1190         default:
1191                 YY_FATAL_ERROR(
1192                         "fatal flex scanner internal error--no action found" );
1193         } /* end of action switch */
1194                 } /* end of scanning one token */
1195 } /* end of _gmx_sel_yylex */
1196
1197 /* yy_get_next_buffer - try to read in a new buffer
1198  *
1199  * Returns a code representing an action:
1200  *      EOB_ACT_LAST_MATCH -
1201  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1202  *      EOB_ACT_END_OF_FILE - end of file
1203  */
1204 static int yy_get_next_buffer (yyscan_t yyscanner)
1205 {
1206     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1207         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1208         register char *source = yyg->yytext_ptr;
1209         register int number_to_move, i;
1210         int ret_val;
1211
1212         if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1213                 YY_FATAL_ERROR(
1214                 "fatal flex scanner internal error--end of buffer missed" );
1215
1216         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1217                 { /* Don't try to fill the buffer, so this is an EOF. */
1218                 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1219                         {
1220                         /* We matched a single character, the EOB, so
1221                          * treat this as a final EOF.
1222                          */
1223                         return EOB_ACT_END_OF_FILE;
1224                         }
1225
1226                 else
1227                         {
1228                         /* We matched some text prior to the EOB, first
1229                          * process it.
1230                          */
1231                         return EOB_ACT_LAST_MATCH;
1232                         }
1233                 }
1234
1235         /* Try to read more data. */
1236
1237         /* First move last chars to start of buffer. */
1238         number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1239
1240         for ( i = 0; i < number_to_move; ++i )
1241                 *(dest++) = *(source++);
1242
1243         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1244                 /* don't do the read, it's not guaranteed to return an EOF,
1245                  * just force an EOF
1246                  */
1247                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1248
1249         else
1250                 {
1251                         int num_to_read =
1252                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1253
1254                 while ( num_to_read <= 0 )
1255                         { /* Not enough room in the buffer - grow it. */
1256
1257                         /* just a shorter name for the current buffer */
1258                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1259
1260                         int yy_c_buf_p_offset =
1261                                 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1262
1263                         if ( b->yy_is_our_buffer )
1264                                 {
1265                                 int new_size = b->yy_buf_size * 2;
1266
1267                                 if ( new_size <= 0 )
1268                                         b->yy_buf_size += b->yy_buf_size / 8;
1269                                 else
1270                                         b->yy_buf_size *= 2;
1271
1272                                 b->yy_ch_buf = (char *)
1273                                         /* Include room in for 2 EOB chars. */
1274                                         _gmx_sel_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1275                                 }
1276                         else
1277                                 /* Can't grow it, we don't own it. */
1278                                 b->yy_ch_buf = 0;
1279
1280                         if ( ! b->yy_ch_buf )
1281                                 YY_FATAL_ERROR(
1282                                 "fatal error - scanner input buffer overflow" );
1283
1284                         yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1285
1286                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1287                                                 number_to_move - 1;
1288
1289                         }
1290
1291                 if ( num_to_read > YY_READ_BUF_SIZE )
1292                         num_to_read = YY_READ_BUF_SIZE;
1293
1294                 /* Read in more data. */
1295                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1296                         yyg->yy_n_chars, (size_t) num_to_read );
1297
1298                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1299                 }
1300
1301         if ( yyg->yy_n_chars == 0 )
1302                 {
1303                 if ( number_to_move == YY_MORE_ADJ )
1304                         {
1305                         ret_val = EOB_ACT_END_OF_FILE;
1306                         _gmx_sel_yyrestart(yyin  ,yyscanner);
1307                         }
1308
1309                 else
1310                         {
1311                         ret_val = EOB_ACT_LAST_MATCH;
1312                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1313                                 YY_BUFFER_EOF_PENDING;
1314                         }
1315                 }
1316
1317         else
1318                 ret_val = EOB_ACT_CONTINUE_SCAN;
1319
1320         if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1321                 /* Extend the array by 50%, plus the number we really need. */
1322                 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1323                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _gmx_sel_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1324                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1325                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1326         }
1327
1328         yyg->yy_n_chars += number_to_move;
1329         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1330         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1331
1332         yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1333
1334         return ret_val;
1335 }
1336
1337 /* yy_get_previous_state - get the state just before the EOB char was reached */
1338
1339     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1340 {
1341         register yy_state_type yy_current_state;
1342         register char *yy_cp;
1343     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1344
1345         yy_current_state = yyg->yy_start;
1346
1347         for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1348                 {
1349                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1350                 if ( yy_accept[yy_current_state] )
1351                         {
1352                         yyg->yy_last_accepting_state = yy_current_state;
1353                         yyg->yy_last_accepting_cpos = yy_cp;
1354                         }
1355                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1356                         {
1357                         yy_current_state = (int) yy_def[yy_current_state];
1358                         if ( yy_current_state >= 89 )
1359                                 yy_c = yy_meta[(unsigned int) yy_c];
1360                         }
1361                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1362                 }
1363
1364         return yy_current_state;
1365 }
1366
1367 /* yy_try_NUL_trans - try to make a transition on the NUL character
1368  *
1369  * synopsis
1370  *      next_state = yy_try_NUL_trans( current_state );
1371  */
1372     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1373 {
1374         register int yy_is_jam;
1375     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1376         register char *yy_cp = yyg->yy_c_buf_p;
1377
1378         register YY_CHAR yy_c = 1;
1379         if ( yy_accept[yy_current_state] )
1380                 {
1381                 yyg->yy_last_accepting_state = yy_current_state;
1382                 yyg->yy_last_accepting_cpos = yy_cp;
1383                 }
1384         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1385                 {
1386                 yy_current_state = (int) yy_def[yy_current_state];
1387                 if ( yy_current_state >= 89 )
1388                         yy_c = yy_meta[(unsigned int) yy_c];
1389                 }
1390         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1391         yy_is_jam = (yy_current_state == 88);
1392
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 int 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                         int 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         int 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, int  _yybytes_len , yyscan_t yyscanner)
1838 {
1839         YY_BUFFER_STATE b;
1840         char *buf;
1841         yy_size_t n;
1842         int 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 int _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" , yyscanner); 
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" , yyscanner); 
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 156 "scanner.l"