~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to contrib/cube/cubescan.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#line 2 "cubescan.c"
 
2
 
 
3
#line 4 "cubescan.c"
 
4
 
 
5
#define  YY_INT_ALIGNED short int
 
6
 
 
7
/* A lexical scanner generated by flex */
 
8
 
 
9
#define yy_create_buffer cube_yy_create_buffer
 
10
#define yy_delete_buffer cube_yy_delete_buffer
 
11
#define yy_flex_debug cube_yy_flex_debug
 
12
#define yy_init_buffer cube_yy_init_buffer
 
13
#define yy_flush_buffer cube_yy_flush_buffer
 
14
#define yy_load_buffer_state cube_yy_load_buffer_state
 
15
#define yy_switch_to_buffer cube_yy_switch_to_buffer
 
16
#define yyin cube_yyin
 
17
#define yyleng cube_yyleng
 
18
#define yylex cube_yylex
 
19
#define yylineno cube_yylineno
 
20
#define yyout cube_yyout
 
21
#define yyrestart cube_yyrestart
 
22
#define yytext cube_yytext
 
23
#define yywrap cube_yywrap
 
24
#define yyalloc cube_yyalloc
 
25
#define yyrealloc cube_yyrealloc
 
26
#define yyfree cube_yyfree
 
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 cube_yyrestart(cube_yyin  )
 
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 cube_yyleng;
 
176
 
 
177
extern FILE *cube_yyin, *cube_yyout;
 
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 cube_yytext. */ \
 
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 cube_yytext 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; /**< The line count. */
 
245
    int yy_bs_column; /**< The column count. */
 
246
    
 
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 cube_yyrestart()), so that the user can continue scanning by
 
264
         * just pointing cube_yyin 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; /**< index of top of stack. */
 
273
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
 
274
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
275
 
 
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 cube_yytext is formed. */
 
292
static char yy_hold_char;
 
293
static int yy_n_chars;          /* number of characters read into yy_ch_buf */
 
294
int cube_yyleng;
 
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 cube_yywrap()'s to do buffer switches
 
302
 * instead of setting up a fresh cube_yyin.  A bit of a hack ...
 
303
 */
 
304
static int yy_did_buffer_switch_on_eof;
 
305
 
 
306
void cube_yyrestart (FILE *input_file  );
 
307
void cube_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
 
308
YY_BUFFER_STATE cube_yy_create_buffer (FILE *file,int size  );
 
309
void cube_yy_delete_buffer (YY_BUFFER_STATE b  );
 
310
void cube_yy_flush_buffer (YY_BUFFER_STATE b  );
 
311
void cube_yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
 
312
void cube_yypop_buffer_state (void );
 
313
 
 
314
static void cube_yyensure_buffer_stack (void );
 
315
static void cube_yy_load_buffer_state (void );
 
316
static void cube_yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
317
 
 
318
#define YY_FLUSH_BUFFER cube_yy_flush_buffer(YY_CURRENT_BUFFER )
 
319
 
 
320
YY_BUFFER_STATE cube_yy_scan_buffer (char *base,yy_size_t size  );
 
321
YY_BUFFER_STATE cube_yy_scan_string (yyconst char *yy_str  );
 
322
YY_BUFFER_STATE cube_yy_scan_bytes (yyconst char *bytes,int len  );
 
323
 
 
324
void *cube_yyalloc (yy_size_t  );
 
325
void *cube_yyrealloc (void *,yy_size_t  );
 
326
void cube_yyfree (void *  );
 
327
 
 
328
#define yy_new_buffer cube_yy_create_buffer
 
329
 
 
330
#define yy_set_interactive(is_interactive) \
 
331
        { \
 
332
        if ( ! YY_CURRENT_BUFFER ){ \
 
333
        cube_yyensure_buffer_stack (); \
 
334
                YY_CURRENT_BUFFER_LVALUE =    \
 
335
            cube_yy_create_buffer(cube_yyin,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
        cube_yyensure_buffer_stack (); \
 
344
                YY_CURRENT_BUFFER_LVALUE =    \
 
345
            cube_yy_create_buffer(cube_yyin,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 cube_yywrap(n) 1
 
355
#define YY_SKIP_YYWRAP
 
356
 
 
357
typedef unsigned char YY_CHAR;
 
358
 
 
359
FILE *cube_yyin = (FILE *) 0, *cube_yyout = (FILE *) 0;
 
360
 
 
361
typedef int yy_state_type;
 
362
 
 
363
extern int cube_yylineno;
 
364
 
 
365
int cube_yylineno = 1;
 
366
 
 
367
extern char *cube_yytext;
 
368
#define yytext_ptr cube_yytext
 
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 cube_yytext.
 
377
 */
 
378
#define YY_DO_BEFORE_ACTION \
 
379
        (yytext_ptr) = yy_bp; \
 
380
        cube_yyleng = (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 9
 
386
#define YY_END_OF_BUFFER 10
 
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[25] =
 
395
    {   0,
 
396
        0,    0,   10,    8,    7,    7,    4,    5,    8,    6,
 
397
        8,    1,    2,    3,    7,    0,    1,    1,    1,    0,
 
398
        1,    0,    1,    0
 
399
    } ;
 
400
 
 
401
static yyconst flex_int32_t yy_ec[256] =
 
402
    {   0,
 
403
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
 
404
        1,    2,    2,    1,    1,    1,    1,    1,    1,    1,
 
405
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
406
        1,    2,    1,    1,    1,    1,    1,    1,    1,    4,
 
407
        5,    1,    6,    7,    6,    8,    1,    9,    9,    9,
 
408
        9,    9,    9,    9,    9,    9,    9,    1,    1,    1,
 
409
        1,    1,    1,    1,    1,    1,    1,    1,   10,    1,
 
410
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
411
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
412
       11,    1,   12,    1,    1,    1,    1,    1,    1,    1,
 
413
 
 
414
       10,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
415
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
416
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
417
        1,    1,    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
 
 
425
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
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
 
431
    } ;
 
432
 
 
433
static yyconst flex_int32_t yy_meta[13] =
 
434
    {   0,
 
435
        1,    2,    2,    1,    1,    1,    1,    1,    1,    1,
 
436
        1,    1
 
437
    } ;
 
438
 
 
439
static yyconst flex_int16_t yy_base[26] =
 
440
    {   0,
 
441
        0,    0,   28,   29,    0,    0,   29,   29,    5,   29,
 
442
       18,    7,   29,   29,    0,   17,    0,    9,   16,   14,
 
443
        0,   15,   13,   29,   19
 
444
    } ;
 
445
 
 
446
static yyconst flex_int16_t yy_def[26] =
 
447
    {   0,
 
448
       24,    1,   24,   24,   25,   25,   24,   24,   24,   24,
 
449
       24,   24,   24,   24,   25,   24,   12,   24,   18,   24,
 
450
       19,   24,   24,    0,   24
 
451
    } ;
 
452
 
 
453
static yyconst flex_int16_t yy_nxt[42] =
 
454
    {   0,
 
455
        4,    5,    6,    7,    8,    9,   10,   11,   12,    4,
 
456
       13,   14,   16,   17,   19,   17,   20,   18,   20,   22,
 
457
       15,   23,   23,   23,   21,   18,   18,   24,    3,   24,
 
458
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
 
459
       24
 
460
    } ;
 
461
 
 
462
static yyconst flex_int16_t yy_chk[42] =
 
463
    {   0,
 
464
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
465
        1,    1,    9,    9,   12,   12,   12,   18,   18,   20,
 
466
       25,   23,   20,   22,   19,   16,   11,    3,   24,   24,
 
467
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
 
468
       24
 
469
    } ;
 
470
 
 
471
static yy_state_type yy_last_accepting_state;
 
472
static char *yy_last_accepting_cpos;
 
473
 
 
474
extern int cube_yy_flex_debug;
 
475
int cube_yy_flex_debug = 0;
 
476
 
 
477
/* The intent behind this definition is that it'll catch
 
478
 * any uses of REJECT which flex missed.
 
479
 */
 
480
#define REJECT reject_used_but_not_detected
 
481
#define yymore() yymore_used_but_not_detected
 
482
#define YY_MORE_ADJ 0
 
483
#define YY_RESTORE_YY_MORE_OFFSET
 
484
char *cube_yytext;
 
485
#line 1 "cubescan.l"
 
486
#line 2 "cubescan.l"
 
487
/*
 
488
 * A scanner for EMP-style numeric ranges
 
489
 * contrib/cube/cubescan.l
 
490
 */
 
491
 
 
492
#include "postgres.h"
 
493
 
 
494
/* No reason to constrain amount of data slurped */
 
495
#define YY_READ_BUF_SIZE 16777216
 
496
 
 
497
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
 
498
#undef fprintf
 
499
#define fprintf(file, fmt, msg)  ereport(ERROR, (errmsg_internal("%s", msg)))
 
500
 
 
501
/* Handles to the buffer that the lexer uses internally */
 
502
static YY_BUFFER_STATE scanbufhandle;
 
503
/* this is now declared in cubeparse.y: */
 
504
/* static char *scanbuf; */
 
505
/* static int   scanbuflen; */
 
506
 
 
507
/* flex 2.5.4 doesn't bother with a decl for this */
 
508
int cube_yylex(void);
 
509
 
 
510
void cube_scanner_init(const char *str);
 
511
void cube_scanner_finish(void);
 
512
#define YY_NO_INPUT 1
 
513
#line 514 "cubescan.c"
 
514
 
 
515
#define INITIAL 0
 
516
 
 
517
#ifndef YY_NO_UNISTD_H
 
518
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 
519
 * down here because we want the user's section 1 to have been scanned first.
 
520
 * The user has a chance to override it with an option.
 
521
 */
 
522
#include <unistd.h>
 
523
#endif
 
524
 
 
525
#ifndef YY_EXTRA_TYPE
 
526
#define YY_EXTRA_TYPE void *
 
527
#endif
 
528
 
 
529
static int yy_init_globals (void );
 
530
 
 
531
/* Accessor methods to globals.
 
532
   These are made visible to non-reentrant scanners for convenience. */
 
533
 
 
534
int cube_yylex_destroy (void );
 
535
 
 
536
int cube_yyget_debug (void );
 
537
 
 
538
void cube_yyset_debug (int debug_flag  );
 
539
 
 
540
YY_EXTRA_TYPE cube_yyget_extra (void );
 
541
 
 
542
void cube_yyset_extra (YY_EXTRA_TYPE user_defined  );
 
543
 
 
544
FILE *cube_yyget_in (void );
 
545
 
 
546
void cube_yyset_in  (FILE * in_str  );
 
547
 
 
548
FILE *cube_yyget_out (void );
 
549
 
 
550
void cube_yyset_out  (FILE * out_str  );
 
551
 
 
552
int cube_yyget_leng (void );
 
553
 
 
554
char *cube_yyget_text (void );
 
555
 
 
556
int cube_yyget_lineno (void );
 
557
 
 
558
void cube_yyset_lineno (int line_number  );
 
559
 
 
560
/* Macros after this point can all be overridden by user definitions in
 
561
 * section 1.
 
562
 */
 
563
 
 
564
#ifndef YY_SKIP_YYWRAP
 
565
#ifdef __cplusplus
 
566
extern "C" int cube_yywrap (void );
 
567
#else
 
568
extern int cube_yywrap (void );
 
569
#endif
 
570
#endif
 
571
 
 
572
#ifndef yytext_ptr
 
573
static void yy_flex_strncpy (char *,yyconst char *,int );
 
574
#endif
 
575
 
 
576
#ifdef YY_NEED_STRLEN
 
577
static int yy_flex_strlen (yyconst char * );
 
578
#endif
 
579
 
 
580
#ifndef YY_NO_INPUT
 
581
 
 
582
#ifdef __cplusplus
 
583
static int yyinput (void );
 
584
#else
 
585
static int input (void );
 
586
#endif
 
587
 
 
588
#endif
 
589
 
 
590
/* Amount of stuff to slurp up with each read. */
 
591
#ifndef YY_READ_BUF_SIZE
 
592
#define YY_READ_BUF_SIZE 8192
 
593
#endif
 
594
 
 
595
/* Copy whatever the last rule matched to the standard output. */
 
596
#ifndef ECHO
 
597
/* This used to be an fputs(), but since the string might contain NUL's,
 
598
 * we now use fwrite().
 
599
 */
 
600
#define ECHO fwrite( cube_yytext, cube_yyleng, 1, cube_yyout )
 
601
#endif
 
602
 
 
603
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 
604
 * is returned in "result".
 
605
 */
 
606
#ifndef YY_INPUT
 
607
#define YY_INPUT(buf,result,max_size) \
 
608
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 
609
                { \
 
610
                int c = '*'; \
 
611
                int n; \
 
612
                for ( n = 0; n < max_size && \
 
613
                             (c = getc( cube_yyin )) != EOF && c != '\n'; ++n ) \
 
614
                        buf[n] = (char) c; \
 
615
                if ( c == '\n' ) \
 
616
                        buf[n++] = (char) c; \
 
617
                if ( c == EOF && ferror( cube_yyin ) ) \
 
618
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
 
619
                result = n; \
 
620
                } \
 
621
        else \
 
622
                { \
 
623
                errno=0; \
 
624
                while ( (result = fread(buf, 1, max_size, cube_yyin))==0 && ferror(cube_yyin)) \
 
625
                        { \
 
626
                        if( errno != EINTR) \
 
627
                                { \
 
628
                                YY_FATAL_ERROR( "input in flex scanner failed" ); \
 
629
                                break; \
 
630
                                } \
 
631
                        errno=0; \
 
632
                        clearerr(cube_yyin); \
 
633
                        } \
 
634
                }\
 
635
\
 
636
 
 
637
#endif
 
638
 
 
639
/* No semi-colon after return; correct usage is to write "yyterminate();" -
 
640
 * we don't want an extra ';' after the "return" because that will cause
 
641
 * some compilers to complain about unreachable statements.
 
642
 */
 
643
#ifndef yyterminate
 
644
#define yyterminate() return YY_NULL
 
645
#endif
 
646
 
 
647
/* Number of entries by which start-condition stack grows. */
 
648
#ifndef YY_START_STACK_INCR
 
649
#define YY_START_STACK_INCR 25
 
650
#endif
 
651
 
 
652
/* Report a fatal error. */
 
653
#ifndef YY_FATAL_ERROR
 
654
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
 
655
#endif
 
656
 
 
657
/* end tables serialization structures and prototypes */
 
658
 
 
659
/* Default declaration of generated scanner - a define so the user can
 
660
 * easily add parameters.
 
661
 */
 
662
#ifndef YY_DECL
 
663
#define YY_DECL_IS_OURS 1
 
664
 
 
665
extern int cube_yylex (void);
 
666
 
 
667
#define YY_DECL int cube_yylex (void)
 
668
#endif /* !YY_DECL */
 
669
 
 
670
/* Code executed at the beginning of each rule, after cube_yytext and cube_yyleng
 
671
 * have been set up.
 
672
 */
 
673
#ifndef YY_USER_ACTION
 
674
#define YY_USER_ACTION
 
675
#endif
 
676
 
 
677
/* Code executed at the end of each rule. */
 
678
#ifndef YY_BREAK
 
679
#define YY_BREAK break;
 
680
#endif
 
681
 
 
682
#define YY_RULE_SETUP \
 
683
        YY_USER_ACTION
 
684
 
 
685
/** The main scanner function which does all the work.
 
686
 */
 
687
YY_DECL
 
688
{
 
689
        register yy_state_type yy_current_state;
 
690
        register char *yy_cp, *yy_bp;
 
691
        register int yy_act;
 
692
    
 
693
#line 43 "cubescan.l"
 
694
 
 
695
 
 
696
#line 697 "cubescan.c"
 
697
 
 
698
        if ( !(yy_init) )
 
699
                {
 
700
                (yy_init) = 1;
 
701
 
 
702
#ifdef YY_USER_INIT
 
703
                YY_USER_INIT;
 
704
#endif
 
705
 
 
706
                if ( ! (yy_start) )
 
707
                        (yy_start) = 1; /* first start state */
 
708
 
 
709
                if ( ! cube_yyin )
 
710
                        cube_yyin = stdin;
 
711
 
 
712
                if ( ! cube_yyout )
 
713
                        cube_yyout = stdout;
 
714
 
 
715
                if ( ! YY_CURRENT_BUFFER ) {
 
716
                        cube_yyensure_buffer_stack ();
 
717
                        YY_CURRENT_BUFFER_LVALUE =
 
718
                                cube_yy_create_buffer(cube_yyin,YY_BUF_SIZE );
 
719
                }
 
720
 
 
721
                cube_yy_load_buffer_state( );
 
722
                }
 
723
 
 
724
        while ( 1 )             /* loops until end-of-file is reached */
 
725
                {
 
726
                yy_cp = (yy_c_buf_p);
 
727
 
 
728
                /* Support of cube_yytext. */
 
729
                *yy_cp = (yy_hold_char);
 
730
 
 
731
                /* yy_bp points to the position in yy_ch_buf of the start of
 
732
                 * the current run.
 
733
                 */
 
734
                yy_bp = yy_cp;
 
735
 
 
736
                yy_current_state = (yy_start);
 
737
yy_match:
 
738
                do
 
739
                        {
 
740
                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 
741
                        if ( yy_accept[yy_current_state] )
 
742
                                {
 
743
                                (yy_last_accepting_state) = yy_current_state;
 
744
                                (yy_last_accepting_cpos) = yy_cp;
 
745
                                }
 
746
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
747
                                {
 
748
                                yy_current_state = (int) yy_def[yy_current_state];
 
749
                                if ( yy_current_state >= 25 )
 
750
                                        yy_c = yy_meta[(unsigned int) yy_c];
 
751
                                }
 
752
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
753
                        ++yy_cp;
 
754
                        }
 
755
                while ( yy_current_state != 24 );
 
756
                yy_cp = (yy_last_accepting_cpos);
 
757
                yy_current_state = (yy_last_accepting_state);
 
758
 
 
759
yy_find_action:
 
760
                yy_act = yy_accept[yy_current_state];
 
761
 
 
762
                YY_DO_BEFORE_ACTION;
 
763
 
 
764
do_action:      /* This label is used only to access EOF actions. */
 
765
 
 
766
                switch ( yy_act )
 
767
        { /* beginning of action switch */
 
768
                        case 0: /* must back up */
 
769
                        /* undo the effects of YY_DO_BEFORE_ACTION */
 
770
                        *yy_cp = (yy_hold_char);
 
771
                        yy_cp = (yy_last_accepting_cpos);
 
772
                        yy_current_state = (yy_last_accepting_state);
 
773
                        goto yy_find_action;
 
774
 
 
775
case 1:
 
776
YY_RULE_SETUP
 
777
#line 45 "cubescan.l"
 
778
yylval = cube_yytext; return CUBEFLOAT;
 
779
        YY_BREAK
 
780
case 2:
 
781
YY_RULE_SETUP
 
782
#line 46 "cubescan.l"
 
783
yylval = "("; return O_BRACKET;
 
784
        YY_BREAK
 
785
case 3:
 
786
YY_RULE_SETUP
 
787
#line 47 "cubescan.l"
 
788
yylval = ")"; return C_BRACKET;
 
789
        YY_BREAK
 
790
case 4:
 
791
YY_RULE_SETUP
 
792
#line 48 "cubescan.l"
 
793
yylval = "("; return O_PAREN;
 
794
        YY_BREAK
 
795
case 5:
 
796
YY_RULE_SETUP
 
797
#line 49 "cubescan.l"
 
798
yylval = ")"; return C_PAREN;
 
799
        YY_BREAK
 
800
case 6:
 
801
YY_RULE_SETUP
 
802
#line 50 "cubescan.l"
 
803
yylval = ")"; return COMMA;
 
804
        YY_BREAK
 
805
case 7:
 
806
/* rule 7 can match eol */
 
807
YY_RULE_SETUP
 
808
#line 51 "cubescan.l"
 
809
/* discard spaces */
 
810
        YY_BREAK
 
811
case 8:
 
812
YY_RULE_SETUP
 
813
#line 52 "cubescan.l"
 
814
return cube_yytext[0]; /* alert parser of the garbage */
 
815
        YY_BREAK
 
816
case 9:
 
817
YY_RULE_SETUP
 
818
#line 54 "cubescan.l"
 
819
YY_FATAL_ERROR( "flex scanner jammed" );
 
820
        YY_BREAK
 
821
#line 822 "cubescan.c"
 
822
case YY_STATE_EOF(INITIAL):
 
823
        yyterminate();
 
824
 
 
825
        case YY_END_OF_BUFFER:
 
826
                {
 
827
                /* Amount of text matched not including the EOB char. */
 
828
                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
829
 
 
830
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
 
831
                *yy_cp = (yy_hold_char);
 
832
                YY_RESTORE_YY_MORE_OFFSET
 
833
 
 
834
                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 
835
                        {
 
836
                        /* We're scanning a new file or input source.  It's
 
837
                         * possible that this happened because the user
 
838
                         * just pointed cube_yyin at a new source and called
 
839
                         * cube_yylex().  If so, then we have to assure
 
840
                         * consistency between YY_CURRENT_BUFFER and our
 
841
                         * globals.  Here is the right place to do so, because
 
842
                         * this is the first action (other than possibly a
 
843
                         * back-up) that will match for the new input source.
 
844
                         */
 
845
                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 
846
                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = cube_yyin;
 
847
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 
848
                        }
 
849
 
 
850
                /* Note that here we test for yy_c_buf_p "<=" to the position
 
851
                 * of the first EOB in the buffer, since yy_c_buf_p will
 
852
                 * already have been incremented past the NUL character
 
853
                 * (since all states make transitions on EOB to the
 
854
                 * end-of-buffer state).  Contrast this with the test
 
855
                 * in input().
 
856
                 */
 
857
                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 
858
                        { /* This was really a NUL. */
 
859
                        yy_state_type yy_next_state;
 
860
 
 
861
                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 
862
 
 
863
                        yy_current_state = yy_get_previous_state(  );
 
864
 
 
865
                        /* Okay, we're now positioned to make the NUL
 
866
                         * transition.  We couldn't have
 
867
                         * yy_get_previous_state() go ahead and do it
 
868
                         * for us because it doesn't know how to deal
 
869
                         * with the possibility of jamming (and we don't
 
870
                         * want to build jamming into it because then it
 
871
                         * will run more slowly).
 
872
                         */
 
873
 
 
874
                        yy_next_state = yy_try_NUL_trans( yy_current_state );
 
875
 
 
876
                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
877
 
 
878
                        if ( yy_next_state )
 
879
                                {
 
880
                                /* Consume the NUL. */
 
881
                                yy_cp = ++(yy_c_buf_p);
 
882
                                yy_current_state = yy_next_state;
 
883
                                goto yy_match;
 
884
                                }
 
885
 
 
886
                        else
 
887
                                {
 
888
                                yy_cp = (yy_last_accepting_cpos);
 
889
                                yy_current_state = (yy_last_accepting_state);
 
890
                                goto yy_find_action;
 
891
                                }
 
892
                        }
 
893
 
 
894
                else switch ( yy_get_next_buffer(  ) )
 
895
                        {
 
896
                        case EOB_ACT_END_OF_FILE:
 
897
                                {
 
898
                                (yy_did_buffer_switch_on_eof) = 0;
 
899
 
 
900
                                if ( cube_yywrap( ) )
 
901
                                        {
 
902
                                        /* Note: because we've taken care in
 
903
                                         * yy_get_next_buffer() to have set up
 
904
                                         * cube_yytext, we can now set up
 
905
                                         * yy_c_buf_p so that if some total
 
906
                                         * hoser (like flex itself) wants to
 
907
                                         * call the scanner after we return the
 
908
                                         * YY_NULL, it'll still work - another
 
909
                                         * YY_NULL will get returned.
 
910
                                         */
 
911
                                        (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
912
 
 
913
                                        yy_act = YY_STATE_EOF(YY_START);
 
914
                                        goto do_action;
 
915
                                        }
 
916
 
 
917
                                else
 
918
                                        {
 
919
                                        if ( ! (yy_did_buffer_switch_on_eof) )
 
920
                                                YY_NEW_FILE;
 
921
                                        }
 
922
                                break;
 
923
                                }
 
924
 
 
925
                        case EOB_ACT_CONTINUE_SCAN:
 
926
                                (yy_c_buf_p) =
 
927
                                        (yytext_ptr) + yy_amount_of_matched_text;
 
928
 
 
929
                                yy_current_state = yy_get_previous_state(  );
 
930
 
 
931
                                yy_cp = (yy_c_buf_p);
 
932
                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
933
                                goto yy_match;
 
934
 
 
935
                        case EOB_ACT_LAST_MATCH:
 
936
                                (yy_c_buf_p) =
 
937
                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
938
 
 
939
                                yy_current_state = yy_get_previous_state(  );
 
940
 
 
941
                                yy_cp = (yy_c_buf_p);
 
942
                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
943
                                goto yy_find_action;
 
944
                        }
 
945
                break;
 
946
                }
 
947
 
 
948
        default:
 
949
                YY_FATAL_ERROR(
 
950
                        "fatal flex scanner internal error--no action found" );
 
951
        } /* end of action switch */
 
952
                } /* end of scanning one token */
 
953
} /* end of cube_yylex */
 
954
 
 
955
/* yy_get_next_buffer - try to read in a new buffer
 
956
 *
 
957
 * Returns a code representing an action:
 
958
 *      EOB_ACT_LAST_MATCH -
 
959
 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 
960
 *      EOB_ACT_END_OF_FILE - end of file
 
961
 */
 
962
static int yy_get_next_buffer (void)
 
963
{
 
964
        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
 
965
        register char *source = (yytext_ptr);
 
966
        register int number_to_move, i;
 
967
        int ret_val;
 
968
 
 
969
        if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 
970
                YY_FATAL_ERROR(
 
971
                "fatal flex scanner internal error--end of buffer missed" );
 
972
 
 
973
        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 
974
                { /* Don't try to fill the buffer, so this is an EOF. */
 
975
                if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 
976
                        {
 
977
                        /* We matched a single character, the EOB, so
 
978
                         * treat this as a final EOF.
 
979
                         */
 
980
                        return EOB_ACT_END_OF_FILE;
 
981
                        }
 
982
 
 
983
                else
 
984
                        {
 
985
                        /* We matched some text prior to the EOB, first
 
986
                         * process it.
 
987
                         */
 
988
                        return EOB_ACT_LAST_MATCH;
 
989
                        }
 
990
                }
 
991
 
 
992
        /* Try to read more data. */
 
993
 
 
994
        /* First move last chars to start of buffer. */
 
995
        number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
996
 
 
997
        for ( i = 0; i < number_to_move; ++i )
 
998
                *(dest++) = *(source++);
 
999
 
 
1000
        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 
1001
                /* don't do the read, it's not guaranteed to return an EOF,
 
1002
                 * just force an EOF
 
1003
                 */
 
1004
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
1005
 
 
1006
        else
 
1007
                {
 
1008
                        int num_to_read =
 
1009
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
1010
 
 
1011
                while ( num_to_read <= 0 )
 
1012
                        { /* Not enough room in the buffer - grow it. */
 
1013
 
 
1014
                        /* just a shorter name for the current buffer */
 
1015
                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
1016
 
 
1017
                        int yy_c_buf_p_offset =
 
1018
                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
 
1019
 
 
1020
                        if ( b->yy_is_our_buffer )
 
1021
                                {
 
1022
                                int new_size = b->yy_buf_size * 2;
 
1023
 
 
1024
                                if ( new_size <= 0 )
 
1025
                                        b->yy_buf_size += b->yy_buf_size / 8;
 
1026
                                else
 
1027
                                        b->yy_buf_size *= 2;
 
1028
 
 
1029
                                b->yy_ch_buf = (char *)
 
1030
                                        /* Include room in for 2 EOB chars. */
 
1031
                                        cube_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
 
1032
                                }
 
1033
                        else
 
1034
                                /* Can't grow it, we don't own it. */
 
1035
                                b->yy_ch_buf = 0;
 
1036
 
 
1037
                        if ( ! b->yy_ch_buf )
 
1038
                                YY_FATAL_ERROR(
 
1039
                                "fatal error - scanner input buffer overflow" );
 
1040
 
 
1041
                        (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
 
1042
 
 
1043
                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
 
1044
                                                number_to_move - 1;
 
1045
 
 
1046
                        }
 
1047
 
 
1048
                if ( num_to_read > YY_READ_BUF_SIZE )
 
1049
                        num_to_read = YY_READ_BUF_SIZE;
 
1050
 
 
1051
                /* Read in more data. */
 
1052
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
 
1053
                        (yy_n_chars), (size_t) num_to_read );
 
1054
 
 
1055
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
1056
                }
 
1057
 
 
1058
        if ( (yy_n_chars) == 0 )
 
1059
                {
 
1060
                if ( number_to_move == YY_MORE_ADJ )
 
1061
                        {
 
1062
                        ret_val = EOB_ACT_END_OF_FILE;
 
1063
                        cube_yyrestart(cube_yyin  );
 
1064
                        }
 
1065
 
 
1066
                else
 
1067
                        {
 
1068
                        ret_val = EOB_ACT_LAST_MATCH;
 
1069
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
 
1070
                                YY_BUFFER_EOF_PENDING;
 
1071
                        }
 
1072
                }
 
1073
 
 
1074
        else
 
1075
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
1076
 
 
1077
        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
 
1078
                /* Extend the array by 50%, plus the number we really need. */
 
1079
                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
 
1080
                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cube_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
 
1081
                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 
1082
                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
 
1083
        }
 
1084
 
 
1085
        (yy_n_chars) += number_to_move;
 
1086
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
 
1087
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
 
1088
 
 
1089
        (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
1090
 
 
1091
        return ret_val;
 
1092
}
 
1093
 
 
1094
/* yy_get_previous_state - get the state just before the EOB char was reached */
 
1095
 
 
1096
    static yy_state_type yy_get_previous_state (void)
 
1097
{
 
1098
        register yy_state_type yy_current_state;
 
1099
        register char *yy_cp;
 
1100
    
 
1101
        yy_current_state = (yy_start);
 
1102
 
 
1103
        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
 
1104
                {
 
1105
                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
 
1106
                if ( yy_accept[yy_current_state] )
 
1107
                        {
 
1108
                        (yy_last_accepting_state) = yy_current_state;
 
1109
                        (yy_last_accepting_cpos) = yy_cp;
 
1110
                        }
 
1111
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
1112
                        {
 
1113
                        yy_current_state = (int) yy_def[yy_current_state];
 
1114
                        if ( yy_current_state >= 25 )
 
1115
                                yy_c = yy_meta[(unsigned int) yy_c];
 
1116
                        }
 
1117
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
1118
                }
 
1119
 
 
1120
        return yy_current_state;
 
1121
}
 
1122
 
 
1123
/* yy_try_NUL_trans - try to make a transition on the NUL character
 
1124
 *
 
1125
 * synopsis
 
1126
 *      next_state = yy_try_NUL_trans( current_state );
 
1127
 */
 
1128
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
 
1129
{
 
1130
        register int yy_is_jam;
 
1131
        register char *yy_cp = (yy_c_buf_p);
 
1132
 
 
1133
        register YY_CHAR yy_c = 1;
 
1134
        if ( yy_accept[yy_current_state] )
 
1135
                {
 
1136
                (yy_last_accepting_state) = yy_current_state;
 
1137
                (yy_last_accepting_cpos) = yy_cp;
 
1138
                }
 
1139
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
1140
                {
 
1141
                yy_current_state = (int) yy_def[yy_current_state];
 
1142
                if ( yy_current_state >= 25 )
 
1143
                        yy_c = yy_meta[(unsigned int) yy_c];
 
1144
                }
 
1145
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
1146
        yy_is_jam = (yy_current_state == 24);
 
1147
 
 
1148
        return yy_is_jam ? 0 : yy_current_state;
 
1149
}
 
1150
 
 
1151
#ifndef YY_NO_INPUT
 
1152
#ifdef __cplusplus
 
1153
    static int yyinput (void)
 
1154
#else
 
1155
    static int input  (void)
 
1156
#endif
 
1157
 
 
1158
{
 
1159
        int c;
 
1160
    
 
1161
        *(yy_c_buf_p) = (yy_hold_char);
 
1162
 
 
1163
        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
 
1164
                {
 
1165
                /* yy_c_buf_p now points to the character we want to return.
 
1166
                 * If this occurs *before* the EOB characters, then it's a
 
1167
                 * valid NUL; if not, then we've hit the end of the buffer.
 
1168
                 */
 
1169
                if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 
1170
                        /* This was really a NUL. */
 
1171
                        *(yy_c_buf_p) = '\0';
 
1172
 
 
1173
                else
 
1174
                        { /* need more input */
 
1175
                        int offset = (yy_c_buf_p) - (yytext_ptr);
 
1176
                        ++(yy_c_buf_p);
 
1177
 
 
1178
                        switch ( yy_get_next_buffer(  ) )
 
1179
                                {
 
1180
                                case EOB_ACT_LAST_MATCH:
 
1181
                                        /* This happens because yy_g_n_b()
 
1182
                                         * sees that we've accumulated a
 
1183
                                         * token and flags that we need to
 
1184
                                         * try matching the token before
 
1185
                                         * proceeding.  But for input(),
 
1186
                                         * there's no matching to consider.
 
1187
                                         * So convert the EOB_ACT_LAST_MATCH
 
1188
                                         * to EOB_ACT_END_OF_FILE.
 
1189
                                         */
 
1190
 
 
1191
                                        /* Reset buffer status. */
 
1192
                                        cube_yyrestart(cube_yyin );
 
1193
 
 
1194
                                        /*FALLTHROUGH*/
 
1195
 
 
1196
                                case EOB_ACT_END_OF_FILE:
 
1197
                                        {
 
1198
                                        if ( cube_yywrap( ) )
 
1199
                                                return EOF;
 
1200
 
 
1201
                                        if ( ! (yy_did_buffer_switch_on_eof) )
 
1202
                                                YY_NEW_FILE;
 
1203
#ifdef __cplusplus
 
1204
                                        return yyinput();
 
1205
#else
 
1206
                                        return input();
 
1207
#endif
 
1208
                                        }
 
1209
 
 
1210
                                case EOB_ACT_CONTINUE_SCAN:
 
1211
                                        (yy_c_buf_p) = (yytext_ptr) + offset;
 
1212
                                        break;
 
1213
                                }
 
1214
                        }
 
1215
                }
 
1216
 
 
1217
        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
 
1218
        *(yy_c_buf_p) = '\0';   /* preserve cube_yytext */
 
1219
        (yy_hold_char) = *++(yy_c_buf_p);
 
1220
 
 
1221
        return c;
 
1222
}
 
1223
#endif  /* ifndef YY_NO_INPUT */
 
1224
 
 
1225
/** Immediately switch to a different input stream.
 
1226
 * @param input_file A readable stream.
 
1227
 * 
 
1228
 * @note This function does not reset the start condition to @c INITIAL .
 
1229
 */
 
1230
    void cube_yyrestart  (FILE * input_file )
 
1231
{
 
1232
    
 
1233
        if ( ! YY_CURRENT_BUFFER ){
 
1234
        cube_yyensure_buffer_stack ();
 
1235
                YY_CURRENT_BUFFER_LVALUE =
 
1236
            cube_yy_create_buffer(cube_yyin,YY_BUF_SIZE );
 
1237
        }
 
1238
 
 
1239
        cube_yy_init_buffer(YY_CURRENT_BUFFER,input_file );
 
1240
        cube_yy_load_buffer_state( );
 
1241
}
 
1242
 
 
1243
/** Switch to a different input buffer.
 
1244
 * @param new_buffer The new input buffer.
 
1245
 * 
 
1246
 */
 
1247
    void cube_yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 
1248
{
 
1249
    
 
1250
        /* TODO. We should be able to replace this entire function body
 
1251
         * with
 
1252
         *              cube_yypop_buffer_state();
 
1253
         *              cube_yypush_buffer_state(new_buffer);
 
1254
     */
 
1255
        cube_yyensure_buffer_stack ();
 
1256
        if ( YY_CURRENT_BUFFER == new_buffer )
 
1257
                return;
 
1258
 
 
1259
        if ( YY_CURRENT_BUFFER )
 
1260
                {
 
1261
                /* Flush out information for old buffer. */
 
1262
                *(yy_c_buf_p) = (yy_hold_char);
 
1263
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
 
1264
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
1265
                }
 
1266
 
 
1267
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
1268
        cube_yy_load_buffer_state( );
 
1269
 
 
1270
        /* We don't actually know whether we did this switch during
 
1271
         * EOF (cube_yywrap()) processing, but the only time this flag
 
1272
         * is looked at is after cube_yywrap() is called, so it's safe
 
1273
         * to go ahead and always set it.
 
1274
         */
 
1275
        (yy_did_buffer_switch_on_eof) = 1;
 
1276
}
 
1277
 
 
1278
static void cube_yy_load_buffer_state  (void)
 
1279
{
 
1280
        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 
1281
        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
 
1282
        cube_yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
 
1283
        (yy_hold_char) = *(yy_c_buf_p);
 
1284
}
 
1285
 
 
1286
/** Allocate and initialize an input buffer state.
 
1287
 * @param file A readable stream.
 
1288
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 
1289
 * 
 
1290
 * @return the allocated buffer state.
 
1291
 */
 
1292
    YY_BUFFER_STATE cube_yy_create_buffer  (FILE * file, int  size )
 
1293
{
 
1294
        YY_BUFFER_STATE b;
 
1295
    
 
1296
        b = (YY_BUFFER_STATE) cube_yyalloc(sizeof( struct yy_buffer_state )  );
 
1297
        if ( ! b )
 
1298
                YY_FATAL_ERROR( "out of dynamic memory in cube_yy_create_buffer()" );
 
1299
 
 
1300
        b->yy_buf_size = size;
 
1301
 
 
1302
        /* yy_ch_buf has to be 2 characters longer than the size given because
 
1303
         * we need to put in 2 end-of-buffer characters.
 
1304
         */
 
1305
        b->yy_ch_buf = (char *) cube_yyalloc(b->yy_buf_size + 2  );
 
1306
        if ( ! b->yy_ch_buf )
 
1307
                YY_FATAL_ERROR( "out of dynamic memory in cube_yy_create_buffer()" );
 
1308
 
 
1309
        b->yy_is_our_buffer = 1;
 
1310
 
 
1311
        cube_yy_init_buffer(b,file );
 
1312
 
 
1313
        return b;
 
1314
}
 
1315
 
 
1316
/** Destroy the buffer.
 
1317
 * @param b a buffer created with cube_yy_create_buffer()
 
1318
 * 
 
1319
 */
 
1320
    void cube_yy_delete_buffer (YY_BUFFER_STATE  b )
 
1321
{
 
1322
    
 
1323
        if ( ! b )
 
1324
                return;
 
1325
 
 
1326
        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
 
1327
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
1328
 
 
1329
        if ( b->yy_is_our_buffer )
 
1330
                cube_yyfree((void *) b->yy_ch_buf  );
 
1331
 
 
1332
        cube_yyfree((void *) b  );
 
1333
}
 
1334
 
 
1335
/* Initializes or reinitializes a buffer.
 
1336
 * This function is sometimes called more than once on the same buffer,
 
1337
 * such as during a cube_yyrestart() or at EOF.
 
1338
 */
 
1339
    static void cube_yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
1340
 
 
1341
{
 
1342
        int oerrno = errno;
 
1343
    
 
1344
        cube_yy_flush_buffer(b );
 
1345
 
 
1346
        b->yy_input_file = file;
 
1347
        b->yy_fill_buffer = 1;
 
1348
 
 
1349
    /* If b is the current buffer, then cube_yy_init_buffer was _probably_
 
1350
     * called from cube_yyrestart() or through yy_get_next_buffer.
 
1351
     * In that case, we don't want to reset the lineno or column.
 
1352
     */
 
1353
    if (b != YY_CURRENT_BUFFER){
 
1354
        b->yy_bs_lineno = 1;
 
1355
        b->yy_bs_column = 0;
 
1356
    }
 
1357
 
 
1358
        b->yy_is_interactive = 0;
 
1359
    
 
1360
        errno = oerrno;
 
1361
}
 
1362
 
 
1363
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 
1364
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 
1365
 * 
 
1366
 */
 
1367
    void cube_yy_flush_buffer (YY_BUFFER_STATE  b )
 
1368
{
 
1369
        if ( ! b )
 
1370
                return;
 
1371
 
 
1372
        b->yy_n_chars = 0;
 
1373
 
 
1374
        /* We always need two end-of-buffer characters.  The first causes
 
1375
         * a transition to the end-of-buffer state.  The second causes
 
1376
         * a jam in that state.
 
1377
         */
 
1378
        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
 
1379
        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
1380
 
 
1381
        b->yy_buf_pos = &b->yy_ch_buf[0];
 
1382
 
 
1383
        b->yy_at_bol = 1;
 
1384
        b->yy_buffer_status = YY_BUFFER_NEW;
 
1385
 
 
1386
        if ( b == YY_CURRENT_BUFFER )
 
1387
                cube_yy_load_buffer_state( );
 
1388
}
 
1389
 
 
1390
/** Pushes the new state onto the stack. The new state becomes
 
1391
 *  the current state. This function will allocate the stack
 
1392
 *  if necessary.
 
1393
 *  @param new_buffer The new state.
 
1394
 *  
 
1395
 */
 
1396
void cube_yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 
1397
{
 
1398
        if (new_buffer == NULL)
 
1399
                return;
 
1400
 
 
1401
        cube_yyensure_buffer_stack();
 
1402
 
 
1403
        /* This block is copied from cube_yy_switch_to_buffer. */
 
1404
        if ( YY_CURRENT_BUFFER )
 
1405
                {
 
1406
                /* Flush out information for old buffer. */
 
1407
                *(yy_c_buf_p) = (yy_hold_char);
 
1408
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
 
1409
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
1410
                }
 
1411
 
 
1412
        /* Only push if top exists. Otherwise, replace top. */
 
1413
        if (YY_CURRENT_BUFFER)
 
1414
                (yy_buffer_stack_top)++;
 
1415
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
1416
 
 
1417
        /* copied from cube_yy_switch_to_buffer. */
 
1418
        cube_yy_load_buffer_state( );
 
1419
        (yy_did_buffer_switch_on_eof) = 1;
 
1420
}
 
1421
 
 
1422
/** Removes and deletes the top of the stack, if present.
 
1423
 *  The next element becomes the new top.
 
1424
 *  
 
1425
 */
 
1426
void cube_yypop_buffer_state (void)
 
1427
{
 
1428
        if (!YY_CURRENT_BUFFER)
 
1429
                return;
 
1430
 
 
1431
        cube_yy_delete_buffer(YY_CURRENT_BUFFER );
 
1432
        YY_CURRENT_BUFFER_LVALUE = NULL;
 
1433
        if ((yy_buffer_stack_top) > 0)
 
1434
                --(yy_buffer_stack_top);
 
1435
 
 
1436
        if (YY_CURRENT_BUFFER) {
 
1437
                cube_yy_load_buffer_state( );
 
1438
                (yy_did_buffer_switch_on_eof) = 1;
 
1439
        }
 
1440
}
 
1441
 
 
1442
/* Allocates the stack if it does not exist.
 
1443
 *  Guarantees space for at least one push.
 
1444
 */
 
1445
static void cube_yyensure_buffer_stack (void)
 
1446
{
 
1447
        int num_to_alloc;
 
1448
    
 
1449
        if (!(yy_buffer_stack)) {
 
1450
 
 
1451
                /* First allocation is just for 2 elements, since we don't know if this
 
1452
                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
 
1453
                 * immediate realloc on the next call.
 
1454
         */
 
1455
                num_to_alloc = 1;
 
1456
                (yy_buffer_stack) = (struct yy_buffer_state**)cube_yyalloc
 
1457
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
 
1458
                                                                );
 
1459
                if ( ! (yy_buffer_stack) )
 
1460
                        YY_FATAL_ERROR( "out of dynamic memory in cube_yyensure_buffer_stack()" );
 
1461
                                                                  
 
1462
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
 
1463
                                
 
1464
                (yy_buffer_stack_max) = num_to_alloc;
 
1465
                (yy_buffer_stack_top) = 0;
 
1466
                return;
 
1467
        }
 
1468
 
 
1469
        if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
 
1470
 
 
1471
                /* Increase the buffer to prepare for a possible push. */
 
1472
                int grow_size = 8 /* arbitrary grow size */;
 
1473
 
 
1474
                num_to_alloc = (yy_buffer_stack_max) + grow_size;
 
1475
                (yy_buffer_stack) = (struct yy_buffer_state**)cube_yyrealloc
 
1476
                                                                ((yy_buffer_stack),
 
1477
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
 
1478
                                                                );
 
1479
                if ( ! (yy_buffer_stack) )
 
1480
                        YY_FATAL_ERROR( "out of dynamic memory in cube_yyensure_buffer_stack()" );
 
1481
 
 
1482
                /* zero only the new slots.*/
 
1483
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
 
1484
                (yy_buffer_stack_max) = num_to_alloc;
 
1485
        }
 
1486
}
 
1487
 
 
1488
/** Setup the input buffer state to scan directly from a user-specified character buffer.
 
1489
 * @param base the character buffer
 
1490
 * @param size the size in bytes of the character buffer
 
1491
 * 
 
1492
 * @return the newly allocated buffer state object. 
 
1493
 */
 
1494
YY_BUFFER_STATE cube_yy_scan_buffer  (char * base, yy_size_t  size )
 
1495
{
 
1496
        YY_BUFFER_STATE b;
 
1497
    
 
1498
        if ( size < 2 ||
 
1499
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
 
1500
             base[size-1] != YY_END_OF_BUFFER_CHAR )
 
1501
                /* They forgot to leave room for the EOB's. */
 
1502
                return 0;
 
1503
 
 
1504
        b = (YY_BUFFER_STATE) cube_yyalloc(sizeof( struct yy_buffer_state )  );
 
1505
        if ( ! b )
 
1506
                YY_FATAL_ERROR( "out of dynamic memory in cube_yy_scan_buffer()" );
 
1507
 
 
1508
        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
 
1509
        b->yy_buf_pos = b->yy_ch_buf = base;
 
1510
        b->yy_is_our_buffer = 0;
 
1511
        b->yy_input_file = 0;
 
1512
        b->yy_n_chars = b->yy_buf_size;
 
1513
        b->yy_is_interactive = 0;
 
1514
        b->yy_at_bol = 1;
 
1515
        b->yy_fill_buffer = 0;
 
1516
        b->yy_buffer_status = YY_BUFFER_NEW;
 
1517
 
 
1518
        cube_yy_switch_to_buffer(b  );
 
1519
 
 
1520
        return b;
 
1521
}
 
1522
 
 
1523
/** Setup the input buffer state to scan a string. The next call to cube_yylex() will
 
1524
 * scan from a @e copy of @a str.
 
1525
 * @param yystr a NUL-terminated string to scan
 
1526
 * 
 
1527
 * @return the newly allocated buffer state object.
 
1528
 * @note If you want to scan bytes that may contain NUL values, then use
 
1529
 *       cube_yy_scan_bytes() instead.
 
1530
 */
 
1531
YY_BUFFER_STATE cube_yy_scan_string (yyconst char * yystr )
 
1532
{
 
1533
    
 
1534
        return cube_yy_scan_bytes(yystr,strlen(yystr) );
 
1535
}
 
1536
 
 
1537
/** Setup the input buffer state to scan the given bytes. The next call to cube_yylex() will
 
1538
 * scan from a @e copy of @a bytes.
 
1539
 * @param bytes the byte buffer to scan
 
1540
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 
1541
 * 
 
1542
 * @return the newly allocated buffer state object.
 
1543
 */
 
1544
YY_BUFFER_STATE cube_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 
1545
{
 
1546
        YY_BUFFER_STATE b;
 
1547
        char *buf;
 
1548
        yy_size_t n;
 
1549
        int i;
 
1550
    
 
1551
        /* Get memory for full buffer, including space for trailing EOB's. */
 
1552
        n = _yybytes_len + 2;
 
1553
        buf = (char *) cube_yyalloc(n  );
 
1554
        if ( ! buf )
 
1555
                YY_FATAL_ERROR( "out of dynamic memory in cube_yy_scan_bytes()" );
 
1556
 
 
1557
        for ( i = 0; i < _yybytes_len; ++i )
 
1558
                buf[i] = yybytes[i];
 
1559
 
 
1560
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
1561
 
 
1562
        b = cube_yy_scan_buffer(buf,n );
 
1563
        if ( ! b )
 
1564
                YY_FATAL_ERROR( "bad buffer in cube_yy_scan_bytes()" );
 
1565
 
 
1566
        /* It's okay to grow etc. this buffer, and we should throw it
 
1567
         * away when we're done.
 
1568
         */
 
1569
        b->yy_is_our_buffer = 1;
 
1570
 
 
1571
        return b;
 
1572
}
 
1573
 
 
1574
#ifndef YY_EXIT_FAILURE
 
1575
#define YY_EXIT_FAILURE 2
 
1576
#endif
 
1577
 
 
1578
static void yy_fatal_error (yyconst char* msg )
 
1579
{
 
1580
        (void) fprintf( stderr, "%s\n", msg );
 
1581
        exit( YY_EXIT_FAILURE );
 
1582
}
 
1583
 
 
1584
/* Redefine yyless() so it works in section 3 code. */
 
1585
 
 
1586
#undef yyless
 
1587
#define yyless(n) \
 
1588
        do \
 
1589
                { \
 
1590
                /* Undo effects of setting up cube_yytext. */ \
 
1591
        int yyless_macro_arg = (n); \
 
1592
        YY_LESS_LINENO(yyless_macro_arg);\
 
1593
                cube_yytext[cube_yyleng] = (yy_hold_char); \
 
1594
                (yy_c_buf_p) = cube_yytext + yyless_macro_arg; \
 
1595
                (yy_hold_char) = *(yy_c_buf_p); \
 
1596
                *(yy_c_buf_p) = '\0'; \
 
1597
                cube_yyleng = yyless_macro_arg; \
 
1598
                } \
 
1599
        while ( 0 )
 
1600
 
 
1601
/* Accessor  methods (get/set functions) to struct members. */
 
1602
 
 
1603
/** Get the current line number.
 
1604
 * 
 
1605
 */
 
1606
int cube_yyget_lineno  (void)
 
1607
{
 
1608
        
 
1609
    return cube_yylineno;
 
1610
}
 
1611
 
 
1612
/** Get the input stream.
 
1613
 * 
 
1614
 */
 
1615
FILE *cube_yyget_in  (void)
 
1616
{
 
1617
        return cube_yyin;
 
1618
}
 
1619
 
 
1620
/** Get the output stream.
 
1621
 * 
 
1622
 */
 
1623
FILE *cube_yyget_out  (void)
 
1624
{
 
1625
        return cube_yyout;
 
1626
}
 
1627
 
 
1628
/** Get the length of the current token.
 
1629
 * 
 
1630
 */
 
1631
int cube_yyget_leng  (void)
 
1632
{
 
1633
        return cube_yyleng;
 
1634
}
 
1635
 
 
1636
/** Get the current token.
 
1637
 * 
 
1638
 */
 
1639
 
 
1640
char *cube_yyget_text  (void)
 
1641
{
 
1642
        return cube_yytext;
 
1643
}
 
1644
 
 
1645
/** Set the current line number.
 
1646
 * @param line_number
 
1647
 * 
 
1648
 */
 
1649
void cube_yyset_lineno (int  line_number )
 
1650
{
 
1651
    
 
1652
    cube_yylineno = line_number;
 
1653
}
 
1654
 
 
1655
/** Set the input stream. This does not discard the current
 
1656
 * input buffer.
 
1657
 * @param in_str A readable stream.
 
1658
 * 
 
1659
 * @see cube_yy_switch_to_buffer
 
1660
 */
 
1661
void cube_yyset_in (FILE *  in_str )
 
1662
{
 
1663
        cube_yyin = in_str ;
 
1664
}
 
1665
 
 
1666
void cube_yyset_out (FILE *  out_str )
 
1667
{
 
1668
        cube_yyout = out_str ;
 
1669
}
 
1670
 
 
1671
int cube_yyget_debug  (void)
 
1672
{
 
1673
        return cube_yy_flex_debug;
 
1674
}
 
1675
 
 
1676
void cube_yyset_debug (int  bdebug )
 
1677
{
 
1678
        cube_yy_flex_debug = bdebug ;
 
1679
}
 
1680
 
 
1681
static int yy_init_globals (void)
 
1682
{
 
1683
        /* Initialization is the same as for the non-reentrant scanner.
 
1684
     * This function is called from cube_yylex_destroy(), so don't allocate here.
 
1685
     */
 
1686
 
 
1687
    (yy_buffer_stack) = 0;
 
1688
    (yy_buffer_stack_top) = 0;
 
1689
    (yy_buffer_stack_max) = 0;
 
1690
    (yy_c_buf_p) = (char *) 0;
 
1691
    (yy_init) = 0;
 
1692
    (yy_start) = 0;
 
1693
 
 
1694
/* Defined in main.c */
 
1695
#ifdef YY_STDINIT
 
1696
    cube_yyin = stdin;
 
1697
    cube_yyout = stdout;
 
1698
#else
 
1699
    cube_yyin = (FILE *) 0;
 
1700
    cube_yyout = (FILE *) 0;
 
1701
#endif
 
1702
 
 
1703
    /* For future reference: Set errno on error, since we are called by
 
1704
     * cube_yylex_init()
 
1705
     */
 
1706
    return 0;
 
1707
}
 
1708
 
 
1709
/* cube_yylex_destroy is for both reentrant and non-reentrant scanners. */
 
1710
int cube_yylex_destroy  (void)
 
1711
{
 
1712
    
 
1713
    /* Pop the buffer stack, destroying each element. */
 
1714
        while(YY_CURRENT_BUFFER){
 
1715
                cube_yy_delete_buffer(YY_CURRENT_BUFFER  );
 
1716
                YY_CURRENT_BUFFER_LVALUE = NULL;
 
1717
                cube_yypop_buffer_state();
 
1718
        }
 
1719
 
 
1720
        /* Destroy the stack itself. */
 
1721
        cube_yyfree((yy_buffer_stack) );
 
1722
        (yy_buffer_stack) = NULL;
 
1723
 
 
1724
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
 
1725
     * cube_yylex() is called, initialization will occur. */
 
1726
    yy_init_globals( );
 
1727
 
 
1728
    return 0;
 
1729
}
 
1730
 
 
1731
/*
 
1732
 * Internal utility routines.
 
1733
 */
 
1734
 
 
1735
#ifndef yytext_ptr
 
1736
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
 
1737
{
 
1738
        register int i;
 
1739
        for ( i = 0; i < n; ++i )
 
1740
                s1[i] = s2[i];
 
1741
}
 
1742
#endif
 
1743
 
 
1744
#ifdef YY_NEED_STRLEN
 
1745
static int yy_flex_strlen (yyconst char * s )
 
1746
{
 
1747
        register int n;
 
1748
        for ( n = 0; s[n]; ++n )
 
1749
                ;
 
1750
 
 
1751
        return n;
 
1752
}
 
1753
#endif
 
1754
 
 
1755
void *cube_yyalloc (yy_size_t  size )
 
1756
{
 
1757
        return (void *) malloc( size );
 
1758
}
 
1759
 
 
1760
void *cube_yyrealloc  (void * ptr, yy_size_t  size )
 
1761
{
 
1762
        /* The cast to (char *) in the following accommodates both
 
1763
         * implementations that use char* generic pointers, and those
 
1764
         * that use void* generic pointers.  It works with the latter
 
1765
         * because both ANSI C and C++ allow castless assignment from
 
1766
         * any pointer type to void*, and deal with argument conversions
 
1767
         * as though doing an assignment.
 
1768
         */
 
1769
        return (void *) realloc( (char *) ptr, size );
 
1770
}
 
1771
 
 
1772
void cube_yyfree (void * ptr )
 
1773
{
 
1774
        free( (char *) ptr );   /* see cube_yyrealloc() for (char *) cast */
 
1775
}
 
1776
 
 
1777
#define YYTABLES_NAME "yytables"
 
1778
 
 
1779
#line 54 "cubescan.l"
 
1780
 
 
1781
 
 
1782
 
 
1783
void
 
1784
yyerror(const char *message)
 
1785
{
 
1786
        if (*cube_yytext == YY_END_OF_BUFFER_CHAR)
 
1787
        {
 
1788
                ereport(ERROR,
 
1789
                                (errcode(ERRCODE_SYNTAX_ERROR),
 
1790
                                 errmsg("bad cube representation"),
 
1791
                                 /* translator: %s is typically "syntax error" */
 
1792
                                 errdetail("%s at end of input", message)));
 
1793
        }
 
1794
        else
 
1795
        {
 
1796
                ereport(ERROR,
 
1797
                                (errcode(ERRCODE_SYNTAX_ERROR),
 
1798
                                 errmsg("bad cube representation"),
 
1799
                                 /* translator: first %s is typically "syntax error" */
 
1800
                                 errdetail("%s at or near \"%s\"", message, cube_yytext)));
 
1801
        }
 
1802
}
 
1803
 
 
1804
 
 
1805
/*
 
1806
 * Called before any actual parsing is done
 
1807
 */
 
1808
void
 
1809
cube_scanner_init(const char *str)
 
1810
{
 
1811
        Size    slen = strlen(str);
 
1812
 
 
1813
        /*
 
1814
         * Might be left over after ereport()
 
1815
         */
 
1816
        if (YY_CURRENT_BUFFER)
 
1817
                cube_yy_delete_buffer(YY_CURRENT_BUFFER);
 
1818
 
 
1819
        /*
 
1820
         * Make a scan buffer with special termination needed by flex.
 
1821
         */
 
1822
        scanbuflen = slen;
 
1823
        scanbuf = palloc(slen + 2);
 
1824
        memcpy(scanbuf, str, slen);
 
1825
        scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
 
1826
        scanbufhandle = cube_yy_scan_buffer(scanbuf,slen + 2);
 
1827
 
 
1828
        BEGIN(INITIAL);
 
1829
}
 
1830
 
 
1831
 
 
1832
/*
 
1833
 * Called after parsing is done to clean up after cube_scanner_init()
 
1834
 */
 
1835
void
 
1836
cube_scanner_finish(void)
 
1837
{
 
1838
        cube_yy_delete_buffer(scanbufhandle);
 
1839
        pfree(scanbuf);
 
1840
}
 
1841