~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/pgscript/lex.pgs.cc

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "pgAdmin3.h"
 
2
 
 
3
 
 
4
#line 2 "pgscript/lex.pgs.cc"
 
5
 
 
6
#line 4 "pgscript/lex.pgs.cc"
 
7
 
 
8
#define  YY_INT_ALIGNED short int
 
9
 
 
10
/* A lexical scanner generated by flex */
 
11
 
 
12
#define FLEX_SCANNER
 
13
#define YY_FLEX_MAJOR_VERSION 2
 
14
#define YY_FLEX_MINOR_VERSION 5
 
15
#define YY_FLEX_SUBMINOR_VERSION 33
 
16
#if YY_FLEX_SUBMINOR_VERSION > 0
 
17
#define FLEX_BETA
 
18
#endif
 
19
 
 
20
    /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
 
21
     * following macro. This is required in order to pass the c++-multiple-scanners
 
22
     * test in the regression suite. We get reports that it breaks inheritance.
 
23
     * We will address this in a future release of flex, or omit the C++ scanner
 
24
     * altogether.
 
25
     */
 
26
    #define yyFlexLexer pgsFlexLexer
 
27
 
 
28
/* First, we deal with  platform-specific or compiler-specific issues. */
 
29
 
 
30
/* begin standard C headers. */
 
31
 
 
32
/* end standard C headers. */
 
33
 
 
34
/* flex integer type definitions */
 
35
 
 
36
#ifndef FLEXINT_H
 
37
#define FLEXINT_H
 
38
 
 
39
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
40
 
 
41
#if __STDC_VERSION__ >= 199901L
 
42
 
 
43
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 
44
 * if you want the limit (max/min) macros for int types. 
 
45
 */
 
46
#ifndef __STDC_LIMIT_MACROS
 
47
#define __STDC_LIMIT_MACROS 1
 
48
#endif
 
49
 
 
50
#include <inttypes.h>
 
51
typedef int8_t flex_int8_t;
 
52
typedef uint8_t flex_uint8_t;
 
53
typedef int16_t flex_int16_t;
 
54
typedef uint16_t flex_uint16_t;
 
55
typedef int32_t flex_int32_t;
 
56
typedef uint32_t flex_uint32_t;
 
57
#else
 
58
typedef signed char flex_int8_t;
 
59
typedef short int flex_int16_t;
 
60
typedef int flex_int32_t;
 
61
typedef unsigned char flex_uint8_t; 
 
62
typedef unsigned short int flex_uint16_t;
 
63
typedef unsigned int flex_uint32_t;
 
64
#endif /* ! C99 */
 
65
 
 
66
/* Limits of integral types. */
 
67
#ifndef INT8_MIN
 
68
#define INT8_MIN               (-128)
 
69
#endif
 
70
#ifndef INT16_MIN
 
71
#define INT16_MIN              (-32767-1)
 
72
#endif
 
73
#ifndef INT32_MIN
 
74
#define INT32_MIN              (-2147483647-1)
 
75
#endif
 
76
#ifndef INT8_MAX
 
77
#define INT8_MAX               (127)
 
78
#endif
 
79
#ifndef INT16_MAX
 
80
#define INT16_MAX              (32767)
 
81
#endif
 
82
#ifndef INT32_MAX
 
83
#define INT32_MAX              (2147483647)
 
84
#endif
 
85
#ifndef UINT8_MAX
 
86
#define UINT8_MAX              (255U)
 
87
#endif
 
88
#ifndef UINT16_MAX
 
89
#define UINT16_MAX             (65535U)
 
90
#endif
 
91
#ifndef UINT32_MAX
 
92
#define UINT32_MAX             (4294967295U)
 
93
#endif
 
94
 
 
95
#endif /* ! FLEXINT_H */
 
96
 
 
97
/* begin standard C++ headers. */
 
98
#include <iostream> 
 
99
#include <errno.h>
 
100
#include <cstdlib>
 
101
#include <cstring>
 
102
/* end standard C++ headers. */
 
103
 
 
104
#ifdef __cplusplus
 
105
 
 
106
/* The "const" storage-class-modifier is valid. */
 
107
#define YY_USE_CONST
 
108
 
 
109
#else   /* ! __cplusplus */
 
110
 
 
111
#if __STDC__
 
112
 
 
113
#define YY_USE_CONST
 
114
 
 
115
#endif  /* __STDC__ */
 
116
#endif  /* ! __cplusplus */
 
117
 
 
118
#ifdef YY_USE_CONST
 
119
#define yyconst const
 
120
#else
 
121
#define yyconst
 
122
#endif
 
123
 
 
124
/* Returned upon end-of-file. */
 
125
#define YY_NULL 0
 
126
 
 
127
/* Promotes a possibly negative, possibly signed char to an unsigned
 
128
 * integer for use as an array index.  If the signed char is negative,
 
129
 * we want to instead treat it as an 8-bit unsigned char, hence the
 
130
 * double cast.
 
131
 */
 
132
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
 
133
 
 
134
/* Enter a start condition.  This macro really ought to take a parameter,
 
135
 * but we do it the disgusting crufty way forced on us by the ()-less
 
136
 * definition of BEGIN.
 
137
 */
 
138
#define BEGIN (yy_start) = 1 + 2 *
 
139
 
 
140
/* Translate the current start state into a value that can be later handed
 
141
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
 
142
 * compatibility.
 
143
 */
 
144
#define YY_START (((yy_start) - 1) / 2)
 
145
#define YYSTATE YY_START
 
146
 
 
147
/* Action number for EOF rule of a given start state. */
 
148
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
149
 
 
150
/* Special action meaning "start processing a new file". */
 
151
#define YY_NEW_FILE yyrestart( yyin  )
 
152
 
 
153
#define YY_END_OF_BUFFER_CHAR 0
 
154
 
 
155
/* Size of default input buffer. */
 
156
#ifndef YY_BUF_SIZE
 
157
#define YY_BUF_SIZE 16384
 
158
#endif
 
159
 
 
160
/* The state buf must be large enough to hold one state per character in the main buffer.
 
161
 */
 
162
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
163
 
 
164
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
 
165
#define YY_TYPEDEF_YY_BUFFER_STATE
 
166
typedef struct yy_buffer_state *YY_BUFFER_STATE;
 
167
#endif
 
168
 
 
169
extern int yyleng;
 
170
 
 
171
#define EOB_ACT_CONTINUE_SCAN 0
 
172
#define EOB_ACT_END_OF_FILE 1
 
173
#define EOB_ACT_LAST_MATCH 2
 
174
 
 
175
    #define YY_LESS_LINENO(n)
 
176
    
 
177
/* Return all but the first "n" matched characters back to the input stream. */
 
178
#define yyless(n) \
 
179
        do \
 
180
                { \
 
181
                /* Undo effects of setting up yytext. */ \
 
182
        int yyless_macro_arg = (n); \
 
183
        YY_LESS_LINENO(yyless_macro_arg);\
 
184
                *yy_cp = (yy_hold_char); \
 
185
                YY_RESTORE_YY_MORE_OFFSET \
 
186
                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
 
187
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 
188
                } \
 
189
        while ( 0 )
 
190
 
 
191
#define unput(c) yyunput( c, (yytext_ptr)  )
 
192
 
 
193
/* The following is because we cannot portably get our hands on size_t
 
194
 * (without autoconf's help, which isn't available because we want
 
195
 * flex-generated scanners to compile on their own).
 
196
 */
 
197
 
 
198
#ifndef YY_TYPEDEF_YY_SIZE_T
 
199
#define YY_TYPEDEF_YY_SIZE_T
 
200
typedef unsigned int yy_size_t;
 
201
#endif
 
202
 
 
203
#ifndef YY_STRUCT_YY_BUFFER_STATE
 
204
#define YY_STRUCT_YY_BUFFER_STATE
 
205
struct yy_buffer_state
 
206
        {
 
207
 
 
208
        std::istream* yy_input_file;
 
209
 
 
210
        char *yy_ch_buf;                /* input buffer */
 
211
        char *yy_buf_pos;               /* current position in input buffer */
 
212
 
 
213
        /* Size of input buffer in bytes, not including room for EOB
 
214
         * characters.
 
215
         */
 
216
        yy_size_t yy_buf_size;
 
217
 
 
218
        /* Number of characters read into yy_ch_buf, not including EOB
 
219
         * characters.
 
220
         */
 
221
        int yy_n_chars;
 
222
 
 
223
        /* Whether we "own" the buffer - i.e., we know we created it,
 
224
         * and can realloc() it to grow it, and should free() it to
 
225
         * delete it.
 
226
         */
 
227
        int yy_is_our_buffer;
 
228
 
 
229
        /* Whether this is an "interactive" input source; if so, and
 
230
         * if we're using stdio for input, then we want to use getc()
 
231
         * instead of fread(), to make sure we stop fetching input after
 
232
         * each newline.
 
233
         */
 
234
        int yy_is_interactive;
 
235
 
 
236
        /* Whether we're considered to be at the beginning of a line.
 
237
         * If so, '^' rules will be active on the next match, otherwise
 
238
         * not.
 
239
         */
 
240
        int yy_at_bol;
 
241
 
 
242
    int yy_bs_lineno; /**< The line count. */
 
243
    int yy_bs_column; /**< The column count. */
 
244
    
 
245
        /* Whether to try to fill the input buffer when we reach the
 
246
         * end of it.
 
247
         */
 
248
        int yy_fill_buffer;
 
249
 
 
250
        int yy_buffer_status;
 
251
 
 
252
#define YY_BUFFER_NEW 0
 
253
#define YY_BUFFER_NORMAL 1
 
254
        /* When an EOF's been seen but there's still some text to process
 
255
         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
 
256
         * shouldn't try reading from the input source any more.  We might
 
257
         * still have a bunch of tokens to match, though, because of
 
258
         * possible backing-up.
 
259
         *
 
260
         * When we actually see the EOF, we change the status to "new"
 
261
         * (via yyrestart()), so that the user can continue scanning by
 
262
         * just pointing yyin at a new input file.
 
263
         */
 
264
#define YY_BUFFER_EOF_PENDING 2
 
265
 
 
266
        };
 
267
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
268
 
 
269
/* We provide macros for accessing buffer states in case in the
 
270
 * future we want to put the buffer states in a more general
 
271
 * "scanner state".
 
272
 *
 
273
 * Returns the top of the stack, or NULL.
 
274
 */
 
275
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
 
276
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
 
277
                          : NULL)
 
278
 
 
279
/* Same as previous macro, but useful when we know that the buffer stack is not
 
280
 * NULL or when we need an lvalue. For internal use only.
 
281
 */
 
282
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
283
 
 
284
void *pgsalloc (yy_size_t  );
 
285
void *pgsrealloc (void *,yy_size_t  );
 
286
void pgsfree (void *  );
 
287
 
 
288
#define yy_new_buffer yy_create_buffer
 
289
 
 
290
#define yy_set_interactive(is_interactive) \
 
291
        { \
 
292
        if ( ! YY_CURRENT_BUFFER ){ \
 
293
        yyensure_buffer_stack (); \
 
294
                YY_CURRENT_BUFFER_LVALUE =    \
 
295
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
 
296
        } \
 
297
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 
298
        }
 
299
 
 
300
#define yy_set_bol(at_bol) \
 
301
        { \
 
302
        if ( ! YY_CURRENT_BUFFER ){\
 
303
        yyensure_buffer_stack (); \
 
304
                YY_CURRENT_BUFFER_LVALUE =    \
 
305
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
 
306
        } \
 
307
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 
308
        }
 
309
 
 
310
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
311
 
 
312
/* Begin user sect3 */
 
313
 
 
314
#define yywrap(n) 1
 
315
#define YY_SKIP_YYWRAP
 
316
 
 
317
typedef unsigned char YY_CHAR;
 
318
 
 
319
#define yytext_ptr yytext
 
320
 
 
321
#include "pgscript/FlexLexer.h"
 
322
 
 
323
/* Done after the current pattern has been matched and before the
 
324
 * corresponding action - sets up yytext.
 
325
 */
 
326
#define YY_DO_BEFORE_ACTION \
 
327
        (yytext_ptr) = yy_bp; \
 
328
        yyleng = (size_t) (yy_cp - yy_bp); \
 
329
        (yy_hold_char) = *yy_cp; \
 
330
        *yy_cp = '\0'; \
 
331
        (yy_c_buf_p) = yy_cp;
 
332
 
 
333
#define YY_NUM_RULES 137
 
334
#define YY_END_OF_BUFFER 138
 
335
/* This struct is not used in this scanner,
 
336
   but its presence is necessary. */
 
337
struct yy_trans_info
 
338
        {
 
339
        flex_int32_t yy_verify;
 
340
        flex_int32_t yy_nxt;
 
341
        };
 
342
static yyconst flex_int16_t yy_accept[444] =
 
343
    {   0,
 
344
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
345
      138,  114,  111,  113,  112,   61,   64,   50,   51,   59,
 
346
       58,   55,   57,   54,   60,   35,   49,   46,   62,   43,
 
347
       63,   34,   52,   53,  114,  114,  114,  114,  114,  114,
 
348
      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
 
349
      114,  114,  114,   47,   48,  114,  130,  129,  128,  130,
 
350
      122,  121,  120,  122,  115,  118,  119,  122,  122,  117,
 
351
      126,  125,  124,  126,  136,  135,  134,  133,  136,  111,
 
352
       48,    0,   36,    2,   38,   35,    0,   53,   47,   52,
 
353
       41,   45,   42,   34,    0,    0,    0,   11,    0,    0,
 
354
 
 
355
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
356
        0,    0,    0,    0,   13,    0,    8,    0,    0,    0,
 
357
        0,    0,   40,    0,    0,    0,    0,    0,    0,    0,
 
358
        0,    0,    0,    0,    0,    0,    0,    0,   44,  127,
 
359
        0,  116,    3,    0,  123,  131,  132,    0,    1,    0,
 
360
       36,    0,    0,   37,    0,    0,    0,   39,    0,    0,
 
361
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
362
        0,    0,    0,    0,    0,    0,    0,   33,    0,    0,
 
363
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
364
       56,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
365
 
 
366
        0,    0,    0,    0,    0,    0,  103,    0,    0,    0,
 
367
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
368
       36,    0,    0,   38,    0,    0,    0,    0,    0,    0,
 
369
       19,    0,    0,    0,    0,    0,    0,   75,    0,   26,
 
370
        0,    0,    0,    0,   81,    9,    0,    0,    0,    0,
 
371
       25,    0,    0,    0,    0,    0,   90,   91,   92,    0,
 
372
        0,    0,   22,    0,    0,    0,    0,    0,    0,    0,
 
373
        0,    0,    0,    0,    0,    0,    0,  104,    0,    0,
 
374
       27,   17,    0,    0,    0,    0,    0,    0,    0,    0,
 
375
       36,   65,   66,    0,    0,   32,    5,    0,   71,    0,
 
376
 
 
377
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
378
        0,    0,    0,    0,   86,   87,    0,    0,   16,    0,
 
379
        0,    0,   14,    0,    0,    0,   24,    0,    0,   98,
 
380
        0,    0,    0,    0,    0,    0,   30,  105,    0,    0,
 
381
        0,    0,    0,    0,    0,    4,    0,   12,    0,    0,
 
382
        0,    0,    0,   74,    0,   76,    0,    0,    0,   79,
 
383
        0,    0,    0,    0,    0,   88,    0,   89,   93,    0,
 
384
        0,   20,    0,    0,    0,    6,   99,   18,    0,    0,
 
385
      102,   23,    0,    0,  108,  109,  110,    0,   67,    0,
 
386
        0,    0,   72,   15,   73,    0,    0,    0,   78,   80,
 
387
 
 
388
        0,    0,   84,   85,   21,   94,    0,    0,   96,   97,
 
389
        0,    0,    0,    0,   10,    0,    0,    0,    7,   28,
 
390
        0,    0,    0,   83,   95,    0,  100,    0,  106,  107,
 
391
        0,    0,    0,    0,   31,   82,   29,  101,   68,   69,
 
392
       70,   77,    0
 
393
    } ;
 
394
 
 
395
static yyconst flex_int32_t yy_ec[256] =
 
396
    {   0,
 
397
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
 
398
        4,    4,    5,    1,    1,    1,    1,    1,    1,    1,
 
399
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
400
        1,    2,    1,    1,    6,    7,    8,    1,    9,   10,
 
401
       11,   12,   13,   14,   15,   16,   17,   18,   18,   18,
 
402
       18,   18,   18,   18,   18,   18,   18,   19,   20,   21,
 
403
       22,   23,    1,   24,   28,   29,   30,   31,   32,   33,
 
404
       34,   35,   36,    6,   37,   38,   39,   40,   41,   42,
 
405
        6,   43,   44,   45,   46,   47,   48,   49,   50,   51,
 
406
       25,   26,   27,    1,    6,    1,   28,   29,   30,   31,
 
407
 
 
408
       32,   33,   34,   35,   36,    6,   37,   38,   39,   40,
 
409
       41,   42,    6,   43,   44,   45,   46,   47,   48,   49,
 
410
       50,   51,   52,    1,   53,   54,    1,    1,    1,    1,
 
411
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
412
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
413
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
414
        1,    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
 
 
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
 
425
    } ;
 
426
 
 
427
static yyconst flex_int32_t yy_meta[55] =
 
428
    {   0,
 
429
        1,    1,    2,    1,    1,    3,    4,    1,    1,    1,
 
430
        1,    1,    1,    1,    1,    1,    1,    3,    1,    1,
 
431
        1,    1,    1,    3,    1,    1,    1,    3,    3,    3,
 
432
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
 
433
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
 
434
        3,    1,    1,    1
 
435
    } ;
 
436
 
 
437
static yyconst flex_int16_t yy_base[453] =
 
438
    {   0,
 
439
        0,    0,   52,   53,   63,   81,   56,   64,   76,   84,
 
440
      507,  508,   58,  508,  508,  483,  508,  508,  508,  508,
 
441
      508,  508,  490,  486,  491,   79,  479,  508,   86,  508,
 
442
      479,    0,  508,  508,   74,   72,   78,   92,   85,   90,
 
443
       34,   67,   91,  459,  458,  455,  454,   97,  105,  103,
 
444
      101,  468,  114,  508,  508,  473,  508,  508,  508,  477,
 
445
      508,  508,  508,  486,  508,  508,  508,  477,  479,  508,
 
446
      508,  508,  508,  483,  508,  508,  508,  480,    0,  143,
 
447
      508,  485,   99,  508,  112,  135,  139,  508,  508,  508,
 
448
      508,  508,  508,    0,  446,  441,  127,  441,  450,  451,
 
449
 
 
450
      438,  449,  115,  124,  448,  434,  140,  434,  436,  432,
 
451
      444,  127,  429,  435,  508,  444,  508,  127,  133,  146,
 
452
      424,  425,  508,  143,  152,  431,  430,  420,  146,  425,
 
453
      155,  426,  156,  426,  432,  151,  426,  425,  508,  508,
 
454
      453,  508,  508,  452,  508,  508,  508,  455,  508,  188,
 
455
      175,  195,  439,  438,  412,  422,  415,  508,  420,  415,
 
456
      422,  404,  418,  403,  402,  399,  405,  398,  392,  413,
 
457
      408,  401,  400,  405,  406,  393,  402,  431,  402,  393,
 
458
      400,  397,  388,  395,  394,  393,  379,  392,  385,  389,
 
459
      384,  377,  378,   38,  376,  384,  383,  374,  381,  380,
 
460
 
 
461
      365,  369,  373,  370,  375,  374,  403,  356,  360,  366,
 
462
      369,  361,  359,  362,  369,  350,  349,  349,  355,  374,
 
463
      373,  196,  372,  371,  343,  344,  336,  342,  344,  346,
 
464
      508,  345,  349,  335,  340,  168,  342,  508,  332,  331,
 
465
      337,  346,  328,  344,  508,  508,  185,  325,  342,  334,
 
466
      508,  323,  324,  332,  321,  332,  508,  508,  508,  330,
 
467
      334,  316,  508,  316,  316,  315,  308,  325,  327,  309,
 
468
      310,  315,  311,  321,  307,  318,  192,  508,  302,  306,
 
469
      508,  508,  315,  300,  298,  296,  309,  307,  307,  320,
 
470
      319,  508,  508,  285,  290,  332,  508,  291,  508,  300,
 
471
 
 
472
      291,  290,  284,  288,  295,  290,  284,  281,  291,  279,
 
473
      278,  279,  274,  282,  508,  508,  272,  284,  508,  275,
 
474
      264,  270,  508,  276,  280,  278,  508,  277,  264,  508,
 
475
      267,  274,  273,  276,  262,  257,  508,  508,  267,  272,
 
476
      254,  266,  258,  252,  254,  508,  262,  508,  193,  252,
 
477
      249,  247,  245,  508,  243,  508,  249,  257,  254,  508,
 
478
      254,  256,  240,  250,  241,  508,  237,  508,  508,  247,
 
479
      244,  508,  237,  227,  243,  508,  508,  508,  244,  237,
 
480
      508,  508,  227,  239,  508,  508,  508,  227,  508,  220,
 
481
      199,  203,  508,  508,  508,  205,  204,  207,  232,  508,
 
482
 
 
483
      192,  194,  508,  508,  508,  508,  189,  198,  508,  508,
 
484
      189,  185,  192,  183,  508,  194,  178,  180,  508,  508,
 
485
      174,  203,  174,  508,  508,  185,  508,  170,  508,  508,
 
486
      172,  128,  115,  116,  508,  508,  508,  508,  508,  508,
 
487
      508,  508,  508,  241,  245,  249,  253,   96,  255,  257,
 
488
      261,  265
 
489
    } ;
 
490
 
 
491
static yyconst flex_int16_t yy_def[453] =
 
492
    {   0,
 
493
      443,    1,  444,  444,  445,  445,  446,  446,  447,  447,
 
494
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
495
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
496
      443,  448,  443,  443,  443,  443,  443,  443,  443,  443,
 
497
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
498
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
499
      443,  443,  443,  449,  443,  443,  443,  443,  443,  443,
 
500
      443,  443,  443,  450,  443,  443,  443,  443,  451,  443,
 
501
      443,  452,  443,  443,  443,  443,  443,  443,  443,  443,
 
502
      443,  443,  443,  448,  443,  443,  443,  443,  443,  443,
 
503
 
 
504
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
505
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
506
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
507
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
508
      449,  443,  443,  450,  443,  443,  443,  452,  443,  443,
 
509
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
510
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
511
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
512
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
513
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
514
 
 
515
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
516
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
517
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
518
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
519
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
520
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
521
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
522
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
523
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
524
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
525
 
 
526
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
527
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
528
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
529
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
530
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
531
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
532
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
533
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
534
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
535
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
536
 
 
537
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
538
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
539
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
540
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
541
      443,  443,    0,  443,  443,  443,  443,  443,  443,  443,
 
542
      443,  443
 
543
    } ;
 
544
 
 
545
static yyconst flex_int16_t yy_nxt[563] =
 
546
    {   0,
 
547
       12,   13,   14,   13,   15,   12,   12,   16,   17,   18,
 
548
       19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
 
549
       29,   30,   31,   32,   33,   12,   34,   35,   36,   37,
 
550
       38,   39,   40,   41,   12,   42,   12,   43,   44,   45,
 
551
       46,   47,   48,   49,   50,   51,   52,   53,   12,   12,
 
552
       12,   54,   55,   56,   58,   58,   59,   59,   72,   80,
 
553
       73,   80,   74,   60,   60,   62,   72,   63,   73,   64,
 
554
       74,   65,   66,   67,  115,  263,  116,   68,   76,   69,
 
555
       77,  264,   70,   62,   78,   63,   76,   64,   77,   65,
 
556
       66,   67,   78,   89,   85,   68,   86,   69,   94,  117,
 
557
 
 
558
       70,   79,   95,   99,   90,  101,  118,   91,   92,   79,
 
559
       87,   96,  102,   97,  100,  103,   83,   98,  104,  106,
 
560
      105,  113,  110,  107,  111,  114,  119,  108,  125,  151,
 
561
      150,  120,  128,  112,  109,  126,  129,  127,  132,  130,
 
562
      134,  137,  135,  152,   80,  133,   80,  442,  138,  131,
 
563
       85,  153,   86,  153,  157,  164,  154,  158,  179,  441,
 
564
      165,  166,  167,  168,  440,  169,   87,  172,  180,  173,
 
565
      184,  185,  186,  188,  192,  189,  187,  174,  193,  194,
 
566
      216,  195,  209,  206,  196,  197,  247,  198,  217,  199,
 
567
      207,  212,  151,  277,  349,  200,  201,  210,  202,  302,
 
568
 
 
569
      220,  213,  220,  303,  422,  221,  222,  223,  290,  223,
 
570
      290,  439,  224,  291,  438,  337,  437,  436,  434,  433,
 
571
      432,  431,  430,  429,  428,  427,  435,  426,  425,  311,
 
572
      424,  423,  312,  422,  421,  420,  419,  390,  418,  417,
 
573
      391,   57,   57,   57,   57,   61,   61,   61,   61,   71,
 
574
       71,   71,   71,   75,   75,   75,   75,  141,  141,  144,
 
575
      144,  147,  416,  147,  147,  148,  148,  148,  148,  415,
 
576
      414,  413,  412,  411,  410,  409,  408,  407,  406,  405,
 
577
      404,  403,  402,  401,  400,  399,  398,  397,  396,  395,
 
578
      394,  393,  392,  389,  388,  387,  386,  385,  384,  383,
 
579
 
 
580
      382,  381,  380,  379,  378,  377,  376,  375,  374,  373,
 
581
      372,  371,  370,  369,  368,  367,  366,  365,  364,  363,
 
582
      362,  361,  360,  359,  358,  357,  356,  355,  354,  353,
 
583
      352,  351,  350,  349,  348,  347,  291,  291,  346,  345,
 
584
      344,  343,  342,  341,  340,  339,  338,  336,  335,  334,
 
585
      333,  332,  331,  330,  329,  328,  327,  326,  325,  324,
 
586
      323,  322,  321,  320,  319,  318,  317,  316,  315,  314,
 
587
      313,  310,  309,  308,  307,  306,  305,  304,  301,  300,
 
588
      299,  298,  297,  296,  295,  294,  293,  292,  224,  224,
 
589
      221,  221,  289,  288,  287,  286,  285,  284,  283,  282,
 
590
 
 
591
      281,  280,  279,  278,  277,  276,  275,  274,  273,  272,
 
592
      271,  270,  269,  268,  267,  266,  265,  262,  261,  260,
 
593
      259,  258,  257,  256,  255,  254,  253,  252,  251,  250,
 
594
      249,  248,  247,  246,  245,  244,  243,  242,  241,  240,
 
595
      239,  238,  237,  236,  235,  234,  233,  232,  231,  230,
 
596
      229,  228,  227,  226,  225,  154,  154,  149,  145,  142,
 
597
      219,  218,  215,  214,  211,  208,  205,  204,  203,  191,
 
598
      190,  183,  182,  181,  178,  177,  176,  175,  171,  170,
 
599
      163,  162,  161,  160,  159,  156,  155,  149,  146,  145,
 
600
      143,   82,  142,  140,  139,  136,  124,  123,  122,  121,
 
601
 
 
602
       93,   88,   84,   83,   82,   81,  443,   11,  443,  443,
 
603
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
604
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
605
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
606
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
607
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
608
      443,  443
 
609
    } ;
 
610
 
 
611
static yyconst flex_int16_t yy_chk[563] =
 
612
    {   0,
 
613
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
614
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
615
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
616
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
617
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
618
        1,    1,    1,    1,    3,    4,    3,    4,    7,   13,
 
619
        7,   13,    7,    3,    4,    5,    8,    5,    8,    5,
 
620
        8,    5,    5,    5,   41,  194,   41,    5,    9,    5,
 
621
        9,  194,    5,    6,    9,    6,   10,    6,   10,    6,
 
622
        6,    6,   10,   29,   26,    6,   26,    6,  448,   42,
 
623
 
 
624
        6,    9,   35,   36,   29,   37,   42,   29,   29,   10,
 
625
       26,   35,   37,   35,   36,   37,   83,   35,   37,   38,
 
626
       37,   40,   39,   38,   39,   40,   43,   38,   48,   85,
 
627
       83,   43,   49,   39,   38,   48,   49,   48,   50,   49,
 
628
       51,   53,   51,   85,   80,   50,   80,  434,   53,   49,
 
629
       86,   87,   86,   87,   97,  103,   87,   97,  112,  433,
 
630
      103,  104,  104,  104,  432,  104,   86,  107,  112,  107,
 
631
      118,  118,  119,  120,  124,  120,  119,  107,  124,  125,
 
632
      136,  125,  131,  129,  125,  125,  247,  125,  136,  125,
 
633
      129,  133,  151,  277,  349,  125,  125,  131,  125,  236,
 
634
 
 
635
      150,  133,  150,  236,  422,  150,  151,  152,  222,  152,
 
636
      222,  431,  152,  222,  428,  277,  426,  423,  421,  418,
 
637
      417,  416,  414,  413,  412,  411,  422,  408,  407,  247,
 
638
      402,  401,  247,  399,  398,  397,  396,  349,  392,  391,
 
639
      349,  444,  444,  444,  444,  445,  445,  445,  445,  446,
 
640
      446,  446,  446,  447,  447,  447,  447,  449,  449,  450,
 
641
      450,  451,  390,  451,  451,  452,  452,  452,  452,  388,
 
642
      384,  383,  380,  379,  375,  374,  373,  371,  370,  367,
 
643
      365,  364,  363,  362,  361,  359,  358,  357,  355,  353,
 
644
      352,  351,  350,  347,  345,  344,  343,  342,  341,  340,
 
645
 
 
646
      339,  336,  335,  334,  333,  332,  331,  329,  328,  326,
 
647
      325,  324,  322,  321,  320,  318,  317,  314,  313,  312,
 
648
      311,  310,  309,  308,  307,  306,  305,  304,  303,  302,
 
649
      301,  300,  298,  296,  295,  294,  291,  290,  289,  288,
 
650
      287,  286,  285,  284,  283,  280,  279,  276,  275,  274,
 
651
      273,  272,  271,  270,  269,  268,  267,  266,  265,  264,
 
652
      262,  261,  260,  256,  255,  254,  253,  252,  250,  249,
 
653
      248,  244,  243,  242,  241,  240,  239,  237,  235,  234,
 
654
      233,  232,  230,  229,  228,  227,  226,  225,  224,  223,
 
655
      221,  220,  219,  218,  217,  216,  215,  214,  213,  212,
 
656
 
 
657
      211,  210,  209,  208,  207,  206,  205,  204,  203,  202,
 
658
      201,  200,  199,  198,  197,  196,  195,  193,  192,  191,
 
659
      190,  189,  188,  187,  186,  185,  184,  183,  182,  181,
 
660
      180,  179,  178,  177,  176,  175,  174,  173,  172,  171,
 
661
      170,  169,  168,  167,  166,  165,  164,  163,  162,  161,
 
662
      160,  159,  157,  156,  155,  154,  153,  148,  144,  141,
 
663
      138,  137,  135,  134,  132,  130,  128,  127,  126,  122,
 
664
      121,  116,  114,  113,  111,  110,  109,  108,  106,  105,
 
665
      102,  101,  100,   99,   98,   96,   95,   82,   78,   74,
 
666
       69,   68,   64,   60,   56,   52,   47,   46,   45,   44,
 
667
 
 
668
       31,   27,   25,   24,   23,   16,   11,  443,  443,  443,
 
669
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
670
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
671
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
672
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
673
      443,  443,  443,  443,  443,  443,  443,  443,  443,  443,
 
674
      443,  443
 
675
    } ;
 
676
 
 
677
/* The intent behind this definition is that it'll catch
 
678
 * any uses of REJECT which flex missed.
 
679
 */
 
680
#define REJECT reject_used_but_not_detected
 
681
#define yymore() yymore_used_but_not_detected
 
682
#define YY_MORE_ADJ 0
 
683
#define YY_RESTORE_YY_MORE_OFFSET
 
684
#line 1 "pgscript/pgsScanner.ll"
 
685
#line 6 "pgscript/pgsScanner.ll"
 
686
 
 
687
//////////////////////////////////////////////////////////////////////////
 
688
//
 
689
// pgScript - PostgreSQL Tools
 
690
// RCS-ID:      $Id: pgsScanner.ll,v 1.5 2008/08/10 22:11:29 pgunittest Exp $
 
691
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
692
// This software is released under the BSD Licence
 
693
//
 
694
//////////////////////////////////////////////////////////////////////////
 
695
 
 
696
#include "pgscript/pgScript.h"
 
697
#include "pgscript/parser.tab.hh"
 
698
#include "pgscript/utilities/pgsScanner.h"
 
699
 
 
700
/* Import the parser's token type into a local typedef */
 
701
typedef pgscript::pgsParser::token token;
 
702
typedef pgscript::pgsParser::token_type token_type;
 
703
 
 
704
/* Work around an incompatibility in flex (at least versions 2.5.31 through
 
705
 * 2.5.33): it generates code that does not conform to C89.  See Debian bug
 
706
 * 333231 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.  */
 
707
#undef  yywrap
 
708
#define yywrap()        1
 
709
 
 
710
/* By default yylex returns int, we use token_type. Unfortunately yyterminate
 
711
 * by default returns 0, which is not of token_type. */
 
712
#define yyterminate() return token::PGS_END
 
713
 
 
714
/* This disables inclusion of unistd.h, which is not available under Visual C++
 
715
 * on Win32. The C++ scanner uses STL streams instead. */
 
716
#define YY_NO_UNISTD_H
 
717
 
 
718
/*** Flex Declarations and Options ***/
 
719
/* Enable C++ scanner class generation */
 
720
/* Change the name of the scanner class. Results in "pgsFlexLexer" */
 
721
/* Case insensitive */
 
722
/* The manual says "somewhat more optimized" */
 
723
/* Prevent isatty warning in VC++ */
 
724
/* For using start conditions */
 
725
/* No support for include files is planned */
 
726
/* The following paragraph suffices to track locations accurately. Each time
 
727
 * yylex is invoked, the begin position is moved onto the end position. */
 
728
#line 66 "pgscript/pgsScanner.ll"
 
729
#define YY_USER_ACTION  yylloc->columns(yyleng);
 
730
 
 
731
 
 
732
 
 
733
 
 
734
#line 732 "pgscript/lex.pgs.cc"
 
735
 
 
736
#define INITIAL 0
 
737
#define SC_COMMENT 1
 
738
#define SC_QUERY 2
 
739
#define SC_DOLLAR 3
 
740
#define SC_STRING 4
 
741
 
 
742
#ifndef YY_NO_UNISTD_H
 
743
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 
744
 * down here because we want the user's section 1 to have been scanned first.
 
745
 * The user has a chance to override it with an option.
 
746
 */
 
747
#include <unistd.h>
 
748
#endif
 
749
 
 
750
#ifndef YY_EXTRA_TYPE
 
751
#define YY_EXTRA_TYPE void *
 
752
#endif
 
753
 
 
754
#ifndef yytext_ptr
 
755
static void yy_flex_strncpy (char *,yyconst char *,int );
 
756
#endif
 
757
 
 
758
#ifdef YY_NEED_STRLEN
 
759
static int yy_flex_strlen (yyconst char * );
 
760
#endif
 
761
 
 
762
#ifndef YY_NO_INPUT
 
763
 
 
764
#endif
 
765
 
 
766
/* Amount of stuff to slurp up with each read. */
 
767
#ifndef YY_READ_BUF_SIZE
 
768
#define YY_READ_BUF_SIZE 8192
 
769
#endif
 
770
 
 
771
/* Copy whatever the last rule matched to the standard output. */
 
772
#ifndef ECHO
 
773
#define ECHO LexerOutput( yytext, yyleng )
 
774
#endif
 
775
 
 
776
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 
777
 * is returned in "result".
 
778
 */
 
779
#ifndef YY_INPUT
 
780
#define YY_INPUT(buf,result,max_size) \
 
781
\
 
782
        if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
 
783
                YY_FATAL_ERROR( "input in flex scanner failed" );
 
784
 
 
785
#endif
 
786
 
 
787
/* No semi-colon after return; correct usage is to write "yyterminate();" -
 
788
 * we don't want an extra ';' after the "return" because that will cause
 
789
 * some compilers to complain about unreachable statements.
 
790
 */
 
791
#ifndef yyterminate
 
792
#define yyterminate() return YY_NULL
 
793
#endif
 
794
 
 
795
/* Number of entries by which start-condition stack grows. */
 
796
#ifndef YY_START_STACK_INCR
 
797
#define YY_START_STACK_INCR 25
 
798
#endif
 
799
 
 
800
/* Report a fatal error. */
 
801
#ifndef YY_FATAL_ERROR
 
802
#define YY_FATAL_ERROR(msg) LexerError( msg )
 
803
#endif
 
804
 
 
805
/* end tables serialization structures and prototypes */
 
806
 
 
807
/* Default declaration of generated scanner - a define so the user can
 
808
 * easily add parameters.
 
809
 */
 
810
#ifndef YY_DECL
 
811
#define YY_DECL_IS_OURS 1
 
812
#define YY_DECL int yyFlexLexer::yylex()
 
813
#endif /* !YY_DECL */
 
814
 
 
815
/* Code executed at the beginning of each rule, after yytext and yyleng
 
816
 * have been set up.
 
817
 */
 
818
#ifndef YY_USER_ACTION
 
819
#define YY_USER_ACTION
 
820
#endif
 
821
 
 
822
/* Code executed at the end of each rule. */
 
823
#ifndef YY_BREAK
 
824
#define YY_BREAK break;
 
825
#endif
 
826
 
 
827
#define YY_RULE_SETUP \
 
828
        YY_USER_ACTION
 
829
 
 
830
/** The main scanner function which does all the work.
 
831
 */
 
832
YY_DECL
 
833
{
 
834
        register yy_state_type yy_current_state;
 
835
        register char *yy_cp, *yy_bp;
 
836
        register int yy_act;
 
837
    
 
838
#line 74 "pgscript/pgsScanner.ll"
 
839
 
 
840
 
 
841
 /* Code to place at the beginning of yylex() */
 
842
 
 
843
        // Reset location
 
844
        yylloc->step();
 
845
 
 
846
 
 
847
#line 845 "pgscript/lex.pgs.cc"
 
848
 
 
849
        if ( !(yy_init) )
 
850
                {
 
851
                (yy_init) = 1;
 
852
 
 
853
#ifdef YY_USER_INIT
 
854
                YY_USER_INIT;
 
855
#endif
 
856
 
 
857
                if ( ! (yy_start) )
 
858
                        (yy_start) = 1; /* first start state */
 
859
 
 
860
                if ( ! yyin )
 
861
                        yyin = & std::cin;
 
862
 
 
863
                if ( ! yyout )
 
864
                        yyout = & std::cout;
 
865
 
 
866
                if ( ! YY_CURRENT_BUFFER ) {
 
867
                        yyensure_buffer_stack ();
 
868
                        YY_CURRENT_BUFFER_LVALUE =
 
869
                                yy_create_buffer( yyin, YY_BUF_SIZE );
 
870
                }
 
871
 
 
872
                yy_load_buffer_state(  );
 
873
                }
 
874
 
 
875
        while ( 1 )             /* loops until end-of-file is reached */
 
876
                {
 
877
                yy_cp = (yy_c_buf_p);
 
878
 
 
879
                /* Support of yytext. */
 
880
                *yy_cp = (yy_hold_char);
 
881
 
 
882
                /* yy_bp points to the position in yy_ch_buf of the start of
 
883
                 * the current run.
 
884
                 */
 
885
                yy_bp = yy_cp;
 
886
 
 
887
                yy_current_state = (yy_start);
 
888
yy_match:
 
889
                do
 
890
                        {
 
891
                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 
892
                        if ( yy_accept[yy_current_state] )
 
893
                                {
 
894
                                (yy_last_accepting_state) = yy_current_state;
 
895
                                (yy_last_accepting_cpos) = yy_cp;
 
896
                                }
 
897
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
898
                                {
 
899
                                yy_current_state = (int) yy_def[yy_current_state];
 
900
                                if ( yy_current_state >= 444 )
 
901
                                        yy_c = yy_meta[(unsigned int) yy_c];
 
902
                                }
 
903
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
904
                        ++yy_cp;
 
905
                        }
 
906
                while ( yy_current_state != 443 );
 
907
                yy_cp = (yy_last_accepting_cpos);
 
908
                yy_current_state = (yy_last_accepting_state);
 
909
 
 
910
yy_find_action:
 
911
                yy_act = yy_accept[yy_current_state];
 
912
 
 
913
                YY_DO_BEFORE_ACTION;
 
914
 
 
915
do_action:      /* This label is used only to access EOF actions. */
 
916
 
 
917
                switch ( yy_act )
 
918
        { /* beginning of action switch */
 
919
                        case 0: /* must back up */
 
920
                        /* undo the effects of YY_DO_BEFORE_ACTION */
 
921
                        *yy_cp = (yy_hold_char);
 
922
                        yy_cp = (yy_last_accepting_cpos);
 
923
                        yy_current_state = (yy_last_accepting_state);
 
924
                        goto yy_find_action;
 
925
 
 
926
case 1:
 
927
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
 
928
(yy_c_buf_p) = yy_cp -= 1;
 
929
YY_DO_BEFORE_ACTION; /* set up yytext again */
 
930
YY_RULE_SETUP
 
931
#line 82 "pgscript/pgsScanner.ll"
 
932
{ /* Ignore SQL comment */ }
 
933
        YY_BREAK
 
934
case 2:
 
935
YY_RULE_SETUP
 
936
#line 83 "pgscript/pgsScanner.ll"
 
937
{ comment_caller = INITIAL; BEGIN(SC_COMMENT); }
 
938
        YY_BREAK
 
939
case 3:
 
940
YY_RULE_SETUP
 
941
#line 84 "pgscript/pgsScanner.ll"
 
942
{ comment_caller = SC_QUERY; BEGIN(SC_COMMENT); }
 
943
        YY_BREAK
 
944
 
 
945
case 4:
 
946
YY_RULE_SETUP
 
947
#line 87 "pgscript/pgsScanner.ll"
 
948
{ return token::PGS_WHILE; }
 
949
        YY_BREAK
 
950
case 5:
 
951
YY_RULE_SETUP
 
952
#line 88 "pgscript/pgsScanner.ll"
 
953
{ return token::PGS_BREAK; }
 
954
        YY_BREAK
 
955
case 6:
 
956
YY_RULE_SETUP
 
957
#line 89 "pgscript/pgsScanner.ll"
 
958
{ return token::PGS_RETURN; }
 
959
        YY_BREAK
 
960
case 7:
 
961
YY_RULE_SETUP
 
962
#line 90 "pgscript/pgsScanner.ll"
 
963
{ return token::PGS_CONTINUE; }
 
964
        YY_BREAK
 
965
case 8:
 
966
YY_RULE_SETUP
 
967
#line 91 "pgscript/pgsScanner.ll"
 
968
{ return token::PGS_IF; }
 
969
        YY_BREAK
 
970
case 9:
 
971
YY_RULE_SETUP
 
972
#line 92 "pgscript/pgsScanner.ll"
 
973
{ return token::PGS_ELSE; }
 
974
        YY_BREAK
 
975
case 10:
 
976
YY_RULE_SETUP
 
977
#line 93 "pgscript/pgsScanner.ll"
 
978
{ return token::PGS_WAITFOR; }
 
979
        YY_BREAK
 
980
case 11:
 
981
YY_RULE_SETUP
 
982
#line 94 "pgscript/pgsScanner.ll"
 
983
{ return token::PGS_AS; }
 
984
        YY_BREAK
 
985
case 12:
 
986
YY_RULE_SETUP
 
987
#line 96 "pgscript/pgsScanner.ll"
 
988
{ return token::PGS_ASSERT; }
 
989
        YY_BREAK
 
990
case 13:
 
991
YY_RULE_SETUP
 
992
#line 97 "pgscript/pgsScanner.ll"
 
993
{ /* Ignore it */ }
 
994
        YY_BREAK
 
995
case 14:
 
996
YY_RULE_SETUP
 
997
#line 98 "pgscript/pgsScanner.ll"
 
998
{ return token::PGS_PRINT; }
 
999
        YY_BREAK
 
1000
case 15:
 
1001
YY_RULE_SETUP
 
1002
#line 100 "pgscript/pgsScanner.ll"
 
1003
{ return token::PGS_CNT_COLUMNS; }
 
1004
        YY_BREAK
 
1005
case 16:
 
1006
YY_RULE_SETUP
 
1007
#line 101 "pgscript/pgsScanner.ll"
 
1008
{ return token::PGS_CNT_LINES; }
 
1009
        YY_BREAK
 
1010
case 17:
 
1011
YY_RULE_SETUP
 
1012
#line 102 "pgscript/pgsScanner.ll"
 
1013
{ return token::PGS_TRIM; }
 
1014
        YY_BREAK
 
1015
case 18:
 
1016
YY_RULE_SETUP
 
1017
#line 103 "pgscript/pgsScanner.ll"
 
1018
{ return token::PGS_RM_LINE; }
 
1019
        YY_BREAK
 
1020
case 19:
 
1021
YY_RULE_SETUP
 
1022
#line 104 "pgscript/pgsScanner.ll"
 
1023
{ return token::PGS_CAST; }
 
1024
        YY_BREAK
 
1025
case 20:
 
1026
YY_RULE_SETUP
 
1027
#line 106 "pgscript/pgsScanner.ll"
 
1028
{ return token::PGS_RECORD; }
 
1029
        YY_BREAK
 
1030
case 21:
 
1031
YY_RULE_SETUP
 
1032
#line 108 "pgscript/pgsScanner.ll"
 
1033
{ return token::PGS_INTEGER; }
 
1034
        YY_BREAK
 
1035
case 22:
 
1036
YY_RULE_SETUP
 
1037
#line 109 "pgscript/pgsScanner.ll"
 
1038
{ return token::PGS_REAL; }
 
1039
        YY_BREAK
 
1040
case 23:
 
1041
YY_RULE_SETUP
 
1042
#line 110 "pgscript/pgsScanner.ll"
 
1043
{ return token::PGS_STRING; }
 
1044
        YY_BREAK
 
1045
case 24:
 
1046
YY_RULE_SETUP
 
1047
#line 111 "pgscript/pgsScanner.ll"
 
1048
{ return token::PGS_REGEX; }
 
1049
        YY_BREAK
 
1050
case 25:
 
1051
YY_RULE_SETUP
 
1052
#line 112 "pgscript/pgsScanner.ll"
 
1053
{ return token::PGS_FILE; }
 
1054
        YY_BREAK
 
1055
case 26:
 
1056
YY_RULE_SETUP
 
1057
#line 113 "pgscript/pgsScanner.ll"
 
1058
{ return token::PGS_DATE; }
 
1059
        YY_BREAK
 
1060
case 27:
 
1061
YY_RULE_SETUP
 
1062
#line 114 "pgscript/pgsScanner.ll"
 
1063
{ return token::PGS_TIME; }
 
1064
        YY_BREAK
 
1065
case 28:
 
1066
YY_RULE_SETUP
 
1067
#line 115 "pgscript/pgsScanner.ll"
 
1068
{ return token::PGS_DATE_TIME; }
 
1069
        YY_BREAK
 
1070
case 29:
 
1071
YY_RULE_SETUP
 
1072
#line 116 "pgscript/pgsScanner.ll"
 
1073
{ return token::PGS_REFERENCE; }
 
1074
        YY_BREAK
 
1075
case 30:
 
1076
YY_RULE_SETUP
 
1077
#line 119 "pgscript/pgsScanner.ll"
 
1078
{ unput('@'); yylloc->end.columns(-1);
 
1079
                                          return token::PGS_SET_ASSIGN; }
 
1080
        YY_BREAK
 
1081
case 31:
 
1082
YY_RULE_SETUP
 
1083
#line 121 "pgscript/pgsScanner.ll"
 
1084
{ unput('@'); yylloc->end.columns(-1);
 
1085
                                          return token::PGS_DECLARE_ASSGN; }
 
1086
        YY_BREAK
 
1087
case 32:
 
1088
YY_RULE_SETUP
 
1089
#line 124 "pgscript/pgsScanner.ll"
 
1090
{ /* Block opening */ return token::PGS_OPEN; }
 
1091
        YY_BREAK
 
1092
case 33:
 
1093
YY_RULE_SETUP
 
1094
#line 125 "pgscript/pgsScanner.ll"
 
1095
{ /* Block closing */ return token::PGS_CLOSE; }
 
1096
        YY_BREAK
 
1097
case 34:
 
1098
YY_RULE_SETUP
 
1099
#line 127 "pgscript/pgsScanner.ll"
 
1100
{ yylval->str = pnew wxString(yytext, m_conv);
 
1101
                                          return token::PGS_IDENTIFIER; }
 
1102
        YY_BREAK
 
1103
case 35:
 
1104
YY_RULE_SETUP
 
1105
#line 130 "pgscript/pgsScanner.ll"
 
1106
{ yylval->str = pnew wxString(yytext, m_conv);
 
1107
                                          return token::PGS_VAL_INT; }
 
1108
        YY_BREAK
 
1109
case 36:
 
1110
YY_RULE_SETUP
 
1111
#line 133 "pgscript/pgsScanner.ll"
 
1112
{ yylval->str = pnew wxString(yytext, m_conv);
 
1113
                                          return token::PGS_VAL_REAL; }
 
1114
        YY_BREAK
 
1115
case 37:
 
1116
YY_RULE_SETUP
 
1117
#line 135 "pgscript/pgsScanner.ll"
 
1118
{ yylval->str = pnew wxString(yytext, m_conv);
 
1119
                                          return token::PGS_VAL_REAL; }
 
1120
        YY_BREAK
 
1121
case 38:
 
1122
YY_RULE_SETUP
 
1123
#line 137 "pgscript/pgsScanner.ll"
 
1124
{ yylval->str = pnew wxString(yytext, m_conv);
 
1125
                                          return token::PGS_VAL_REAL; }
 
1126
        YY_BREAK
 
1127
case 39:
 
1128
YY_RULE_SETUP
 
1129
#line 140 "pgscript/pgsScanner.ll"
 
1130
{ return token::PGS_AND_OP; }
 
1131
        YY_BREAK
 
1132
case 40:
 
1133
YY_RULE_SETUP
 
1134
#line 141 "pgscript/pgsScanner.ll"
 
1135
{ return token::PGS_OR_OP; }
 
1136
        YY_BREAK
 
1137
case 41:
 
1138
YY_RULE_SETUP
 
1139
#line 142 "pgscript/pgsScanner.ll"
 
1140
{ return token::PGS_LE_OP; }
 
1141
        YY_BREAK
 
1142
case 42:
 
1143
YY_RULE_SETUP
 
1144
#line 143 "pgscript/pgsScanner.ll"
 
1145
{ return token::PGS_GE_OP; }
 
1146
        YY_BREAK
 
1147
case 43:
 
1148
YY_RULE_SETUP
 
1149
#line 144 "pgscript/pgsScanner.ll"
 
1150
{ return token::PGS_EQ_OP; }
 
1151
        YY_BREAK
 
1152
case 44:
 
1153
YY_RULE_SETUP
 
1154
#line 145 "pgscript/pgsScanner.ll"
 
1155
{ return token::PGS_AE_OP; }
 
1156
        YY_BREAK
 
1157
case 45:
 
1158
YY_RULE_SETUP
 
1159
#line 146 "pgscript/pgsScanner.ll"
 
1160
{ return token::PGS_NE_OP; }
 
1161
        YY_BREAK
 
1162
case 46:
 
1163
YY_RULE_SETUP
 
1164
#line 147 "pgscript/pgsScanner.ll"
 
1165
{ return wx_static_cast(token_type, ';'); }
 
1166
        YY_BREAK
 
1167
case 47:
 
1168
YY_RULE_SETUP
 
1169
#line 148 "pgscript/pgsScanner.ll"
 
1170
{ return wx_static_cast(token_type, '{'); }
 
1171
        YY_BREAK
 
1172
case 48:
 
1173
YY_RULE_SETUP
 
1174
#line 149 "pgscript/pgsScanner.ll"
 
1175
{ return wx_static_cast(token_type, '}'); }
 
1176
        YY_BREAK
 
1177
case 49:
 
1178
YY_RULE_SETUP
 
1179
#line 150 "pgscript/pgsScanner.ll"
 
1180
{ return wx_static_cast(token_type, ':'); }
 
1181
        YY_BREAK
 
1182
case 50:
 
1183
YY_RULE_SETUP
 
1184
#line 151 "pgscript/pgsScanner.ll"
 
1185
{ return wx_static_cast(token_type, '('); }
 
1186
        YY_BREAK
 
1187
case 51:
 
1188
YY_RULE_SETUP
 
1189
#line 152 "pgscript/pgsScanner.ll"
 
1190
{ return wx_static_cast(token_type, ')'); }
 
1191
        YY_BREAK
 
1192
case 52:
 
1193
YY_RULE_SETUP
 
1194
#line 153 "pgscript/pgsScanner.ll"
 
1195
{ return wx_static_cast(token_type, '['); }
 
1196
        YY_BREAK
 
1197
case 53:
 
1198
YY_RULE_SETUP
 
1199
#line 154 "pgscript/pgsScanner.ll"
 
1200
{ return wx_static_cast(token_type, ']'); }
 
1201
        YY_BREAK
 
1202
case 54:
 
1203
YY_RULE_SETUP
 
1204
#line 155 "pgscript/pgsScanner.ll"
 
1205
{ return wx_static_cast(token_type, '.'); }
 
1206
        YY_BREAK
 
1207
case 55:
 
1208
YY_RULE_SETUP
 
1209
#line 156 "pgscript/pgsScanner.ll"
 
1210
{ return wx_static_cast(token_type, ','); }
 
1211
        YY_BREAK
 
1212
case 56:
 
1213
YY_RULE_SETUP
 
1214
#line 157 "pgscript/pgsScanner.ll"
 
1215
{ return token::PGS_NOT_OP; }
 
1216
        YY_BREAK
 
1217
case 57:
 
1218
YY_RULE_SETUP
 
1219
#line 158 "pgscript/pgsScanner.ll"
 
1220
{ return wx_static_cast(token_type, '-'); }
 
1221
        YY_BREAK
 
1222
case 58:
 
1223
YY_RULE_SETUP
 
1224
#line 159 "pgscript/pgsScanner.ll"
 
1225
{ return wx_static_cast(token_type, '+'); }
 
1226
        YY_BREAK
 
1227
case 59:
 
1228
YY_RULE_SETUP
 
1229
#line 160 "pgscript/pgsScanner.ll"
 
1230
{ return wx_static_cast(token_type, '*'); }
 
1231
        YY_BREAK
 
1232
case 60:
 
1233
YY_RULE_SETUP
 
1234
#line 161 "pgscript/pgsScanner.ll"
 
1235
{ return wx_static_cast(token_type, '/'); }
 
1236
        YY_BREAK
 
1237
case 61:
 
1238
YY_RULE_SETUP
 
1239
#line 162 "pgscript/pgsScanner.ll"
 
1240
{ return wx_static_cast(token_type, '%'); }
 
1241
        YY_BREAK
 
1242
case 62:
 
1243
YY_RULE_SETUP
 
1244
#line 163 "pgscript/pgsScanner.ll"
 
1245
{ return wx_static_cast(token_type, '<'); }
 
1246
        YY_BREAK
 
1247
case 63:
 
1248
YY_RULE_SETUP
 
1249
#line 164 "pgscript/pgsScanner.ll"
 
1250
{ return wx_static_cast(token_type, '>'); }
 
1251
        YY_BREAK
 
1252
case 64:
 
1253
YY_RULE_SETUP
 
1254
#line 166 "pgscript/pgsScanner.ll"
 
1255
{ string_caller = INITIAL; BEGIN(SC_STRING); }
 
1256
        YY_BREAK
 
1257
case 65:
 
1258
YY_RULE_SETUP
 
1259
#line 168 "pgscript/pgsScanner.ll"
 
1260
{ query += yytext; query_token = token::PGS_ABORT;
 
1261
                                          BEGIN(SC_QUERY); }
 
1262
        YY_BREAK
 
1263
case 66:
 
1264
YY_RULE_SETUP
 
1265
#line 170 "pgscript/pgsScanner.ll"
 
1266
{ query += yytext; query_token = token::PGS_ALTER;
 
1267
                                          BEGIN(SC_QUERY); }
 
1268
        YY_BREAK
 
1269
case 67:
 
1270
YY_RULE_SETUP
 
1271
#line 172 "pgscript/pgsScanner.ll"
 
1272
{ query += yytext; query_token = token::PGS_ANALYZE;
 
1273
                                          BEGIN(SC_QUERY); }
 
1274
        YY_BREAK
 
1275
case 68:
 
1276
YY_RULE_SETUP
 
1277
#line 174 "pgscript/pgsScanner.ll"
 
1278
{ query += yytext; query_token = token::PGS_BEGIN;
 
1279
                                          BEGIN(SC_QUERY); }
 
1280
        YY_BREAK
 
1281
case 69:
 
1282
YY_RULE_SETUP
 
1283
#line 176 "pgscript/pgsScanner.ll"
 
1284
{ query += yytext; query_token = token::PGS_BEGIN;
 
1285
                                          BEGIN(SC_QUERY); }
 
1286
        YY_BREAK
 
1287
case 70:
 
1288
YY_RULE_SETUP
 
1289
#line 178 "pgscript/pgsScanner.ll"
 
1290
{ query += yytext; query_token = token::PGS_CHECKPOINT;
 
1291
                                          BEGIN(SC_QUERY); }
 
1292
        YY_BREAK
 
1293
case 71:
 
1294
YY_RULE_SETUP
 
1295
#line 180 "pgscript/pgsScanner.ll"
 
1296
{ query += yytext; query_token = token::PGS_CLOSE_ST;
 
1297
                                          BEGIN(SC_QUERY); }
 
1298
        YY_BREAK
 
1299
case 72:
 
1300
YY_RULE_SETUP
 
1301
#line 182 "pgscript/pgsScanner.ll"
 
1302
{ query += yytext; query_token = token::PGS_CLUSTER;
 
1303
                                          BEGIN(SC_QUERY); }
 
1304
        YY_BREAK
 
1305
case 73:
 
1306
YY_RULE_SETUP
 
1307
#line 184 "pgscript/pgsScanner.ll"
 
1308
{ query += yytext; query_token = token::PGS_COMMENT;
 
1309
                                          BEGIN(SC_QUERY); }
 
1310
        YY_BREAK
 
1311
case 74:
 
1312
YY_RULE_SETUP
 
1313
#line 186 "pgscript/pgsScanner.ll"
 
1314
{ query += yytext; query_token = token::PGS_COMMIT;
 
1315
                                          BEGIN(SC_QUERY); }
 
1316
        YY_BREAK
 
1317
case 75:
 
1318
YY_RULE_SETUP
 
1319
#line 188 "pgscript/pgsScanner.ll"
 
1320
{ query += yytext; query_token = token::PGS_COPY;
 
1321
                                          BEGIN(SC_QUERY); }
 
1322
        YY_BREAK
 
1323
case 76:
 
1324
YY_RULE_SETUP
 
1325
#line 190 "pgscript/pgsScanner.ll"
 
1326
{ query += yytext; query_token = token::PGS_CREATE;
 
1327
                                          BEGIN(SC_QUERY); }
 
1328
        YY_BREAK
 
1329
case 77:
 
1330
YY_RULE_SETUP
 
1331
#line 192 "pgscript/pgsScanner.ll"
 
1332
{ query += yytext; query_token = token::PGS_DEALLOCATE;
 
1333
                                          BEGIN(SC_QUERY); }
 
1334
        YY_BREAK
 
1335
case 78:
 
1336
YY_RULE_SETUP
 
1337
#line 194 "pgscript/pgsScanner.ll"
 
1338
{ query += yytext; query_token = token::PGS_DECLARE;
 
1339
                                          BEGIN(SC_QUERY); }
 
1340
        YY_BREAK
 
1341
case 79:
 
1342
YY_RULE_SETUP
 
1343
#line 196 "pgscript/pgsScanner.ll"
 
1344
{ query += yytext; query_token = token::PGS_DELETE;
 
1345
                                          BEGIN(SC_QUERY); }
 
1346
        YY_BREAK
 
1347
case 80:
 
1348
YY_RULE_SETUP
 
1349
#line 198 "pgscript/pgsScanner.ll"
 
1350
{ query += yytext; query_token = token::PGS_DISCARD;
 
1351
                                          BEGIN(SC_QUERY); }
 
1352
        YY_BREAK
 
1353
case 81:
 
1354
YY_RULE_SETUP
 
1355
#line 200 "pgscript/pgsScanner.ll"
 
1356
{ query += yytext; query_token = token::PGS_DROP;
 
1357
                                          BEGIN(SC_QUERY); }
 
1358
        YY_BREAK
 
1359
case 82:
 
1360
YY_RULE_SETUP
 
1361
#line 202 "pgscript/pgsScanner.ll"
 
1362
{ query += yytext; query_token = token::PGS_END_ST;
 
1363
                                          BEGIN(SC_QUERY); }
 
1364
        YY_BREAK
 
1365
case 83:
 
1366
YY_RULE_SETUP
 
1367
#line 204 "pgscript/pgsScanner.ll"
 
1368
{ query += yytext; query_token = token::PGS_END_ST;
 
1369
                                          BEGIN(SC_QUERY); }
 
1370
        YY_BREAK
 
1371
case 84:
 
1372
YY_RULE_SETUP
 
1373
#line 206 "pgscript/pgsScanner.ll"
 
1374
{ query += yytext; query_token = token::PGS_EXECUTE;
 
1375
                                          BEGIN(SC_QUERY); }
 
1376
        YY_BREAK
 
1377
case 85:
 
1378
YY_RULE_SETUP
 
1379
#line 208 "pgscript/pgsScanner.ll"
 
1380
{ query += yytext; query_token = token::PGS_EXPLAIN;
 
1381
                                          BEGIN(SC_QUERY); }
 
1382
        YY_BREAK
 
1383
case 86:
 
1384
YY_RULE_SETUP
 
1385
#line 210 "pgscript/pgsScanner.ll"
 
1386
{ query += yytext; query_token = token::PGS_FETCH;
 
1387
                                          BEGIN(SC_QUERY); }
 
1388
        YY_BREAK
 
1389
case 87:
 
1390
YY_RULE_SETUP
 
1391
#line 212 "pgscript/pgsScanner.ll"
 
1392
{ query += yytext; query_token = token::PGS_GRANT;
 
1393
                                          BEGIN(SC_QUERY); }
 
1394
        YY_BREAK
 
1395
case 88:
 
1396
YY_RULE_SETUP
 
1397
#line 214 "pgscript/pgsScanner.ll"
 
1398
{ query += yytext; query_token = token::PGS_INSERT;
 
1399
                                          BEGIN(SC_QUERY); }
 
1400
        YY_BREAK
 
1401
case 89:
 
1402
YY_RULE_SETUP
 
1403
#line 216 "pgscript/pgsScanner.ll"
 
1404
{ query += yytext; query_token = token::PGS_LISTEN;
 
1405
                                          BEGIN(SC_QUERY); }
 
1406
        YY_BREAK
 
1407
case 90:
 
1408
YY_RULE_SETUP
 
1409
#line 218 "pgscript/pgsScanner.ll"
 
1410
{ query += yytext; query_token = token::PGS_LOAD;
 
1411
                                          BEGIN(SC_QUERY); }
 
1412
        YY_BREAK
 
1413
case 91:
 
1414
YY_RULE_SETUP
 
1415
#line 220 "pgscript/pgsScanner.ll"
 
1416
{ query += yytext; query_token = token::PGS_LOCK;
 
1417
                                          BEGIN(SC_QUERY); }
 
1418
        YY_BREAK
 
1419
case 92:
 
1420
YY_RULE_SETUP
 
1421
#line 222 "pgscript/pgsScanner.ll"
 
1422
{ query += yytext; query_token = token::PGS_MOVE;
 
1423
                                          BEGIN(SC_QUERY); }
 
1424
        YY_BREAK
 
1425
case 93:
 
1426
YY_RULE_SETUP
 
1427
#line 224 "pgscript/pgsScanner.ll"
 
1428
{ query += yytext; query_token = token::PGS_NOTIFY;
 
1429
                                          BEGIN(SC_QUERY); }
 
1430
        YY_BREAK
 
1431
case 94:
 
1432
YY_RULE_SETUP
 
1433
#line 226 "pgscript/pgsScanner.ll"
 
1434
{ query += yytext; query_token = token::PGS_PREPARE;
 
1435
                                          BEGIN(SC_QUERY); }
 
1436
        YY_BREAK
 
1437
case 95:
 
1438
YY_RULE_SETUP
 
1439
#line 228 "pgscript/pgsScanner.ll"
 
1440
{ query += yytext; query_token = token::PGS_REASSIGN;
 
1441
                                          BEGIN(SC_QUERY); }
 
1442
        YY_BREAK
 
1443
case 96:
 
1444
YY_RULE_SETUP
 
1445
#line 230 "pgscript/pgsScanner.ll"
 
1446
{ query += yytext; query_token = token::PGS_REINDEX;
 
1447
                                          BEGIN(SC_QUERY); }
 
1448
        YY_BREAK
 
1449
case 97:
 
1450
YY_RULE_SETUP
 
1451
#line 232 "pgscript/pgsScanner.ll"
 
1452
{ query += yytext; query_token = token::PGS_RELEASE;
 
1453
                                          BEGIN(SC_QUERY); }
 
1454
        YY_BREAK
 
1455
case 98:
 
1456
YY_RULE_SETUP
 
1457
#line 234 "pgscript/pgsScanner.ll"
 
1458
{ query += yytext; query_token = token::PGS_RESET;
 
1459
                                          BEGIN(SC_QUERY); }
 
1460
        YY_BREAK
 
1461
case 99:
 
1462
YY_RULE_SETUP
 
1463
#line 236 "pgscript/pgsScanner.ll"
 
1464
{ query += yytext; query_token = token::PGS_REVOKE;
 
1465
                                          BEGIN(SC_QUERY); }
 
1466
        YY_BREAK
 
1467
case 100:
 
1468
YY_RULE_SETUP
 
1469
#line 238 "pgscript/pgsScanner.ll"
 
1470
{ query += yytext; query_token = token::PGS_ROLLBACK;
 
1471
                                          BEGIN(SC_QUERY); }
 
1472
        YY_BREAK
 
1473
case 101:
 
1474
YY_RULE_SETUP
 
1475
#line 240 "pgscript/pgsScanner.ll"
 
1476
{ query += yytext; query_token = token::PGS_SAVEPOINT;
 
1477
                                          BEGIN(SC_QUERY); }
 
1478
        YY_BREAK
 
1479
case 102:
 
1480
YY_RULE_SETUP
 
1481
#line 242 "pgscript/pgsScanner.ll"
 
1482
{ query += yytext; query_token = token::PGS_SELECT;
 
1483
                                          BEGIN(SC_QUERY); }
 
1484
        YY_BREAK
 
1485
case 103:
 
1486
YY_RULE_SETUP
 
1487
#line 244 "pgscript/pgsScanner.ll"
 
1488
{ query += yytext; query_token = token::PGS_SET;
 
1489
                                          BEGIN(SC_QUERY); }
 
1490
        YY_BREAK
 
1491
case 104:
 
1492
YY_RULE_SETUP
 
1493
#line 246 "pgscript/pgsScanner.ll"
 
1494
{ query += yytext; query_token = token::PGS_SHOW;
 
1495
                                          BEGIN(SC_QUERY); }
 
1496
        YY_BREAK
 
1497
case 105:
 
1498
YY_RULE_SETUP
 
1499
#line 248 "pgscript/pgsScanner.ll"
 
1500
{ query += yytext; query_token = token::PGS_START;
 
1501
                                          BEGIN(SC_QUERY); }
 
1502
        YY_BREAK
 
1503
case 106:
 
1504
YY_RULE_SETUP
 
1505
#line 250 "pgscript/pgsScanner.ll"
 
1506
{ query += yytext; query_token = token::PGS_TRUNCATE;
 
1507
                                          BEGIN(SC_QUERY); }
 
1508
        YY_BREAK
 
1509
case 107:
 
1510
YY_RULE_SETUP
 
1511
#line 252 "pgscript/pgsScanner.ll"
 
1512
{ query += yytext; query_token = token::PGS_UNLISTEN;
 
1513
                                          BEGIN(SC_QUERY); }
 
1514
        YY_BREAK
 
1515
case 108:
 
1516
YY_RULE_SETUP
 
1517
#line 254 "pgscript/pgsScanner.ll"
 
1518
{ query += yytext; query_token = token::PGS_UPDATE;
 
1519
                                          BEGIN(SC_QUERY); }
 
1520
        YY_BREAK
 
1521
case 109:
 
1522
YY_RULE_SETUP
 
1523
#line 256 "pgscript/pgsScanner.ll"
 
1524
{ query += yytext; query_token = token::PGS_VACUUM;
 
1525
                                          BEGIN(SC_QUERY); }
 
1526
        YY_BREAK
 
1527
case 110:
 
1528
YY_RULE_SETUP
 
1529
#line 258 "pgscript/pgsScanner.ll"
 
1530
{ query += yytext; query_token = token::PGS_VALUES;
 
1531
                                          BEGIN(SC_QUERY); }
 
1532
        YY_BREAK
 
1533
case 111:
 
1534
YY_RULE_SETUP
 
1535
#line 261 "pgscript/pgsScanner.ll"
 
1536
{ }
 
1537
        YY_BREAK
 
1538
case 112:
 
1539
YY_RULE_SETUP
 
1540
#line 262 "pgscript/pgsScanner.ll"
 
1541
{ yylloc->step(); }
 
1542
        YY_BREAK
 
1543
case 113:
 
1544
/* rule 113 can match eol */
 
1545
YY_RULE_SETUP
 
1546
#line 263 "pgscript/pgsScanner.ll"
 
1547
{ yylloc->lines(yyleng); yylloc->step(); }
 
1548
        YY_BREAK
 
1549
case 114:
 
1550
YY_RULE_SETUP
 
1551
#line 264 "pgscript/pgsScanner.ll"
 
1552
{ return token::PGS_UNKNOWN; }
 
1553
        YY_BREAK
 
1554
 
 
1555
 
 
1556
case 115:
 
1557
YY_RULE_SETUP
 
1558
#line 268 "pgscript/pgsScanner.ll"
 
1559
{ query += yytext; string_caller = SC_QUERY; BEGIN(SC_STRING); }
 
1560
        YY_BREAK
 
1561
case 116:
 
1562
YY_RULE_SETUP
 
1563
#line 269 "pgscript/pgsScanner.ll"
 
1564
{ query += yytext; dollar = yytext; BEGIN(SC_DOLLAR); }
 
1565
        YY_BREAK
 
1566
case 117:
 
1567
YY_RULE_SETUP
 
1568
#line 270 "pgscript/pgsScanner.ll"
 
1569
{ yylval->str = pnew wxString(query.c_str(), m_conv);
 
1570
                                          query.clear(); unput(';'); yylloc->end.columns(-1);
 
1571
                                          BEGIN(INITIAL); m_parent = 0; return query_token; }
 
1572
        YY_BREAK
 
1573
case 118:
 
1574
YY_RULE_SETUP
 
1575
#line 273 "pgscript/pgsScanner.ll"
 
1576
{ ++m_parent; query += yytext; }
 
1577
        YY_BREAK
 
1578
case 119:
 
1579
YY_RULE_SETUP
 
1580
#line 274 "pgscript/pgsScanner.ll"
 
1581
{
 
1582
                                                --m_parent;
 
1583
                                                if (m_parent == -1)
 
1584
                                                {
 
1585
                                                        yylval->str = pnew wxString(query.c_str(), m_conv);
 
1586
                                                        query.clear(); unput(')'); yylloc->end.columns(-1);
 
1587
                                                        BEGIN(INITIAL); m_parent = 0; return query_token;
 
1588
                                                }
 
1589
                                                else
 
1590
                                                {
 
1591
                                                        query += yytext;
 
1592
                                                }
 
1593
                                        }
 
1594
        YY_BREAK
 
1595
case 120:
 
1596
YY_RULE_SETUP
 
1597
#line 287 "pgscript/pgsScanner.ll"
 
1598
{ query += yytext; yylloc->step(); }
 
1599
        YY_BREAK
 
1600
case 121:
 
1601
/* rule 121 can match eol */
 
1602
YY_RULE_SETUP
 
1603
#line 288 "pgscript/pgsScanner.ll"
 
1604
{ query += yytext; yylloc->lines(yyleng); yylloc->step(); }
 
1605
        YY_BREAK
 
1606
case YY_STATE_EOF(SC_QUERY):
 
1607
#line 289 "pgscript/pgsScanner.ll"
 
1608
{ yylval->str = pnew wxString(query.c_str(), m_conv);
 
1609
                                          query.clear(); m_parent = 0; return query_token; }
 
1610
        YY_BREAK
 
1611
case 122:
 
1612
YY_RULE_SETUP
 
1613
#line 291 "pgscript/pgsScanner.ll"
 
1614
{ yylloc->columns(columns(*yytext)); query += yytext; }
 
1615
        YY_BREAK
 
1616
 
 
1617
 
 
1618
case 123:
 
1619
YY_RULE_SETUP
 
1620
#line 295 "pgscript/pgsScanner.ll"
 
1621
{ query += yytext;
 
1622
                                          if (std::string(yytext) == dollar) BEGIN(SC_QUERY); }
 
1623
        YY_BREAK
 
1624
case 124:
 
1625
YY_RULE_SETUP
 
1626
#line 297 "pgscript/pgsScanner.ll"
 
1627
{ query += yytext; yylloc->step(); }
 
1628
        YY_BREAK
 
1629
case 125:
 
1630
/* rule 125 can match eol */
 
1631
YY_RULE_SETUP
 
1632
#line 298 "pgscript/pgsScanner.ll"
 
1633
{ query += yytext; yylloc->lines(yyleng); yylloc->step(); }
 
1634
        YY_BREAK
 
1635
case YY_STATE_EOF(SC_DOLLAR):
 
1636
#line 299 "pgscript/pgsScanner.ll"
 
1637
{ query += yytext; yylval->str = pnew wxString(query.c_str(), m_conv);
 
1638
                                          query.clear(); m_parent = 0; return query_token; }
 
1639
        YY_BREAK
 
1640
case 126:
 
1641
YY_RULE_SETUP
 
1642
#line 301 "pgscript/pgsScanner.ll"
 
1643
{ yylloc->columns(columns(*yytext)); query += yytext; }
 
1644
        YY_BREAK
 
1645
 
 
1646
 
 
1647
case 127:
 
1648
YY_RULE_SETUP
 
1649
#line 305 "pgscript/pgsScanner.ll"
 
1650
{ BEGIN(comment_caller); }
 
1651
        YY_BREAK
 
1652
case 128:
 
1653
YY_RULE_SETUP
 
1654
#line 306 "pgscript/pgsScanner.ll"
 
1655
{ yylloc->step(); }
 
1656
        YY_BREAK
 
1657
case 129:
 
1658
/* rule 129 can match eol */
 
1659
YY_RULE_SETUP
 
1660
#line 307 "pgscript/pgsScanner.ll"
 
1661
{ yylloc->lines(yyleng); yylloc->step(); }
 
1662
        YY_BREAK
 
1663
case 130:
 
1664
YY_RULE_SETUP
 
1665
#line 308 "pgscript/pgsScanner.ll"
 
1666
{ yylloc->columns(columns(*yytext)); }
 
1667
        YY_BREAK
 
1668
 
 
1669
 
 
1670
case 131:
 
1671
YY_RULE_SETUP
 
1672
#line 312 "pgscript/pgsScanner.ll"
 
1673
{
 
1674
                                                if (string_caller == SC_QUERY)
 
1675
                                                        query += yytext;
 
1676
                                                else
 
1677
                                                        str += "'";
 
1678
                                        }
 
1679
        YY_BREAK
 
1680
case 132:
 
1681
YY_RULE_SETUP
 
1682
#line 318 "pgscript/pgsScanner.ll"
 
1683
{
 
1684
                                                if (string_caller == SC_QUERY)
 
1685
                                                        query += yytext;
 
1686
                                                else
 
1687
                                                        str += *(yytext + 1);
 
1688
                                                yylloc->columns(columns(*(yytext + 1)));
 
1689
                                        }
 
1690
        YY_BREAK
 
1691
case 133:
 
1692
YY_RULE_SETUP
 
1693
#line 325 "pgscript/pgsScanner.ll"
 
1694
{
 
1695
                                                if (string_caller == SC_QUERY)
 
1696
                                                {
 
1697
                                                        query += yytext;
 
1698
                                                        BEGIN(string_caller);
 
1699
                                                }
 
1700
                                                else
 
1701
                                                {
 
1702
                                                        yylval->str = pnew wxString(str.c_str(), m_conv);
 
1703
                                                        str.clear();
 
1704
                                                        BEGIN(string_caller);
 
1705
                                                        return token::PGS_VAL_STR;
 
1706
                                                }
 
1707
                                        }
 
1708
        YY_BREAK
 
1709
case 134:
 
1710
YY_RULE_SETUP
 
1711
#line 339 "pgscript/pgsScanner.ll"
 
1712
{
 
1713
                                                if (string_caller == SC_QUERY)
 
1714
                                                        query += yytext;
 
1715
                                                else
 
1716
                                                        str += yytext;
 
1717
                                                yylloc->step();
 
1718
                                        }
 
1719
        YY_BREAK
 
1720
case 135:
 
1721
/* rule 135 can match eol */
 
1722
YY_RULE_SETUP
 
1723
#line 346 "pgscript/pgsScanner.ll"
 
1724
{
 
1725
                                                if (string_caller == SC_QUERY)
 
1726
                                                        query += yytext;
 
1727
                                                else
 
1728
                                                        str += yytext;
 
1729
                                                yylloc->lines(yyleng); yylloc->step();
 
1730
                                        }
 
1731
        YY_BREAK
 
1732
case YY_STATE_EOF(SC_STRING):
 
1733
#line 353 "pgscript/pgsScanner.ll"
 
1734
{
 
1735
                                                if (string_caller == SC_QUERY)
 
1736
                                                {
 
1737
                                                        query += yytext; yylval->str = pnew wxString(query.c_str(), m_conv);
 
1738
                                                        query.clear(); m_parent = 0; return query_token;
 
1739
                                                }
 
1740
                                                else
 
1741
                                                {
 
1742
                                                        yylval->str = pnew wxString(str.c_str(), m_conv);
 
1743
                                                        str.clear();
 
1744
                                                        BEGIN(string_caller);
 
1745
                                                        return token::PGS_VAL_STR;
 
1746
                                                }
 
1747
                                        }
 
1748
        YY_BREAK
 
1749
case 136:
 
1750
YY_RULE_SETUP
 
1751
#line 367 "pgscript/pgsScanner.ll"
 
1752
 
1753
                                                if (string_caller == SC_QUERY)
 
1754
                                                        query += yytext;
 
1755
                                                else
 
1756
                                                        str += yytext;
 
1757
                                                yylloc->columns(columns(*yytext));
 
1758
                                        }
 
1759
        YY_BREAK
 
1760
 
 
1761
case 137:
 
1762
YY_RULE_SETUP
 
1763
#line 376 "pgscript/pgsScanner.ll"
 
1764
ECHO;
 
1765
        YY_BREAK
 
1766
#line 1764 "pgscript/lex.pgs.cc"
 
1767
case YY_STATE_EOF(INITIAL):
 
1768
case YY_STATE_EOF(SC_COMMENT):
 
1769
        yyterminate();
 
1770
 
 
1771
        case YY_END_OF_BUFFER:
 
1772
                {
 
1773
                /* Amount of text matched not including the EOB char. */
 
1774
                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
1775
 
 
1776
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
 
1777
                *yy_cp = (yy_hold_char);
 
1778
                YY_RESTORE_YY_MORE_OFFSET
 
1779
 
 
1780
                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 
1781
                        {
 
1782
                        /* We're scanning a new file or input source.  It's
 
1783
                         * possible that this happened because the user
 
1784
                         * just pointed yyin at a new source and called
 
1785
                         * yylex().  If so, then we have to assure
 
1786
                         * consistency between YY_CURRENT_BUFFER and our
 
1787
                         * globals.  Here is the right place to do so, because
 
1788
                         * this is the first action (other than possibly a
 
1789
                         * back-up) that will match for the new input source.
 
1790
                         */
 
1791
                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 
1792
                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
 
1793
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 
1794
                        }
 
1795
 
 
1796
                /* Note that here we test for yy_c_buf_p "<=" to the position
 
1797
                 * of the first EOB in the buffer, since yy_c_buf_p will
 
1798
                 * already have been incremented past the NUL character
 
1799
                 * (since all states make transitions on EOB to the
 
1800
                 * end-of-buffer state).  Contrast this with the test
 
1801
                 * in input().
 
1802
                 */
 
1803
                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 
1804
                        { /* This was really a NUL. */
 
1805
                        yy_state_type yy_next_state;
 
1806
 
 
1807
                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 
1808
 
 
1809
                        yy_current_state = yy_get_previous_state(  );
 
1810
 
 
1811
                        /* Okay, we're now positioned to make the NUL
 
1812
                         * transition.  We couldn't have
 
1813
                         * yy_get_previous_state() go ahead and do it
 
1814
                         * for us because it doesn't know how to deal
 
1815
                         * with the possibility of jamming (and we don't
 
1816
                         * want to build jamming into it because then it
 
1817
                         * will run more slowly).
 
1818
                         */
 
1819
 
 
1820
                        yy_next_state = yy_try_NUL_trans( yy_current_state );
 
1821
 
 
1822
                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
1823
 
 
1824
                        if ( yy_next_state )
 
1825
                                {
 
1826
                                /* Consume the NUL. */
 
1827
                                yy_cp = ++(yy_c_buf_p);
 
1828
                                yy_current_state = yy_next_state;
 
1829
                                goto yy_match;
 
1830
                                }
 
1831
 
 
1832
                        else
 
1833
                                {
 
1834
                                yy_cp = (yy_last_accepting_cpos);
 
1835
                                yy_current_state = (yy_last_accepting_state);
 
1836
                                goto yy_find_action;
 
1837
                                }
 
1838
                        }
 
1839
 
 
1840
                else switch ( yy_get_next_buffer(  ) )
 
1841
                        {
 
1842
                        case EOB_ACT_END_OF_FILE:
 
1843
                                {
 
1844
                                (yy_did_buffer_switch_on_eof) = 0;
 
1845
 
 
1846
                                if ( yywrap(  ) )
 
1847
                                        {
 
1848
                                        /* Note: because we've taken care in
 
1849
                                         * yy_get_next_buffer() to have set up
 
1850
                                         * yytext, we can now set up
 
1851
                                         * yy_c_buf_p so that if some total
 
1852
                                         * hoser (like flex itself) wants to
 
1853
                                         * call the scanner after we return the
 
1854
                                         * YY_NULL, it'll still work - another
 
1855
                                         * YY_NULL will get returned.
 
1856
                                         */
 
1857
                                        (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
1858
 
 
1859
                                        yy_act = YY_STATE_EOF(YY_START);
 
1860
                                        goto do_action;
 
1861
                                        }
 
1862
 
 
1863
                                else
 
1864
                                        {
 
1865
                                        if ( ! (yy_did_buffer_switch_on_eof) )
 
1866
                                                YY_NEW_FILE;
 
1867
                                        }
 
1868
                                break;
 
1869
                                }
 
1870
 
 
1871
                        case EOB_ACT_CONTINUE_SCAN:
 
1872
                                (yy_c_buf_p) =
 
1873
                                        (yytext_ptr) + yy_amount_of_matched_text;
 
1874
 
 
1875
                                yy_current_state = yy_get_previous_state(  );
 
1876
 
 
1877
                                yy_cp = (yy_c_buf_p);
 
1878
                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
1879
                                goto yy_match;
 
1880
 
 
1881
                        case EOB_ACT_LAST_MATCH:
 
1882
                                (yy_c_buf_p) =
 
1883
                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
1884
 
 
1885
                                yy_current_state = yy_get_previous_state(  );
 
1886
 
 
1887
                                yy_cp = (yy_c_buf_p);
 
1888
                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
1889
                                goto yy_find_action;
 
1890
                        }
 
1891
                break;
 
1892
                }
 
1893
 
 
1894
        default:
 
1895
                YY_FATAL_ERROR(
 
1896
                        "fatal flex scanner internal error--no action found" );
 
1897
        } /* end of action switch */
 
1898
                } /* end of scanning one token */
 
1899
} /* end of yylex */
 
1900
 
 
1901
yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
 
1902
{
 
1903
        yyin = arg_yyin;
 
1904
        yyout = arg_yyout;
 
1905
        yy_c_buf_p = 0;
 
1906
        yy_init = 0;
 
1907
        yy_start = 0;
 
1908
        yy_flex_debug = 0;
 
1909
        yylineno = 1;   // this will only get updated if %option yylineno
 
1910
 
 
1911
        yy_did_buffer_switch_on_eof = 0;
 
1912
 
 
1913
        yy_looking_for_trail_begin = 0;
 
1914
        yy_more_flag = 0;
 
1915
        yy_more_len = 0;
 
1916
        yy_more_offset = yy_prev_more_offset = 0;
 
1917
 
 
1918
        yy_start_stack_ptr = yy_start_stack_depth = 0;
 
1919
        yy_start_stack = NULL;
 
1920
 
 
1921
    (yy_buffer_stack) = 0;
 
1922
    (yy_buffer_stack_top) = 0;
 
1923
    (yy_buffer_stack_max) = 0;
 
1924
 
 
1925
        yy_state_buf = 0;
 
1926
 
 
1927
}
 
1928
 
 
1929
yyFlexLexer::~yyFlexLexer()
 
1930
{
 
1931
        delete [] yy_state_buf;
 
1932
        pgsfree(yy_start_stack  );
 
1933
        yy_delete_buffer( YY_CURRENT_BUFFER );
 
1934
}
 
1935
 
 
1936
void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
 
1937
{
 
1938
        if ( new_in )
 
1939
                {
 
1940
                yy_delete_buffer( YY_CURRENT_BUFFER );
 
1941
                yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE  ) );
 
1942
                }
 
1943
 
 
1944
        if ( new_out )
 
1945
                yyout = new_out;
 
1946
}
 
1947
 
 
1948
#ifdef YY_INTERACTIVE
 
1949
int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
 
1950
#else
 
1951
int yyFlexLexer::LexerInput( char* buf, int max_size )
 
1952
#endif
 
1953
{
 
1954
        if ( yyin->eof() || yyin->fail() )
 
1955
                return 0;
 
1956
 
 
1957
#ifdef YY_INTERACTIVE
 
1958
        yyin->get( buf[0] );
 
1959
 
 
1960
        if ( yyin->eof() )
 
1961
                return 0;
 
1962
 
 
1963
        if ( yyin->bad() )
 
1964
                return -1;
 
1965
 
 
1966
        return 1;
 
1967
 
 
1968
#else
 
1969
        (void) yyin->read( buf, max_size );
 
1970
 
 
1971
        if ( yyin->bad() )
 
1972
                return -1;
 
1973
        else
 
1974
                return yyin->gcount();
 
1975
#endif
 
1976
}
 
1977
 
 
1978
void yyFlexLexer::LexerOutput( const char* buf, int size )
 
1979
{
 
1980
        (void) yyout->write( buf, size );
 
1981
}
 
1982
 
 
1983
/* yy_get_next_buffer - try to read in a new buffer
 
1984
 *
 
1985
 * Returns a code representing an action:
 
1986
 *      EOB_ACT_LAST_MATCH -
 
1987
 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 
1988
 *      EOB_ACT_END_OF_FILE - end of file
 
1989
 */
 
1990
int yyFlexLexer::yy_get_next_buffer()
 
1991
{
 
1992
        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
 
1993
        register char *source = (yytext_ptr);
 
1994
        register int number_to_move, i;
 
1995
        int ret_val;
 
1996
 
 
1997
        if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 
1998
                YY_FATAL_ERROR(
 
1999
                "fatal flex scanner internal error--end of buffer missed" );
 
2000
 
 
2001
        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 
2002
                { /* Don't try to fill the buffer, so this is an EOF. */
 
2003
                if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 
2004
                        {
 
2005
                        /* We matched a single character, the EOB, so
 
2006
                         * treat this as a final EOF.
 
2007
                         */
 
2008
                        return EOB_ACT_END_OF_FILE;
 
2009
                        }
 
2010
 
 
2011
                else
 
2012
                        {
 
2013
                        /* We matched some text prior to the EOB, first
 
2014
                         * process it.
 
2015
                         */
 
2016
                        return EOB_ACT_LAST_MATCH;
 
2017
                        }
 
2018
                }
 
2019
 
 
2020
        /* Try to read more data. */
 
2021
 
 
2022
        /* First move last chars to start of buffer. */
 
2023
        number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
2024
 
 
2025
        for ( i = 0; i < number_to_move; ++i )
 
2026
                *(dest++) = *(source++);
 
2027
 
 
2028
        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 
2029
                /* don't do the read, it's not guaranteed to return an EOF,
 
2030
                 * just force an EOF
 
2031
                 */
 
2032
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
2033
 
 
2034
        else
 
2035
                {
 
2036
                        int num_to_read =
 
2037
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
2038
 
 
2039
                while ( num_to_read <= 0 )
 
2040
                        { /* Not enough room in the buffer - grow it. */
 
2041
 
 
2042
                        /* just a shorter name for the current buffer */
 
2043
                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
2044
 
 
2045
                        int yy_c_buf_p_offset =
 
2046
                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
 
2047
 
 
2048
                        if ( b->yy_is_our_buffer )
 
2049
                                {
 
2050
                                int new_size = b->yy_buf_size * 2;
 
2051
 
 
2052
                                if ( new_size <= 0 )
 
2053
                                        b->yy_buf_size += b->yy_buf_size / 8;
 
2054
                                else
 
2055
                                        b->yy_buf_size *= 2;
 
2056
 
 
2057
                                b->yy_ch_buf = (char *)
 
2058
                                        /* Include room in for 2 EOB chars. */
 
2059
                                        pgsrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
 
2060
                                }
 
2061
                        else
 
2062
                                /* Can't grow it, we don't own it. */
 
2063
                                b->yy_ch_buf = 0;
 
2064
 
 
2065
                        if ( ! b->yy_ch_buf )
 
2066
                                YY_FATAL_ERROR(
 
2067
                                "fatal error - scanner input buffer overflow" );
 
2068
 
 
2069
                        (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
 
2070
 
 
2071
                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
 
2072
                                                number_to_move - 1;
 
2073
 
 
2074
                        }
 
2075
 
 
2076
                if ( num_to_read > YY_READ_BUF_SIZE )
 
2077
                        num_to_read = YY_READ_BUF_SIZE;
 
2078
 
 
2079
                /* Read in more data. */
 
2080
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
 
2081
                        (yy_n_chars), num_to_read );
 
2082
 
 
2083
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
2084
                }
 
2085
 
 
2086
        if ( (yy_n_chars) == 0 )
 
2087
                {
 
2088
                if ( number_to_move == YY_MORE_ADJ )
 
2089
                        {
 
2090
                        ret_val = EOB_ACT_END_OF_FILE;
 
2091
                        yyrestart( yyin  );
 
2092
                        }
 
2093
 
 
2094
                else
 
2095
                        {
 
2096
                        ret_val = EOB_ACT_LAST_MATCH;
 
2097
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
 
2098
                                YY_BUFFER_EOF_PENDING;
 
2099
                        }
 
2100
                }
 
2101
 
 
2102
        else
 
2103
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
2104
 
 
2105
        (yy_n_chars) += number_to_move;
 
2106
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
 
2107
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
 
2108
 
 
2109
        (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
2110
 
 
2111
        return ret_val;
 
2112
}
 
2113
 
 
2114
/* yy_get_previous_state - get the state just before the EOB char was reached */
 
2115
 
 
2116
    yy_state_type yyFlexLexer::yy_get_previous_state()
 
2117
{
 
2118
        register yy_state_type yy_current_state;
 
2119
        register char *yy_cp;
 
2120
    
 
2121
        yy_current_state = (yy_start);
 
2122
 
 
2123
        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
 
2124
                {
 
2125
                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
 
2126
                if ( yy_accept[yy_current_state] )
 
2127
                        {
 
2128
                        (yy_last_accepting_state) = yy_current_state;
 
2129
                        (yy_last_accepting_cpos) = yy_cp;
 
2130
                        }
 
2131
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
2132
                        {
 
2133
                        yy_current_state = (int) yy_def[yy_current_state];
 
2134
                        if ( yy_current_state >= 444 )
 
2135
                                yy_c = yy_meta[(unsigned int) yy_c];
 
2136
                        }
 
2137
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
2138
                }
 
2139
 
 
2140
        return yy_current_state;
 
2141
}
 
2142
 
 
2143
/* yy_try_NUL_trans - try to make a transition on the NUL character
 
2144
 *
 
2145
 * synopsis
 
2146
 *      next_state = yy_try_NUL_trans( current_state );
 
2147
 */
 
2148
    yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
 
2149
{
 
2150
        register int yy_is_jam;
 
2151
        register char *yy_cp = (yy_c_buf_p);
 
2152
 
 
2153
        register YY_CHAR yy_c = 1;
 
2154
        if ( yy_accept[yy_current_state] )
 
2155
                {
 
2156
                (yy_last_accepting_state) = yy_current_state;
 
2157
                (yy_last_accepting_cpos) = yy_cp;
 
2158
                }
 
2159
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 
2160
                {
 
2161
                yy_current_state = (int) yy_def[yy_current_state];
 
2162
                if ( yy_current_state >= 444 )
 
2163
                        yy_c = yy_meta[(unsigned int) yy_c];
 
2164
                }
 
2165
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 
2166
        yy_is_jam = (yy_current_state == 443);
 
2167
 
 
2168
        return yy_is_jam ? 0 : yy_current_state;
 
2169
}
 
2170
 
 
2171
    void yyFlexLexer::yyunput( int c, register char* yy_bp)
 
2172
{
 
2173
        register char *yy_cp;
 
2174
    
 
2175
    yy_cp = (yy_c_buf_p);
 
2176
 
 
2177
        /* undo effects of setting up yytext */
 
2178
        *yy_cp = (yy_hold_char);
 
2179
 
 
2180
        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 
2181
                { /* need to shift things up to make room */
 
2182
                /* +2 for EOB chars. */
 
2183
                register int number_to_move = (yy_n_chars) + 2;
 
2184
                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
 
2185
                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
 
2186
                register char *source =
 
2187
                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
 
2188
 
 
2189
                while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 
2190
                        *--dest = *--source;
 
2191
 
 
2192
                yy_cp += (int) (dest - source);
 
2193
                yy_bp += (int) (dest - source);
 
2194
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
 
2195
                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
 
2196
 
 
2197
                if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 
2198
                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
 
2199
                }
 
2200
 
 
2201
        *--yy_cp = (char) c;
 
2202
 
 
2203
        (yytext_ptr) = yy_bp;
 
2204
        (yy_hold_char) = *yy_cp;
 
2205
        (yy_c_buf_p) = yy_cp;
 
2206
}
 
2207
 
 
2208
    int yyFlexLexer::yyinput()
 
2209
{
 
2210
        int c;
 
2211
    
 
2212
        *(yy_c_buf_p) = (yy_hold_char);
 
2213
 
 
2214
        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
 
2215
                {
 
2216
                /* yy_c_buf_p now points to the character we want to return.
 
2217
                 * If this occurs *before* the EOB characters, then it's a
 
2218
                 * valid NUL; if not, then we've hit the end of the buffer.
 
2219
                 */
 
2220
                if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 
2221
                        /* This was really a NUL. */
 
2222
                        *(yy_c_buf_p) = '\0';
 
2223
 
 
2224
                else
 
2225
                        { /* need more input */
 
2226
                        int offset = (yy_c_buf_p) - (yytext_ptr);
 
2227
                        ++(yy_c_buf_p);
 
2228
 
 
2229
                        switch ( yy_get_next_buffer(  ) )
 
2230
                                {
 
2231
                                case EOB_ACT_LAST_MATCH:
 
2232
                                        /* This happens because yy_g_n_b()
 
2233
                                         * sees that we've accumulated a
 
2234
                                         * token and flags that we need to
 
2235
                                         * try matching the token before
 
2236
                                         * proceeding.  But for input(),
 
2237
                                         * there's no matching to consider.
 
2238
                                         * So convert the EOB_ACT_LAST_MATCH
 
2239
                                         * to EOB_ACT_END_OF_FILE.
 
2240
                                         */
 
2241
 
 
2242
                                        /* Reset buffer status. */
 
2243
                                        yyrestart( yyin );
 
2244
 
 
2245
                                        /*FALLTHROUGH*/
 
2246
 
 
2247
                                case EOB_ACT_END_OF_FILE:
 
2248
                                        {
 
2249
                                        if ( yywrap(  ) )
 
2250
                                                return EOF;
 
2251
 
 
2252
                                        if ( ! (yy_did_buffer_switch_on_eof) )
 
2253
                                                YY_NEW_FILE;
 
2254
#ifdef __cplusplus
 
2255
                                        return yyinput();
 
2256
#else
 
2257
                                        return input();
 
2258
#endif
 
2259
                                        }
 
2260
 
 
2261
                                case EOB_ACT_CONTINUE_SCAN:
 
2262
                                        (yy_c_buf_p) = (yytext_ptr) + offset;
 
2263
                                        break;
 
2264
                                }
 
2265
                        }
 
2266
                }
 
2267
 
 
2268
        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
 
2269
        *(yy_c_buf_p) = '\0';   /* preserve yytext */
 
2270
        (yy_hold_char) = *++(yy_c_buf_p);
 
2271
 
 
2272
        return c;
 
2273
}
 
2274
 
 
2275
/** Immediately switch to a different input stream.
 
2276
 * @param input_file A readable stream.
 
2277
 * 
 
2278
 * @note This function does not reset the start condition to @c INITIAL .
 
2279
 */
 
2280
    void yyFlexLexer::yyrestart( std::istream* input_file )
 
2281
{
 
2282
    
 
2283
        if ( ! YY_CURRENT_BUFFER ){
 
2284
        yyensure_buffer_stack ();
 
2285
                YY_CURRENT_BUFFER_LVALUE =
 
2286
            yy_create_buffer( yyin, YY_BUF_SIZE );
 
2287
        }
 
2288
 
 
2289
        yy_init_buffer( YY_CURRENT_BUFFER, input_file );
 
2290
        yy_load_buffer_state(  );
 
2291
}
 
2292
 
 
2293
/** Switch to a different input buffer.
 
2294
 * @param new_buffer The new input buffer.
 
2295
 * 
 
2296
 */
 
2297
    void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
 
2298
{
 
2299
    
 
2300
        /* TODO. We should be able to replace this entire function body
 
2301
         * with
 
2302
         *              yypop_buffer_state();
 
2303
         *              yypush_buffer_state(new_buffer);
 
2304
     */
 
2305
        yyensure_buffer_stack ();
 
2306
        if ( YY_CURRENT_BUFFER == new_buffer )
 
2307
                return;
 
2308
 
 
2309
        if ( YY_CURRENT_BUFFER )
 
2310
                {
 
2311
                /* Flush out information for old buffer. */
 
2312
                *(yy_c_buf_p) = (yy_hold_char);
 
2313
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
 
2314
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
2315
                }
 
2316
 
 
2317
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
2318
        yy_load_buffer_state(  );
 
2319
 
 
2320
        /* We don't actually know whether we did this switch during
 
2321
         * EOF (yywrap()) processing, but the only time this flag
 
2322
         * is looked at is after yywrap() is called, so it's safe
 
2323
         * to go ahead and always set it.
 
2324
         */
 
2325
        (yy_did_buffer_switch_on_eof) = 1;
 
2326
}
 
2327
 
 
2328
    void yyFlexLexer::yy_load_buffer_state()
 
2329
{
 
2330
        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 
2331
        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
 
2332
        yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
 
2333
        (yy_hold_char) = *(yy_c_buf_p);
 
2334
}
 
2335
 
 
2336
/** Allocate and initialize an input buffer state.
 
2337
 * @param file A readable stream.
 
2338
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 
2339
 * 
 
2340
 * @return the allocated buffer state.
 
2341
 */
 
2342
    YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
 
2343
{
 
2344
        YY_BUFFER_STATE b;
 
2345
    
 
2346
        b = (YY_BUFFER_STATE) pgsalloc(sizeof( struct yy_buffer_state )  );
 
2347
        if ( ! b )
 
2348
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
2349
 
 
2350
        b->yy_buf_size = size;
 
2351
 
 
2352
        /* yy_ch_buf has to be 2 characters longer than the size given because
 
2353
         * we need to put in 2 end-of-buffer characters.
 
2354
         */
 
2355
        b->yy_ch_buf = (char *) pgsalloc(b->yy_buf_size + 2  );
 
2356
        if ( ! b->yy_ch_buf )
 
2357
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
2358
 
 
2359
        b->yy_is_our_buffer = 1;
 
2360
 
 
2361
        yy_init_buffer( b, file );
 
2362
 
 
2363
        return b;
 
2364
}
 
2365
 
 
2366
/** Destroy the buffer.
 
2367
 * @param b a buffer created with yy_create_buffer()
 
2368
 * 
 
2369
 */
 
2370
    void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
 
2371
{
 
2372
    
 
2373
        if ( ! b )
 
2374
                return;
 
2375
 
 
2376
        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
 
2377
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
2378
 
 
2379
        if ( b->yy_is_our_buffer )
 
2380
                pgsfree((void *) b->yy_ch_buf  );
 
2381
 
 
2382
        pgsfree((void *) b  );
 
2383
}
 
2384
 
 
2385
/* Initializes or reinitializes a buffer.
 
2386
 * This function is sometimes called more than once on the same buffer,
 
2387
 * such as during a yyrestart() or at EOF.
 
2388
 */
 
2389
    void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
 
2390
 
 
2391
{
 
2392
        int oerrno = errno;
 
2393
    
 
2394
        yy_flush_buffer( b );
 
2395
 
 
2396
        b->yy_input_file = file;
 
2397
        b->yy_fill_buffer = 1;
 
2398
 
 
2399
    /* If b is the current buffer, then yy_init_buffer was _probably_
 
2400
     * called from yyrestart() or through yy_get_next_buffer.
 
2401
     * In that case, we don't want to reset the lineno or column.
 
2402
     */
 
2403
    if (b != YY_CURRENT_BUFFER){
 
2404
        b->yy_bs_lineno = 1;
 
2405
        b->yy_bs_column = 0;
 
2406
    }
 
2407
 
 
2408
        b->yy_is_interactive = 0;
 
2409
        errno = oerrno;
 
2410
}
 
2411
 
 
2412
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 
2413
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 
2414
 * 
 
2415
 */
 
2416
    void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
 
2417
{
 
2418
        if ( ! b )
 
2419
                return;
 
2420
 
 
2421
        b->yy_n_chars = 0;
 
2422
 
 
2423
        /* We always need two end-of-buffer characters.  The first causes
 
2424
         * a transition to the end-of-buffer state.  The second causes
 
2425
         * a jam in that state.
 
2426
         */
 
2427
        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
 
2428
        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
2429
 
 
2430
        b->yy_buf_pos = &b->yy_ch_buf[0];
 
2431
 
 
2432
        b->yy_at_bol = 1;
 
2433
        b->yy_buffer_status = YY_BUFFER_NEW;
 
2434
 
 
2435
        if ( b == YY_CURRENT_BUFFER )
 
2436
                yy_load_buffer_state(  );
 
2437
}
 
2438
 
 
2439
/** Pushes the new state onto the stack. The new state becomes
 
2440
 *  the current state. This function will allocate the stack
 
2441
 *  if necessary.
 
2442
 *  @param new_buffer The new state.
 
2443
 *  
 
2444
 */
 
2445
void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
 
2446
{
 
2447
        if (new_buffer == NULL)
 
2448
                return;
 
2449
 
 
2450
        yyensure_buffer_stack();
 
2451
 
 
2452
        /* This block is copied from yy_switch_to_buffer. */
 
2453
        if ( YY_CURRENT_BUFFER )
 
2454
                {
 
2455
                /* Flush out information for old buffer. */
 
2456
                *(yy_c_buf_p) = (yy_hold_char);
 
2457
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
 
2458
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
2459
                }
 
2460
 
 
2461
        /* Only push if top exists. Otherwise, replace top. */
 
2462
        if (YY_CURRENT_BUFFER)
 
2463
                (yy_buffer_stack_top)++;
 
2464
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
2465
 
 
2466
        /* copied from yy_switch_to_buffer. */
 
2467
        yy_load_buffer_state(  );
 
2468
        (yy_did_buffer_switch_on_eof) = 1;
 
2469
}
 
2470
 
 
2471
/** Removes and deletes the top of the stack, if present.
 
2472
 *  The next element becomes the new top.
 
2473
 *  
 
2474
 */
 
2475
void yyFlexLexer::yypop_buffer_state (void)
 
2476
{
 
2477
        if (!YY_CURRENT_BUFFER)
 
2478
                return;
 
2479
 
 
2480
        yy_delete_buffer(YY_CURRENT_BUFFER );
 
2481
        YY_CURRENT_BUFFER_LVALUE = NULL;
 
2482
        if ((yy_buffer_stack_top) > 0)
 
2483
                --(yy_buffer_stack_top);
 
2484
 
 
2485
        if (YY_CURRENT_BUFFER) {
 
2486
                yy_load_buffer_state(  );
 
2487
                (yy_did_buffer_switch_on_eof) = 1;
 
2488
        }
 
2489
}
 
2490
 
 
2491
/* Allocates the stack if it does not exist.
 
2492
 *  Guarantees space for at least one push.
 
2493
 */
 
2494
void yyFlexLexer::yyensure_buffer_stack(void)
 
2495
{
 
2496
        int num_to_alloc;
 
2497
    
 
2498
        if (!(yy_buffer_stack)) {
 
2499
 
 
2500
                /* First allocation is just for 2 elements, since we don't know if this
 
2501
                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
 
2502
                 * immediate realloc on the next call.
 
2503
         */
 
2504
                num_to_alloc = 1;
 
2505
                (yy_buffer_stack) = (struct yy_buffer_state**)pgsalloc
 
2506
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
 
2507
                                                                );
 
2508
                
 
2509
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
 
2510
                                
 
2511
                (yy_buffer_stack_max) = num_to_alloc;
 
2512
                (yy_buffer_stack_top) = 0;
 
2513
                return;
 
2514
        }
 
2515
 
 
2516
        if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
 
2517
 
 
2518
                /* Increase the buffer to prepare for a possible push. */
 
2519
                int grow_size = 8 /* arbitrary grow size */;
 
2520
 
 
2521
                num_to_alloc = (yy_buffer_stack_max) + grow_size;
 
2522
                (yy_buffer_stack) = (struct yy_buffer_state**)pgsrealloc
 
2523
                                                                ((yy_buffer_stack),
 
2524
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
 
2525
                                                                );
 
2526
 
 
2527
                /* zero only the new slots.*/
 
2528
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
 
2529
                (yy_buffer_stack_max) = num_to_alloc;
 
2530
        }
 
2531
}
 
2532
 
 
2533
    void yyFlexLexer::yy_push_state( int new_state )
 
2534
{
 
2535
        if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
 
2536
                {
 
2537
                yy_size_t new_size;
 
2538
 
 
2539
                (yy_start_stack_depth) += YY_START_STACK_INCR;
 
2540
                new_size = (yy_start_stack_depth) * sizeof( int );
 
2541
 
 
2542
                if ( ! (yy_start_stack) )
 
2543
                        (yy_start_stack) = (int *) pgsalloc(new_size  );
 
2544
 
 
2545
                else
 
2546
                        (yy_start_stack) = (int *) pgsrealloc((void *) (yy_start_stack),new_size  );
 
2547
 
 
2548
                if ( ! (yy_start_stack) )
 
2549
                        YY_FATAL_ERROR(
 
2550
                        "out of memory expanding start-condition stack" );
 
2551
                }
 
2552
 
 
2553
        (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
 
2554
 
 
2555
        BEGIN(new_state);
 
2556
}
 
2557
 
 
2558
    void yyFlexLexer::yy_pop_state()
 
2559
{
 
2560
        if ( --(yy_start_stack_ptr) < 0 )
 
2561
                YY_FATAL_ERROR( "start-condition stack underflow" );
 
2562
 
 
2563
        BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
 
2564
}
 
2565
 
 
2566
    int yyFlexLexer::yy_top_state()
 
2567
{
 
2568
        return (yy_start_stack)[(yy_start_stack_ptr) - 1];
 
2569
}
 
2570
 
 
2571
#ifndef YY_EXIT_FAILURE
 
2572
#define YY_EXIT_FAILURE 2
 
2573
#endif
 
2574
 
 
2575
void yyFlexLexer::LexerError( yyconst char msg[] )
 
2576
{
 
2577
        std::cerr << msg << std::endl;
 
2578
        exit( YY_EXIT_FAILURE );
 
2579
}
 
2580
 
 
2581
/* Redefine yyless() so it works in section 3 code. */
 
2582
 
 
2583
#undef yyless
 
2584
#define yyless(n) \
 
2585
        do \
 
2586
                { \
 
2587
                /* Undo effects of setting up yytext. */ \
 
2588
        int yyless_macro_arg = (n); \
 
2589
        YY_LESS_LINENO(yyless_macro_arg);\
 
2590
                yytext[yyleng] = (yy_hold_char); \
 
2591
                (yy_c_buf_p) = yytext + yyless_macro_arg; \
 
2592
                (yy_hold_char) = *(yy_c_buf_p); \
 
2593
                *(yy_c_buf_p) = '\0'; \
 
2594
                yyleng = yyless_macro_arg; \
 
2595
                } \
 
2596
        while ( 0 )
 
2597
 
 
2598
/* Accessor  methods (get/set functions) to struct members. */
 
2599
 
 
2600
/*
 
2601
 * Internal utility routines.
 
2602
 */
 
2603
 
 
2604
#ifndef yytext_ptr
 
2605
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
 
2606
{
 
2607
        register int i;
 
2608
        for ( i = 0; i < n; ++i )
 
2609
                s1[i] = s2[i];
 
2610
}
 
2611
#endif
 
2612
 
 
2613
#ifdef YY_NEED_STRLEN
 
2614
static int yy_flex_strlen (yyconst char * s )
 
2615
{
 
2616
        register int n;
 
2617
        for ( n = 0; s[n]; ++n )
 
2618
                ;
 
2619
 
 
2620
        return n;
 
2621
}
 
2622
#endif
 
2623
 
 
2624
void *pgsalloc (yy_size_t  size )
 
2625
{
 
2626
        return (void *) malloc( size );
 
2627
}
 
2628
 
 
2629
void *pgsrealloc  (void * ptr, yy_size_t  size )
 
2630
{
 
2631
        /* The cast to (char *) in the following accommodates both
 
2632
         * implementations that use char* generic pointers, and those
 
2633
         * that use void* generic pointers.  It works with the latter
 
2634
         * because both ANSI C and C++ allow castless assignment from
 
2635
         * any pointer type to void*, and deal with argument conversions
 
2636
         * as though doing an assignment.
 
2637
         */
 
2638
        return (void *) realloc( (char *) ptr, size );
 
2639
}
 
2640
 
 
2641
void pgsfree (void * ptr )
 
2642
{
 
2643
        free( (char *) ptr );   /* see pgsrealloc() for (char *) cast */
 
2644
}
 
2645
 
 
2646
#define YYTABLES_NAME "yytables"
 
2647
 
 
2648
#line 376 "pgscript/pgsScanner.ll"
 
2649
 
 
2650
 
 
2651
 
 
2652
namespace pgscript
 
2653
{
 
2654
 
 
2655
pgsScanner::pgsScanner(wxMBConv & conv, std::istream * in, std::ostream * out) :
 
2656
        pgsFlexLexer(in, out), m_parent(0), m_conv(conv)
 
2657
{
 
2658
 
 
2659
}
 
2660
 
 
2661
pgsScanner::~pgsScanner()
 
2662
{
 
2663
 
 
2664
}
 
2665
 
 
2666
void pgsScanner::set_debug(bool b)
 
2667
{
 
2668
        yy_flex_debug = b;
 
2669
}
 
2670
 
 
2671
int pgsScanner::columns(const char & c)
 
2672
{
 
2673
        if ((c & 0xF0) == 0xF0) // 4 bytes
 
2674
                return -3;
 
2675
        else if ((c & 0xE0) == 0xE0) // 3 bytes
 
2676
                return -2;
 
2677
        else if ((c & 0xC0) == 0xC0) // 2 bytes
 
2678
                return -1;
 
2679
        else return 0;
 
2680
}
 
2681
 
 
2682
}
 
2683
 
 
2684
/* This implementation of pgsFlexLexer::yylex() is required to fill the
 
2685
 * vtable of the class pgsFlexLexer. We define the scanner's main yylex
 
2686
 * function via YY_DECL to reside in the pgsScanner class instead. */
 
2687
 
 
2688
#ifdef yylex
 
2689
#undef yylex
 
2690
#endif
 
2691
 
 
2692
int pgsFlexLexer::yylex()
 
2693
{
 
2694
        return 0;
 
2695
}
 
2696