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