OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
lex.gse.cc
Go to the documentation of this file.
1 #line 2 "lex.gse.cc"
2 
3 #line 4 "lex.gse.cc"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer gse__create_buffer
10 #define yy_delete_buffer gse__delete_buffer
11 #define yy_flex_debug gse__flex_debug
12 #define yy_init_buffer gse__init_buffer
13 #define yy_flush_buffer gse__flush_buffer
14 #define yy_load_buffer_state gse__load_buffer_state
15 #define yy_switch_to_buffer gse__switch_to_buffer
16 #define yyin gse_in
17 #define yyleng gse_leng
18 #define yylex gse_lex
19 #define yylineno gse_lineno
20 #define yyout gse_out
21 #define yyrestart gse_restart
22 #define yytext gse_text
23 #define yywrap gse_wrap
24 #define yyalloc gse_alloc
25 #define yyrealloc gse_realloc
26 #define yyfree gse_free
27 
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35 
36 /* First, we deal with platform-specific or compiler-specific issues. */
37 
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43 
44 /* end standard C headers. */
45 
46 /* flex integer type definitions */
47 
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50 
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56  * if you want the limit (max/min) macros for int types.
57  */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61 
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
76 #endif /* ! C99 */
77 
78 /* Limits of integral types. */
79 #ifndef INT8_MIN
80 #define INT8_MIN (-128)
81 #endif
82 #ifndef INT16_MIN
83 #define INT16_MIN (-32767-1)
84 #endif
85 #ifndef INT32_MIN
86 #define INT32_MIN (-2147483647-1)
87 #endif
88 #ifndef INT8_MAX
89 #define INT8_MAX (127)
90 #endif
91 #ifndef INT16_MAX
92 #define INT16_MAX (32767)
93 #endif
94 #ifndef INT32_MAX
95 #define INT32_MAX (2147483647)
96 #endif
97 #ifndef UINT8_MAX
98 #define UINT8_MAX (255U)
99 #endif
100 #ifndef UINT16_MAX
101 #define UINT16_MAX (65535U)
102 #endif
103 #ifndef UINT32_MAX
104 #define UINT32_MAX (4294967295U)
105 #endif
106 
107 #endif /* ! FLEXINT_H */
108 
109 #ifdef __cplusplus
110 
111 /* The "const" storage-class-modifier is valid. */
112 #define YY_USE_CONST
113 
114 #else /* ! __cplusplus */
115 
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
118 
119 #define YY_USE_CONST
120 
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
123 
124 #ifdef YY_USE_CONST
125 #define yyconst const
126 #else
127 #define yyconst
128 #endif
129 
130 /* Returned upon end-of-file. */
131 #define YY_NULL 0
132 
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134  * integer for use as an array index. If the signed char is negative,
135  * we want to instead treat it as an 8-bit unsigned char, hence the
136  * double cast.
137  */
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139 
140 /* Enter a start condition. This macro really ought to take a parameter,
141  * but we do it the disgusting crufty way forced on us by the ()-less
142  * definition of BEGIN.
143  */
144 #define BEGIN (yy_start) = 1 + 2 *
145 
146 /* Translate the current start state into a value that can be later handed
147  * to BEGIN to return to the state. The YYSTATE alias is for lex
148  * compatibility.
149  */
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
152 
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE gse_restart(gse_in )
158 
159 #define YY_END_OF_BUFFER_CHAR 0
160 
161 /* Size of default input buffer. */
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE 16384
164 #endif
165 
166 /* The state buf must be large enough to hold one state per character in the main buffer.
167  */
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169 
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
173 #endif
174 
175 extern int gse_leng;
176 
177 extern FILE *gse_in, *gse_out;
178 
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182 
183  #define YY_LESS_LINENO(n)
184 
185 /* Return all but the first "n" matched characters back to the input stream. */
186 #define yyless(n) \
187  do \
188  { \
189  /* Undo effects of setting up gse_text. */ \
190  int yyless_macro_arg = (n); \
191  YY_LESS_LINENO(yyless_macro_arg);\
192  *yy_cp = (yy_hold_char); \
193  YY_RESTORE_YY_MORE_OFFSET \
194  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
195  YY_DO_BEFORE_ACTION; /* set up gse_text again */ \
196  } \
197  while ( 0 )
198 
199 #define unput(c) yyunput( c, (yytext_ptr) )
200 
201 #ifndef YY_TYPEDEF_YY_SIZE_T
202 #define YY_TYPEDEF_YY_SIZE_T
203 typedef size_t yy_size_t;
204 #endif
205 
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
209  {
210  FILE *yy_input_file;
211 
212  char *yy_ch_buf; /* input buffer */
213  char *yy_buf_pos; /* current position in input buffer */
214 
215  /* Size of input buffer in bytes, not including room for EOB
216  * characters.
217  */
218  yy_size_t yy_buf_size;
219 
220  /* Number of characters read into yy_ch_buf, not including EOB
221  * characters.
222  */
223  int yy_n_chars;
224 
225  /* Whether we "own" the buffer - i.e., we know we created it,
226  * and can realloc() it to grow it, and should free() it to
227  * delete it.
228  */
229  int yy_is_our_buffer;
230 
231  /* Whether this is an "interactive" input source; if so, and
232  * if we're using stdio for input, then we want to use getc()
233  * instead of fread(), to make sure we stop fetching input after
234  * each newline.
235  */
236  int yy_is_interactive;
237 
238  /* Whether we're considered to be at the beginning of a line.
239  * If so, '^' rules will be active on the next match, otherwise
240  * not.
241  */
242  int yy_at_bol;
243 
244  int yy_bs_lineno;
245  int yy_bs_column;
247  /* Whether to try to fill the input buffer when we reach the
248  * end of it.
249  */
250  int yy_fill_buffer;
251 
252  int yy_buffer_status;
253 
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256  /* When an EOF's been seen but there's still some text to process
257  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258  * shouldn't try reading from the input source any more. We might
259  * still have a bunch of tokens to match, though, because of
260  * possible backing-up.
261  *
262  * When we actually see the EOF, we change the status to "new"
263  * (via gse_restart()), so that the user can continue scanning by
264  * just pointing gse_in at a new input file.
265  */
266 #define YY_BUFFER_EOF_PENDING 2
267 
268  };
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
270 
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0;
273 static size_t yy_buffer_stack_max = 0;
274 static YY_BUFFER_STATE * yy_buffer_stack = 0;
276 /* We provide macros for accessing buffer states in case in the
277  * future we want to put the buffer states in a more general
278  * "scanner state".
279  *
280  * Returns the top of the stack, or NULL.
281  */
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
284  : NULL)
285 
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287  * NULL or when we need an lvalue. For internal use only.
288  */
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
290 
291 /* yy_hold_char holds the character lost when gse_text is formed. */
292 static char yy_hold_char;
293 static int yy_n_chars; /* number of characters read into yy_ch_buf */
295 
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0; /* whether we need to initialize */
299 static int yy_start = 0; /* start state number */
300 
301 /* Flag which is used to allow gse_wrap()'s to do buffer switches
302  * instead of setting up a fresh gse_in. A bit of a hack ...
303  */
304 static int yy_did_buffer_switch_on_eof;
305 
306 void gse_restart (FILE *input_file );
307 void gse__switch_to_buffer (YY_BUFFER_STATE new_buffer );
308 YY_BUFFER_STATE gse__create_buffer (FILE *file,int size );
311 void gse_push_buffer_state (YY_BUFFER_STATE new_buffer );
312 void gse_pop_buffer_state (void );
313 
314 static void gse_ensure_buffer_stack (void );
315 static void gse__load_buffer_state (void );
316 static void gse__init_buffer (YY_BUFFER_STATE b,FILE *file );
317 
318 #define YY_FLUSH_BUFFER gse__flush_buffer(YY_CURRENT_BUFFER )
319 
320 YY_BUFFER_STATE gse__scan_buffer (char *base,yy_size_t size );
322 YY_BUFFER_STATE gse__scan_bytes (yyconst char *bytes,int len );
323 
324 void *gse_alloc (yy_size_t );
325 void *gse_realloc (void *,yy_size_t );
326 void gse_free (void * );
327 
328 #define yy_new_buffer gse__create_buffer
329 
330 #define yy_set_interactive(is_interactive) \
331  { \
332  if ( ! YY_CURRENT_BUFFER ){ \
333  gse_ensure_buffer_stack (); \
334  YY_CURRENT_BUFFER_LVALUE = \
335  gse__create_buffer(gse_in,YY_BUF_SIZE ); \
336  } \
337  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
338  }
339 
340 #define yy_set_bol(at_bol) \
341  { \
342  if ( ! YY_CURRENT_BUFFER ){\
343  gse_ensure_buffer_stack (); \
344  YY_CURRENT_BUFFER_LVALUE = \
345  gse__create_buffer(gse_in,YY_BUF_SIZE ); \
346  } \
347  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
348  }
349 
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
351 
352 /* Begin user sect3 */
353 
354 #define gse_wrap(n) 1
355 #define YY_SKIP_YYWRAP
356 
357 typedef unsigned char YY_CHAR;
358 
359 FILE *gse_in = (FILE *) 0, *gse_out = (FILE *) 0;
360 
361 typedef int yy_state_type;
362 
363 extern int gse_lineno;
364 
365 int gse_lineno = 1;
366 
367 extern char *gse_text;
368 #define yytext_ptr gse_text
369 
370 static yy_state_type yy_get_previous_state (void );
371 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
372 static int yy_get_next_buffer (void );
373 static void yy_fatal_error (yyconst char msg[] );
374 
375 /* Done after the current pattern has been matched and before the
376  * corresponding action - sets up gse_text.
377  */
378 #define YY_DO_BEFORE_ACTION \
379  (yytext_ptr) = yy_bp; \
380  gse_leng = (size_t) (yy_cp - yy_bp); \
381  (yy_hold_char) = *yy_cp; \
382  *yy_cp = '\0'; \
383  (yy_c_buf_p) = yy_cp;
384 
385 #define YY_NUM_RULES 10
386 #define YY_END_OF_BUFFER 11
387 /* This struct is not used in this scanner,
388  but its presence is necessary. */
389 struct yy_trans_info
390  {
391  flex_int32_t yy_verify;
392  flex_int32_t yy_nxt;
393  };
394 static yyconst flex_int16_t yy_accept[32] =
395  { 0,
396  0, 0, 11, 10, 10, 3, 3, 3, 1, 8,
397  4, 6, 3, 3, 5, 3, 3, 1, 2, 2,
398  1, 3, 9, 7, 3, 3, 2, 3, 2, 2,
399  0
400  } ;
401 
402 static yyconst flex_int32_t yy_ec[256] =
403  { 0,
404  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 2, 1, 3, 1, 4, 1, 1, 1,
408  1, 1, 5, 1, 5, 6, 4, 7, 7, 7,
409  7, 7, 7, 7, 7, 7, 7, 1, 1, 8,
410  9, 10, 1, 1, 11, 4, 4, 4, 12, 13,
411  4, 4, 14, 4, 4, 4, 4, 15, 4, 4,
412  4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
413  1, 4, 1, 1, 4, 1, 11, 4, 4, 4,
414 
415  16, 13, 4, 4, 14, 4, 4, 4, 4, 15,
416  4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
417  4, 4, 1, 1, 1, 1, 1, 1, 1, 1,
418  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 
426  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431  1, 1, 1, 1, 1
432  } ;
433 
434 static yyconst flex_int32_t yy_meta[17] =
435  { 0,
436  1, 1, 2, 2, 2, 2, 2, 1, 1, 1,
437  2, 2, 2, 2, 2, 2
438  } ;
439 
440 static yyconst flex_int16_t yy_base[33] =
441  { 0,
442  0, 0, 43, 44, 33, 0, 11, 34, 13, 31,
443  44, 30, 23, 26, 44, 0, 29, 0, 15, 17,
444  0, 21, 44, 44, 22, 19, 24, 26, 25, 0,
445  44, 25
446  } ;
447 
448 static yyconst flex_int16_t yy_def[33] =
449  { 0,
450  31, 1, 31, 31, 31, 32, 32, 32, 32, 31,
451  31, 31, 32, 32, 31, 32, 32, 9, 9, 9,
452  9, 32, 31, 31, 32, 32, 9, 32, 32, 32,
453  0, 31
454  } ;
455 
456 static yyconst flex_int16_t yy_nxt[61] =
457  { 0,
458  4, 5, 4, 6, 7, 8, 9, 10, 11, 12,
459  6, 6, 6, 13, 14, 6, 17, 18, 20, 21,
460  16, 19, 16, 27, 22, 28, 16, 29, 22, 16,
461  27, 29, 29, 30, 30, 19, 26, 25, 24, 23,
462  19, 15, 31, 3, 31, 31, 31, 31, 31, 31,
463  31, 31, 31, 31, 31, 31, 31, 31, 31, 31
464  } ;
465 
466 static yyconst flex_int16_t yy_chk[61] =
467  { 0,
468  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469  1, 1, 1, 1, 1, 1, 7, 7, 9, 9,
470  19, 19, 20, 20, 9, 22, 32, 22, 9, 27,
471  27, 29, 28, 26, 25, 17, 14, 13, 12, 10,
472  8, 5, 3, 31, 31, 31, 31, 31, 31, 31,
473  31, 31, 31, 31, 31, 31, 31, 31, 31, 31
474  } ;
475 
476 static yy_state_type yy_last_accepting_state;
477 static char *yy_last_accepting_cpos;
478 
479 extern int gse__flex_debug;
480 int gse__flex_debug = 0;
481 
482 /* The intent behind this definition is that it'll catch
483  * any uses of REJECT which flex missed.
484  */
485 #define REJECT reject_used_but_not_detected
486 #define yymore() yymore_used_but_not_detected
487 #define YY_MORE_ADJ 0
488 #define YY_RESTORE_YY_MORE_OFFSET
489 char *gse_text;
490 #line 1 "gse.lex"
491 /*
492  -*- mode: c++; c-basic-offset:4 -*-
493 
494  This file is part of libdap, A C++ implementation of the OPeNDAP Data
495  Access Protocol.
496 
497  Copyright (c) 2002,2003 OPeNDAP, Inc.
498  Author: James Gallagher <jgallagher@opendap.org>
499 
500  This library is free software; you can redistribute it and/or
501  modify it under the terms of the GNU Lesser General Public
502  License as published by the Free Software Foundation; either
503  version 2.1 of the License, or (at your option) any later version.
504 
505  This library is distributed in the hope that it will be useful,
506  but WITHOUT ANY WARRANTY; without even the implied warranty of
507  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
508  Lesser General Public License for more details.
509 
510  You should have received a copy of the GNU Lesser General Public
511  License along with this library; if not, write to the Free Software
512  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
513 
514  You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
515 
516  (c) COPYRIGHT URI/MIT 1999
517 */
518 /*
519  Scanner for grid selection sub-expressions. The scanner is not reentrant,
520  but can share a name space with other scanners.
521 
522  Note:
523  1) The `defines' file gse.tab.h is built using `bison -d'.
524  2) Define YY_DECL such that the scanner is called `gse_lex'.
525  3) When bison builds the gse.tab.h file, it uses `gse_' instead
526  of `yy' for variable name prefixes (e.g., yylval --> gse_lval).
527 
528  1/13/99 jhrg
529 */
530 #line 44 "gse.lex"
531 
532 #include "config.h"
533 
534 #include <string>
535 #include <cstring>
536 
537 #include "Error.h"
538 
539 #ifndef YY_PROTO
540 #define YY_PROTO(proto) proto
541 #endif
542 
543 #define YY_DECL int gse_lex YY_PROTO(( void ))
544 #define ID_MAX 256
545 #define YY_NO_UNPUT 1
546 #define YY_NO_INPUT 1
547 
548 /* The call to yy_fatal_error() suppresses a warning message. jhrg 8/20/13 */
549 #define YY_FATAL_ERROR(msg) {\
550  throw(Error(string("Error scanning grid constraint expression text: ") + string(msg)));\
551  yy_fatal_error("never called");\
552 }
553 
554 #include "gse.tab.hh"
555 
556 using namespace std;
557 using namespace libdap;
558 
559 static void store_int32();
560 static void store_float64();
561 static void store_id();
562 static void store_op(int op);
563 
564 /* See das.lex for comments about the characters allowed in a WORD.
565  10/31/2001 jhrg */
566 #line 567 "lex.gse.cc"
567 
568 #define INITIAL 0
569 
570 #ifndef YY_NO_UNISTD_H
571 /* Special case for "unistd.h", since it is non-ANSI. We include it way
572  * down here because we want the user's section 1 to have been scanned first.
573  * The user has a chance to override it with an option.
574  */
575 #include <unistd.h>
576 #endif
577 
578 #ifndef YY_EXTRA_TYPE
579 #define YY_EXTRA_TYPE void *
580 #endif
581 
582 static int yy_init_globals (void );
583 
584 /* Accessor methods to globals.
585  These are made visible to non-reentrant scanners for convenience. */
586 
587 int gse_lex_destroy (void );
588 
589 int gse_get_debug (void );
590 
591 void gse_set_debug (int debug_flag );
592 
594 
595 void gse_set_extra (YY_EXTRA_TYPE user_defined );
596 
597 FILE *gse_get_in (void );
598 
599 void gse_set_in (FILE * in_str );
600 
601 FILE *gse_get_out (void );
602 
603 void gse_set_out (FILE * out_str );
604 
605 int gse_get_leng (void );
606 
607 char *gse_get_text (void );
608 
609 int gse_get_lineno (void );
610 
611 void gse_set_lineno (int line_number );
612 
613 /* Macros after this point can all be overridden by user definitions in
614  * section 1.
615  */
616 
617 #ifndef YY_SKIP_YYWRAP
618 #ifdef __cplusplus
619 extern "C" int gse_wrap (void );
620 #else
621 extern int gse_wrap (void );
622 #endif
623 #endif
624 
625 #ifndef yytext_ptr
626 static void yy_flex_strncpy (char *,yyconst char *,int );
627 #endif
628 
629 #ifdef YY_NEED_STRLEN
630 static int yy_flex_strlen (yyconst char * );
631 #endif
632 
633 #ifndef YY_NO_INPUT
634 
635 #ifdef __cplusplus
636 static int yyinput (void );
637 #else
638 static int input (void );
639 #endif
640 
641 #endif
642 
643 /* Amount of stuff to slurp up with each read. */
644 #ifndef YY_READ_BUF_SIZE
645 #define YY_READ_BUF_SIZE 8192
646 #endif
647 
648 /* Copy whatever the last rule matched to the standard output. */
649 #ifndef ECHO
650 /* This used to be an fputs(), but since the string might contain NUL's,
651  * we now use fwrite().
652  */
653 #define ECHO do { if (fwrite( gse_text, gse_leng, 1, gse_out )) {} } while (0)
654 #endif
655 
656 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
657  * is returned in "result".
658  */
659 #ifndef YY_INPUT
660 #define YY_INPUT(buf,result,max_size) \
661  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
662  { \
663  int c = '*'; \
664  unsigned n; \
665  for ( n = 0; n < max_size && \
666  (c = getc( gse_in )) != EOF && c != '\n'; ++n ) \
667  buf[n] = (char) c; \
668  if ( c == '\n' ) \
669  buf[n++] = (char) c; \
670  if ( c == EOF && ferror( gse_in ) ) \
671  YY_FATAL_ERROR( "input in flex scanner failed" ); \
672  result = n; \
673  } \
674  else \
675  { \
676  errno=0; \
677  while ( (result = fread(buf, 1, max_size, gse_in))==0 && ferror(gse_in)) \
678  { \
679  if( errno != EINTR) \
680  { \
681  YY_FATAL_ERROR( "input in flex scanner failed" ); \
682  break; \
683  } \
684  errno=0; \
685  clearerr(gse_in); \
686  } \
687  }\
688 \
689 
690 #endif
691 
692 /* No semi-colon after return; correct usage is to write "yyterminate();" -
693  * we don't want an extra ';' after the "return" because that will cause
694  * some compilers to complain about unreachable statements.
695  */
696 #ifndef yyterminate
697 #define yyterminate() return YY_NULL
698 #endif
699 
700 /* Number of entries by which start-condition stack grows. */
701 #ifndef YY_START_STACK_INCR
702 #define YY_START_STACK_INCR 25
703 #endif
704 
705 /* Report a fatal error. */
706 #ifndef YY_FATAL_ERROR
707 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
708 #endif
709 
710 /* end tables serialization structures and prototypes */
711 
712 /* Default declaration of generated scanner - a define so the user can
713  * easily add parameters.
714  */
715 #ifndef YY_DECL
716 #define YY_DECL_IS_OURS 1
717 
718 extern int gse_lex (void);
719 
720 #define YY_DECL int gse_lex (void)
721 #endif /* !YY_DECL */
722 
723 /* Code executed at the beginning of each rule, after gse_text and gse_leng
724  * have been set up.
725  */
726 #ifndef YY_USER_ACTION
727 #define YY_USER_ACTION
728 #endif
729 
730 /* Code executed at the end of each rule. */
731 #ifndef YY_BREAK
732 #define YY_BREAK break;
733 #endif
734 
735 #define YY_RULE_SETUP \
736  YY_USER_ACTION
737 
740 YY_DECL
741 {
742  register yy_state_type yy_current_state;
743  register char *yy_cp, *yy_bp;
744  register int yy_act;
745 
746 #line 109 "gse.lex"
747 
748 
749 #line 750 "lex.gse.cc"
750 
751  if ( !(yy_init) )
752  {
753  (yy_init) = 1;
754 
755 #ifdef YY_USER_INIT
756  YY_USER_INIT;
757 #endif
758 
759  if ( ! (yy_start) )
760  (yy_start) = 1; /* first start state */
761 
762  if ( ! gse_in )
763  gse_in = stdin;
764 
765  if ( ! gse_out )
766  gse_out = stdout;
767 
768  if ( ! YY_CURRENT_BUFFER ) {
769  gse_ensure_buffer_stack ();
772  }
773 
774  gse__load_buffer_state( );
775  }
776 
777  while ( 1 ) /* loops until end-of-file is reached */
778  {
779  yy_cp = (yy_c_buf_p);
780 
781  /* Support of gse_text. */
782  *yy_cp = (yy_hold_char);
783 
784  /* yy_bp points to the position in yy_ch_buf of the start of
785  * the current run.
786  */
787  yy_bp = yy_cp;
788 
789  yy_current_state = (yy_start);
790 yy_match:
791  do
792  {
793  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
794  if ( yy_accept[yy_current_state] )
795  {
796  (yy_last_accepting_state) = yy_current_state;
797  (yy_last_accepting_cpos) = yy_cp;
798  }
799  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
800  {
801  yy_current_state = (int) yy_def[yy_current_state];
802  if ( yy_current_state >= 32 )
803  yy_c = yy_meta[(unsigned int) yy_c];
804  }
805  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
806  ++yy_cp;
807  }
808  while ( yy_base[yy_current_state] != 44 );
809 
810 yy_find_action:
811  yy_act = yy_accept[yy_current_state];
812  if ( yy_act == 0 )
813  { /* have to back up */
814  yy_cp = (yy_last_accepting_cpos);
815  yy_current_state = (yy_last_accepting_state);
816  yy_act = yy_accept[yy_current_state];
817  }
818 
820 
821 do_action: /* This label is used only to access EOF actions. */
822 
823  switch ( yy_act )
824  { /* beginning of action switch */
825  case 0: /* must back up */
826  /* undo the effects of YY_DO_BEFORE_ACTION */
827  *yy_cp = (yy_hold_char);
828  yy_cp = (yy_last_accepting_cpos);
829  yy_current_state = (yy_last_accepting_state);
830  goto yy_find_action;
831 
832 case 1:
834 #line 111 "gse.lex"
835 store_int32(); return SCAN_INT;
836  YY_BREAK
837 case 2:
839 #line 112 "gse.lex"
840 store_float64(); return SCAN_FLOAT;
841  YY_BREAK
842 case 3:
844 #line 114 "gse.lex"
845 store_id(); return SCAN_WORD;
846  YY_BREAK
847 case 4:
849 #line 116 "gse.lex"
850 store_op(SCAN_EQUAL); return SCAN_EQUAL;
851  YY_BREAK
852 case 5:
854 #line 117 "gse.lex"
855 store_op(SCAN_NOT_EQUAL); return SCAN_NOT_EQUAL;
856  YY_BREAK
857 case 6:
859 #line 118 "gse.lex"
860 store_op(SCAN_GREATER); return SCAN_GREATER;
861  YY_BREAK
862 case 7:
864 #line 119 "gse.lex"
865 store_op(SCAN_GREATER_EQL); return SCAN_GREATER_EQL;
866  YY_BREAK
867 case 8:
869 #line 120 "gse.lex"
870 store_op(SCAN_LESS); return SCAN_LESS;
871  YY_BREAK
872 case 9:
874 #line 121 "gse.lex"
875 store_op(SCAN_LESS_EQL); return SCAN_LESS_EQL;
876  YY_BREAK
877 case 10:
879 #line 123 "gse.lex"
880 ECHO;
881  YY_BREAK
882 #line 883 "lex.gse.cc"
883 case YY_STATE_EOF(INITIAL):
884  yyterminate();
885 
886  case YY_END_OF_BUFFER:
887  {
888  /* Amount of text matched not including the EOB char. */
889  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
890 
891  /* Undo the effects of YY_DO_BEFORE_ACTION. */
892  *yy_cp = (yy_hold_char);
894 
895  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
896  {
897  /* We're scanning a new file or input source. It's
898  * possible that this happened because the user
899  * just pointed gse_in at a new source and called
900  * gse_lex(). If so, then we have to assure
901  * consistency between YY_CURRENT_BUFFER and our
902  * globals. Here is the right place to do so, because
903  * this is the first action (other than possibly a
904  * back-up) that will match for the new input source.
905  */
906  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
907  YY_CURRENT_BUFFER_LVALUE->yy_input_file = gse_in;
908  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
909  }
910 
911  /* Note that here we test for yy_c_buf_p "<=" to the position
912  * of the first EOB in the buffer, since yy_c_buf_p will
913  * already have been incremented past the NUL character
914  * (since all states make transitions on EOB to the
915  * end-of-buffer state). Contrast this with the test
916  * in input().
917  */
918  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
919  { /* This was really a NUL. */
920  yy_state_type yy_next_state;
921 
922  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
923 
924  yy_current_state = yy_get_previous_state( );
925 
926  /* Okay, we're now positioned to make the NUL
927  * transition. We couldn't have
928  * yy_get_previous_state() go ahead and do it
929  * for us because it doesn't know how to deal
930  * with the possibility of jamming (and we don't
931  * want to build jamming into it because then it
932  * will run more slowly).
933  */
934 
935  yy_next_state = yy_try_NUL_trans( yy_current_state );
936 
937  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
938 
939  if ( yy_next_state )
940  {
941  /* Consume the NUL. */
942  yy_cp = ++(yy_c_buf_p);
943  yy_current_state = yy_next_state;
944  goto yy_match;
945  }
946 
947  else
948  {
949  yy_cp = (yy_c_buf_p);
950  goto yy_find_action;
951  }
952  }
953 
954  else switch ( yy_get_next_buffer( ) )
955  {
956  case EOB_ACT_END_OF_FILE:
957  {
958  (yy_did_buffer_switch_on_eof) = 0;
959 
960  if ( gse_wrap( ) )
961  {
962  /* Note: because we've taken care in
963  * yy_get_next_buffer() to have set up
964  * gse_text, we can now set up
965  * yy_c_buf_p so that if some total
966  * hoser (like flex itself) wants to
967  * call the scanner after we return the
968  * YY_NULL, it'll still work - another
969  * YY_NULL will get returned.
970  */
971  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
972 
973  yy_act = YY_STATE_EOF(YY_START);
974  goto do_action;
975  }
976 
977  else
978  {
979  if ( ! (yy_did_buffer_switch_on_eof) )
980  YY_NEW_FILE;
981  }
982  break;
983  }
984 
986  (yy_c_buf_p) =
987  (yytext_ptr) + yy_amount_of_matched_text;
988 
989  yy_current_state = yy_get_previous_state( );
990 
991  yy_cp = (yy_c_buf_p);
992  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
993  goto yy_match;
994 
995  case EOB_ACT_LAST_MATCH:
996  (yy_c_buf_p) =
997  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
998 
999  yy_current_state = yy_get_previous_state( );
1000 
1001  yy_cp = (yy_c_buf_p);
1002  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1003  goto yy_find_action;
1004  }
1005  break;
1006  }
1007 
1008  default:
1010  "fatal flex scanner internal error--no action found" );
1011  } /* end of action switch */
1012  } /* end of scanning one token */
1013 } /* end of gse_lex */
1014 
1015 /* yy_get_next_buffer - try to read in a new buffer
1016  *
1017  * Returns a code representing an action:
1018  * EOB_ACT_LAST_MATCH -
1019  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1020  * EOB_ACT_END_OF_FILE - end of file
1021  */
1022 static int yy_get_next_buffer (void)
1023 {
1024  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1025  register char *source = (yytext_ptr);
1026  register int number_to_move, i;
1027  int ret_val;
1028 
1029  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1031  "fatal flex scanner internal error--end of buffer missed" );
1032 
1033  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1034  { /* Don't try to fill the buffer, so this is an EOF. */
1035  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1036  {
1037  /* We matched a single character, the EOB, so
1038  * treat this as a final EOF.
1039  */
1040  return EOB_ACT_END_OF_FILE;
1041  }
1042 
1043  else
1044  {
1045  /* We matched some text prior to the EOB, first
1046  * process it.
1047  */
1048  return EOB_ACT_LAST_MATCH;
1049  }
1050  }
1051 
1052  /* Try to read more data. */
1053 
1054  /* First move last chars to start of buffer. */
1055  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1056 
1057  for ( i = 0; i < number_to_move; ++i )
1058  *(dest++) = *(source++);
1059 
1060  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1061  /* don't do the read, it's not guaranteed to return an EOF,
1062  * just force an EOF
1063  */
1064  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1065 
1066  else
1067  {
1068  int num_to_read =
1069  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1070 
1071  while ( num_to_read <= 0 )
1072  { /* Not enough room in the buffer - grow it. */
1073 
1074  /* just a shorter name for the current buffer */
1076 
1077  int yy_c_buf_p_offset =
1078  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1079 
1080  if ( b->yy_is_our_buffer )
1081  {
1082  int new_size = b->yy_buf_size * 2;
1083 
1084  if ( new_size <= 0 )
1085  b->yy_buf_size += b->yy_buf_size / 8;
1086  else
1087  b->yy_buf_size *= 2;
1088 
1089  b->yy_ch_buf = (char *)
1090  /* Include room in for 2 EOB chars. */
1091  gse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1092  }
1093  else
1094  /* Can't grow it, we don't own it. */
1095  b->yy_ch_buf = 0;
1096 
1097  if ( ! b->yy_ch_buf )
1099  "fatal error - scanner input buffer overflow" );
1100 
1101  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1102 
1103  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1104  number_to_move - 1;
1105 
1106  }
1107 
1108  if ( num_to_read > YY_READ_BUF_SIZE )
1109  num_to_read = YY_READ_BUF_SIZE;
1110 
1111  /* Read in more data. */
1112  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1113  (yy_n_chars), (size_t) num_to_read );
1114 
1115  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1116  }
1117 
1118  if ( (yy_n_chars) == 0 )
1119  {
1120  if ( number_to_move == YY_MORE_ADJ )
1121  {
1122  ret_val = EOB_ACT_END_OF_FILE;
1123  gse_restart(gse_in );
1124  }
1125 
1126  else
1127  {
1128  ret_val = EOB_ACT_LAST_MATCH;
1129  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1131  }
1132  }
1133 
1134  else
1135  ret_val = EOB_ACT_CONTINUE_SCAN;
1136 
1137  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1138  /* Extend the array by 50%, plus the number we really need. */
1139  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1140  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) gse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1141  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1142  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1143  }
1144 
1145  (yy_n_chars) += number_to_move;
1146  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1147  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1148 
1149  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1150 
1151  return ret_val;
1152 }
1153 
1154 /* yy_get_previous_state - get the state just before the EOB char was reached */
1155 
1156  static yy_state_type yy_get_previous_state (void)
1157 {
1158  register yy_state_type yy_current_state;
1159  register char *yy_cp;
1160 
1161  yy_current_state = (yy_start);
1162 
1163  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1164  {
1165  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1166  if ( yy_accept[yy_current_state] )
1167  {
1168  (yy_last_accepting_state) = yy_current_state;
1169  (yy_last_accepting_cpos) = yy_cp;
1170  }
1171  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1172  {
1173  yy_current_state = (int) yy_def[yy_current_state];
1174  if ( yy_current_state >= 32 )
1175  yy_c = yy_meta[(unsigned int) yy_c];
1176  }
1177  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1178  }
1179 
1180  return yy_current_state;
1181 }
1182 
1183 /* yy_try_NUL_trans - try to make a transition on the NUL character
1184  *
1185  * synopsis
1186  * next_state = yy_try_NUL_trans( current_state );
1187  */
1188  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1189 {
1190  register int yy_is_jam;
1191  register char *yy_cp = (yy_c_buf_p);
1192 
1193  register YY_CHAR yy_c = 1;
1194  if ( yy_accept[yy_current_state] )
1195  {
1196  (yy_last_accepting_state) = yy_current_state;
1197  (yy_last_accepting_cpos) = yy_cp;
1198  }
1199  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1200  {
1201  yy_current_state = (int) yy_def[yy_current_state];
1202  if ( yy_current_state >= 32 )
1203  yy_c = yy_meta[(unsigned int) yy_c];
1204  }
1205  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1206  yy_is_jam = (yy_current_state == 31);
1207 
1208  return yy_is_jam ? 0 : yy_current_state;
1209 }
1210 
1211 #ifndef YY_NO_INPUT
1212 #ifdef __cplusplus
1213  static int yyinput (void)
1214 #else
1215  static int input (void)
1216 #endif
1217 
1218 {
1219  int c;
1220 
1221  *(yy_c_buf_p) = (yy_hold_char);
1222 
1223  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1224  {
1225  /* yy_c_buf_p now points to the character we want to return.
1226  * If this occurs *before* the EOB characters, then it's a
1227  * valid NUL; if not, then we've hit the end of the buffer.
1228  */
1229  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1230  /* This was really a NUL. */
1231  *(yy_c_buf_p) = '\0';
1232 
1233  else
1234  { /* need more input */
1235  int offset = (yy_c_buf_p) - (yytext_ptr);
1236  ++(yy_c_buf_p);
1237 
1238  switch ( yy_get_next_buffer( ) )
1239  {
1240  case EOB_ACT_LAST_MATCH:
1241  /* This happens because yy_g_n_b()
1242  * sees that we've accumulated a
1243  * token and flags that we need to
1244  * try matching the token before
1245  * proceeding. But for input(),
1246  * there's no matching to consider.
1247  * So convert the EOB_ACT_LAST_MATCH
1248  * to EOB_ACT_END_OF_FILE.
1249  */
1250 
1251  /* Reset buffer status. */
1252  gse_restart(gse_in );
1253 
1254  /*FALLTHROUGH*/
1255 
1256  case EOB_ACT_END_OF_FILE:
1257  {
1258  if ( gse_wrap( ) )
1259  return EOF;
1260 
1261  if ( ! (yy_did_buffer_switch_on_eof) )
1262  YY_NEW_FILE;
1263 #ifdef __cplusplus
1264  return yyinput();
1265 #else
1266  return input();
1267 #endif
1268  }
1269 
1270  case EOB_ACT_CONTINUE_SCAN:
1271  (yy_c_buf_p) = (yytext_ptr) + offset;
1272  break;
1273  }
1274  }
1275  }
1276 
1277  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1278  *(yy_c_buf_p) = '\0'; /* preserve gse_text */
1279  (yy_hold_char) = *++(yy_c_buf_p);
1280 
1281  return c;
1282 }
1283 #endif /* ifndef YY_NO_INPUT */
1284 
1290  void gse_restart (FILE * input_file )
1291 {
1292 
1293  if ( ! YY_CURRENT_BUFFER ){
1294  gse_ensure_buffer_stack ();
1297  }
1298 
1299  gse__init_buffer(YY_CURRENT_BUFFER,input_file );
1300  gse__load_buffer_state( );
1301 }
1302 
1308 {
1309 
1310  /* TODO. We should be able to replace this entire function body
1311  * with
1312  * gse_pop_buffer_state();
1313  * gse_push_buffer_state(new_buffer);
1314  */
1315  gse_ensure_buffer_stack ();
1316  if ( YY_CURRENT_BUFFER == new_buffer )
1317  return;
1318 
1319  if ( YY_CURRENT_BUFFER )
1320  {
1321  /* Flush out information for old buffer. */
1322  *(yy_c_buf_p) = (yy_hold_char);
1323  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1324  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1325  }
1326 
1327  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1328  gse__load_buffer_state( );
1329 
1330  /* We don't actually know whether we did this switch during
1331  * EOF (gse_wrap()) processing, but the only time this flag
1332  * is looked at is after gse_wrap() is called, so it's safe
1333  * to go ahead and always set it.
1334  */
1335  (yy_did_buffer_switch_on_eof) = 1;
1336 }
1337 
1338 static void gse__load_buffer_state (void)
1339 {
1340  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1341  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1342  gse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1343  (yy_hold_char) = *(yy_c_buf_p);
1344 }
1345 
1352  YY_BUFFER_STATE gse__create_buffer (FILE * file, int size )
1353 {
1354  YY_BUFFER_STATE b;
1355 
1356  b = (YY_BUFFER_STATE) gse_alloc(sizeof( struct yy_buffer_state ) );
1357  if ( ! b )
1358  YY_FATAL_ERROR( "out of dynamic memory in gse__create_buffer()" );
1359 
1360  b->yy_buf_size = size;
1361 
1362  /* yy_ch_buf has to be 2 characters longer than the size given because
1363  * we need to put in 2 end-of-buffer characters.
1364  */
1365  b->yy_ch_buf = (char *) gse_alloc(b->yy_buf_size + 2 );
1366  if ( ! b->yy_ch_buf )
1367  YY_FATAL_ERROR( "out of dynamic memory in gse__create_buffer()" );
1368 
1369  b->yy_is_our_buffer = 1;
1370 
1371  gse__init_buffer(b,file );
1372 
1373  return b;
1374 }
1375 
1381 {
1382 
1383  if ( ! b )
1384  return;
1385 
1386  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1388 
1389  if ( b->yy_is_our_buffer )
1390  gse_free((void *) b->yy_ch_buf );
1391 
1392  gse_free((void *) b );
1393 }
1394 
1395 #ifndef __cplusplus
1396 extern int isatty (int );
1397 #endif /* __cplusplus */
1398 
1399 /* Initializes or reinitializes a buffer.
1400  * This function is sometimes called more than once on the same buffer,
1401  * such as during a gse_restart() or at EOF.
1402  */
1403  static void gse__init_buffer (YY_BUFFER_STATE b, FILE * file )
1404 
1405 {
1406  int oerrno = errno;
1407 
1408  gse__flush_buffer(b );
1409 
1410  b->yy_input_file = file;
1411  b->yy_fill_buffer = 1;
1412 
1413  /* If b is the current buffer, then gse__init_buffer was _probably_
1414  * called from gse_restart() or through yy_get_next_buffer.
1415  * In that case, we don't want to reset the lineno or column.
1416  */
1417  if (b != YY_CURRENT_BUFFER){
1418  b->yy_bs_lineno = 1;
1419  b->yy_bs_column = 0;
1420  }
1421 
1422  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1423 
1424  errno = oerrno;
1425 }
1426 
1432 {
1433  if ( ! b )
1434  return;
1435 
1436  b->yy_n_chars = 0;
1437 
1438  /* We always need two end-of-buffer characters. The first causes
1439  * a transition to the end-of-buffer state. The second causes
1440  * a jam in that state.
1441  */
1442  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1443  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1444 
1445  b->yy_buf_pos = &b->yy_ch_buf[0];
1446 
1447  b->yy_at_bol = 1;
1448  b->yy_buffer_status = YY_BUFFER_NEW;
1449 
1450  if ( b == YY_CURRENT_BUFFER )
1451  gse__load_buffer_state( );
1452 }
1453 
1461 {
1462  if (new_buffer == NULL)
1463  return;
1464 
1465  gse_ensure_buffer_stack();
1466 
1467  /* This block is copied from gse__switch_to_buffer. */
1468  if ( YY_CURRENT_BUFFER )
1469  {
1470  /* Flush out information for old buffer. */
1471  *(yy_c_buf_p) = (yy_hold_char);
1472  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1473  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1474  }
1475 
1476  /* Only push if top exists. Otherwise, replace top. */
1477  if (YY_CURRENT_BUFFER)
1478  (yy_buffer_stack_top)++;
1479  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1480 
1481  /* copied from gse__switch_to_buffer. */
1482  gse__load_buffer_state( );
1483  (yy_did_buffer_switch_on_eof) = 1;
1484 }
1485 
1491 {
1492  if (!YY_CURRENT_BUFFER)
1493  return;
1494 
1496  YY_CURRENT_BUFFER_LVALUE = NULL;
1497  if ((yy_buffer_stack_top) > 0)
1498  --(yy_buffer_stack_top);
1499 
1500  if (YY_CURRENT_BUFFER) {
1501  gse__load_buffer_state( );
1502  (yy_did_buffer_switch_on_eof) = 1;
1503  }
1504 }
1505 
1506 /* Allocates the stack if it does not exist.
1507  * Guarantees space for at least one push.
1508  */
1509 static void gse_ensure_buffer_stack (void)
1510 {
1511  int num_to_alloc;
1512 
1513  if (!(yy_buffer_stack)) {
1514 
1515  /* First allocation is just for 2 elements, since we don't know if this
1516  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1517  * immediate realloc on the next call.
1518  */
1519  num_to_alloc = 1;
1520  (yy_buffer_stack) = (struct yy_buffer_state**)gse_alloc
1521  (num_to_alloc * sizeof(struct yy_buffer_state*)
1522  );
1523  if ( ! (yy_buffer_stack) )
1524  YY_FATAL_ERROR( "out of dynamic memory in gse_ensure_buffer_stack()" );
1525 
1526  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1527 
1528  (yy_buffer_stack_max) = num_to_alloc;
1529  (yy_buffer_stack_top) = 0;
1530  return;
1531  }
1532 
1533  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1534 
1535  /* Increase the buffer to prepare for a possible push. */
1536  int grow_size = 8 /* arbitrary grow size */;
1537 
1538  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1539  (yy_buffer_stack) = (struct yy_buffer_state**)gse_realloc
1540  ((yy_buffer_stack),
1541  num_to_alloc * sizeof(struct yy_buffer_state*)
1542  );
1543  if ( ! (yy_buffer_stack) )
1544  YY_FATAL_ERROR( "out of dynamic memory in gse_ensure_buffer_stack()" );
1545 
1546  /* zero only the new slots.*/
1547  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1548  (yy_buffer_stack_max) = num_to_alloc;
1549  }
1550 }
1551 
1559 {
1560  YY_BUFFER_STATE b;
1561 
1562  if ( size < 2 ||
1563  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1564  base[size-1] != YY_END_OF_BUFFER_CHAR )
1565  /* They forgot to leave room for the EOB's. */
1566  return 0;
1567 
1568  b = (YY_BUFFER_STATE) gse_alloc(sizeof( struct yy_buffer_state ) );
1569  if ( ! b )
1570  YY_FATAL_ERROR( "out of dynamic memory in gse__scan_buffer()" );
1571 
1572  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1573  b->yy_buf_pos = b->yy_ch_buf = base;
1574  b->yy_is_our_buffer = 0;
1575  b->yy_input_file = 0;
1576  b->yy_n_chars = b->yy_buf_size;
1577  b->yy_is_interactive = 0;
1578  b->yy_at_bol = 1;
1579  b->yy_fill_buffer = 0;
1580  b->yy_buffer_status = YY_BUFFER_NEW;
1581 
1583 
1584  return b;
1585 }
1586 
1596 {
1597 
1598  return gse__scan_bytes(yystr,strlen(yystr) );
1599 }
1600 
1608 YY_BUFFER_STATE gse__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1609 {
1610  YY_BUFFER_STATE b;
1611  char *buf;
1612  yy_size_t n;
1613  int i;
1614 
1615  /* Get memory for full buffer, including space for trailing EOB's. */
1616  n = _yybytes_len + 2;
1617  buf = (char *) gse_alloc(n );
1618  if ( ! buf )
1619  YY_FATAL_ERROR( "out of dynamic memory in gse__scan_bytes()" );
1620 
1621  for ( i = 0; i < _yybytes_len; ++i )
1622  buf[i] = yybytes[i];
1623 
1624  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1625 
1626  b = gse__scan_buffer(buf,n );
1627  if ( ! b )
1628  YY_FATAL_ERROR( "bad buffer in gse__scan_bytes()" );
1629 
1630  /* It's okay to grow etc. this buffer, and we should throw it
1631  * away when we're done.
1632  */
1633  b->yy_is_our_buffer = 1;
1634 
1635  return b;
1636 }
1637 
1638 #ifndef YY_EXIT_FAILURE
1639 #define YY_EXIT_FAILURE 2
1640 #endif
1641 
1642 static void yy_fatal_error (yyconst char* msg )
1643 {
1644  (void) fprintf( stderr, "%s\n", msg );
1645  exit( YY_EXIT_FAILURE );
1646 }
1647 
1648 /* Redefine yyless() so it works in section 3 code. */
1649 
1650 #undef yyless
1651 #define yyless(n) \
1652  do \
1653  { \
1654  /* Undo effects of setting up gse_text. */ \
1655  int yyless_macro_arg = (n); \
1656  YY_LESS_LINENO(yyless_macro_arg);\
1657  gse_text[gse_leng] = (yy_hold_char); \
1658  (yy_c_buf_p) = gse_text + yyless_macro_arg; \
1659  (yy_hold_char) = *(yy_c_buf_p); \
1660  *(yy_c_buf_p) = '\0'; \
1661  gse_leng = yyless_macro_arg; \
1662  } \
1663  while ( 0 )
1664 
1665 /* Accessor methods (get/set functions) to struct members. */
1666 
1670 int gse_get_lineno (void)
1671 {
1672 
1673  return gse_lineno;
1674 }
1675 
1679 FILE *gse_get_in (void)
1680 {
1681  return gse_in;
1682 }
1683 
1687 FILE *gse_get_out (void)
1688 {
1689  return gse_out;
1690 }
1691 
1695 int gse_get_leng (void)
1696 {
1697  return gse_leng;
1698 }
1699 
1704 char *gse_get_text (void)
1705 {
1706  return gse_text;
1707 }
1708 
1713 void gse_set_lineno (int line_number )
1714 {
1715 
1716  gse_lineno = line_number;
1717 }
1718 
1725 void gse_set_in (FILE * in_str )
1726 {
1727  gse_in = in_str ;
1728 }
1729 
1730 void gse_set_out (FILE * out_str )
1731 {
1732  gse_out = out_str ;
1733 }
1734 
1735 int gse_get_debug (void)
1736 {
1737  return gse__flex_debug;
1738 }
1739 
1740 void gse_set_debug (int bdebug )
1741 {
1742  gse__flex_debug = bdebug ;
1743 }
1744 
1745 static int yy_init_globals (void)
1746 {
1747  /* Initialization is the same as for the non-reentrant scanner.
1748  * This function is called from gse_lex_destroy(), so don't allocate here.
1749  */
1750 
1751  (yy_buffer_stack) = 0;
1752  (yy_buffer_stack_top) = 0;
1753  (yy_buffer_stack_max) = 0;
1754  (yy_c_buf_p) = (char *) 0;
1755  (yy_init) = 0;
1756  (yy_start) = 0;
1757 
1758 /* Defined in main.c */
1759 #ifdef YY_STDINIT
1760  gse_in = stdin;
1761  gse_out = stdout;
1762 #else
1763  gse_in = (FILE *) 0;
1764  gse_out = (FILE *) 0;
1765 #endif
1766 
1767  /* For future reference: Set errno on error, since we are called by
1768  * gse_lex_init()
1769  */
1770  return 0;
1771 }
1772 
1773 /* gse_lex_destroy is for both reentrant and non-reentrant scanners. */
1775 {
1776 
1777  /* Pop the buffer stack, destroying each element. */
1778  while(YY_CURRENT_BUFFER){
1780  YY_CURRENT_BUFFER_LVALUE = NULL;
1782  }
1783 
1784  /* Destroy the stack itself. */
1785  gse_free((yy_buffer_stack) );
1786  (yy_buffer_stack) = NULL;
1787 
1788  /* Reset the globals. This is important in a non-reentrant scanner so the next time
1789  * gse_lex() is called, initialization will occur. */
1790  yy_init_globals( );
1791 
1792  return 0;
1793 }
1794 
1795 /*
1796  * Internal utility routines.
1797  */
1798 
1799 #ifndef yytext_ptr
1800 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1801 {
1802  register int i;
1803  for ( i = 0; i < n; ++i )
1804  s1[i] = s2[i];
1805 }
1806 #endif
1807 
1808 #ifdef YY_NEED_STRLEN
1809 static int yy_flex_strlen (yyconst char * s )
1810 {
1811  register int n;
1812  for ( n = 0; s[n]; ++n )
1813  ;
1814 
1815  return n;
1816 }
1817 #endif
1818 
1819 void *gse_alloc (yy_size_t size )
1820 {
1821  return (void *) malloc( size );
1822 }
1823 
1824 void *gse_realloc (void * ptr, yy_size_t size )
1825 {
1826  /* The cast to (char *) in the following accommodates both
1827  * implementations that use char* generic pointers, and those
1828  * that use void* generic pointers. It works with the latter
1829  * because both ANSI C and C++ allow castless assignment from
1830  * any pointer type to void*, and deal with argument conversions
1831  * as though doing an assignment.
1832  */
1833  return (void *) realloc( (char *) ptr, size );
1834 }
1835 
1836 void gse_free (void * ptr )
1837 {
1838  free( (char *) ptr ); /* see gse_realloc() for (char *) cast */
1839 }
1840 
1841 #define YYTABLES_NAME "yytables"
1842 
1843 #line 123 "gse.lex"
1844 
1845 
1846 
1847 // Three glue routines for string scanning. These are not declared in the
1848 // header gse.tab.h nor is YY_BUFFER_STATE. Including these here allows them
1849 // to see the type definitions in lex.gse.c (where YY_BUFFER_STATE is
1850 // defined) and allows callers to declare them (since callers outside of this
1851 // file cannot declare YY_BUFFER_STATE variable).
1852 
1853 void *
1854 gse_string(const char *str)
1855 {
1856  return (void *)gse__scan_string(str);
1857 }
1858 
1859 void
1861 {
1863 }
1864 
1865 void
1867 {
1869 }
1870 
1871 // Note that the grid() CE function only deals with numeric maps (8/28/2001
1872 // jhrg) and that all comparisons are done using doubles.
1873 
1874 static void
1875 store_int32()
1876 {
1877  gse_lval.val = atof(gse_text);
1878 }
1879 
1880 static void
1881 store_float64()
1882 {
1883  gse_lval.val = atof(gse_text);
1884 }
1885 
1886 static void
1887 store_id()
1888 {
1889  strncpy(gse_lval.id, gse_text, ID_MAX-1);
1890  gse_lval.id[ID_MAX-1] = '\0';
1891 }
1892 
1893 static void
1894 store_op(int op)
1895 {
1896  gse_lval.op = op;
1897 }
1898 
1899 
int gse_get_leng(void)
Get the length of the current token.
Definition: lex.gse.cc:1695
void * gse_realloc(void *, yy_size_t)
Definition: lex.gse.cc:1824
#define YY_EXTRA_TYPE
Definition: lex.gse.cc:579
#define YY_BUFFER_NEW
Definition: lex.gse.cc:254
#define YY_BUF_SIZE
Definition: lex.gse.cc:163
#define EOB_ACT_END_OF_FILE
Definition: lex.gse.cc:180
void gse_restart(FILE *input_file)
Immediately switch to a different input stream.
Definition: lex.gse.cc:1290
#define YY_CURRENT_BUFFER
Definition: lex.gse.cc:282
int gse_get_debug(void)
Definition: lex.gse.cc:1735
#define YY_NEW_FILE
Definition: lex.gse.cc:157
int gse_lex(void)
#define YY_SC_TO_UI(c)
Definition: lex.gse.cc:138
#define YY_DO_BEFORE_ACTION
Definition: lex.gse.cc:378
int gse_lineno
Definition: lex.gse.cc:365
FILE * gse_get_out(void)
Get the output stream.
Definition: lex.gse.cc:1687
void gse_delete_buffer(void *buf)
Definition: lex.gse.cc:1866
FILE * gse_in
Definition: lex.gse.cc:359
YY_BUFFER_STATE gse__scan_buffer(char *base, yy_size_t size)
Setup the input buffer state to scan directly from a user-specified character buffer.
Definition: lex.gse.cc:1558
#define yyconst
Definition: lex.gse.cc:127
#define YY_BREAK
Definition: lex.gse.cc:732
register int yy_act
Definition: lex.gse.cc:744
#define YY_END_OF_BUFFER_CHAR
Definition: lex.gse.cc:159
#define yytext_ptr
Definition: lex.gse.cc:368
#define YY_RULE_SETUP
Definition: lex.gse.cc:735
void * gse_alloc(yy_size_t)
Definition: lex.gse.cc:1819
short int flex_int16_t
Definition: lex.gse.cc:71
unsigned short int flex_uint16_t
Definition: lex.gse.cc:74
void gse__flush_buffer(YY_BUFFER_STATE b)
Discard all buffered characters.
Definition: lex.gse.cc:1431
signed char flex_int8_t
Definition: lex.gse.cc:70
int yy_state_type
Definition: lex.gse.cc:361
char * gse_get_text(void)
Get the current token.
Definition: lex.gse.cc:1704
#define YY_CURRENT_BUFFER_LVALUE
Definition: lex.gse.cc:289
unsigned int flex_uint32_t
Definition: lex.gse.cc:75
void gse_switch_to_buffer(void *buf)
Definition: lex.gse.cc:1860
register char * yy_bp
Definition: lex.gse.cc:743
YY_BUFFER_STATE gse__scan_string(yyconst char *yy_str)
Setup the input buffer state to scan a string.
Definition: lex.gse.cc:1595
void gse_free(void *)
Definition: lex.gse.cc:1836
#define YY_READ_BUF_SIZE
Definition: lex.gse.cc:645
void gse_pop_buffer_state(void)
Removes and deletes the top of the stack, if present.
Definition: lex.gse.cc:1490
int isatty(int)
void gse_set_lineno(int line_number)
Set the current line number.
Definition: lex.gse.cc:1713
YY_BUFFER_STATE gse__scan_bytes(yyconst char *bytes, int len)
Setup the input buffer state to scan the given bytes.
Definition: lex.gse.cc:1608
#define YY_STATE_EOF(state)
Definition: lex.gse.cc:154
int gse_lex_destroy(void)
Definition: lex.gse.cc:1774
int gse__flex_debug
Definition: lex.gse.cc:480
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lex.gse.cc:488
void gse_set_debug(int debug_flag)
Definition: lex.gse.cc:1740
#define EOB_ACT_CONTINUE_SCAN
Definition: lex.gse.cc:179
char * gse_text
Definition: lex.gse.cc:489
register char * yy_cp
Definition: lex.gse.cc:743
#define YY_EXIT_FAILURE
Definition: lex.gse.cc:1639
#define INITIAL
Definition: lex.gse.cc:568
void gse_push_buffer_state(YY_BUFFER_STATE new_buffer)
Pushes the new state onto the stack.
Definition: lex.gse.cc:1460
#define gse_wrap(n)
Definition: lex.gse.cc:354
FILE * gse_out
Definition: lex.gse.cc:359
#define YY_FATAL_ERROR(msg)
Definition: lex.gse.cc:549
YY_EXTRA_TYPE gse_get_extra(void)
#define YY_MORE_ADJ
Definition: lex.gse.cc:487
#define YY_END_OF_BUFFER
Definition: lex.gse.cc:386
void * gse_string(const char *str)
Definition: lex.gse.cc:1854
int flex_int32_t
Definition: lex.gse.cc:72
void gse_set_in(FILE *in_str)
Set the input stream.
Definition: lex.gse.cc:1725
#define YY_BUFFER_NORMAL
Definition: lex.gse.cc:255
unsigned char YY_CHAR
Definition: lex.gse.cc:357
#define yyterminate()
Definition: lex.gse.cc:697
#define EOB_ACT_LAST_MATCH
Definition: lex.gse.cc:181
void gse_set_out(FILE *out_str)
Definition: lex.gse.cc:1730
#define YY_DECL
Definition: lex.gse.cc:543
YY_BUFFER_STATE gse__create_buffer(FILE *file, int size)
Allocate and initialize an input buffer state.
Definition: lex.gse.cc:1352
unsigned char flex_uint8_t
Definition: lex.gse.cc:73
size_t yy_size_t
Definition: lex.gse.cc:203
FILE * gse_get_in(void)
Get the input stream.
Definition: lex.gse.cc:1679
#define YY_INPUT(buf, result, max_size)
Definition: lex.gse.cc:660
#define YY_BUFFER_EOF_PENDING
Definition: lex.gse.cc:266
#define ECHO
Definition: lex.gse.cc:653
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lex.gse.cc:172
#define YY_START
Definition: lex.gse.cc:150
int gse_get_lineno(void)
Get the current line number.
Definition: lex.gse.cc:1670
void gse__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Switch to a different input buffer.
Definition: lex.gse.cc:1307
int gse_leng
Definition: lex.gse.cc:294
#define ID_MAX
Definition: lex.gse.cc:544
void gse__delete_buffer(YY_BUFFER_STATE b)
Destroy the buffer.
Definition: lex.gse.cc:1380
void gse_set_extra(YY_EXTRA_TYPE user_defined)