~ubuntu-branches/ubuntu/lucid/postgresql-8.4/lucid-proposed

« back to all changes in this revision

Viewing changes to src/backend/parser/scan.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-09-06 14:11:13 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090906141113-qf5f3hkw7n036jfy
Tags: 8.4.1-1
* Urgency medium due to security fix.
* New upstream security/bug fix release:
  - Disallow "RESET ROLE" and "RESET SESSION AUTHORIZATION" inside
    security-definer functions. This covers a case that was missed in the
    previous patch that disallowed "SET ROLE" and "SET SESSION
    AUTHORIZATION" inside security-definer functions. [CVE-2007-6600]
  - Fix WAL page header initialization at the end of archive recovery.
    This could lead to failure to process the WAL in a subsequent archive
    recovery.
  - Fix "cannot make new WAL entries during recovery" error.
  - Fix problem that could make expired rows visible after a crash.
    This bug involved a page status bit potentially not being set
    correctly after a server crash.
  - Make "LOAD" of an already-loaded loadable module into a no-op.
    Formerly, "LOAD" would attempt to unload and re-load the module,
    but this is unsafe and not all that useful.
  - Make window function PARTITION BY and ORDER BY items always be
    interpreted as simple expressions.
    In 8.4.0 these lists were parsed following the rules used for
    top-level GROUP BY and ORDER BY lists. But this was not correct per
    the SQL standard, and it led to possible circularity.
  - Fix several errors in planning of semi-joins. These led to wrong query
    results in some cases where IN or EXISTS was used together with another
    join.
  - Fix handling of whole-row references to subqueries that are within
    an outer join. An example is SELECT COUNT(ss.-) FROM ... LEFT JOIN
    (SELECT ...) ss ON .... Here, ss.- would be treated as
    ROW(NULL,NULL,...) for null-extended join rows, which is not the same as
    a simple NULL.  Now it is treated as a simple NULL.
  - Fix locale handling with plperl. This bug could cause the server's
    locale setting to change when a plperl function is called, leading to
    data corruption.
  - Fix handling of reloptions to ensure setting one option doesn't
    force default values for others.
  - Ensure that a "fast shutdown" request will forcibly terminate open
    sessions, even if a "smart shutdown" was already in progress.
  - Avoid memory leak for array_agg() in GROUP BY queries.
  - Treat to_char(..., 'TH') as an uppercase ordinal suffix with
    'HH'/'HH12'.  It was previously handled as 'th'.
  - Include the fractional part in the result of EXTRACT(second) and
    EXTRACT(milliseconds) for time and time with time zone inputs.
    This has always worked for floating-point datetime configurations,
    but was broken in the integer datetime code.
  - Fix overflow for INTERVAL 'x ms' when "x" is more than 2 million
    and integer datetimes are in use.
  - Improve performance when processing toasted values in index scans.
    This is particularly useful for PostGIS.
  - Fix a typo that disabled commit_delay.
  - Output early-startup messages to "postmaster.log" if the server is
    started in silent mode. Previously such error messages were discarded,
    leading to difficulty in debugging.
  - Remove translated FAQs. They are now on the wiki. The main FAQ was moved
    to the wiki some time ago.
  - Fix pg_ctl to not go into an infinite loop if "postgresql.conf" is
    empty.
  - Fix several errors in pg_dump's --binary-upgrade mode. pg_dump
    --binary-upgrade is used by pg_migrator.
  - Fix "contrib/xml2"'s xslt_process() to properly handle the maximum
    number of parameters (twenty).
  - Improve robustness of libpq's code to recover from errors during
    "COPY FROM STDIN".
  - Avoid including conflicting readline and editline header files when
    both libraries are installed.
  - Work around gcc bug that causes "floating-point exception" instead
    of "division by zero" on some platforms.
* debian/control: Bump Standards-Version to 3.8.3 (no changes necessary).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#line 2 "scan.c"
 
2
 
 
3
#line 4 "scan.c"
 
4
 
 
5
#define  YY_INT_ALIGNED short int
 
6
 
 
7
/* A lexical scanner generated by flex */
 
8
 
1
9
#define yy_create_buffer base_yy_create_buffer
2
10
#define yy_delete_buffer base_yy_delete_buffer
3
 
#define yy_scan_buffer base_yy_scan_buffer
4
 
#define yy_scan_string base_yy_scan_string
5
 
#define yy_scan_bytes base_yy_scan_bytes
6
11
#define yy_flex_debug base_yy_flex_debug
7
12
#define yy_init_buffer base_yy_init_buffer
8
13
#define yy_flush_buffer base_yy_flush_buffer
11
16
#define yyin base_yyin
12
17
#define yyleng base_yyleng
13
18
#define yylex base_yylex
 
19
#define yylineno base_yylineno
14
20
#define yyout base_yyout
15
21
#define yyrestart base_yyrestart
16
22
#define yytext base_yytext
17
 
 
18
 
#line 19 "scan.c"
19
 
/* A lexical scanner generated by flex */
20
 
 
21
 
/* Scanner skeleton version:
22
 
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
23
 
 */
 
23
#define yywrap base_yywrap
 
24
#define yyalloc base_yyalloc
 
25
#define yyrealloc base_yyrealloc
 
26
#define yyfree base_yyfree
24
27
 
25
28
#define FLEX_SCANNER
26
29
#define YY_FLEX_MAJOR_VERSION 2
27
30
#define YY_FLEX_MINOR_VERSION 5
28
 
 
 
31
#define YY_FLEX_SUBMINOR_VERSION 35
 
32
#if YY_FLEX_SUBMINOR_VERSION > 0
 
33
#define FLEX_BETA
 
34
#endif
 
35
 
 
36
/* First, we deal with  platform-specific or compiler-specific issues. */
 
37
 
 
38
/* begin standard C headers. */
29
39
#include <stdio.h>
30
 
 
31
 
 
32
 
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
33
 
#ifdef c_plusplus
34
 
#ifndef __cplusplus
35
 
#define __cplusplus
36
 
#endif
37
 
#endif
38
 
 
 
40
#include <string.h>
 
41
#include <errno.h>
 
42
#include <stdlib.h>
 
43
 
 
44
/* end standard C headers. */
 
45
 
 
46
/* flex integer type definitions */
 
47
 
 
48
#ifndef FLEXINT_H
 
49
#define FLEXINT_H
 
50
 
 
51
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
52
 
 
53
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
54
 
 
55
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 
56
 * if you want the limit (max/min) macros for int types. 
 
57
 */
 
58
#ifndef __STDC_LIMIT_MACROS
 
59
#define __STDC_LIMIT_MACROS 1
 
60
#endif
 
61
 
 
62
#include <inttypes.h>
 
63
typedef int8_t flex_int8_t;
 
64
typedef uint8_t flex_uint8_t;
 
65
typedef int16_t flex_int16_t;
 
66
typedef uint16_t flex_uint16_t;
 
67
typedef int32_t flex_int32_t;
 
68
typedef uint32_t flex_uint32_t;
 
69
#else
 
70
typedef signed char flex_int8_t;
 
71
typedef short int flex_int16_t;
 
72
typedef int flex_int32_t;
 
73
typedef unsigned char flex_uint8_t; 
 
74
typedef unsigned short int flex_uint16_t;
 
75
typedef unsigned int flex_uint32_t;
 
76
#endif /* ! C99 */
 
77
 
 
78
/* Limits of integral types. */
 
79
#ifndef INT8_MIN
 
80
#define INT8_MIN               (-128)
 
81
#endif
 
82
#ifndef INT16_MIN
 
83
#define INT16_MIN              (-32767-1)
 
84
#endif
 
85
#ifndef INT32_MIN
 
86
#define INT32_MIN              (-2147483647-1)
 
87
#endif
 
88
#ifndef INT8_MAX
 
89
#define INT8_MAX               (127)
 
90
#endif
 
91
#ifndef INT16_MAX
 
92
#define INT16_MAX              (32767)
 
93
#endif
 
94
#ifndef INT32_MAX
 
95
#define INT32_MAX              (2147483647)
 
96
#endif
 
97
#ifndef UINT8_MAX
 
98
#define UINT8_MAX              (255U)
 
99
#endif
 
100
#ifndef UINT16_MAX
 
101
#define UINT16_MAX             (65535U)
 
102
#endif
 
103
#ifndef UINT32_MAX
 
104
#define UINT32_MAX             (4294967295U)
 
105
#endif
 
106
 
 
107
#endif /* ! FLEXINT_H */
39
108
 
40
109
#ifdef __cplusplus
41
110
 
42
 
#include <stdlib.h>
43
 
#include <unistd.h>
44
 
 
45
 
/* Use prototypes in function declarations. */
46
 
#define YY_USE_PROTOS
47
 
 
48
111
/* The "const" storage-class-modifier is valid. */
49
112
#define YY_USE_CONST
50
113
 
51
114
#else   /* ! __cplusplus */
52
115
 
53
 
#if __STDC__
 
116
/* C99 requires __STDC__ to be defined as 1. */
 
117
#if defined (__STDC__)
54
118
 
55
 
#define YY_USE_PROTOS
56
119
#define YY_USE_CONST
57
120
 
58
 
#endif  /* __STDC__ */
 
121
#endif  /* defined (__STDC__) */
59
122
#endif  /* ! __cplusplus */
60
123
 
61
 
#ifdef __TURBOC__
62
 
 #pragma warn -rch
63
 
 #pragma warn -use
64
 
#include <io.h>
65
 
#include <stdlib.h>
66
 
#define YY_USE_CONST
67
 
#define YY_USE_PROTOS
68
 
#endif
69
 
 
70
124
#ifdef YY_USE_CONST
71
125
#define yyconst const
72
126
#else
73
127
#define yyconst
74
128
#endif
75
129
 
76
 
 
77
 
#ifdef YY_USE_PROTOS
78
 
#define YY_PROTO(proto) proto
79
 
#else
80
 
#define YY_PROTO(proto) ()
81
 
#endif
82
 
 
83
130
/* Returned upon end-of-file. */
84
131
#define YY_NULL 0
85
132
 
94
141
 * but we do it the disgusting crufty way forced on us by the ()-less
95
142
 * definition of BEGIN.
96
143
 */
97
 
#define BEGIN yy_start = 1 + 2 *
 
144
#define BEGIN (yy_start) = 1 + 2 *
98
145
 
99
146
/* Translate the current start state into a value that can be later handed
100
147
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
101
148
 * compatibility.
102
149
 */
103
 
#define YY_START ((yy_start - 1) / 2)
 
150
#define YY_START (((yy_start) - 1) / 2)
104
151
#define YYSTATE YY_START
105
152
 
106
153
/* Action number for EOF rule of a given start state. */
107
154
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
108
155
 
109
156
/* Special action meaning "start processing a new file". */
110
 
#define YY_NEW_FILE yyrestart( yyin )
 
157
#define YY_NEW_FILE base_yyrestart(base_yyin  )
111
158
 
112
159
#define YY_END_OF_BUFFER_CHAR 0
113
160
 
114
161
/* Size of default input buffer. */
 
162
#ifndef YY_BUF_SIZE
115
163
#define YY_BUF_SIZE 16384
116
 
 
 
164
#endif
 
165
 
 
166
/* The state buf must be large enough to hold one state per character in the main buffer.
 
167
 */
 
168
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
169
 
 
170
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
 
171
#define YY_TYPEDEF_YY_BUFFER_STATE
117
172
typedef struct yy_buffer_state *YY_BUFFER_STATE;
118
 
 
119
 
extern int yyleng;
120
 
extern FILE *yyin, *yyout;
 
173
#endif
 
174
 
 
175
extern int base_yyleng;
 
176
 
 
177
extern FILE *base_yyin, *base_yyout;
121
178
 
122
179
#define EOB_ACT_CONTINUE_SCAN 0
123
180
#define EOB_ACT_END_OF_FILE 1
124
181
#define EOB_ACT_LAST_MATCH 2
125
182
 
126
 
/* The funky do-while in the following #define is used to turn the definition
127
 
 * int a single C statement (which needs a semi-colon terminator).  This
128
 
 * avoids problems with code like:
129
 
 *
130
 
 *      if ( condition_holds )
131
 
 *              yyless( 5 );
132
 
 *      else
133
 
 *              do_something_else();
134
 
 *
135
 
 * Prior to using the do-while the compiler would get upset at the
136
 
 * "else" because it interpreted the "if" statement as being all
137
 
 * done when it reached the ';' after the yyless() call.
138
 
 */
139
 
 
140
 
/* Return all but the first 'n' matched characters back to the input stream. */
141
 
 
 
183
    #define YY_LESS_LINENO(n)
 
184
    
 
185
/* Return all but the first "n" matched characters back to the input stream. */
142
186
#define yyless(n) \
143
187
        do \
144
188
                { \
145
 
                /* Undo effects of setting up yytext. */ \
146
 
                *yy_cp = yy_hold_char; \
 
189
                /* Undo effects of setting up base_yytext. */ \
 
190
        int yyless_macro_arg = (n); \
 
191
        YY_LESS_LINENO(yyless_macro_arg);\
 
192
                *yy_cp = (yy_hold_char); \
147
193
                YY_RESTORE_YY_MORE_OFFSET \
148
 
                yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149
 
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 
194
                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
 
195
                YY_DO_BEFORE_ACTION; /* set up base_yytext again */ \
150
196
                } \
151
197
        while ( 0 )
152
198
 
153
 
#define unput(c) yyunput( c, yytext_ptr )
154
 
 
155
 
/* The following is because we cannot portably get our hands on size_t
156
 
 * (without autoconf's help, which isn't available because we want
157
 
 * flex-generated scanners to compile on their own).
158
 
 */
159
 
typedef unsigned int yy_size_t;
160
 
 
161
 
 
 
199
#define unput(c) yyunput( c, (yytext_ptr)  )
 
200
 
 
201
#ifndef YY_TYPEDEF_YY_SIZE_T
 
202
#define YY_TYPEDEF_YY_SIZE_T
 
203
typedef size_t yy_size_t;
 
204
#endif
 
205
 
 
206
#ifndef YY_STRUCT_YY_BUFFER_STATE
 
207
#define YY_STRUCT_YY_BUFFER_STATE
162
208
struct yy_buffer_state
163
209
        {
164
210
        FILE *yy_input_file;
195
241
         */
196
242
        int yy_at_bol;
197
243
 
 
244
    int yy_bs_lineno; /**< The line count. */
 
245
    int yy_bs_column; /**< The column count. */
 
246
    
198
247
        /* Whether to try to fill the input buffer when we reach the
199
248
         * end of it.
200
249
         */
201
250
        int yy_fill_buffer;
202
251
 
203
252
        int yy_buffer_status;
 
253
 
204
254
#define YY_BUFFER_NEW 0
205
255
#define YY_BUFFER_NORMAL 1
206
256
        /* When an EOF's been seen but there's still some text to process
210
260
         * possible backing-up.
211
261
         *
212
262
         * When we actually see the EOF, we change the status to "new"
213
 
         * (via yyrestart()), so that the user can continue scanning by
214
 
         * just pointing yyin at a new input file.
 
263
         * (via base_yyrestart()), so that the user can continue scanning by
 
264
         * just pointing base_yyin at a new input file.
215
265
         */
216
266
#define YY_BUFFER_EOF_PENDING 2
 
267
 
217
268
        };
 
269
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
218
270
 
219
 
static YY_BUFFER_STATE yy_current_buffer = 0;
 
271
/* Stack of input buffers. */
 
272
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 
273
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
 
274
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
220
275
 
221
276
/* We provide macros for accessing buffer states in case in the
222
277
 * future we want to put the buffer states in a more general
223
278
 * "scanner state".
224
 
 */
225
 
#define YY_CURRENT_BUFFER yy_current_buffer
226
 
 
227
 
 
228
 
/* yy_hold_char holds the character lost when yytext is formed. */
 
279
 *
 
280
 * Returns the top of the stack, or NULL.
 
281
 */
 
282
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
 
283
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
 
284
                          : NULL)
 
285
 
 
286
/* Same as previous macro, but useful when we know that the buffer stack is not
 
287
 * NULL or when we need an lvalue. For internal use only.
 
288
 */
 
289
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
290
 
 
291
/* yy_hold_char holds the character lost when base_yytext is formed. */
229
292
static char yy_hold_char;
230
 
 
231
293
static int yy_n_chars;          /* number of characters read into yy_ch_buf */
232
 
 
233
 
 
234
 
int yyleng;
 
294
int base_yyleng;
235
295
 
236
296
/* Points to current character in buffer. */
237
297
static char *yy_c_buf_p = (char *) 0;
238
 
static int yy_init = 1;         /* whether we need to initialize */
 
298
static int yy_init = 0;         /* whether we need to initialize */
239
299
static int yy_start = 0;        /* start state number */
240
300
 
241
 
/* Flag which is used to allow yywrap()'s to do buffer switches
242
 
 * instead of setting up a fresh yyin.  A bit of a hack ...
 
301
/* Flag which is used to allow base_yywrap()'s to do buffer switches
 
302
 * instead of setting up a fresh base_yyin.  A bit of a hack ...
243
303
 */
244
304
static int yy_did_buffer_switch_on_eof;
245
305
 
246
 
void yyrestart YY_PROTO(( FILE *input_file ));
247
 
 
248
 
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
249
 
void yy_load_buffer_state YY_PROTO(( void ));
250
 
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
251
 
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
252
 
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
253
 
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254
 
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
255
 
 
256
 
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
257
 
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
258
 
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
259
 
 
260
 
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
261
 
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
262
 
static void yy_flex_free YY_PROTO(( void * ));
263
 
 
264
 
#define yy_new_buffer yy_create_buffer
 
306
void base_yyrestart (FILE *input_file  );
 
307
void base_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
 
308
YY_BUFFER_STATE base_yy_create_buffer (FILE *file,int size  );
 
309
void base_yy_delete_buffer (YY_BUFFER_STATE b  );
 
310
void base_yy_flush_buffer (YY_BUFFER_STATE b  );
 
311
void base_yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
 
312
void base_yypop_buffer_state (void );
 
313
 
 
314
static void base_yyensure_buffer_stack (void );
 
315
static void base_yy_load_buffer_state (void );
 
316
static void base_yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
317
 
 
318
#define YY_FLUSH_BUFFER base_yy_flush_buffer(YY_CURRENT_BUFFER )
 
319
 
 
320
YY_BUFFER_STATE base_yy_scan_buffer (char *base,yy_size_t size  );
 
321
YY_BUFFER_STATE base_yy_scan_string (yyconst char *yy_str  );
 
322
YY_BUFFER_STATE base_yy_scan_bytes (yyconst char *bytes,int len  );
 
323
 
 
324
void *base_yyalloc (yy_size_t  );
 
325
void *base_yyrealloc (void *,yy_size_t  );
 
326
void base_yyfree (void *  );
 
327
 
 
328
#define yy_new_buffer base_yy_create_buffer
265
329
 
266
330
#define yy_set_interactive(is_interactive) \
267
331
        { \
268
 
        if ( ! yy_current_buffer ) \
269
 
                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270
 
        yy_current_buffer->yy_is_interactive = is_interactive; \
 
332
        if ( ! YY_CURRENT_BUFFER ){ \
 
333
        base_yyensure_buffer_stack (); \
 
334
                YY_CURRENT_BUFFER_LVALUE =    \
 
335
            base_yy_create_buffer(base_yyin,YY_BUF_SIZE ); \
 
336
        } \
 
337
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
271
338
        }
272
339
 
273
340
#define yy_set_bol(at_bol) \
274
341
        { \
275
 
        if ( ! yy_current_buffer ) \
276
 
                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277
 
        yy_current_buffer->yy_at_bol = at_bol; \
 
342
        if ( ! YY_CURRENT_BUFFER ){\
 
343
        base_yyensure_buffer_stack (); \
 
344
                YY_CURRENT_BUFFER_LVALUE =    \
 
345
            base_yy_create_buffer(base_yyin,YY_BUF_SIZE ); \
 
346
        } \
 
347
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
278
348
        }
279
349
 
280
 
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
281
 
 
282
 
 
283
 
#define yywrap() 1
 
350
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
351
 
 
352
/* Begin user sect3 */
 
353
 
 
354
#define base_yywrap(n) 1
284
355
#define YY_SKIP_YYWRAP
 
356
 
285
357
typedef unsigned char YY_CHAR;
286
 
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
 
358
 
 
359
FILE *base_yyin = (FILE *) 0, *base_yyout = (FILE *) 0;
 
360
 
287
361
typedef yyconst struct yy_trans_info *yy_state_type;
288
 
extern char *yytext;
289
 
#define yytext_ptr yytext
290
 
 
291
 
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
292
 
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
293
 
static int yy_get_next_buffer YY_PROTO(( void ));
294
 
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
 
362
 
 
363
extern int base_yylineno;
 
364
 
 
365
int base_yylineno = 1;
 
366
 
 
367
extern char *base_yytext;
 
368
#define yytext_ptr base_yytext
 
369
 
 
370
static yy_state_type yy_get_previous_state (void );
 
371
static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
 
372
static int yy_get_next_buffer (void );
 
373
static void yy_fatal_error (yyconst char msg[]  );
295
374
 
296
375
/* Done after the current pattern has been matched and before the
297
 
 * corresponding action - sets up yytext.
 
376
 * corresponding action - sets up base_yytext.
298
377
 */
299
378
#define YY_DO_BEFORE_ACTION \
300
 
        yytext_ptr = yy_bp; \
301
 
        yyleng = (int) (yy_cp - yy_bp); \
302
 
        yy_hold_char = *yy_cp; \
 
379
        (yytext_ptr) = yy_bp; \
 
380
        base_yyleng = (size_t) (yy_cp - yy_bp); \
 
381
        (yy_hold_char) = *yy_cp; \
303
382
        *yy_cp = '\0'; \
304
 
        yy_c_buf_p = yy_cp;
 
383
        (yy_c_buf_p) = yy_cp;
305
384
 
306
385
#define YY_NUM_RULES 59
307
386
#define YY_END_OF_BUFFER 60
308
387
struct yy_trans_info
309
388
        {
310
 
        short yy_verify;
311
 
        long yy_nxt;
 
389
        flex_int32_t yy_verify;
 
390
        flex_int32_t yy_nxt;
312
391
        };
313
392
static yyconst struct yy_trans_info yy_transition[62623] =
314
393
    {
14058
14137
    &yy_transition[4647],
14059
14138
    &yy_transition[4905],
14060
14139
 
14061
 
 
14062
14140
    } ;
14063
14141
 
 
14142
extern int base_yy_flex_debug;
 
14143
int base_yy_flex_debug = 0;
 
14144
 
14064
14145
/* The intent behind this definition is that it'll catch
14065
14146
 * any uses of REJECT which flex missed.
14066
14147
 */
14068
14149
#define yymore() yymore_used_but_not_detected
14069
14150
#define YY_MORE_ADJ 0
14070
14151
#define YY_RESTORE_YY_MORE_OFFSET
14071
 
char *yytext;
 
14152
char *base_yytext;
14072
14153
#line 1 "scan.l"
14073
 
#define INITIAL 0
14074
14154
#line 2 "scan.l"
14075
14155
/*-------------------------------------------------------------------------
14076
14156
 *
14157
14237
static void check_string_escape_warning(unsigned char ychar);
14158
14238
 
14159
14239
/*
14160
 
 * Each call to yylex must set yylloc to the location of the found token
 
14240
 * Each call to base_yylex must set yylloc to the location of the found token
14161
14241
 * (expressed as a byte offset from the start of the input text).
14162
14242
 * When we parse a token that requires multiple lexer rules to process,
14163
14243
 * this should be done in the first such rule, else yylloc will point
14164
14244
 * into the middle of the token.
14165
14245
 */
14166
 
#define SET_YYLLOC()  (yylloc = yytext - scanbuf)
 
14246
#define SET_YYLLOC()  (yylloc = base_yytext - scanbuf)
14167
14247
 
14168
14248
/* Handles to the buffer that the lexer uses internally */
14169
14249
static YY_BUFFER_STATE scanbufhandle;
14171
14251
 
14172
14252
static unsigned char unescape_single_char(unsigned char c);
14173
14253
 
14174
 
#define YY_NEVER_INTERACTIVE 1
14175
14254
#define YY_NO_INPUT 1
14176
 
#define YY_NO_UNPUT 1
14177
14255
/*
14178
14256
 * OK, here is a short description of lex/flex rules behavior.
14179
14257
 * The longest pattern which matches an input string is always chosen.
14195
14273
 *  <xui> quoted identifier with Unicode escapes
14196
14274
 *  <xus> quoted string with Unicode escapes
14197
14275
 */
14198
 
#define xb 1
14199
 
 
14200
 
#define xc 2
14201
 
 
14202
 
#define xd 3
14203
 
 
14204
 
#define xh 4
14205
 
 
14206
 
#define xe 5
14207
 
 
14208
 
#define xq 6
14209
 
 
14210
 
#define xdolq 7
14211
 
 
14212
 
#define xui 8
14213
 
 
14214
 
#define xus 9
 
14276
 
 
14277
 
 
14278
 
 
14279
 
 
14280
 
 
14281
 
 
14282
 
 
14283
 
14215
14284
 
14216
14285
/*
14217
14286
 * In order to make the world safe for Windows and Mac clients as well as
14324
14393
 * Note that xcstart must appear before operator, as explained above!
14325
14394
 *  Also whitespace (comment) must appear before operator.
14326
14395
 */
14327
 
#line 14328 "scan.c"
 
14396
#line 14397 "scan.c"
 
14397
 
 
14398
#define INITIAL 0
 
14399
#define xb 1
 
14400
#define xc 2
 
14401
#define xd 3
 
14402
#define xh 4
 
14403
#define xe 5
 
14404
#define xq 6
 
14405
#define xdolq 7
 
14406
#define xui 8
 
14407
#define xus 9
 
14408
 
 
14409
#ifndef YY_NO_UNISTD_H
 
14410
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 
14411
 * down here because we want the user's section 1 to have been scanned first.
 
14412
 * The user has a chance to override it with an option.
 
14413
 */
 
14414
#include <unistd.h>
 
14415
#endif
 
14416
 
 
14417
#ifndef YY_EXTRA_TYPE
 
14418
#define YY_EXTRA_TYPE void *
 
14419
#endif
 
14420
 
 
14421
static int yy_init_globals (void );
 
14422
 
 
14423
/* Accessor methods to globals.
 
14424
   These are made visible to non-reentrant scanners for convenience. */
 
14425
 
 
14426
int base_yylex_destroy (void );
 
14427
 
 
14428
int base_yyget_debug (void );
 
14429
 
 
14430
void base_yyset_debug (int debug_flag  );
 
14431
 
 
14432
YY_EXTRA_TYPE base_yyget_extra (void );
 
14433
 
 
14434
void base_yyset_extra (YY_EXTRA_TYPE user_defined  );
 
14435
 
 
14436
FILE *base_yyget_in (void );
 
14437
 
 
14438
void base_yyset_in  (FILE * in_str  );
 
14439
 
 
14440
FILE *base_yyget_out (void );
 
14441
 
 
14442
void base_yyset_out  (FILE * out_str  );
 
14443
 
 
14444
int base_yyget_leng (void );
 
14445
 
 
14446
char *base_yyget_text (void );
 
14447
 
 
14448
int base_yyget_lineno (void );
 
14449
 
 
14450
void base_yyset_lineno (int line_number  );
14328
14451
 
14329
14452
/* Macros after this point can all be overridden by user definitions in
14330
14453
 * section 1.
14332
14455
 
14333
14456
#ifndef YY_SKIP_YYWRAP
14334
14457
#ifdef __cplusplus
14335
 
extern "C" int yywrap YY_PROTO(( void ));
 
14458
extern "C" int base_yywrap (void );
14336
14459
#else
14337
 
extern int yywrap YY_PROTO(( void ));
14338
 
#endif
14339
 
#endif
14340
 
 
14341
 
#ifndef YY_NO_UNPUT
14342
 
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
 
14460
extern int base_yywrap (void );
 
14461
#endif
14343
14462
#endif
14344
14463
 
14345
14464
#ifndef yytext_ptr
14346
 
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
 
14465
static void yy_flex_strncpy (char *,yyconst char *,int );
14347
14466
#endif
14348
14467
 
14349
14468
#ifdef YY_NEED_STRLEN
14350
 
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
 
14469
static int yy_flex_strlen (yyconst char * );
14351
14470
#endif
14352
14471
 
14353
14472
#ifndef YY_NO_INPUT
 
14473
 
14354
14474
#ifdef __cplusplus
14355
 
static int yyinput YY_PROTO(( void ));
14356
 
#else
14357
 
static int input YY_PROTO(( void ));
14358
 
#endif
14359
 
#endif
14360
 
 
14361
 
#if YY_STACK_USED
14362
 
static int yy_start_stack_ptr = 0;
14363
 
static int yy_start_stack_depth = 0;
14364
 
static int *yy_start_stack = 0;
14365
 
#ifndef YY_NO_PUSH_STATE
14366
 
static void yy_push_state YY_PROTO(( int new_state ));
14367
 
#endif
14368
 
#ifndef YY_NO_POP_STATE
14369
 
static void yy_pop_state YY_PROTO(( void ));
14370
 
#endif
14371
 
#ifndef YY_NO_TOP_STATE
14372
 
static int yy_top_state YY_PROTO(( void ));
14373
 
#endif
14374
 
 
14375
 
#else
14376
 
#define YY_NO_PUSH_STATE 1
14377
 
#define YY_NO_POP_STATE 1
14378
 
#define YY_NO_TOP_STATE 1
14379
 
#endif
14380
 
 
14381
 
#ifdef YY_MALLOC_DECL
14382
 
YY_MALLOC_DECL
14383
 
#else
14384
 
#if __STDC__
14385
 
#ifndef __cplusplus
14386
 
#include <stdlib.h>
14387
 
#endif
14388
 
#else
14389
 
/* Just try to get by without declaring the routines.  This will fail
14390
 
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
14391
 
 * or sizeof(void*) != sizeof(int).
14392
 
 */
14393
 
#endif
 
14475
static int yyinput (void );
 
14476
#else
 
14477
static int input (void );
 
14478
#endif
 
14479
 
14394
14480
#endif
14395
14481
 
14396
14482
/* Amount of stuff to slurp up with each read. */
14399
14485
#endif
14400
14486
 
14401
14487
/* Copy whatever the last rule matched to the standard output. */
14402
 
 
14403
14488
#ifndef ECHO
14404
14489
/* This used to be an fputs(), but since the string might contain NUL's,
14405
14490
 * we now use fwrite().
14406
14491
 */
14407
 
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
 
14492
#define ECHO fwrite( base_yytext, base_yyleng, 1, base_yyout )
14408
14493
#endif
14409
14494
 
14410
14495
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
14412
14497
 */
14413
14498
#ifndef YY_INPUT
14414
14499
#define YY_INPUT(buf,result,max_size) \
14415
 
        if ( yy_current_buffer->yy_is_interactive ) \
 
14500
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
14416
14501
                { \
14417
 
                int c = '*', n; \
 
14502
                int c = '*'; \
 
14503
                int n; \
14418
14504
                for ( n = 0; n < max_size && \
14419
 
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 
14505
                             (c = getc( base_yyin )) != EOF && c != '\n'; ++n ) \
14420
14506
                        buf[n] = (char) c; \
14421
14507
                if ( c == '\n' ) \
14422
14508
                        buf[n++] = (char) c; \
14423
 
                if ( c == EOF && ferror( yyin ) ) \
 
14509
                if ( c == EOF && ferror( base_yyin ) ) \
14424
14510
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
14425
14511
                result = n; \
14426
14512
                } \
14427
 
        else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
14428
 
                  && ferror( yyin ) ) \
14429
 
                YY_FATAL_ERROR( "input in flex scanner failed" );
 
14513
        else \
 
14514
                { \
 
14515
                errno=0; \
 
14516
                while ( (result = fread(buf, 1, max_size, base_yyin))==0 && ferror(base_yyin)) \
 
14517
                        { \
 
14518
                        if( errno != EINTR) \
 
14519
                                { \
 
14520
                                YY_FATAL_ERROR( "input in flex scanner failed" ); \
 
14521
                                break; \
 
14522
                                } \
 
14523
                        errno=0; \
 
14524
                        clearerr(base_yyin); \
 
14525
                        } \
 
14526
                }\
 
14527
\
 
14528
 
14430
14529
#endif
14431
14530
 
14432
14531
/* No semi-colon after return; correct usage is to write "yyterminate();" -
14447
14546
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
14448
14547
#endif
14449
14548
 
 
14549
/* end tables serialization structures and prototypes */
 
14550
 
14450
14551
/* Default declaration of generated scanner - a define so the user can
14451
14552
 * easily add parameters.
14452
14553
 */
14453
14554
#ifndef YY_DECL
14454
 
#define YY_DECL int yylex YY_PROTO(( void ))
14455
 
#endif
14456
 
 
14457
 
/* Code executed at the beginning of each rule, after yytext and yyleng
 
14555
#define YY_DECL_IS_OURS 1
 
14556
 
 
14557
extern int base_yylex (void);
 
14558
 
 
14559
#define YY_DECL int base_yylex (void)
 
14560
#endif /* !YY_DECL */
 
14561
 
 
14562
/* Code executed at the beginning of each rule, after base_yytext and base_yyleng
14458
14563
 * have been set up.
14459
14564
 */
14460
14565
#ifndef YY_USER_ACTION
14469
14574
#define YY_RULE_SETUP \
14470
14575
        YY_USER_ACTION
14471
14576
 
 
14577
/** The main scanner function which does all the work.
 
14578
 */
14472
14579
YY_DECL
14473
 
        {
 
14580
{
14474
14581
        register yy_state_type yy_current_state;
14475
14582
        register char *yy_cp, *yy_bp;
14476
14583
        register int yy_act;
14477
 
 
 
14584
    
14478
14585
#line 346 "scan.l"
14479
14586
 
14480
14587
 
14481
 
#line 14482 "scan.c"
 
14588
#line 14589 "scan.c"
14482
14589
 
14483
 
        if ( yy_init )
 
14590
        if ( !(yy_init) )
14484
14591
                {
14485
 
                yy_init = 0;
 
14592
                (yy_init) = 1;
14486
14593
 
14487
14594
#ifdef YY_USER_INIT
14488
14595
                YY_USER_INIT;
14489
14596
#endif
14490
14597
 
14491
 
                if ( ! yy_start )
14492
 
                        yy_start = 1;   /* first start state */
14493
 
 
14494
 
                if ( ! yyin )
14495
 
                        yyin = stdin;
14496
 
 
14497
 
                if ( ! yyout )
14498
 
                        yyout = stdout;
14499
 
 
14500
 
                if ( ! yy_current_buffer )
14501
 
                        yy_current_buffer =
14502
 
                                yy_create_buffer( yyin, YY_BUF_SIZE );
14503
 
 
14504
 
                yy_load_buffer_state();
 
14598
                if ( ! (yy_start) )
 
14599
                        (yy_start) = 1; /* first start state */
 
14600
 
 
14601
                if ( ! base_yyin )
 
14602
                        base_yyin = stdin;
 
14603
 
 
14604
                if ( ! base_yyout )
 
14605
                        base_yyout = stdout;
 
14606
 
 
14607
                if ( ! YY_CURRENT_BUFFER ) {
 
14608
                        base_yyensure_buffer_stack ();
 
14609
                        YY_CURRENT_BUFFER_LVALUE =
 
14610
                                base_yy_create_buffer(base_yyin,YY_BUF_SIZE );
 
14611
                }
 
14612
 
 
14613
                base_yy_load_buffer_state( );
14505
14614
                }
14506
14615
 
14507
14616
        while ( 1 )             /* loops until end-of-file is reached */
14508
14617
                {
14509
 
                yy_cp = yy_c_buf_p;
 
14618
                yy_cp = (yy_c_buf_p);
14510
14619
 
14511
 
                /* Support of yytext. */
14512
 
                *yy_cp = yy_hold_char;
 
14620
                /* Support of base_yytext. */
 
14621
                *yy_cp = (yy_hold_char);
14513
14622
 
14514
14623
                /* yy_bp points to the position in yy_ch_buf of the start of
14515
14624
                 * the current run.
14516
14625
                 */
14517
14626
                yy_bp = yy_cp;
14518
14627
 
14519
 
                yy_current_state = yy_start_state_list[yy_start];
 
14628
                yy_current_state = yy_start_state_list[(yy_start)];
14520
14629
yy_match:
14521
14630
                {
14522
14631
                register yyconst struct yy_trans_info *yy_trans_info;
14535
14644
 
14536
14645
                YY_DO_BEFORE_ACTION;
14537
14646
 
14538
 
 
14539
14647
do_action:      /* This label is used only to access EOF actions. */
14540
14648
 
14541
 
 
14542
14649
                switch ( yy_act )
14543
14650
        { /* beginning of action switch */
14544
14651
case 1:
 
14652
/* rule 1 can match eol */
14545
14653
YY_RULE_SETUP
14546
14654
#line 348 "scan.l"
14547
14655
{
14580
14688
                                }
14581
14689
        YY_BREAK
14582
14690
case 5:
 
14691
/* rule 5 can match eol */
14583
14692
YY_RULE_SETUP
14584
14693
#line 374 "scan.l"
14585
14694
{
14621
14730
                                }
14622
14731
        YY_BREAK
14623
14732
case 9:
 
14733
/* rule 9 can match eol */
14624
14734
#line 401 "scan.l"
14625
14735
case 10:
 
14736
/* rule 10 can match eol */
14626
14737
YY_RULE_SETUP
14627
14738
#line 401 "scan.l"
14628
14739
{
14633
14744
                                }
14634
14745
        YY_BREAK
14635
14746
case 11:
 
14747
/* rule 11 can match eol */
14636
14748
#line 408 "scan.l"
14637
14749
case 12:
 
14750
/* rule 12 can match eol */
14638
14751
YY_RULE_SETUP
14639
14752
#line 408 "scan.l"
14640
14753
{
14641
 
                                        addlit(yytext, yyleng);
 
14754
                                        addlit(base_yytext, base_yyleng);
14642
14755
                                }
14643
14756
        YY_BREAK
14644
14757
case 13:
 
14758
/* rule 13 can match eol */
14645
14759
#line 412 "scan.l"
14646
14760
case 14:
 
14761
/* rule 14 can match eol */
14647
14762
YY_RULE_SETUP
14648
14763
#line 412 "scan.l"
14649
14764
{
14671
14786
                                }
14672
14787
        YY_BREAK
14673
14788
case 16:
 
14789
/* rule 16 can match eol */
14674
14790
#line 430 "scan.l"
14675
14791
case 17:
 
14792
/* rule 17 can match eol */
14676
14793
YY_RULE_SETUP
14677
14794
#line 430 "scan.l"
14678
14795
{
14746
14863
                                }
14747
14864
        YY_BREAK
14748
14865
case 22:
 
14866
/* rule 22 can match eol */
14749
14867
#line 483 "scan.l"
14750
14868
case 23:
 
14869
/* rule 23 can match eol */
14751
14870
YY_RULE_SETUP
14752
14871
#line 483 "scan.l"
14753
14872
{
14764
14883
                                }
14765
14884
        YY_BREAK
14766
14885
case 24:
 
14886
/* rule 24 can match eol */
14767
14887
YY_RULE_SETUP
14768
14888
#line 495 "scan.l"
14769
14889
{
14775
14895
                                }
14776
14896
        YY_BREAK
14777
14897
case 25:
 
14898
/* rule 25 can match eol */
14778
14899
YY_RULE_SETUP
14779
14900
#line 502 "scan.l"
14780
14901
{
14781
14902
                                        BEGIN(INITIAL);
14782
 
                                        yylval.str = litbuf_udeescape(yytext[yyleng-2]);
 
14903
                                        yylval.str = litbuf_udeescape(base_yytext[base_yyleng-2]);
14783
14904
                                        return SCONST;
14784
14905
                                }
14785
14906
        YY_BREAK
14791
14912
                                }
14792
14913
        YY_BREAK
14793
14914
case 27:
 
14915
/* rule 27 can match eol */
14794
14916
YY_RULE_SETUP
14795
14917
#line 510 "scan.l"
14796
14918
{
14797
 
                                        addlit(yytext, yyleng);
 
14919
                                        addlit(base_yytext, base_yyleng);
14798
14920
                                }
14799
14921
        YY_BREAK
14800
14922
case 28:
 
14923
/* rule 28 can match eol */
14801
14924
YY_RULE_SETUP
14802
14925
#line 513 "scan.l"
14803
14926
{
14804
 
                                        addlit(yytext, yyleng);
 
14927
                                        addlit(base_yytext, base_yyleng);
14805
14928
                                }
14806
14929
        YY_BREAK
14807
14930
case 29:
 
14931
/* rule 29 can match eol */
14808
14932
YY_RULE_SETUP
14809
14933
#line 516 "scan.l"
14810
14934
{
14811
 
                                        if (yytext[1] == '\'')
 
14935
                                        if (base_yytext[1] == '\'')
14812
14936
                                        {
14813
14937
                                                if (backslash_quote == BACKSLASH_QUOTE_OFF ||
14814
14938
                                                        (backslash_quote == BACKSLASH_QUOTE_SAFE_ENCODING &&
14819
14943
                                                                         errhint("Use '' to write quotes in strings. \\' is insecure in client-only encodings."),
14820
14944
                                                                         lexer_errposition()));
14821
14945
                                        }
14822
 
                                        check_string_escape_warning(yytext[1]);
14823
 
                                        addlitchar(unescape_single_char(yytext[1]));
 
14946
                                        check_string_escape_warning(base_yytext[1]);
 
14947
                                        addlitchar(unescape_single_char(base_yytext[1]));
14824
14948
                                }
14825
14949
        YY_BREAK
14826
14950
case 30:
14827
14951
YY_RULE_SETUP
14828
14952
#line 531 "scan.l"
14829
14953
{
14830
 
                                        unsigned char c = strtoul(yytext+1, NULL, 8);
 
14954
                                        unsigned char c = strtoul(base_yytext+1, NULL, 8);
14831
14955
 
14832
14956
                                        check_escape_warning();
14833
14957
                                        addlitchar(c);
14839
14963
YY_RULE_SETUP
14840
14964
#line 539 "scan.l"
14841
14965
{
14842
 
                                        unsigned char c = strtoul(yytext+2, NULL, 16);
 
14966
                                        unsigned char c = strtoul(base_yytext+2, NULL, 16);
14843
14967
 
14844
14968
                                        check_escape_warning();
14845
14969
                                        addlitchar(c);
14848
14972
                                }
14849
14973
        YY_BREAK
14850
14974
case 32:
 
14975
/* rule 32 can match eol */
14851
14976
YY_RULE_SETUP
14852
14977
#line 547 "scan.l"
14853
14978
{
14859
14984
#line 550 "scan.l"
14860
14985
{
14861
14986
                                        /* This is only needed for \ just before EOF */
14862
 
                                        addlitchar(yytext[0]);
 
14987
                                        addlitchar(base_yytext[0]);
14863
14988
                                }
14864
14989
        YY_BREAK
14865
14990
case YY_STATE_EOF(xq):
14873
14998
#line 556 "scan.l"
14874
14999
{
14875
15000
                                        SET_YYLLOC();
14876
 
                                        dolqstart = pstrdup(yytext);
 
15001
                                        dolqstart = pstrdup(base_yytext);
14877
15002
                                        BEGIN(xdolq);
14878
15003
                                        startlit();
14879
15004
                                }
14886
15011
                                        /* throw back all but the initial "$" */
14887
15012
                                        yyless(1);
14888
15013
                                        /* and treat it as {other} */
14889
 
                                        return yytext[0];
 
15014
                                        return base_yytext[0];
14890
15015
                                }
14891
15016
        YY_BREAK
14892
15017
case 36:
14893
15018
YY_RULE_SETUP
14894
15019
#line 569 "scan.l"
14895
15020
{
14896
 
                                        if (strcmp(yytext, dolqstart) == 0)
 
15021
                                        if (strcmp(base_yytext, dolqstart) == 0)
14897
15022
                                        {
14898
15023
                                                pfree(dolqstart);
14899
15024
                                                BEGIN(INITIAL);
14907
15032
                                                 * the $... part to the output, but put back the final
14908
15033
                                                 * $ for rescanning.  Consider $delim$...$junk$delim$
14909
15034
                                                 */
14910
 
                                                addlit(yytext, yyleng-1);
14911
 
                                                yyless(yyleng-1);
 
15035
                                                addlit(base_yytext, base_yyleng-1);
 
15036
                                                yyless(base_yyleng-1);
14912
15037
                                        }
14913
15038
                                }
14914
15039
        YY_BREAK
14915
15040
case 37:
 
15041
/* rule 37 can match eol */
14916
15042
YY_RULE_SETUP
14917
15043
#line 588 "scan.l"
14918
15044
{
14919
 
                                        addlit(yytext, yyleng);
 
15045
                                        addlit(base_yytext, base_yyleng);
14920
15046
                                }
14921
15047
        YY_BREAK
14922
15048
case 38:
14923
15049
YY_RULE_SETUP
14924
15050
#line 591 "scan.l"
14925
15051
{
14926
 
                                        addlit(yytext, yyleng);
 
15052
                                        addlit(base_yytext, base_yyleng);
14927
15053
                                }
14928
15054
        YY_BREAK
14929
15055
case 39:
14931
15057
#line 594 "scan.l"
14932
15058
{
14933
15059
                                        /* This is only needed for $ inside the quoted text */
14934
 
                                        addlitchar(yytext[0]);
 
15060
                                        addlitchar(base_yytext[0]);
14935
15061
                                }
14936
15062
        YY_BREAK
14937
15063
case YY_STATE_EOF(xdolq):
14973
15099
                                }
14974
15100
        YY_BREAK
14975
15101
case 43:
 
15102
/* rule 43 can match eol */
14976
15103
YY_RULE_SETUP
14977
15104
#line 622 "scan.l"
14978
15105
{
14991
15118
                                }
14992
15119
        YY_BREAK
14993
15120
case 44:
 
15121
/* rule 44 can match eol */
14994
15122
YY_RULE_SETUP
14995
15123
#line 636 "scan.l"
14996
15124
{
14999
15127
                                        BEGIN(INITIAL);
15000
15128
                                        if (literallen == 0)
15001
15129
                                                yyerror("zero-length delimited identifier");
15002
 
                                        ident = litbuf_udeescape(yytext[yyleng - 2]);
 
15130
                                        ident = litbuf_udeescape(base_yytext[base_yyleng - 2]);
15003
15131
                                        if (literallen >= NAMEDATALEN)
15004
15132
                                                truncate_identifier(ident, literallen, true);
15005
15133
                                        yylval.str = ident;
15014
15142
                                }
15015
15143
        YY_BREAK
15016
15144
case 46:
 
15145
/* rule 46 can match eol */
15017
15146
YY_RULE_SETUP
15018
15147
#line 651 "scan.l"
15019
15148
{
15020
 
                                        addlit(yytext, yyleng);
 
15149
                                        addlit(base_yytext, base_yyleng);
15021
15150
                                }
15022
15151
        YY_BREAK
15023
15152
case YY_STATE_EOF(xd):
15035
15164
                                        /* throw back all but the initial u/U */
15036
15165
                                        yyless(1);
15037
15166
                                        /* and treat it as {identifier} */
15038
 
                                        ident = downcase_truncate_identifier(yytext, yyleng, true);
 
15167
                                        ident = downcase_truncate_identifier(base_yytext, base_yyleng, true);
15039
15168
                                        yylval.str = ident;
15040
15169
                                        return IDENT;
15041
15170
                                }
15053
15182
#line 673 "scan.l"
15054
15183
{
15055
15184
                                        SET_YYLLOC();
15056
 
                                        return yytext[0];
 
15185
                                        return base_yytext[0];
15057
15186
                                }
15058
15187
        YY_BREAK
15059
15188
case 50:
15066
15195
                                         * Note that slash-star or dash-dash at the first
15067
15196
                                         * character will match a prior rule, not this one.
15068
15197
                                         */
15069
 
                                        int             nchars = yyleng;
15070
 
                                        char   *slashstar = strstr(yytext, "/*");
15071
 
                                        char   *dashdash = strstr(yytext, "--");
 
15198
                                        int             nchars = base_yyleng;
 
15199
                                        char   *slashstar = strstr(base_yytext, "/*");
 
15200
                                        char   *dashdash = strstr(base_yytext, "--");
15072
15201
 
15073
15202
                                        if (slashstar && dashdash)
15074
15203
                                        {
15079
15208
                                        else if (!slashstar)
15080
15209
                                                slashstar = dashdash;
15081
15210
                                        if (slashstar)
15082
 
                                                nchars = slashstar - yytext;
 
15211
                                                nchars = slashstar - base_yytext;
15083
15212
 
15084
15213
                                        /*
15085
15214
                                         * For SQL compatibility, '+' and '-' cannot be the
15090
15219
                                         * sequences of SQL operators.
15091
15220
                                         */
15092
15221
                                        while (nchars > 1 &&
15093
 
                                                   (yytext[nchars-1] == '+' ||
15094
 
                                                        yytext[nchars-1] == '-'))
 
15222
                                                   (base_yytext[nchars-1] == '+' ||
 
15223
                                                        base_yytext[nchars-1] == '-'))
15095
15224
                                        {
15096
15225
                                                int             ic;
15097
15226
 
15098
15227
                                                for (ic = nchars-2; ic >= 0; ic--)
15099
15228
                                                {
15100
 
                                                        if (strchr("~!@#^&|`?%", yytext[ic]))
 
15229
                                                        if (strchr("~!@#^&|`?%", base_yytext[ic]))
15101
15230
                                                                break;
15102
15231
                                                }
15103
15232
                                                if (ic >= 0)
15107
15236
 
15108
15237
                                        SET_YYLLOC();
15109
15238
 
15110
 
                                        if (nchars < yyleng)
 
15239
                                        if (nchars < base_yyleng)
15111
15240
                                        {
15112
15241
                                                /* Strip the unwanted chars from the token */
15113
15242
                                                yyless(nchars);
15118
15247
                                                 * that the "self" rule would have.
15119
15248
                                                 */
15120
15249
                                                if (nchars == 1 &&
15121
 
                                                        strchr(",()[].;:+-*/%^<>=", yytext[0]))
15122
 
                                                        return yytext[0];
 
15250
                                                        strchr(",()[].;:+-*/%^<>=", base_yytext[0]))
 
15251
                                                        return base_yytext[0];
15123
15252
                                        }
15124
15253
 
15125
15254
                                        /*
15132
15261
                                                yyerror("operator too long");
15133
15262
 
15134
15263
                                        /* Convert "!=" operator to "<>" for compatibility */
15135
 
                                        if (strcmp(yytext, "!=") == 0)
 
15264
                                        if (strcmp(base_yytext, "!=") == 0)
15136
15265
                                                yylval.str = pstrdup("<>");
15137
15266
                                        else
15138
 
                                                yylval.str = pstrdup(yytext);
 
15267
                                                yylval.str = pstrdup(base_yytext);
15139
15268
                                        return Op;
15140
15269
                                }
15141
15270
        YY_BREAK
15144
15273
#line 758 "scan.l"
15145
15274
{
15146
15275
                                        SET_YYLLOC();
15147
 
                                        yylval.ival = atol(yytext + 1);
 
15276
                                        yylval.ival = atol(base_yytext + 1);
15148
15277
                                        return PARAM;
15149
15278
                                }
15150
15279
        YY_BREAK
15157
15286
 
15158
15287
                                        SET_YYLLOC();
15159
15288
                                        errno = 0;
15160
 
                                        val = strtol(yytext, &endptr, 10);
 
15289
                                        val = strtol(base_yytext, &endptr, 10);
15161
15290
                                        if (*endptr != '\0' || errno == ERANGE
15162
15291
#ifdef HAVE_LONG_INT_64
15163
15292
                                                /* if long > 32 bits, check for overflow of int4 */
15166
15295
                                                )
15167
15296
                                        {
15168
15297
                                                /* integer too large, treat it as a float */
15169
 
                                                yylval.str = pstrdup(yytext);
 
15298
                                                yylval.str = pstrdup(base_yytext);
15170
15299
                                                return FCONST;
15171
15300
                                        }
15172
15301
                                        yylval.ival = val;
15178
15307
#line 785 "scan.l"
15179
15308
{
15180
15309
                                        SET_YYLLOC();
15181
 
                                        yylval.str = pstrdup(yytext);
 
15310
                                        yylval.str = pstrdup(base_yytext);
15182
15311
                                        return FCONST;
15183
15312
                                }
15184
15313
        YY_BREAK
15187
15316
#line 790 "scan.l"
15188
15317
{
15189
15318
                                        SET_YYLLOC();
15190
 
                                        yylval.str = pstrdup(yytext);
 
15319
                                        yylval.str = pstrdup(base_yytext);
15191
15320
                                        return FCONST;
15192
15321
                                }
15193
15322
        YY_BREAK
15201
15330
                                         * but since this case will almost certainly lead to a
15202
15331
                                         * syntax error anyway, we don't bother to distinguish.
15203
15332
                                         */
15204
 
                                        yyless(yyleng-1);
 
15333
                                        yyless(base_yyleng-1);
15205
15334
                                        SET_YYLLOC();
15206
 
                                        yylval.str = pstrdup(yytext);
 
15335
                                        yylval.str = pstrdup(base_yytext);
15207
15336
                                        return FCONST;
15208
15337
                                }
15209
15338
        YY_BREAK
15212
15341
#line 807 "scan.l"
15213
15342
{
15214
15343
                                        /* throw back the [Ee][+-], and proceed as above */
15215
 
                                        yyless(yyleng-2);
 
15344
                                        yyless(base_yyleng-2);
15216
15345
                                        SET_YYLLOC();
15217
 
                                        yylval.str = pstrdup(yytext);
 
15346
                                        yylval.str = pstrdup(base_yytext);
15218
15347
                                        return FCONST;
15219
15348
                                }
15220
15349
        YY_BREAK
15228
15357
                                        SET_YYLLOC();
15229
15358
 
15230
15359
                                        /* Is it a keyword? */
15231
 
                                        keyword = ScanKeywordLookup(yytext);
 
15360
                                        keyword = ScanKeywordLookup(base_yytext);
15232
15361
                                        if (keyword != NULL)
15233
15362
                                        {
15234
15363
                                                yylval.keyword = keyword->name;
15239
15368
                                         * No.  Convert the identifier to lower case, and truncate
15240
15369
                                         * if necessary.
15241
15370
                                         */
15242
 
                                        ident = downcase_truncate_identifier(yytext, yyleng, true);
 
15371
                                        ident = downcase_truncate_identifier(base_yytext, base_yyleng, true);
15243
15372
                                        yylval.str = ident;
15244
15373
                                        return IDENT;
15245
15374
                                }
15249
15378
#line 839 "scan.l"
15250
15379
{
15251
15380
                                        SET_YYLLOC();
15252
 
                                        return yytext[0];
 
15381
                                        return base_yytext[0];
15253
15382
                                }
15254
15383
        YY_BREAK
15255
15384
case YY_STATE_EOF(INITIAL):
15264
15393
#line 849 "scan.l"
15265
15394
YY_FATAL_ERROR( "flex scanner jammed" );
15266
15395
        YY_BREAK
15267
 
#line 15268 "scan.c"
 
15396
#line 15397 "scan.c"
15268
15397
 
15269
15398
        case YY_END_OF_BUFFER:
15270
15399
                {
15271
15400
                /* Amount of text matched not including the EOB char. */
15272
 
                int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
 
15401
                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
15273
15402
 
15274
15403
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
15275
 
                *yy_cp = yy_hold_char;
 
15404
                *yy_cp = (yy_hold_char);
15276
15405
                YY_RESTORE_YY_MORE_OFFSET
15277
15406
 
15278
 
                if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
 
15407
                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
15279
15408
                        {
15280
15409
                        /* We're scanning a new file or input source.  It's
15281
15410
                         * possible that this happened because the user
15282
 
                         * just pointed yyin at a new source and called
15283
 
                         * yylex().  If so, then we have to assure
15284
 
                         * consistency between yy_current_buffer and our
 
15411
                         * just pointed base_yyin at a new source and called
 
15412
                         * base_yylex().  If so, then we have to assure
 
15413
                         * consistency between YY_CURRENT_BUFFER and our
15285
15414
                         * globals.  Here is the right place to do so, because
15286
15415
                         * this is the first action (other than possibly a
15287
15416
                         * back-up) that will match for the new input source.
15288
15417
                         */
15289
 
                        yy_n_chars = yy_current_buffer->yy_n_chars;
15290
 
                        yy_current_buffer->yy_input_file = yyin;
15291
 
                        yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
 
15418
                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 
15419
                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = base_yyin;
 
15420
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
15292
15421
                        }
15293
15422
 
15294
15423
                /* Note that here we test for yy_c_buf_p "<=" to the position
15298
15427
                 * end-of-buffer state).  Contrast this with the test
15299
15428
                 * in input().
15300
15429
                 */
15301
 
                if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
 
15430
                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
15302
15431
                        { /* This was really a NUL. */
15303
15432
                        yy_state_type yy_next_state;
15304
15433
 
15305
 
                        yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
 
15434
                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
15306
15435
 
15307
 
                        yy_current_state = yy_get_previous_state();
 
15436
                        yy_current_state = yy_get_previous_state(  );
15308
15437
 
15309
15438
                        /* Okay, we're now positioned to make the NUL
15310
15439
                         * transition.  We couldn't have
15317
15446
 
15318
15447
                        yy_next_state = yy_try_NUL_trans( yy_current_state );
15319
15448
 
15320
 
                        yy_bp = yytext_ptr + YY_MORE_ADJ;
 
15449
                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
15321
15450
 
15322
15451
                        if ( yy_next_state )
15323
15452
                                {
15324
15453
                                /* Consume the NUL. */
15325
 
                                yy_cp = ++yy_c_buf_p;
 
15454
                                yy_cp = ++(yy_c_buf_p);
15326
15455
                                yy_current_state = yy_next_state;
15327
15456
                                goto yy_match;
15328
15457
                                }
15329
15458
 
15330
15459
                        else
15331
15460
                                {
15332
 
                                yy_cp = yy_c_buf_p;
 
15461
                                yy_cp = (yy_c_buf_p);
15333
15462
                                goto yy_find_action;
15334
15463
                                }
15335
15464
                        }
15336
15465
 
15337
 
                else switch ( yy_get_next_buffer() )
 
15466
                else switch ( yy_get_next_buffer(  ) )
15338
15467
                        {
15339
15468
                        case EOB_ACT_END_OF_FILE:
15340
15469
                                {
15341
 
                                yy_did_buffer_switch_on_eof = 0;
 
15470
                                (yy_did_buffer_switch_on_eof) = 0;
15342
15471
 
15343
 
                                if ( yywrap() )
 
15472
                                if ( base_yywrap( ) )
15344
15473
                                        {
15345
15474
                                        /* Note: because we've taken care in
15346
15475
                                         * yy_get_next_buffer() to have set up
15347
 
                                         * yytext, we can now set up
 
15476
                                         * base_yytext, we can now set up
15348
15477
                                         * yy_c_buf_p so that if some total
15349
15478
                                         * hoser (like flex itself) wants to
15350
15479
                                         * call the scanner after we return the
15351
15480
                                         * YY_NULL, it'll still work - another
15352
15481
                                         * YY_NULL will get returned.
15353
15482
                                         */
15354
 
                                        yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
 
15483
                                        (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
15355
15484
 
15356
15485
                                        yy_act = YY_STATE_EOF(YY_START);
15357
15486
                                        goto do_action;
15359
15488
 
15360
15489
                                else
15361
15490
                                        {
15362
 
                                        if ( ! yy_did_buffer_switch_on_eof )
 
15491
                                        if ( ! (yy_did_buffer_switch_on_eof) )
15363
15492
                                                YY_NEW_FILE;
15364
15493
                                        }
15365
15494
                                break;
15366
15495
                                }
15367
15496
 
15368
15497
                        case EOB_ACT_CONTINUE_SCAN:
15369
 
                                yy_c_buf_p =
15370
 
                                        yytext_ptr + yy_amount_of_matched_text;
15371
 
 
15372
 
                                yy_current_state = yy_get_previous_state();
15373
 
 
15374
 
                                yy_cp = yy_c_buf_p;
15375
 
                                yy_bp = yytext_ptr + YY_MORE_ADJ;
 
15498
                                (yy_c_buf_p) =
 
15499
                                        (yytext_ptr) + yy_amount_of_matched_text;
 
15500
 
 
15501
                                yy_current_state = yy_get_previous_state(  );
 
15502
 
 
15503
                                yy_cp = (yy_c_buf_p);
 
15504
                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
15376
15505
                                goto yy_match;
15377
15506
 
15378
15507
                        case EOB_ACT_LAST_MATCH:
15379
 
                                yy_c_buf_p =
15380
 
                                &yy_current_buffer->yy_ch_buf[yy_n_chars];
15381
 
 
15382
 
                                yy_current_state = yy_get_previous_state();
15383
 
 
15384
 
                                yy_cp = yy_c_buf_p;
15385
 
                                yy_bp = yytext_ptr + YY_MORE_ADJ;
 
15508
                                (yy_c_buf_p) =
 
15509
                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
15510
 
 
15511
                                yy_current_state = yy_get_previous_state(  );
 
15512
 
 
15513
                                yy_cp = (yy_c_buf_p);
 
15514
                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
15386
15515
                                goto yy_find_action;
15387
15516
                        }
15388
15517
                break;
15393
15522
                        "fatal flex scanner internal error--no action found" );
15394
15523
        } /* end of action switch */
15395
15524
                } /* end of scanning one token */
15396
 
        } /* end of yylex */
15397
 
 
 
15525
} /* end of base_yylex */
15398
15526
 
15399
15527
/* yy_get_next_buffer - try to read in a new buffer
15400
15528
 *
15403
15531
 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
15404
15532
 *      EOB_ACT_END_OF_FILE - end of file
15405
15533
 */
15406
 
 
15407
 
static int yy_get_next_buffer()
15408
 
        {
15409
 
        register char *dest = yy_current_buffer->yy_ch_buf;
15410
 
        register char *source = yytext_ptr;
 
15534
static int yy_get_next_buffer (void)
 
15535
{
 
15536
        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
 
15537
        register char *source = (yytext_ptr);
15411
15538
        register int number_to_move, i;
15412
15539
        int ret_val;
15413
15540
 
15414
 
        if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
 
15541
        if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
15415
15542
                YY_FATAL_ERROR(
15416
15543
                "fatal flex scanner internal error--end of buffer missed" );
15417
15544
 
15418
 
        if ( yy_current_buffer->yy_fill_buffer == 0 )
 
15545
        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
15419
15546
                { /* Don't try to fill the buffer, so this is an EOF. */
15420
 
                if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
 
15547
                if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
15421
15548
                        {
15422
15549
                        /* We matched a single character, the EOB, so
15423
15550
                         * treat this as a final EOF.
15437
15564
        /* Try to read more data. */
15438
15565
 
15439
15566
        /* First move last chars to start of buffer. */
15440
 
        number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
 
15567
        number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
15441
15568
 
15442
15569
        for ( i = 0; i < number_to_move; ++i )
15443
15570
                *(dest++) = *(source++);
15444
15571
 
15445
 
        if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 
15572
        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
15446
15573
                /* don't do the read, it's not guaranteed to return an EOF,
15447
15574
                 * just force an EOF
15448
15575
                 */
15449
 
                yy_current_buffer->yy_n_chars = yy_n_chars = 0;
 
15576
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
15450
15577
 
15451
15578
        else
15452
15579
                {
15453
 
                int num_to_read =
15454
 
                        yy_current_buffer->yy_buf_size - number_to_move - 1;
 
15580
                        int num_to_read =
 
15581
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
15455
15582
 
15456
15583
                while ( num_to_read <= 0 )
15457
15584
                        { /* Not enough room in the buffer - grow it. */
15458
 
#ifdef YY_USES_REJECT
15459
 
                        YY_FATAL_ERROR(
15460
 
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
15461
 
#else
15462
15585
 
15463
15586
                        /* just a shorter name for the current buffer */
15464
 
                        YY_BUFFER_STATE b = yy_current_buffer;
 
15587
                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
15465
15588
 
15466
15589
                        int yy_c_buf_p_offset =
15467
 
                                (int) (yy_c_buf_p - b->yy_ch_buf);
 
15590
                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
15468
15591
 
15469
15592
                        if ( b->yy_is_our_buffer )
15470
15593
                                {
15477
15600
 
15478
15601
                                b->yy_ch_buf = (char *)
15479
15602
                                        /* Include room in for 2 EOB chars. */
15480
 
                                        yy_flex_realloc( (void *) b->yy_ch_buf,
15481
 
                                                         b->yy_buf_size + 2 );
 
15603
                                        base_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
15482
15604
                                }
15483
15605
                        else
15484
15606
                                /* Can't grow it, we don't own it. */
15488
15610
                                YY_FATAL_ERROR(
15489
15611
                                "fatal error - scanner input buffer overflow" );
15490
15612
 
15491
 
                        yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
 
15613
                        (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
15492
15614
 
15493
 
                        num_to_read = yy_current_buffer->yy_buf_size -
 
15615
                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
15494
15616
                                                number_to_move - 1;
15495
 
#endif
 
15617
 
15496
15618
                        }
15497
15619
 
15498
15620
                if ( num_to_read > YY_READ_BUF_SIZE )
15499
15621
                        num_to_read = YY_READ_BUF_SIZE;
15500
15622
 
15501
15623
                /* Read in more data. */
15502
 
                YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
15503
 
                        yy_n_chars, num_to_read );
 
15624
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
 
15625
                        (yy_n_chars), (size_t) num_to_read );
15504
15626
 
15505
 
                yy_current_buffer->yy_n_chars = yy_n_chars;
 
15627
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
15506
15628
                }
15507
15629
 
15508
 
        if ( yy_n_chars == 0 )
 
15630
        if ( (yy_n_chars) == 0 )
15509
15631
                {
15510
15632
                if ( number_to_move == YY_MORE_ADJ )
15511
15633
                        {
15512
15634
                        ret_val = EOB_ACT_END_OF_FILE;
15513
 
                        yyrestart( yyin );
 
15635
                        base_yyrestart(base_yyin  );
15514
15636
                        }
15515
15637
 
15516
15638
                else
15517
15639
                        {
15518
15640
                        ret_val = EOB_ACT_LAST_MATCH;
15519
 
                        yy_current_buffer->yy_buffer_status =
 
15641
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
15520
15642
                                YY_BUFFER_EOF_PENDING;
15521
15643
                        }
15522
15644
                }
15524
15646
        else
15525
15647
                ret_val = EOB_ACT_CONTINUE_SCAN;
15526
15648
 
15527
 
        yy_n_chars += number_to_move;
15528
 
        yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
15529
 
        yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
15530
 
 
15531
 
        yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
 
15649
        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
 
15650
                /* Extend the array by 50%, plus the number we really need. */
 
15651
                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
 
15652
                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) base_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
 
15653
                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 
15654
                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
 
15655
        }
 
15656
 
 
15657
        (yy_n_chars) += number_to_move;
 
15658
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
 
15659
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
 
15660
 
 
15661
        (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
15532
15662
 
15533
15663
        return ret_val;
15534
 
        }
15535
 
 
 
15664
}
15536
15665
 
15537
15666
/* yy_get_previous_state - get the state just before the EOB char was reached */
15538
15667
 
15539
 
static yy_state_type yy_get_previous_state()
15540
 
        {
 
15668
    static yy_state_type yy_get_previous_state (void)
 
15669
{
15541
15670
        register yy_state_type yy_current_state;
15542
15671
        register char *yy_cp;
15543
 
 
15544
 
        yy_current_state = yy_start_state_list[yy_start];
15545
 
 
15546
 
        for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
 
15672
    
 
15673
        yy_current_state = yy_start_state_list[(yy_start)];
 
15674
 
 
15675
        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
15547
15676
                {
15548
15677
                yy_current_state += yy_current_state[(*yy_cp ? YY_SC_TO_UI(*yy_cp) : 256)].yy_nxt;
15549
15678
                }
15550
15679
 
15551
15680
        return yy_current_state;
15552
 
        }
15553
 
 
 
15681
}
15554
15682
 
15555
15683
/* yy_try_NUL_trans - try to make a transition on the NUL character
15556
15684
 *
15557
15685
 * synopsis
15558
15686
 *      next_state = yy_try_NUL_trans( current_state );
15559
15687
 */
15560
 
 
15561
 
#ifdef YY_USE_PROTOS
15562
 
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
15563
 
#else
15564
 
static yy_state_type yy_try_NUL_trans( yy_current_state )
15565
 
yy_state_type yy_current_state;
15566
 
#endif
15567
 
        {
 
15688
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
 
15689
{
15568
15690
        register int yy_is_jam;
15569
 
 
 
15691
    
15570
15692
        register int yy_c = 256;
15571
15693
        register yyconst struct yy_trans_info *yy_trans_info;
15572
15694
 
15575
15697
        yy_is_jam = (yy_trans_info->yy_verify != yy_c);
15576
15698
 
15577
15699
        return yy_is_jam ? 0 : yy_current_state;
15578
 
        }
15579
 
 
15580
 
 
15581
 
#ifndef YY_NO_UNPUT
15582
 
#ifdef YY_USE_PROTOS
15583
 
static void yyunput( int c, register char *yy_bp )
15584
 
#else
15585
 
static void yyunput( c, yy_bp )
15586
 
int c;
15587
 
register char *yy_bp;
15588
 
#endif
15589
 
        {
15590
 
        register char *yy_cp = yy_c_buf_p;
15591
 
 
15592
 
        /* undo effects of setting up yytext */
15593
 
        *yy_cp = yy_hold_char;
15594
 
 
15595
 
        if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
15596
 
                { /* need to shift things up to make room */
15597
 
                /* +2 for EOB chars. */
15598
 
                register int number_to_move = yy_n_chars + 2;
15599
 
                register char *dest = &yy_current_buffer->yy_ch_buf[
15600
 
                                        yy_current_buffer->yy_buf_size + 2];
15601
 
                register char *source =
15602
 
                                &yy_current_buffer->yy_ch_buf[number_to_move];
15603
 
 
15604
 
                while ( source > yy_current_buffer->yy_ch_buf )
15605
 
                        *--dest = *--source;
15606
 
 
15607
 
                yy_cp += (int) (dest - source);
15608
 
                yy_bp += (int) (dest - source);
15609
 
                yy_current_buffer->yy_n_chars =
15610
 
                        yy_n_chars = yy_current_buffer->yy_buf_size;
15611
 
 
15612
 
                if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
15613
 
                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
15614
 
                }
15615
 
 
15616
 
        *--yy_cp = (char) c;
15617
 
 
15618
 
 
15619
 
        yytext_ptr = yy_bp;
15620
 
        yy_hold_char = *yy_cp;
15621
 
        yy_c_buf_p = yy_cp;
15622
 
        }
15623
 
#endif  /* ifndef YY_NO_UNPUT */
15624
 
 
15625
 
 
 
15700
}
 
15701
 
 
15702
#ifndef YY_NO_INPUT
15626
15703
#ifdef __cplusplus
15627
 
static int yyinput()
 
15704
    static int yyinput (void)
15628
15705
#else
15629
 
static int input()
 
15706
    static int input  (void)
15630
15707
#endif
15631
 
        {
 
15708
 
 
15709
{
15632
15710
        int c;
15633
 
 
15634
 
        *yy_c_buf_p = yy_hold_char;
15635
 
 
15636
 
        if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
 
15711
    
 
15712
        *(yy_c_buf_p) = (yy_hold_char);
 
15713
 
 
15714
        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
15637
15715
                {
15638
15716
                /* yy_c_buf_p now points to the character we want to return.
15639
15717
                 * If this occurs *before* the EOB characters, then it's a
15640
15718
                 * valid NUL; if not, then we've hit the end of the buffer.
15641
15719
                 */
15642
 
                if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
 
15720
                if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
15643
15721
                        /* This was really a NUL. */
15644
 
                        *yy_c_buf_p = '\0';
 
15722
                        *(yy_c_buf_p) = '\0';
15645
15723
 
15646
15724
                else
15647
15725
                        { /* need more input */
15648
 
                        int offset = yy_c_buf_p - yytext_ptr;
15649
 
                        ++yy_c_buf_p;
 
15726
                        int offset = (yy_c_buf_p) - (yytext_ptr);
 
15727
                        ++(yy_c_buf_p);
15650
15728
 
15651
 
                        switch ( yy_get_next_buffer() )
 
15729
                        switch ( yy_get_next_buffer(  ) )
15652
15730
                                {
15653
15731
                                case EOB_ACT_LAST_MATCH:
15654
15732
                                        /* This happens because yy_g_n_b()
15662
15740
                                         */
15663
15741
 
15664
15742
                                        /* Reset buffer status. */
15665
 
                                        yyrestart( yyin );
 
15743
                                        base_yyrestart(base_yyin );
15666
15744
 
15667
 
                                        /* fall through */
 
15745
                                        /*FALLTHROUGH*/
15668
15746
 
15669
15747
                                case EOB_ACT_END_OF_FILE:
15670
15748
                                        {
15671
 
                                        if ( yywrap() )
 
15749
                                        if ( base_yywrap( ) )
15672
15750
                                                return EOF;
15673
15751
 
15674
 
                                        if ( ! yy_did_buffer_switch_on_eof )
 
15752
                                        if ( ! (yy_did_buffer_switch_on_eof) )
15675
15753
                                                YY_NEW_FILE;
15676
15754
#ifdef __cplusplus
15677
15755
                                        return yyinput();
15681
15759
                                        }
15682
15760
 
15683
15761
                                case EOB_ACT_CONTINUE_SCAN:
15684
 
                                        yy_c_buf_p = yytext_ptr + offset;
 
15762
                                        (yy_c_buf_p) = (yytext_ptr) + offset;
15685
15763
                                        break;
15686
15764
                                }
15687
15765
                        }
15688
15766
                }
15689
15767
 
15690
 
        c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
15691
 
        *yy_c_buf_p = '\0';     /* preserve yytext */
15692
 
        yy_hold_char = *++yy_c_buf_p;
15693
 
 
 
15768
        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
 
15769
        *(yy_c_buf_p) = '\0';   /* preserve base_yytext */
 
15770
        (yy_hold_char) = *++(yy_c_buf_p);
15694
15771
 
15695
15772
        return c;
15696
 
        }
15697
 
 
15698
 
 
15699
 
#ifdef YY_USE_PROTOS
15700
 
void yyrestart( FILE *input_file )
15701
 
#else
15702
 
void yyrestart( input_file )
15703
 
FILE *input_file;
15704
 
#endif
15705
 
        {
15706
 
        if ( ! yy_current_buffer )
15707
 
                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
15708
 
 
15709
 
        yy_init_buffer( yy_current_buffer, input_file );
15710
 
        yy_load_buffer_state();
15711
 
        }
15712
 
 
15713
 
 
15714
 
#ifdef YY_USE_PROTOS
15715
 
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
15716
 
#else
15717
 
void yy_switch_to_buffer( new_buffer )
15718
 
YY_BUFFER_STATE new_buffer;
15719
 
#endif
15720
 
        {
15721
 
        if ( yy_current_buffer == new_buffer )
 
15773
}
 
15774
#endif  /* ifndef YY_NO_INPUT */
 
15775
 
 
15776
/** Immediately switch to a different input stream.
 
15777
 * @param input_file A readable stream.
 
15778
 * 
 
15779
 * @note This function does not reset the start condition to @c INITIAL .
 
15780
 */
 
15781
    void base_yyrestart  (FILE * input_file )
 
15782
{
 
15783
    
 
15784
        if ( ! YY_CURRENT_BUFFER ){
 
15785
        base_yyensure_buffer_stack ();
 
15786
                YY_CURRENT_BUFFER_LVALUE =
 
15787
            base_yy_create_buffer(base_yyin,YY_BUF_SIZE );
 
15788
        }
 
15789
 
 
15790
        base_yy_init_buffer(YY_CURRENT_BUFFER,input_file );
 
15791
        base_yy_load_buffer_state( );
 
15792
}
 
15793
 
 
15794
/** Switch to a different input buffer.
 
15795
 * @param new_buffer The new input buffer.
 
15796
 * 
 
15797
 */
 
15798
    void base_yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 
15799
{
 
15800
    
 
15801
        /* TODO. We should be able to replace this entire function body
 
15802
         * with
 
15803
         *              base_yypop_buffer_state();
 
15804
         *              base_yypush_buffer_state(new_buffer);
 
15805
     */
 
15806
        base_yyensure_buffer_stack ();
 
15807
        if ( YY_CURRENT_BUFFER == new_buffer )
15722
15808
                return;
15723
15809
 
15724
 
        if ( yy_current_buffer )
 
15810
        if ( YY_CURRENT_BUFFER )
15725
15811
                {
15726
15812
                /* Flush out information for old buffer. */
15727
 
                *yy_c_buf_p = yy_hold_char;
15728
 
                yy_current_buffer->yy_buf_pos = yy_c_buf_p;
15729
 
                yy_current_buffer->yy_n_chars = yy_n_chars;
 
15813
                *(yy_c_buf_p) = (yy_hold_char);
 
15814
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
 
15815
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
15730
15816
                }
15731
15817
 
15732
 
        yy_current_buffer = new_buffer;
15733
 
        yy_load_buffer_state();
 
15818
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
15819
        base_yy_load_buffer_state( );
15734
15820
 
15735
15821
        /* We don't actually know whether we did this switch during
15736
 
         * EOF (yywrap()) processing, but the only time this flag
15737
 
         * is looked at is after yywrap() is called, so it's safe
 
15822
         * EOF (base_yywrap()) processing, but the only time this flag
 
15823
         * is looked at is after base_yywrap() is called, so it's safe
15738
15824
         * to go ahead and always set it.
15739
15825
         */
15740
 
        yy_did_buffer_switch_on_eof = 1;
15741
 
        }
15742
 
 
15743
 
 
15744
 
#ifdef YY_USE_PROTOS
15745
 
void yy_load_buffer_state( void )
15746
 
#else
15747
 
void yy_load_buffer_state()
15748
 
#endif
15749
 
        {
15750
 
        yy_n_chars = yy_current_buffer->yy_n_chars;
15751
 
        yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
15752
 
        yyin = yy_current_buffer->yy_input_file;
15753
 
        yy_hold_char = *yy_c_buf_p;
15754
 
        }
15755
 
 
15756
 
 
15757
 
#ifdef YY_USE_PROTOS
15758
 
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
15759
 
#else
15760
 
YY_BUFFER_STATE yy_create_buffer( file, size )
15761
 
FILE *file;
15762
 
int size;
15763
 
#endif
15764
 
        {
 
15826
        (yy_did_buffer_switch_on_eof) = 1;
 
15827
}
 
15828
 
 
15829
static void base_yy_load_buffer_state  (void)
 
15830
{
 
15831
        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
 
15832
        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
 
15833
        base_yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
 
15834
        (yy_hold_char) = *(yy_c_buf_p);
 
15835
}
 
15836
 
 
15837
/** Allocate and initialize an input buffer state.
 
15838
 * @param file A readable stream.
 
15839
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 
15840
 * 
 
15841
 * @return the allocated buffer state.
 
15842
 */
 
15843
    YY_BUFFER_STATE base_yy_create_buffer  (FILE * file, int  size )
 
15844
{
15765
15845
        YY_BUFFER_STATE b;
15766
 
 
15767
 
        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
 
15846
    
 
15847
        b = (YY_BUFFER_STATE) base_yyalloc(sizeof( struct yy_buffer_state )  );
15768
15848
        if ( ! b )
15769
 
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
15849
                YY_FATAL_ERROR( "out of dynamic memory in base_yy_create_buffer()" );
15770
15850
 
15771
15851
        b->yy_buf_size = size;
15772
15852
 
15773
15853
        /* yy_ch_buf has to be 2 characters longer than the size given because
15774
15854
         * we need to put in 2 end-of-buffer characters.
15775
15855
         */
15776
 
        b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
 
15856
        b->yy_ch_buf = (char *) base_yyalloc(b->yy_buf_size + 2  );
15777
15857
        if ( ! b->yy_ch_buf )
15778
 
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
15858
                YY_FATAL_ERROR( "out of dynamic memory in base_yy_create_buffer()" );
15779
15859
 
15780
15860
        b->yy_is_our_buffer = 1;
15781
15861
 
15782
 
        yy_init_buffer( b, file );
 
15862
        base_yy_init_buffer(b,file );
15783
15863
 
15784
15864
        return b;
15785
 
        }
15786
 
 
15787
 
 
15788
 
#ifdef YY_USE_PROTOS
15789
 
void yy_delete_buffer( YY_BUFFER_STATE b )
15790
 
#else
15791
 
void yy_delete_buffer( b )
15792
 
YY_BUFFER_STATE b;
15793
 
#endif
15794
 
        {
 
15865
}
 
15866
 
 
15867
/** Destroy the buffer.
 
15868
 * @param b a buffer created with base_yy_create_buffer()
 
15869
 * 
 
15870
 */
 
15871
    void base_yy_delete_buffer (YY_BUFFER_STATE  b )
 
15872
{
 
15873
    
15795
15874
        if ( ! b )
15796
15875
                return;
15797
15876
 
15798
 
        if ( b == yy_current_buffer )
15799
 
                yy_current_buffer = (YY_BUFFER_STATE) 0;
 
15877
        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
 
15878
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
15800
15879
 
15801
15880
        if ( b->yy_is_our_buffer )
15802
 
                yy_flex_free( (void *) b->yy_ch_buf );
15803
 
 
15804
 
        yy_flex_free( (void *) b );
15805
 
        }
15806
 
 
15807
 
 
15808
 
#ifndef YY_ALWAYS_INTERACTIVE
15809
 
#ifndef YY_NEVER_INTERACTIVE
15810
 
extern int isatty YY_PROTO(( int ));
15811
 
#endif
15812
 
#endif
15813
 
 
15814
 
#ifdef YY_USE_PROTOS
15815
 
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
15816
 
#else
15817
 
void yy_init_buffer( b, file )
15818
 
YY_BUFFER_STATE b;
15819
 
FILE *file;
15820
 
#endif
15821
 
 
15822
 
 
15823
 
        {
15824
 
        yy_flush_buffer( b );
 
15881
                base_yyfree((void *) b->yy_ch_buf  );
 
15882
 
 
15883
        base_yyfree((void *) b  );
 
15884
}
 
15885
 
 
15886
/* Initializes or reinitializes a buffer.
 
15887
 * This function is sometimes called more than once on the same buffer,
 
15888
 * such as during a base_yyrestart() or at EOF.
 
15889
 */
 
15890
    static void base_yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
15891
 
 
15892
{
 
15893
        int oerrno = errno;
 
15894
    
 
15895
        base_yy_flush_buffer(b );
15825
15896
 
15826
15897
        b->yy_input_file = file;
15827
15898
        b->yy_fill_buffer = 1;
15828
15899
 
15829
 
#if YY_ALWAYS_INTERACTIVE
15830
 
        b->yy_is_interactive = 1;
15831
 
#else
15832
 
#if YY_NEVER_INTERACTIVE
15833
 
        b->yy_is_interactive = 0;
15834
 
#else
15835
 
        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
15836
 
#endif
15837
 
#endif
15838
 
        }
15839
 
 
15840
 
 
15841
 
#ifdef YY_USE_PROTOS
15842
 
void yy_flush_buffer( YY_BUFFER_STATE b )
15843
 
#else
15844
 
void yy_flush_buffer( b )
15845
 
YY_BUFFER_STATE b;
15846
 
#endif
15847
 
 
15848
 
        {
15849
 
        if ( ! b )
 
15900
    /* If b is the current buffer, then base_yy_init_buffer was _probably_
 
15901
     * called from base_yyrestart() or through yy_get_next_buffer.
 
15902
     * In that case, we don't want to reset the lineno or column.
 
15903
     */
 
15904
    if (b != YY_CURRENT_BUFFER){
 
15905
        b->yy_bs_lineno = 1;
 
15906
        b->yy_bs_column = 0;
 
15907
    }
 
15908
 
 
15909
        b->yy_is_interactive = 0;
 
15910
    
 
15911
        errno = oerrno;
 
15912
}
 
15913
 
 
15914
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 
15915
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 
15916
 * 
 
15917
 */
 
15918
    void base_yy_flush_buffer (YY_BUFFER_STATE  b )
 
15919
{
 
15920
        if ( ! b )
15850
15921
                return;
15851
15922
 
15852
15923
        b->yy_n_chars = 0;
15863
15934
        b->yy_at_bol = 1;
15864
15935
        b->yy_buffer_status = YY_BUFFER_NEW;
15865
15936
 
15866
 
        if ( b == yy_current_buffer )
15867
 
                yy_load_buffer_state();
15868
 
        }
15869
 
 
15870
 
 
15871
 
#ifndef YY_NO_SCAN_BUFFER
15872
 
#ifdef YY_USE_PROTOS
15873
 
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
15874
 
#else
15875
 
YY_BUFFER_STATE yy_scan_buffer( base, size )
15876
 
char *base;
15877
 
yy_size_t size;
15878
 
#endif
15879
 
        {
 
15937
        if ( b == YY_CURRENT_BUFFER )
 
15938
                base_yy_load_buffer_state( );
 
15939
}
 
15940
 
 
15941
/** Pushes the new state onto the stack. The new state becomes
 
15942
 *  the current state. This function will allocate the stack
 
15943
 *  if necessary.
 
15944
 *  @param new_buffer The new state.
 
15945
 *  
 
15946
 */
 
15947
void base_yypush_buffer_state (YY_BUFFER_STATE new_buffer )
 
15948
{
 
15949
        if (new_buffer == NULL)
 
15950
                return;
 
15951
 
 
15952
        base_yyensure_buffer_stack();
 
15953
 
 
15954
        /* This block is copied from base_yy_switch_to_buffer. */
 
15955
        if ( YY_CURRENT_BUFFER )
 
15956
                {
 
15957
                /* Flush out information for old buffer. */
 
15958
                *(yy_c_buf_p) = (yy_hold_char);
 
15959
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
 
15960
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 
15961
                }
 
15962
 
 
15963
        /* Only push if top exists. Otherwise, replace top. */
 
15964
        if (YY_CURRENT_BUFFER)
 
15965
                (yy_buffer_stack_top)++;
 
15966
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
15967
 
 
15968
        /* copied from base_yy_switch_to_buffer. */
 
15969
        base_yy_load_buffer_state( );
 
15970
        (yy_did_buffer_switch_on_eof) = 1;
 
15971
}
 
15972
 
 
15973
/** Removes and deletes the top of the stack, if present.
 
15974
 *  The next element becomes the new top.
 
15975
 *  
 
15976
 */
 
15977
void base_yypop_buffer_state (void)
 
15978
{
 
15979
        if (!YY_CURRENT_BUFFER)
 
15980
                return;
 
15981
 
 
15982
        base_yy_delete_buffer(YY_CURRENT_BUFFER );
 
15983
        YY_CURRENT_BUFFER_LVALUE = NULL;
 
15984
        if ((yy_buffer_stack_top) > 0)
 
15985
                --(yy_buffer_stack_top);
 
15986
 
 
15987
        if (YY_CURRENT_BUFFER) {
 
15988
                base_yy_load_buffer_state( );
 
15989
                (yy_did_buffer_switch_on_eof) = 1;
 
15990
        }
 
15991
}
 
15992
 
 
15993
/* Allocates the stack if it does not exist.
 
15994
 *  Guarantees space for at least one push.
 
15995
 */
 
15996
static void base_yyensure_buffer_stack (void)
 
15997
{
 
15998
        int num_to_alloc;
 
15999
    
 
16000
        if (!(yy_buffer_stack)) {
 
16001
 
 
16002
                /* First allocation is just for 2 elements, since we don't know if this
 
16003
                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
 
16004
                 * immediate realloc on the next call.
 
16005
         */
 
16006
                num_to_alloc = 1;
 
16007
                (yy_buffer_stack) = (struct yy_buffer_state**)base_yyalloc
 
16008
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
 
16009
                                                                );
 
16010
                if ( ! (yy_buffer_stack) )
 
16011
                        YY_FATAL_ERROR( "out of dynamic memory in base_yyensure_buffer_stack()" );
 
16012
                                                                  
 
16013
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
 
16014
                                
 
16015
                (yy_buffer_stack_max) = num_to_alloc;
 
16016
                (yy_buffer_stack_top) = 0;
 
16017
                return;
 
16018
        }
 
16019
 
 
16020
        if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
 
16021
 
 
16022
                /* Increase the buffer to prepare for a possible push. */
 
16023
                int grow_size = 8 /* arbitrary grow size */;
 
16024
 
 
16025
                num_to_alloc = (yy_buffer_stack_max) + grow_size;
 
16026
                (yy_buffer_stack) = (struct yy_buffer_state**)base_yyrealloc
 
16027
                                                                ((yy_buffer_stack),
 
16028
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
 
16029
                                                                );
 
16030
                if ( ! (yy_buffer_stack) )
 
16031
                        YY_FATAL_ERROR( "out of dynamic memory in base_yyensure_buffer_stack()" );
 
16032
 
 
16033
                /* zero only the new slots.*/
 
16034
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
 
16035
                (yy_buffer_stack_max) = num_to_alloc;
 
16036
        }
 
16037
}
 
16038
 
 
16039
/** Setup the input buffer state to scan directly from a user-specified character buffer.
 
16040
 * @param base the character buffer
 
16041
 * @param size the size in bytes of the character buffer
 
16042
 * 
 
16043
 * @return the newly allocated buffer state object. 
 
16044
 */
 
16045
YY_BUFFER_STATE base_yy_scan_buffer  (char * base, yy_size_t  size )
 
16046
{
15880
16047
        YY_BUFFER_STATE b;
15881
 
 
 
16048
    
15882
16049
        if ( size < 2 ||
15883
16050
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
15884
16051
             base[size-1] != YY_END_OF_BUFFER_CHAR )
15885
16052
                /* They forgot to leave room for the EOB's. */
15886
16053
                return 0;
15887
16054
 
15888
 
        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
 
16055
        b = (YY_BUFFER_STATE) base_yyalloc(sizeof( struct yy_buffer_state )  );
15889
16056
        if ( ! b )
15890
 
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
16057
                YY_FATAL_ERROR( "out of dynamic memory in base_yy_scan_buffer()" );
15891
16058
 
15892
16059
        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
15893
16060
        b->yy_buf_pos = b->yy_ch_buf = base;
15899
16066
        b->yy_fill_buffer = 0;
15900
16067
        b->yy_buffer_status = YY_BUFFER_NEW;
15901
16068
 
15902
 
        yy_switch_to_buffer( b );
 
16069
        base_yy_switch_to_buffer(b  );
15903
16070
 
15904
16071
        return b;
15905
 
        }
15906
 
#endif
15907
 
 
15908
 
 
15909
 
#ifndef YY_NO_SCAN_STRING
15910
 
#ifdef YY_USE_PROTOS
15911
 
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
15912
 
#else
15913
 
YY_BUFFER_STATE yy_scan_string( yy_str )
15914
 
yyconst char *yy_str;
15915
 
#endif
15916
 
        {
15917
 
        int len;
15918
 
        for ( len = 0; yy_str[len]; ++len )
15919
 
                ;
15920
 
 
15921
 
        return yy_scan_bytes( yy_str, len );
15922
 
        }
15923
 
#endif
15924
 
 
15925
 
 
15926
 
#ifndef YY_NO_SCAN_BYTES
15927
 
#ifdef YY_USE_PROTOS
15928
 
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
15929
 
#else
15930
 
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
15931
 
yyconst char *bytes;
15932
 
int len;
15933
 
#endif
15934
 
        {
 
16072
}
 
16073
 
 
16074
/** Setup the input buffer state to scan a string. The next call to base_yylex() will
 
16075
 * scan from a @e copy of @a str.
 
16076
 * @param yystr a NUL-terminated string to scan
 
16077
 * 
 
16078
 * @return the newly allocated buffer state object.
 
16079
 * @note If you want to scan bytes that may contain NUL values, then use
 
16080
 *       base_yy_scan_bytes() instead.
 
16081
 */
 
16082
YY_BUFFER_STATE base_yy_scan_string (yyconst char * yystr )
 
16083
{
 
16084
    
 
16085
        return base_yy_scan_bytes(yystr,strlen(yystr) );
 
16086
}
 
16087
 
 
16088
/** Setup the input buffer state to scan the given bytes. The next call to base_yylex() will
 
16089
 * scan from a @e copy of @a bytes.
 
16090
 * @param bytes the byte buffer to scan
 
16091
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 
16092
 * 
 
16093
 * @return the newly allocated buffer state object.
 
16094
 */
 
16095
YY_BUFFER_STATE base_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 
16096
{
15935
16097
        YY_BUFFER_STATE b;
15936
16098
        char *buf;
15937
16099
        yy_size_t n;
15938
16100
        int i;
15939
 
 
 
16101
    
15940
16102
        /* Get memory for full buffer, including space for trailing EOB's. */
15941
 
        n = len + 2;
15942
 
        buf = (char *) yy_flex_alloc( n );
 
16103
        n = _yybytes_len + 2;
 
16104
        buf = (char *) base_yyalloc(n  );
15943
16105
        if ( ! buf )
15944
 
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
15945
 
 
15946
 
        for ( i = 0; i < len; ++i )
15947
 
                buf[i] = bytes[i];
15948
 
 
15949
 
        buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
15950
 
 
15951
 
        b = yy_scan_buffer( buf, n );
 
16106
                YY_FATAL_ERROR( "out of dynamic memory in base_yy_scan_bytes()" );
 
16107
 
 
16108
        for ( i = 0; i < _yybytes_len; ++i )
 
16109
                buf[i] = yybytes[i];
 
16110
 
 
16111
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
16112
 
 
16113
        b = base_yy_scan_buffer(buf,n );
15952
16114
        if ( ! b )
15953
 
                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
16115
                YY_FATAL_ERROR( "bad buffer in base_yy_scan_bytes()" );
15954
16116
 
15955
16117
        /* It's okay to grow etc. this buffer, and we should throw it
15956
16118
         * away when we're done.
15958
16120
        b->yy_is_our_buffer = 1;
15959
16121
 
15960
16122
        return b;
15961
 
        }
15962
 
#endif
15963
 
 
15964
 
 
15965
 
#ifndef YY_NO_PUSH_STATE
15966
 
#ifdef YY_USE_PROTOS
15967
 
static void yy_push_state( int new_state )
15968
 
#else
15969
 
static void yy_push_state( new_state )
15970
 
int new_state;
15971
 
#endif
15972
 
        {
15973
 
        if ( yy_start_stack_ptr >= yy_start_stack_depth )
15974
 
                {
15975
 
                yy_size_t new_size;
15976
 
 
15977
 
                yy_start_stack_depth += YY_START_STACK_INCR;
15978
 
                new_size = yy_start_stack_depth * sizeof( int );
15979
 
 
15980
 
                if ( ! yy_start_stack )
15981
 
                        yy_start_stack = (int *) yy_flex_alloc( new_size );
15982
 
 
15983
 
                else
15984
 
                        yy_start_stack = (int *) yy_flex_realloc(
15985
 
                                        (void *) yy_start_stack, new_size );
15986
 
 
15987
 
                if ( ! yy_start_stack )
15988
 
                        YY_FATAL_ERROR(
15989
 
                        "out of memory expanding start-condition stack" );
15990
 
                }
15991
 
 
15992
 
        yy_start_stack[yy_start_stack_ptr++] = YY_START;
15993
 
 
15994
 
        BEGIN(new_state);
15995
 
        }
15996
 
#endif
15997
 
 
15998
 
 
15999
 
#ifndef YY_NO_POP_STATE
16000
 
static void yy_pop_state()
16001
 
        {
16002
 
        if ( --yy_start_stack_ptr < 0 )
16003
 
                YY_FATAL_ERROR( "start-condition stack underflow" );
16004
 
 
16005
 
        BEGIN(yy_start_stack[yy_start_stack_ptr]);
16006
 
        }
16007
 
#endif
16008
 
 
16009
 
 
16010
 
#ifndef YY_NO_TOP_STATE
16011
 
static int yy_top_state()
16012
 
        {
16013
 
        return yy_start_stack[yy_start_stack_ptr - 1];
16014
 
        }
16015
 
#endif
 
16123
}
16016
16124
 
16017
16125
#ifndef YY_EXIT_FAILURE
16018
16126
#define YY_EXIT_FAILURE 2
16019
16127
#endif
16020
16128
 
16021
 
#ifdef YY_USE_PROTOS
16022
 
static void yy_fatal_error( yyconst char msg[] )
16023
 
#else
16024
 
static void yy_fatal_error( msg )
16025
 
char msg[];
16026
 
#endif
16027
 
        {
16028
 
        (void) fprintf( stderr, "%s\n", msg );
 
16129
static void yy_fatal_error (yyconst char* msg )
 
16130
{
 
16131
        (void) fprintf( stderr, "%s\n", msg );
16029
16132
        exit( YY_EXIT_FAILURE );
16030
 
        }
16031
 
 
16032
 
 
 
16133
}
16033
16134
 
16034
16135
/* Redefine yyless() so it works in section 3 code. */
16035
16136
 
16037
16138
#define yyless(n) \
16038
16139
        do \
16039
16140
                { \
16040
 
                /* Undo effects of setting up yytext. */ \
16041
 
                yytext[yyleng] = yy_hold_char; \
16042
 
                yy_c_buf_p = yytext + n; \
16043
 
                yy_hold_char = *yy_c_buf_p; \
16044
 
                *yy_c_buf_p = '\0'; \
16045
 
                yyleng = n; \
 
16141
                /* Undo effects of setting up base_yytext. */ \
 
16142
        int yyless_macro_arg = (n); \
 
16143
        YY_LESS_LINENO(yyless_macro_arg);\
 
16144
                base_yytext[base_yyleng] = (yy_hold_char); \
 
16145
                (yy_c_buf_p) = base_yytext + yyless_macro_arg; \
 
16146
                (yy_hold_char) = *(yy_c_buf_p); \
 
16147
                *(yy_c_buf_p) = '\0'; \
 
16148
                base_yyleng = yyless_macro_arg; \
16046
16149
                } \
16047
16150
        while ( 0 )
16048
16151
 
16049
 
 
16050
 
/* Internal utility routines. */
16051
 
 
16052
 
#ifndef yytext_ptr
16053
 
#ifdef YY_USE_PROTOS
16054
 
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
 
16152
/* Accessor  methods (get/set functions) to struct members. */
 
16153
 
 
16154
/** Get the current line number.
 
16155
 * 
 
16156
 */
 
16157
int base_yyget_lineno  (void)
 
16158
{
 
16159
        
 
16160
    return base_yylineno;
 
16161
}
 
16162
 
 
16163
/** Get the input stream.
 
16164
 * 
 
16165
 */
 
16166
FILE *base_yyget_in  (void)
 
16167
{
 
16168
        return base_yyin;
 
16169
}
 
16170
 
 
16171
/** Get the output stream.
 
16172
 * 
 
16173
 */
 
16174
FILE *base_yyget_out  (void)
 
16175
{
 
16176
        return base_yyout;
 
16177
}
 
16178
 
 
16179
/** Get the length of the current token.
 
16180
 * 
 
16181
 */
 
16182
int base_yyget_leng  (void)
 
16183
{
 
16184
        return base_yyleng;
 
16185
}
 
16186
 
 
16187
/** Get the current token.
 
16188
 * 
 
16189
 */
 
16190
 
 
16191
char *base_yyget_text  (void)
 
16192
{
 
16193
        return base_yytext;
 
16194
}
 
16195
 
 
16196
/** Set the current line number.
 
16197
 * @param line_number
 
16198
 * 
 
16199
 */
 
16200
void base_yyset_lineno (int  line_number )
 
16201
{
 
16202
    
 
16203
    base_yylineno = line_number;
 
16204
}
 
16205
 
 
16206
/** Set the input stream. This does not discard the current
 
16207
 * input buffer.
 
16208
 * @param in_str A readable stream.
 
16209
 * 
 
16210
 * @see base_yy_switch_to_buffer
 
16211
 */
 
16212
void base_yyset_in (FILE *  in_str )
 
16213
{
 
16214
        base_yyin = in_str ;
 
16215
}
 
16216
 
 
16217
void base_yyset_out (FILE *  out_str )
 
16218
{
 
16219
        base_yyout = out_str ;
 
16220
}
 
16221
 
 
16222
int base_yyget_debug  (void)
 
16223
{
 
16224
        return base_yy_flex_debug;
 
16225
}
 
16226
 
 
16227
void base_yyset_debug (int  bdebug )
 
16228
{
 
16229
        base_yy_flex_debug = bdebug ;
 
16230
}
 
16231
 
 
16232
static int yy_init_globals (void)
 
16233
{
 
16234
        /* Initialization is the same as for the non-reentrant scanner.
 
16235
     * This function is called from base_yylex_destroy(), so don't allocate here.
 
16236
     */
 
16237
 
 
16238
    (yy_buffer_stack) = 0;
 
16239
    (yy_buffer_stack_top) = 0;
 
16240
    (yy_buffer_stack_max) = 0;
 
16241
    (yy_c_buf_p) = (char *) 0;
 
16242
    (yy_init) = 0;
 
16243
    (yy_start) = 0;
 
16244
 
 
16245
/* Defined in main.c */
 
16246
#ifdef YY_STDINIT
 
16247
    base_yyin = stdin;
 
16248
    base_yyout = stdout;
16055
16249
#else
16056
 
static void yy_flex_strncpy( s1, s2, n )
16057
 
char *s1;
16058
 
yyconst char *s2;
16059
 
int n;
 
16250
    base_yyin = (FILE *) 0;
 
16251
    base_yyout = (FILE *) 0;
16060
16252
#endif
16061
 
        {
 
16253
 
 
16254
    /* For future reference: Set errno on error, since we are called by
 
16255
     * base_yylex_init()
 
16256
     */
 
16257
    return 0;
 
16258
}
 
16259
 
 
16260
/* base_yylex_destroy is for both reentrant and non-reentrant scanners. */
 
16261
int base_yylex_destroy  (void)
 
16262
{
 
16263
    
 
16264
    /* Pop the buffer stack, destroying each element. */
 
16265
        while(YY_CURRENT_BUFFER){
 
16266
                base_yy_delete_buffer(YY_CURRENT_BUFFER  );
 
16267
                YY_CURRENT_BUFFER_LVALUE = NULL;
 
16268
                base_yypop_buffer_state();
 
16269
        }
 
16270
 
 
16271
        /* Destroy the stack itself. */
 
16272
        base_yyfree((yy_buffer_stack) );
 
16273
        (yy_buffer_stack) = NULL;
 
16274
 
 
16275
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
 
16276
     * base_yylex() is called, initialization will occur. */
 
16277
    yy_init_globals( );
 
16278
 
 
16279
    return 0;
 
16280
}
 
16281
 
 
16282
/*
 
16283
 * Internal utility routines.
 
16284
 */
 
16285
 
 
16286
#ifndef yytext_ptr
 
16287
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
 
16288
{
16062
16289
        register int i;
16063
16290
        for ( i = 0; i < n; ++i )
16064
16291
                s1[i] = s2[i];
16065
 
        }
 
16292
}
16066
16293
#endif
16067
16294
 
16068
16295
#ifdef YY_NEED_STRLEN
16069
 
#ifdef YY_USE_PROTOS
16070
 
static int yy_flex_strlen( yyconst char *s )
16071
 
#else
16072
 
static int yy_flex_strlen( s )
16073
 
yyconst char *s;
16074
 
#endif
16075
 
        {
 
16296
static int yy_flex_strlen (yyconst char * s )
 
16297
{
16076
16298
        register int n;
16077
16299
        for ( n = 0; s[n]; ++n )
16078
16300
                ;
16079
16301
 
16080
16302
        return n;
16081
 
        }
16082
 
#endif
16083
 
 
16084
 
 
16085
 
#ifdef YY_USE_PROTOS
16086
 
static void *yy_flex_alloc( yy_size_t size )
16087
 
#else
16088
 
static void *yy_flex_alloc( size )
16089
 
yy_size_t size;
16090
 
#endif
16091
 
        {
 
16303
}
 
16304
#endif
 
16305
 
 
16306
void *base_yyalloc (yy_size_t  size )
 
16307
{
16092
16308
        return (void *) malloc( size );
16093
 
        }
 
16309
}
16094
16310
 
16095
 
#ifdef YY_USE_PROTOS
16096
 
static void *yy_flex_realloc( void *ptr, yy_size_t size )
16097
 
#else
16098
 
static void *yy_flex_realloc( ptr, size )
16099
 
void *ptr;
16100
 
yy_size_t size;
16101
 
#endif
16102
 
        {
 
16311
void *base_yyrealloc  (void * ptr, yy_size_t  size )
 
16312
{
16103
16313
        /* The cast to (char *) in the following accommodates both
16104
16314
         * implementations that use char* generic pointers, and those
16105
16315
         * that use void* generic pointers.  It works with the latter
16108
16318
         * as though doing an assignment.
16109
16319
         */
16110
16320
        return (void *) realloc( (char *) ptr, size );
16111
 
        }
16112
 
 
16113
 
#ifdef YY_USE_PROTOS
16114
 
static void yy_flex_free( void *ptr )
16115
 
#else
16116
 
static void yy_flex_free( ptr )
16117
 
void *ptr;
16118
 
#endif
16119
 
        {
16120
 
        free( ptr );
16121
 
        }
16122
 
 
16123
 
#if YY_MAIN
16124
 
int main()
16125
 
        {
16126
 
        yylex();
16127
 
        return 0;
16128
 
        }
16129
 
#endif
 
16321
}
 
16322
 
 
16323
void base_yyfree (void * ptr )
 
16324
{
 
16325
        free( (char *) ptr );   /* see base_yyrealloc() for (char *) cast */
 
16326
}
 
16327
 
 
16328
#define YYTABLES_NAME "yytables"
 
16329
 
16130
16330
#line 849 "scan.l"
16131
16331
 
16132
16332
 
 
16333
 
16133
16334
/*
16134
16335
 * scanner_errposition
16135
16336
 *              Report a lexer or grammar error cursor position, if possible.
16202
16403
         * Might be left over after ereport()
16203
16404
         */
16204
16405
        if (YY_CURRENT_BUFFER)
16205
 
                yy_delete_buffer(YY_CURRENT_BUFFER);
 
16406
                base_yy_delete_buffer(YY_CURRENT_BUFFER);
16206
16407
 
16207
16408
        /*
16208
16409
         * Make a scan buffer with special termination needed by flex.
16210
16411
        scanbuf = palloc(slen + 2);
16211
16412
        memcpy(scanbuf, str, slen);
16212
16413
        scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
16213
 
        scanbufhandle = yy_scan_buffer(scanbuf, slen + 2);
 
16414
        scanbufhandle = base_yy_scan_buffer(scanbuf,slen + 2);
16214
16415
 
16215
16416
        /* initialize literal buffer to a reasonable but expansible size */
16216
16417
        literalalloc = 1024;
16227
16428
void
16228
16429
scanner_finish(void)
16229
16430
{
16230
 
        yy_delete_buffer(scanbufhandle);
 
16431
        base_yy_delete_buffer(scanbufhandle);
16231
16432
        pfree(scanbuf);
16232
16433
        scanbuf = NULL;
16233
16434
}
16320
16521
                || escape == '"'
16321
16522
                || scanner_isspace(escape))
16322
16523
        {
16323
 
                yylloc += literallen + yyleng + 1;
 
16524
                yylloc += literallen + base_yyleng + 1;
16324
16525
                yyerror("invalid Unicode escape character");
16325
16526
        }
16326
16527
 
16443
16644
                                 lexer_errposition()));
16444
16645
        warn_on_first_escape = false;   /* warn only once per string */
16445
16646
}
 
16647