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