~tapaal-ltl/verifypn/scc-optimise

« back to all changes in this revision

Viewing changes to PetriEngine/PQL/PQLQueryTokens.lexer.cpp

  • Committer: srba.jiri at gmail
  • Date: 2020-09-11 14:23:39 UTC
  • mfrom: (213.1.151 interval_tar)
  • Revision ID: srba.jiri@gmail.com-20200911142339-bq9328s1gppw24uj
merged in lp:~verifypn-maintainers/verifypn/interval_tar doing 
- Implements TAR w/o z3, but using a simple integer inference engine for Hoare logic.
 - Replaces LP-Solve with GLPK, reduces computation-time and memory overhead
 - Implements new global properties, translated into CTL formulae.

Show diffs side-by-side

added added

removed removed

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