~dexter/parrot-pkg/maverick

« back to all changes in this revision

Viewing changes to compilers/pirc/src/pirlexer.c

  • Committer: Piotr Roszatycki
  • Date: 2011-01-11 14:34:28 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: piotr.roszatycki@gmail.com-20110111143428-s7pa7qz38m61o4tw
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#line 2 "pirlexer.c"
2
 
#line 2 "pir.l"
3
 
 
4
 
/* ex: set ro ft=c:
5
 
 * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
6
 
 *
7
 
 * This file is generated automatically by the Parrot build process
8
 
 * from the file compilers/pirc/new/pir.l.
9
 
 *
10
 
 * Any changes made here will be lost!
11
 
 *
12
 
*/
13
 
 
14
 
/* HEADERIZER HFILE: none */
15
 
/* HEADERIZER STOP */
16
 
 
17
 
#ifndef __STDC_VERSION__
18
 
#  define __STDC_VERSION__ 0
19
 
#endif
20
 
 
21
 
#ifndef YY_NO_UNISTD_H
22
 
#  define YY_NO_UNISTD_H
23
 
#endif
24
 
 
25
 
/* prevent warnings on undefined #defines: */
26
 
#ifndef YY_MAIN
27
 
#  define YY_MAIN 0
28
 
#endif
29
 
 
30
 
#ifndef YY_ALWAYS_INTERACTIVE
31
 
#  define YY_ALWAYS_INTERACTIVE 0
32
 
#endif
33
 
 
34
 
#include <stdlib.h> /* for size_t */
35
 
typedef size_t yy_size_t;
36
 
#define YY_TYPEDEF_YY_SIZE_T
37
 
 
38
 
 
39
 
 
40
 
 
41
 
#line 42 "pirlexer.c"
42
 
 
43
 
#define  YY_INT_ALIGNED short int
44
 
 
45
 
/* A lexical scanner generated by flex */
46
 
 
47
 
/* %not-for-header */
48
 
 
49
 
/* %if-c-only */
50
 
/* %if-not-reentrant */
51
 
/* %endif */
52
 
/* %endif */
53
 
/* %ok-for-header */
54
 
 
55
 
#define FLEX_SCANNER
56
 
#define YY_FLEX_MAJOR_VERSION 2
57
 
#define YY_FLEX_MINOR_VERSION 5
58
 
#define YY_FLEX_SUBMINOR_VERSION 35
59
 
#if YY_FLEX_SUBMINOR_VERSION > 0
60
 
#define FLEX_BETA
61
 
#endif
62
 
 
63
 
/* %if-c++-only */
64
 
/* %endif */
65
 
 
66
 
/* %if-c-only */
67
 
    
68
 
/* %endif */
69
 
 
70
 
/* %if-c-only */
71
 
 
72
 
/* %endif */
73
 
 
74
 
/* First, we deal with  platform-specific or compiler-specific issues. */
75
 
 
76
 
/* begin standard C headers. */
77
 
/* %if-c-only */
78
 
#include <stdio.h>
79
 
#include <string.h>
80
 
#include <errno.h>
81
 
#include <stdlib.h>
82
 
/* %endif */
83
 
 
84
 
/* %if-tables-serialization */
85
 
/* %endif */
86
 
/* end standard C headers. */
87
 
 
88
 
/* %if-c-or-c++ */
89
 
/* flex integer type definitions */
90
 
 
91
 
#ifndef FLEXINT_H
92
 
#define FLEXINT_H
93
 
 
94
 
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
95
 
 
96
 
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
97
 
 
98
 
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
99
 
 * if you want the limit (max/min) macros for int types. 
100
 
 */
101
 
#ifndef __STDC_LIMIT_MACROS
102
 
#define __STDC_LIMIT_MACROS 1
103
 
#endif
104
 
 
105
 
#include <inttypes.h>
106
 
typedef int8_t flex_int8_t;
107
 
typedef uint8_t flex_uint8_t;
108
 
typedef int16_t flex_int16_t;
109
 
typedef uint16_t flex_uint16_t;
110
 
typedef int32_t flex_int32_t;
111
 
typedef uint32_t flex_uint32_t;
112
 
#else
113
 
typedef signed char flex_int8_t;
114
 
typedef short int flex_int16_t;
115
 
typedef int flex_int32_t;
116
 
typedef unsigned char flex_uint8_t; 
117
 
typedef unsigned short int flex_uint16_t;
118
 
typedef unsigned int flex_uint32_t;
119
 
#endif /* ! C99 */
120
 
 
121
 
/* Limits of integral types. */
122
 
#ifndef INT8_MIN
123
 
#define INT8_MIN               (-128)
124
 
#endif
125
 
#ifndef INT16_MIN
126
 
#define INT16_MIN              (-32767-1)
127
 
#endif
128
 
#ifndef INT32_MIN
129
 
#define INT32_MIN              (-2147483647-1)
130
 
#endif
131
 
#ifndef INT8_MAX
132
 
#define INT8_MAX               (127)
133
 
#endif
134
 
#ifndef INT16_MAX
135
 
#define INT16_MAX              (32767)
136
 
#endif
137
 
#ifndef INT32_MAX
138
 
#define INT32_MAX              (2147483647)
139
 
#endif
140
 
#ifndef UINT8_MAX
141
 
#define UINT8_MAX              (255U)
142
 
#endif
143
 
#ifndef UINT16_MAX
144
 
#define UINT16_MAX             (65535U)
145
 
#endif
146
 
#ifndef UINT32_MAX
147
 
#define UINT32_MAX             (4294967295U)
148
 
#endif
149
 
 
150
 
#endif /* ! FLEXINT_H */
151
 
 
152
 
/* %endif */
153
 
 
154
 
/* %if-c++-only */
155
 
/* %endif */
156
 
 
157
 
#ifdef __cplusplus
158
 
 
159
 
/* The "const" storage-class-modifier is valid. */
160
 
#define YY_USE_CONST
161
 
 
162
 
#else   /* ! __cplusplus */
163
 
 
164
 
/* C99 requires __STDC__ to be defined as 1. */
165
 
#if defined (__STDC__)
166
 
 
167
 
#define YY_USE_CONST
168
 
 
169
 
#endif  /* defined (__STDC__) */
170
 
#endif  /* ! __cplusplus */
171
 
 
172
 
#ifdef YY_USE_CONST
173
 
#define yyconst const
174
 
#else
175
 
#define yyconst
176
 
#endif
177
 
 
178
 
/* %not-for-header */
179
 
 
180
 
/* Returned upon end-of-file. */
181
 
#define YY_NULL 0
182
 
/* %ok-for-header */
183
 
 
184
 
/* %not-for-header */
185
 
 
186
 
/* Promotes a possibly negative, possibly signed char to an unsigned
187
 
 * integer for use as an array index.  If the signed char is negative,
188
 
 * we want to instead treat it as an 8-bit unsigned char, hence the
189
 
 * double cast.
190
 
 */
191
 
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
192
 
/* %ok-for-header */
193
 
 
194
 
/* %if-reentrant */
195
 
 
196
 
/* An opaque pointer. */
197
 
#ifndef YY_TYPEDEF_YY_SCANNER_T
198
 
#define YY_TYPEDEF_YY_SCANNER_T
199
 
typedef void* yyscan_t;
200
 
#endif
201
 
 
202
 
/* For convenience, these vars (plus the bison vars far below)
203
 
   are macros in the reentrant scanner. */
204
 
#define yyin yyg->yyin_r
205
 
#define yyout yyg->yyout_r
206
 
#define yyextra yyg->yyextra_r
207
 
#define yyleng yyg->yyleng_r
208
 
#define yytext yyg->yytext_r
209
 
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
210
 
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
211
 
#define yy_flex_debug yyg->yy_flex_debug_r
212
 
 
213
 
/* %endif */
214
 
 
215
 
/* %if-not-reentrant */
216
 
/* %endif */
217
 
 
218
 
/* Enter a start condition.  This macro really ought to take a parameter,
219
 
 * but we do it the disgusting crufty way forced on us by the ()-less
220
 
 * definition of BEGIN.
221
 
 */
222
 
#define BEGIN yyg->yy_start = 1 + 2 *
223
 
 
224
 
/* Translate the current start state into a value that can be later handed
225
 
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
226
 
 * compatibility.
227
 
 */
228
 
#define YY_START ((yyg->yy_start - 1) / 2)
229
 
#define YYSTATE YY_START
230
 
 
231
 
/* Action number for EOF rule of a given start state. */
232
 
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
233
 
 
234
 
/* Special action meaning "start processing a new file". */
235
 
#define YY_NEW_FILE yypirrestart(yyin ,yyscanner )
236
 
 
237
 
#define YY_END_OF_BUFFER_CHAR 0
238
 
 
239
 
/* Size of default input buffer. */
240
 
#ifndef YY_BUF_SIZE
241
 
#define YY_BUF_SIZE 16384
242
 
#endif
243
 
 
244
 
/* The state buf must be large enough to hold one state per character in the main buffer.
245
 
 */
246
 
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
247
 
 
248
 
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
249
 
#define YY_TYPEDEF_YY_BUFFER_STATE
250
 
typedef struct yy_buffer_state *YY_BUFFER_STATE;
251
 
#endif
252
 
 
253
 
#ifndef YY_TYPEDEF_YY_SIZE_T
254
 
#define YY_TYPEDEF_YY_SIZE_T
255
 
typedef size_t yy_size_t;
256
 
#endif
257
 
 
258
 
/* %if-not-reentrant */
259
 
/* %endif */
260
 
 
261
 
/* %if-c-only */
262
 
/* %if-not-reentrant */
263
 
/* %endif */
264
 
/* %endif */
265
 
 
266
 
#define EOB_ACT_CONTINUE_SCAN 0
267
 
#define EOB_ACT_END_OF_FILE 1
268
 
#define EOB_ACT_LAST_MATCH 2
269
 
 
270
 
    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
271
 
     *       access to the local variable yy_act. Since yyless() is a macro, it would break
272
 
     *       existing scanners that call yyless() from OUTSIDE yypirlex. 
273
 
     *       One obvious solution it to make yy_act a global. I tried that, and saw
274
 
     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
275
 
     *       normally declared as a register variable-- so it is not worth it.
276
 
     */
277
 
    #define  YY_LESS_LINENO(n) \
278
 
            do { \
279
 
                int yyl;\
280
 
                for ( yyl = n; yyl < yyleng; ++yyl )\
281
 
                    if ( yytext[yyl] == '\n' )\
282
 
                        --yylineno;\
283
 
            }while(0)
284
 
    
285
 
/* Return all but the first "n" matched characters back to the input stream. */
286
 
#define yyless(n) \
287
 
        do \
288
 
                { \
289
 
                /* Undo effects of setting up yytext. */ \
290
 
        int yyless_macro_arg = (n); \
291
 
        YY_LESS_LINENO(yyless_macro_arg);\
292
 
                *yy_cp = yyg->yy_hold_char; \
293
 
                YY_RESTORE_YY_MORE_OFFSET \
294
 
                yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
295
 
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
296
 
                } \
297
 
        while ( 0 )
298
 
 
299
 
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
300
 
 
301
 
#ifndef YY_STRUCT_YY_BUFFER_STATE
302
 
#define YY_STRUCT_YY_BUFFER_STATE
303
 
struct yy_buffer_state
304
 
        {
305
 
/* %if-c-only */
306
 
        FILE *yy_input_file;
307
 
/* %endif */
308
 
 
309
 
/* %if-c++-only */
310
 
/* %endif */
311
 
 
312
 
        char *yy_ch_buf;                /* input buffer */
313
 
        char *yy_buf_pos;               /* current position in input buffer */
314
 
 
315
 
        /* Size of input buffer in bytes, not including room for EOB
316
 
         * characters.
317
 
         */
318
 
        yy_size_t yy_buf_size;
319
 
 
320
 
        /* Number of characters read into yy_ch_buf, not including EOB
321
 
         * characters.
322
 
         */
323
 
        yy_size_t yy_n_chars;
324
 
 
325
 
        /* Whether we "own" the buffer - i.e., we know we created it,
326
 
         * and can realloc() it to grow it, and should free() it to
327
 
         * delete it.
328
 
         */
329
 
        int yy_is_our_buffer;
330
 
 
331
 
        /* Whether this is an "interactive" input source; if so, and
332
 
         * if we're using stdio for input, then we want to use getc()
333
 
         * instead of fread(), to make sure we stop fetching input after
334
 
         * each newline.
335
 
         */
336
 
        int yy_is_interactive;
337
 
 
338
 
        /* Whether we're considered to be at the beginning of a line.
339
 
         * If so, '^' rules will be active on the next match, otherwise
340
 
         * not.
341
 
         */
342
 
        int yy_at_bol;
343
 
 
344
 
    int yy_bs_lineno; /**< The line count. */
345
 
    int yy_bs_column; /**< The column count. */
346
 
    
347
 
        /* Whether to try to fill the input buffer when we reach the
348
 
         * end of it.
349
 
         */
350
 
        int yy_fill_buffer;
351
 
 
352
 
        int yy_buffer_status;
353
 
 
354
 
#define YY_BUFFER_NEW 0
355
 
#define YY_BUFFER_NORMAL 1
356
 
        /* When an EOF's been seen but there's still some text to process
357
 
         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
358
 
         * shouldn't try reading from the input source any more.  We might
359
 
         * still have a bunch of tokens to match, though, because of
360
 
         * possible backing-up.
361
 
         *
362
 
         * When we actually see the EOF, we change the status to "new"
363
 
         * (via yypirrestart()), so that the user can continue scanning by
364
 
         * just pointing yyin at a new input file.
365
 
         */
366
 
#define YY_BUFFER_EOF_PENDING 2
367
 
 
368
 
        };
369
 
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
370
 
 
371
 
/* %if-c-only Standard (non-C++) definition */
372
 
/* %not-for-header */
373
 
 
374
 
/* %if-not-reentrant */
375
 
/* %endif */
376
 
/* %ok-for-header */
377
 
 
378
 
/* %endif */
379
 
 
380
 
/* We provide macros for accessing buffer states in case in the
381
 
 * future we want to put the buffer states in a more general
382
 
 * "scanner state".
383
 
 *
384
 
 * Returns the top of the stack, or NULL.
385
 
 */
386
 
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
387
 
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
388
 
                          : NULL)
389
 
 
390
 
/* Same as previous macro, but useful when we know that the buffer stack is not
391
 
 * NULL or when we need an lvalue. For internal use only.
392
 
 */
393
 
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
394
 
 
395
 
/* %if-c-only Standard (non-C++) definition */
396
 
 
397
 
/* %if-not-reentrant */
398
 
/* %not-for-header */
399
 
 
400
 
/* %ok-for-header */
401
 
 
402
 
/* %endif */
403
 
 
404
 
void yypirrestart (FILE *input_file ,yyscan_t yyscanner );
405
 
void yypir_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
406
 
YY_BUFFER_STATE yypir_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
407
 
void yypir_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
408
 
void yypir_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
409
 
void yypirpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
410
 
void yypirpop_buffer_state (yyscan_t yyscanner );
411
 
 
412
 
static void yypirensure_buffer_stack (yyscan_t yyscanner );
413
 
static void yypir_load_buffer_state (yyscan_t yyscanner );
414
 
static void yypir_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
415
 
 
416
 
#define YY_FLUSH_BUFFER yypir_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
417
 
 
418
 
YY_BUFFER_STATE yypir_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
419
 
YY_BUFFER_STATE yypir_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
420
 
YY_BUFFER_STATE yypir_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
421
 
 
422
 
/* %endif */
423
 
 
424
 
void *yypiralloc (yy_size_t ,yyscan_t yyscanner );
425
 
void *yypirrealloc (void *,yy_size_t ,yyscan_t yyscanner );
426
 
void yypirfree (void * ,yyscan_t yyscanner );
427
 
 
428
 
#define yy_new_buffer yypir_create_buffer
429
 
 
430
 
#define yy_set_interactive(is_interactive) \
431
 
        { \
432
 
        if ( ! YY_CURRENT_BUFFER ){ \
433
 
        yypirensure_buffer_stack (yyscanner); \
434
 
                YY_CURRENT_BUFFER_LVALUE =    \
435
 
            yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
436
 
        } \
437
 
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
438
 
        }
439
 
 
440
 
#define yy_set_bol(at_bol) \
441
 
        { \
442
 
        if ( ! YY_CURRENT_BUFFER ){\
443
 
        yypirensure_buffer_stack (yyscanner); \
444
 
                YY_CURRENT_BUFFER_LVALUE =    \
445
 
            yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
446
 
        } \
447
 
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
448
 
        }
449
 
 
450
 
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
451
 
 
452
 
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
453
 
/* Begin user sect3 */
454
 
 
455
 
#define yypirwrap(n) 1
456
 
#define YY_SKIP_YYWRAP
457
 
 
458
 
#define FLEX_DEBUG
459
 
 
460
 
typedef unsigned char YY_CHAR;
461
 
 
462
 
typedef int yy_state_type;
463
 
 
464
 
#define yytext_ptr yytext_r
465
 
 
466
 
/* %if-c-only Standard (non-C++) definition */
467
 
 
468
 
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
469
 
static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
470
 
static int yy_get_next_buffer (yyscan_t yyscanner );
471
 
static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
472
 
 
473
 
/* %endif */
474
 
 
475
 
/* Done after the current pattern has been matched and before the
476
 
 * corresponding action - sets up yytext.
477
 
 */
478
 
#define YY_DO_BEFORE_ACTION \
479
 
        yyg->yytext_ptr = yy_bp; \
480
 
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
481
 
        yyleng = (size_t) (yy_cp - yy_bp); \
482
 
        yyg->yy_hold_char = *yy_cp; \
483
 
        *yy_cp = '\0'; \
484
 
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
485
 
        yyg->yy_c_buf_p = yy_cp;
486
 
 
487
 
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
488
 
#define YY_NUM_RULES 209
489
 
#define YY_END_OF_BUFFER 210
490
 
/* This struct is not used in this scanner,
491
 
   but its presence is necessary. */
492
 
struct yy_trans_info
493
 
        {
494
 
        flex_int32_t yy_verify;
495
 
        flex_int32_t yy_nxt;
496
 
        };
497
 
static yyconst flex_int16_t yy_accept[825] =
498
 
    {   0,
499
 
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
500
 
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
501
 
        0,    0,    0,    0,  210,  129,    2,    4,    2,   25,
502
 
      129,  129,  129,   22,  129,  129,   28,   29,   23,   21,
503
 
       30,   27,  129,   24,  122,  122,  129,   35,   15,   34,
504
 
       16,  120,  120,   31,   32,  120,  120,  120,  120,  120,
505
 
      120,  129,   26,  209,  136,  141,  136,  138,  139,  140,
506
 
      137,  175,  173,  175,  175,  167,  165,  166,  165,  167,
507
 
      161,  161,  161,  161,  161,  170,  209,  209,  209,  154,
508
 
      146,  153,  146,  154,  154,  154,  148,  149,  154,  147,
509
 
 
510
 
      154,  150,  150,  144,  151,  152,  134,  133,  134,  134,
511
 
      134,  134,  134,  132,  132,  131,  129,  129,  120,  120,
512
 
      120,  120,  120,  120,  120,  120,  209,  209,  209,  209,
513
 
      150,  150,    1,  208,  206,  207,  206,  208,  208,  208,
514
 
      208,  176,  208,  201,  201,  208,  199,  199,  199,  199,
515
 
      199,  177,  178,    0,    4,    4,   12,    0,  110,    0,
516
 
        0,    3,    0,    0,    0,    0,    0,   40,   18,   43,
517
 
        0,  111,    0,   39,    0,  122,   36,   37,  126,  121,
518
 
       46,  126,  126,  142,  126,  126,  126,  126,  126,  126,
519
 
      126,  126,  126,  126,  126,  126,  126,  126,  126,   17,
520
 
 
521
 
       38,  121,    0,    0,    0,    0,  109,  109,  109,  109,
522
 
      109,  109,  109,  109,  109,  109,  109,  109,    9,   13,
523
 
       11,   10,   14,    8,    0,  120,  118,  119,  120,   47,
524
 
      120,  120,  120,  120,  120,   42,   19,   45,   20,  141,
525
 
      141,  137,  173,  173,    0,    0,    0,  166,  166,  162,
526
 
      161,  161,  161,  161,  161,  170,  170,    0,    0,  169,
527
 
      153,  153,    0,  150,    0,    0,    0,    0,  150,  150,
528
 
      143,  150,    0,    0,    0,    0,  144,    0,  132,    0,
529
 
        0,    0,    0,  132,  132,  132,    0,    0,    0,    0,
530
 
      131,    0,    0,    0,    0,    0,  126,  120,  128,  119,
531
 
 
532
 
      120,   47,  120,  120,  120,  120,  120,  207,  207,    0,
533
 
      205,    0,    0,    0,    0,  201,  200,  192,  192,  192,
534
 
      192,  192,  192,  200,    0,    0,    0,    0,    0,    0,
535
 
        0,    0,    0,  199,  193,  197,  196,  195,  198,  127,
536
 
       33,    3,  117,  116,  114,  115,   41,    0,  142,  142,
537
 
      142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
538
 
      142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
539
 
      142,  142,   44,  121,  124,    0,  121,  125,  123,  109,
540
 
      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
541
 
      109,  109,  109,  109,  109,  109,  109,  109,    7,    6,
542
 
 
543
 
        0,    0,    0,  120,   51,  120,   52,   53,  120,  120,
544
 
        0,    0,    0,  162,  157,  159,  158,  161,  145,    0,
545
 
      143,  150,  150,    0,  150,  150,  150,  132,    0,  132,
546
 
      132,    0,  132,  132,  132,    0,  164,  117,  116,  114,
547
 
      115,  163,  171,  120,   51,  120,   52,   53,  120,  120,
548
 
      194,    0,  192,  192,  192,  192,  192,  192,  192,  200,
549
 
      203,    0,  200,  204,  202,    0,    0,    0,    0,    0,
550
 
        0,    0,  121,   62,  142,  142,  142,  142,   58,  142,
551
 
      142,  142,  142,   64,  142,  142,  142,  142,  142,  142,
552
 
      142,  142,  142,  142,   81,  142,  142,  109,  109,  109,
553
 
 
554
 
      109,  109,  109,   94,  109,  109,  109,  109,  109,  109,
555
 
      109,  109,  109,  109,  109,  109,  109,  109,    5,    0,
556
 
      112,    0,    0,    0,   48,   50,  120,  120,    0,    0,
557
 
        0,  161,    0,  150,    0,  132,  172,  163,   48,   50,
558
 
      120,  120,    0,  200,  192,  186,  192,  192,  192,  192,
559
 
        0,    0,    0,    0,    0,    0,  142,  142,   75,  142,
560
 
      142,   86,   59,  142,  142,  142,   65,  142,  142,  142,
561
 
      142,  142,  142,  142,  142,  142,  142,  142,   87,  106,
562
 
      109,   88,  109,  109,   89,  109,   92,  109,  109,  109,
563
 
      109,  109,  109,  109,  109,  109,  109,  109,  109,    0,
564
 
 
565
 
      120,  120,  174,    0,    0,  161,  120,  120,  191,  190,
566
 
      192,  192,  192,  182,    0,  181,  180,  179,    0,  142,
567
 
      142,   57,  142,  142,  142,  142,  142,  142,  142,   67,
568
 
      135,  142,  142,  142,   71,  142,  142,  142,  142,  142,
569
 
       82,  109,  109,  109,  109,  109,   97,  105,  109,  109,
570
 
      109,   95,  109,  109,   98,  109,  109,    0,  113,    0,
571
 
       54,   49,  155,    0,  160,   54,   49,  188,  192,  192,
572
 
        0,    0,  142,  142,  142,  142,  142,  142,  142,  142,
573
 
      142,  142,  142,  142,  142,   80,  142,  142,  142,  142,
574
 
      109,  109,  109,  109,   93,  109,  109,  109,  109,  104,
575
 
 
576
 
      109,   96,    0,  192,  192,  192,    0,    0,  142,  142,
577
 
      142,  142,  142,  142,  142,  142,  142,  142,   66,  142,
578
 
      142,  142,  142,  142,   56,  142,  142,  142,  109,  109,
579
 
      109,  109,  100,  109,  109,  109,  109,    0,  192,  192,
580
 
      185,    0,    0,   55,  142,  142,  142,   76,  142,  142,
581
 
      142,  142,   63,  142,  142,  142,  142,  142,   70,  142,
582
 
      142,   85,  109,  109,  107,  109,  103,  102,   90,  109,
583
 
        0,    0,  192,  192,    0,  183,  142,  142,  142,  142,
584
 
       78,  142,  142,  142,  142,  142,   68,   69,  142,   84,
585
 
       91,  109,  108,  109,    0,    0,  192,  187,  184,   72,
586
 
 
587
 
      142,  142,   77,   79,  142,  142,  142,  142,   83,   99,
588
 
      101,    0,    0,  192,  142,   74,   60,   61,  130,  168,
589
 
      156,  189,   73,    0
590
 
    } ;
591
 
 
592
 
static yyconst flex_int32_t yy_ec[256] =
593
 
    {   0,
594
 
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
595
 
        1,    4,    5,    1,    1,    1,    1,    1,    1,    1,
596
 
        1,    1,    1,    1,    1,    4,    1,    1,    1,    1,
597
 
        1,    2,    6,    7,    8,    9,   10,   11,   12,   13,
598
 
       14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
599
 
       23,   23,   23,   23,   23,   24,   24,   25,   26,   27,
600
 
       28,   29,    1,   30,   31,   32,   31,   31,   33,   31,
601
 
       34,   35,   36,   34,   34,   37,   34,   38,   39,   40,
602
 
       34,   34,   41,   34,   34,   34,   42,   43,   34,   34,
603
 
       44,   45,   46,    1,   47,    1,   48,   49,   50,   51,
604
 
 
605
 
       52,   53,   54,   55,   56,   34,   57,   58,   59,   60,
606
 
       61,   62,   63,   64,   65,   66,   67,   68,   34,   69,
607
 
       70,   34,   71,   72,   73,   74,    1,    1,    1,    1,
608
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
609
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
610
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
611
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
612
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
613
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
614
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
615
 
 
616
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
617
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
618
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
619
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
620
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
621
 
        1,    1,    1,    1,    1
622
 
    } ;
623
 
 
624
 
static yyconst flex_int32_t yy_meta[75] =
625
 
    {   0,
626
 
        1,    1,    2,    1,    1,    1,    3,    1,    1,    1,
627
 
        1,    1,    1,    1,    1,    1,    1,    4,    1,    1,
628
 
        5,    5,    5,    5,    6,    1,    1,    1,    1,    7,
629
 
        8,    8,    8,    9,    9,    9,    9,    9,    9,    9,
630
 
       10,   10,    9,    1,    1,    1,    9,    8,    8,    8,
631
 
        8,    8,    8,    9,    9,    9,    9,    9,    9,    9,
632
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
633
 
       11,    1,   11,    1
634
 
    } ;
635
 
 
636
 
static yyconst flex_int16_t yy_base[885] =
637
 
    {   0,
638
 
        0,    0,   74,    0,  146,  147,  166,    0,  240,    0,
639
 
      314,    0,  388,    0,    0,    0,  462,    0,  530,  543,
640
 
        0,    0,  567,    0, 2392, 2393, 2372,  151,  537, 2362,
641
 
      635,  152,  122, 2361,  530, 2376, 2393, 2393,  529,  624,
642
 
     2393,  632,  674,  519,  726,  640,  723, 2393,  622,  629,
643
 
      637,  520,  653, 2393, 2393,  728,  739,  736,  737,  654,
644
 
      738,  616,  723, 2393, 2393,  665, 2384, 2393, 2393, 2393,
645
 
        0, 2393,  682, 2383,  641, 2393, 2393,  765, 2382,    0,
646
 
        0, 2324, 2316, 2323, 2315,  799, 2377,    0, 2354, 2393,
647
 
     2393,  803, 2375,  765,  771, 2365, 2393, 2393,  794, 2393,
648
 
 
649
 
      798,  804,  811,    0, 2393, 2393, 2393, 2393,  779,  810,
650
 
     2364,  836,  817,  855,  847,    0,  845, 2366,  664,  887,
651
 
      866,  872,  888,  901,  903,  904,  786, 2362,  916,  920,
652
 
        0,  926, 2393, 2393, 2393,  859, 2370,  807,  916, 2360,
653
 
      944, 2393,  949,  993,  958,  927, 2346,  971,  976,  997,
654
 
     1006, 2393, 2393,  699,  890,  898, 2393,  822, 2393,    0,
655
 
      156, 1001,  948, 1016, 1025, 1029, 1034, 2393, 2393, 2393,
656
 
     2358, 2393, 2341, 2393, 1042, 1048, 2393, 2393, 2393, 1052,
657
 
     2393,    0, 2331,    0, 2307, 2314,  712, 2305, 2308,  722,
658
 
     2303,  793,  910,  926, 2314, 2309,  863, 2312, 2303, 2330,
659
 
 
660
 
     2393, 1056,  669, 1070, 1012,    0,    0, 2297, 2298,  659,
661
 
      862, 1035,  495, 1028, 2294,  946, 2294, 2287, 2393, 2393,
662
 
     2393, 2393, 2393,  959, 2327,  857, 2344, 1088, 1078, 1043,
663
 
     1080, 1089, 1099, 1097, 1098, 2393, 2393, 2393, 2393, 1116,
664
 
     1123,    0, 1127, 1131, 2290, 2288, 2300, 1135, 1140,    0,
665
 
        0, 2281, 2287, 2295, 2280, 1148, 1152, 2318, 2317, 2393,
666
 
     1157, 1161,  939, 2393,    0, 1146, 2329, 1150, 1156, 1160,
667
 
        0, 1164, 1002, 1178, 1169,    0,    0, 1037, 2393,    0,
668
 
     1182, 2328, 1196, 1202, 1206, 1210, 1038, 1224, 1188,    0,
669
 
        0, 2309, 1229, 1242, 1246, 1256,    0, 1219, 2313, 1266,
670
 
 
671
 
     1267, 1275, 1276, 1277, 1290, 1286, 1294, 1320, 1324, 1090,
672
 
     2393,    0, 1322, 2325, 1332, 1338, 1342,    0, 2280, 1075,
673
 
     2287, 2286, 2283, 1346, 1192, 1360, 1234,    0, 2272, 1201,
674
 
     2270, 2282, 2268, 2303, 2393, 1364, 1378, 1383, 1388, 2393,
675
 
     2393, 1269, 1393, 1397, 1401, 1405, 2393, 1414,    0, 2290,
676
 
     2266, 2271, 2266, 2263, 2271, 2263, 2254, 2258, 2250, 2248,
677
 
     2256,  993, 2265, 2248, 2254, 2256, 2247, 2244, 2243, 2259,
678
 
     2251, 2254, 2393, 1418, 1260, 1422, 1426, 1309,    0,    0,
679
 
     2244, 2256, 2244, 1253, 2233, 1091, 2245, 2234, 2241, 2239,
680
 
     2245, 2230, 2229, 2229, 2226, 2243, 2235, 2242, 2393, 2261,
681
 
 
682
 
     2281, 1113, 2262, 1316, 1197, 1333, 1285, 1355, 1434, 1435,
683
 
     2235, 2235, 2234,    0,    0,    0,    0, 2227, 1433, 1445,
684
 
        0, 1450, 1277, 1454, 1458, 1316,    0, 1470, 1482, 1486,
685
 
     1292, 1490, 1494, 1326,    0, 2252, 2256, 1499, 1503, 1513,
686
 
     1518,    0, 2393, 1471, 1526, 1527, 1528, 1529, 1537, 1543,
687
 
     1542, 1553,    0, 2222, 2210, 2218, 2227, 2217, 2225, 1557,
688
 
     1371, 1565, 1575, 1374,    0, 2213, 2214, 2216, 2223, 2214,
689
 
     2204, 1579, 1583,    0, 2207, 2211, 2208, 2200, 1148, 2212,
690
 
     2216, 2213, 2200,    0, 2208, 2208, 2210, 2193, 2201, 2203,
691
 
     2207, 2205, 2185, 2204,    0, 2192, 2191, 2188, 2181, 2194,
692
 
 
693
 
     2179, 2178, 2182,    0, 2191, 2184, 2180, 2184, 2172, 2185,
694
 
     2176, 1439, 2183, 2168, 2169, 2176, 2168, 2181, 2393, 1191,
695
 
     2393,    0, 2204, 2221, 1440, 1566, 1590, 1592, 2168, 2178,
696
 
     2161, 2164, 1590, 1597, 1601, 1605, 2393,    0, 1612, 1613,
697
 
     1614, 1615, 1625, 1630, 2171,    0, 2170, 2157, 2168, 2172,
698
 
     2158, 2165, 2150, 2164, 2154, 2147, 2146, 2151,    0, 2144,
699
 
     1591,    0,    0, 2145, 2160, 2157,    0, 2148, 2147, 2143,
700
 
     2156, 2137, 2151, 2141, 2135, 1608, 2148, 2146,    0,    0,
701
 
     2145,    0, 2147, 2144,    0, 2145,    0, 2131, 2135, 2139,
702
 
     2123, 2135, 2126, 2122, 2135, 2122, 2132, 2115, 2123, 1628,
703
 
 
704
 
     1640, 1641, 2393, 2122, 2118, 2124, 1645, 1646,    0,    0,
705
 
     2116, 2111, 2110, 2393, 2123, 2393, 2393, 2393, 2123, 2124,
706
 
     2124,    0, 2122, 2117, 2112, 2115, 2108, 2108, 2095,    0,
707
 
     2103, 2095, 2076, 2077,    0, 2060, 2052, 2063, 2054, 2061,
708
 
        0, 2042, 2027, 2023, 2011, 2014,    0,    0, 1998, 2003,
709
 
     1990,    0, 1978, 1964,    0, 1981, 1978, 1653, 2393,    0,
710
 
     1644, 1659, 2393, 1982,    0, 1661, 1663, 1977, 1961, 1951,
711
 
     1956, 1950, 1940, 1632, 1947, 1934, 1947, 1929, 1943, 1932,
712
 
     1942, 1225, 1938, 1931, 1914,    0, 1917, 1902, 1915, 1904,
713
 
     1913, 1900, 1868, 1862,    0, 1838, 1859, 1848, 1826,    0,
714
 
 
715
 
     1823,    0, 1811, 1808, 1799, 1793, 1793, 1777, 1783, 1776,
716
 
     1761, 1752, 1741, 1731, 1732, 1722, 1723, 1702,    0, 1685,
717
 
     1436, 1652, 1659, 1650,    0, 1640, 1647, 1646, 1637, 1649,
718
 
     1634, 1649,    0, 1641, 1634, 1628, 1625, 1522, 1626, 1635,
719
 
        0, 1617, 1606,    0, 1609, 1570, 1582,    0, 1552, 1543,
720
 
     1534, 1522,    0, 1512, 1511, 1500, 1491, 1479,    0, 1466,
721
 
     1477,    0, 1447, 1427,    0, 1434,    0,    0,    0, 1412,
722
 
     1413, 1384, 1373, 1379, 1322, 2393, 1314, 1261, 1259, 1181,
723
 
        0, 1172, 1111, 1100, 1089, 1053,    0,    0, 1039,    0,
724
 
        0, 1031,    0,  936,  909,  888,  855,    0, 2393,    0,
725
 
 
726
 
      825,  821,    0,  777,  734,  728,  719,  708,    0,    0,
727
 
        0,  694,  611,  497,  104,    0,    0,    0,    0, 2393,
728
 
     2393,    0,    0, 2393, 1711, 1722, 1733, 1744, 1755, 1766,
729
 
     1770, 1777, 1783, 1786, 1792, 1795, 1801, 1811, 1822, 1829,
730
 
     1835, 1845, 1856, 1863, 1866, 1873, 1883, 1894, 1901, 1907,
731
 
     1917, 1926, 1937, 1948, 1955, 1961, 1965, 1972, 1979, 1987,
732
 
     1993, 1999, 2005, 2011, 2017, 2023, 2027, 2037, 2048, 2055,
733
 
     2059, 2065, 2068, 2075, 2085, 2096, 2103, 2109, 2113, 2123,
734
 
     2131, 2138, 2144, 2154
735
 
    } ;
736
 
 
737
 
static yyconst flex_int16_t yy_def[885] =
738
 
    {   0,
739
 
      824,    1,  824,    3,  825,  825,  824,    7,  824,    9,
740
 
      824,   11,  824,   13,    1,    1,  824,   17,  826,  826,
741
 
      827,  827,  824,   23,  824,  824,  824,  824,  824,  824,
742
 
      828,  829,  824,  824,  824,  830,  824,  824,  824,  824,
743
 
      824,  824,  824,  824,  824,  824,  831,  824,  824,  824,
744
 
      824,  832,  832,  824,  824,  832,  832,  832,  832,  832,
745
 
      832,  824,  824,  824,  824,  824,  824,  824,  824,  824,
746
 
      833,  824,  824,  824,  824,  824,  824,  824,  824,  834,
747
 
      835,  835,  835,  835,  835,  824,  824,  836,  837,  824,
748
 
      824,  824,  824,  838,  824,  839,  824,  824,  824,  824,
749
 
 
750
 
      840,  824,  824,  841,  824,  824,  824,  824,  842,  824,
751
 
      843,  824,  824,  824,  824,  844,  845,   43,  846,  846,
752
 
      846,  846,  846,  846,  846,  846,  838,  839,  824,  824,
753
 
      102,  824,  824,  824,  824,  824,  824,  847,  824,  848,
754
 
      824,  824,  849,  824,  824,  824,  850,  850,  850,  850,
755
 
      850,  824,  824,  851,  824,  824,  824,  852,  824,  852,
756
 
      853,  824,  853,  824,  824,  824,  824,  824,  824,  824,
757
 
      854,  824,  824,  824,  824,  824,  824,  824,  824,  824,
758
 
      824,  855,  855,  855,  855,  855,  855,  855,  855,  855,
759
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  824,
760
 
 
761
 
      824,  824,  824,  824,  824,  856,  857,  857,  857,  857,
762
 
      857,  857,  857,  857,  857,  857,  857,  857,  824,  824,
763
 
      824,  824,  824,  824,  858,  859,  860,  859,  859,  859,
764
 
      859,  859,  859,  859,  859,  824,  824,  824,  824,  824,
765
 
      824,  861,  824,  824,  824,  824,  824,  824,  824,  862,
766
 
      863,  863,  863,  863,  863,  824,  824,  864,  864,  824,
767
 
      824,  824,  838,  824,  838,  824,  839,  824,  824,  824,
768
 
      865,  824,  824,  824,  824,  866,  867,  868,  824,  868,
769
 
      824,  869,  824,  824,  824,  824,  824,  824,  824,  870,
770
 
      871,  872,  872,  872,  872,  872,  873,  874,  824,  874,
771
 
 
772
 
      874,  874,  874,  874,  874,  874,  874,  824,  824,  875,
773
 
      824,  875,  824,  876,  824,  824,  824,  877,  877,  877,
774
 
      877,  877,  877,  824,  824,  824,  824,  878,  824,  824,
775
 
      824,  824,  824,  879,  824,  879,  879,  879,  879,  824,
776
 
      824,  824,  824,  824,  824,  824,  824,  824,  855,  855,
777
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
778
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
779
 
      855,  855,  824,  824,  824,  824,  824,  824,  856,  857,
780
 
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
781
 
      857,  857,  857,  857,  857,  857,  857,  857,  824,  824,
782
 
 
783
 
      860,  880,  881,  882,  882,  882,  882,  882,  882,  882,
784
 
      824,  824,  824,  862,  863,  863,  863,  863,  824,  824,
785
 
      865,  824,  824,  824,  824,  824,  866,  824,  824,  824,
786
 
      824,  824,  824,  824,  870,  872,  824,  872,  872,  872,
787
 
      872,  883,  824,  874,  874,  874,  874,  874,  874,  874,
788
 
      824,  824,  877,  877,  877,  877,  877,  877,  877,  824,
789
 
      824,  824,  824,  824,  878,  824,  824,  824,  824,  824,
790
 
      824,  824,  824,  855,  855,  855,  855,  855,  855,  855,
791
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
792
 
      855,  855,  855,  855,  855,  855,  855,  857,  857,  857,
793
 
 
794
 
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
795
 
      857,  857,  857,  857,  857,  857,  857,  857,  824,  880,
796
 
      824,  880,  881,  824,  882,  882,  882,  882,  824,  824,
797
 
      824,  863,  824,  824,  824,  824,  824,  883,  874,  874,
798
 
      874,  874,  824,  824,  877,  877,  877,  877,  877,  877,
799
 
      824,  824,  824,  824,  824,  824,  855,  855,  855,  855,
800
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
801
 
      855,  855,  855,  855,  855,  855,  855,  855,  857,  857,
802
 
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
803
 
      857,  857,  857,  857,  857,  857,  857,  857,  857,  884,
804
 
 
805
 
      882,  882,  824,  824,  824,  863,  874,  874,  877,  877,
806
 
      877,  877,  877,  824,  824,  824,  824,  824,  824,  855,
807
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
808
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
809
 
      855,  857,  857,  857,  857,  857,  857,  857,  857,  857,
810
 
      857,  857,  857,  857,  857,  857,  857,  884,  824,  884,
811
 
      882,  882,  824,  824,  863,  874,  874,  877,  877,  877,
812
 
      824,  824,  855,  855,  855,  855,  855,  855,  855,  855,
813
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
814
 
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
815
 
 
816
 
      857,  857,  824,  877,  877,  877,  824,  824,  855,  855,
817
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
818
 
      855,  855,  855,  855,  855,  855,  855,  855,  857,  857,
819
 
      857,  857,  857,  857,  857,  857,  857,  824,  877,  877,
820
 
      877,  824,  824,  855,  855,  855,  855,  855,  855,  855,
821
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
822
 
      855,  855,  857,  857,  857,  857,  857,  857,  857,  857,
823
 
      824,  824,  877,  877,  824,  824,  855,  855,  855,  855,
824
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
825
 
      857,  857,  857,  857,  824,  824,  877,  877,  824,  855,
826
 
 
827
 
      855,  855,  855,  855,  855,  855,  855,  855,  855,  857,
828
 
      857,  824,  824,  877,  855,  855,  855,  855,  855,  824,
829
 
      824,  877,  855,    0,  824,  824,  824,  824,  824,  824,
830
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
831
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
832
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
833
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
834
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
835
 
      824,  824,  824,  824
836
 
    } ;
837
 
 
838
 
static yyconst flex_int16_t yy_nxt[2468] =
839
 
    {   0,
840
 
       26,   27,   28,   27,   29,   30,   31,   32,   33,   34,
841
 
       35,   36,   37,   38,   39,   40,   41,   42,   43,   44,
842
 
       45,   46,   46,   46,   47,   48,   49,   50,   51,   26,
843
 
       52,   52,   52,   52,   52,   53,   52,   53,   52,   53,
844
 
       53,   52,   52,   54,   26,   55,   52,   52,   52,   52,
845
 
       52,   52,   52,   56,   52,   57,   52,   52,   52,   58,
846
 
       52,   59,   52,   52,   60,   52,   61,   52,   52,   52,
847
 
       26,   62,   26,   63,   64,   65,   66,   65,   67,   64,
848
 
       64,   64,   64,   64,   64,   64,   68,   69,   64,   64,
849
 
       70,   64,   64,   64,   64,   64,   64,   64,   64,   64,
850
 
 
851
 
       64,   64,   64,   64,   71,   71,   71,   71,   71,   71,
852
 
       71,   71,   71,   71,   71,   71,   71,   64,   64,   64,
853
 
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
854
 
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
855
 
       71,   71,   71,   71,   64,   64,   64,   64,   73,   73,
856
 
       74,   74,  155,  155,  162,  155,  163,  164,  162,  165,
857
 
      163,  166,  167,  823,   75,   75,   76,   77,   78,   77,
858
 
       79,   76,   76,   76,   80,   76,   76,   76,   76,   76,
859
 
       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
860
 
       76,   76,   76,   76,   76,   76,   81,   81,   81,   81,
861
 
 
862
 
       81,   81,   81,   81,   81,   81,   81,   81,   81,   76,
863
 
       76,   76,   81,   81,   81,   81,   81,   81,   81,   81,
864
 
       81,   82,   81,   81,   81,   83,   81,   84,   81,   81,
865
 
       85,   81,   81,   81,   81,   81,   76,   76,   76,   76,
866
 
       64,   64,   86,   64,   87,   64,   64,   64,   88,   64,
867
 
       64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
868
 
       64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
869
 
       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
870
 
       89,   89,   89,   64,   64,   64,   89,   89,   89,   89,
871
 
       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
872
 
 
873
 
       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
874
 
       64,   64,   64,   64,   90,   91,   92,   91,   93,   90,
875
 
       94,   90,   95,   90,   90,   96,   97,   98,   90,   99,
876
 
      100,   99,  101,   90,  102,  103,  103,  103,   90,   90,
877
 
       90,   90,   90,   90,  104,  104,  104,  104,  104,  104,
878
 
      104,  104,  104,  104,  104,  104,  104,   90,   90,   90,
879
 
      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
880
 
      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
881
 
      104,  104,  104,  104,  105,   90,  106,   90,  107,  108,
882
 
       64,  108,  108,  107,  109,  107,  110,  107,  107,  111,
883
 
 
884
 
      107,  107,  107,  112,  107,  112,  113,  107,  114,  115,
885
 
      115,  115,  107,  107,  107,  107,  107,  107,  116,  116,
886
 
      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
887
 
      116,  107,  107,  107,  116,  116,  116,  116,  116,  116,
888
 
      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
889
 
      116,  116,  116,  116,  116,  116,  116,  116,  107,  107,
890
 
      107,  107,   26,   27,   28,   27,   29,   30,   31,   32,
891
 
      117,   34,   35,   36,   37,   38,   39,   40,   41,   42,
892
 
      118,   44,   45,   46,   46,   46,   47,   48,   49,   50,
893
 
       51,   26,  119,  119,  119,  119,  119,  120,  119,  120,
894
 
 
895
 
      119,  120,  120,  119,  119,   54,   26,   55,  119,  119,
896
 
      119,  119,  119,  119,  119,  121,  119,  122,  119,  119,
897
 
      119,  123,  119,  124,  119,  119,  125,  119,  126,  119,
898
 
      119,  119,   26,   62,   26,   63,  127,  225,  200,  156,
899
 
      169,  128,  390,  173,  227,  129,  201,  129,  130,  127,
900
 
      131,  132,  132,  132,  128,  154,  174,  170,  129,  391,
901
 
      129,  130,  822,  131,  132,  132,  132,  134,  135,  136,
902
 
      135,  137,  134,  138,  134,  139,  134,  134,  140,  134,
903
 
      134,  134,  141,  142,  141,  143,  134,  144,  145,  145,
904
 
      145,  146,  134,  134,  134,  134,  134,  147,  147,  147,
905
 
 
906
 
      147,  147,  148,  147,  149,  147,  150,  151,  147,  147,
907
 
      152,  134,  153,  147,  147,  147,  147,  147,  147,  147,
908
 
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
909
 
      147,  147,  147,  147,  147,  147,  147,  134,  134,  134,
910
 
      134,  159,  175,  236,  176,  176,  176,  176,  219,  220,
911
 
      175,  177,  176,  176,  176,  176,  221,  222,  202,  178,
912
 
      176,  176,  176,  176,  223,  224,  240,  240,  821,  240,
913
 
      225,  225,  204,  228,  228,  228,  228,  227,  227,  160,
914
 
      179,  225,  179,  243,  243,  179,  243,  237,  227,  375,
915
 
      375,  204,  245,  299,  180,  180,  180,  180,  246,  247,
916
 
 
917
 
      341,  181,  341,  341,  182,  182,  182,  182,  183,  182,
918
 
      182,  182,  182,  182,  182,  182,  182,  383,  384,  234,
919
 
      184,  185,  186,  187,  182,  188,  189,  190,  182,  191,
920
 
      182,  192,  193,  194,  182,  195,  182,  196,  197,  198,
921
 
      182,  182,  182,  199,  202,  225,  176,  176,  176,  176,
922
 
      238,  820,  227,  225,  225,  225,  225,  203,  204,  353,
923
 
      227,  227,  227,  227,  205,  562,  248,  248,  206,  248,
924
 
      208,  264,  354,  357,  203,  209,  562,  204,  210,  358,
925
 
      211,  212,  213,  214,  215,  279,  205,  216,  229,  217,
926
 
      218,  230,  264,  819,  206,  233,  239,  235,  231,  818,
927
 
 
928
 
      256,  256,  232,  256,  261,  261,  266,  261,  266,  265,
929
 
      266,  266,  268,  311,  269,  269,  269,  269,  270,  270,
930
 
      270,  270,  272,  280,  269,  269,  269,  269,  159,  272,
931
 
      265,  269,  269,  269,  269,  273,  274,  285,  285,  285,
932
 
      285,  817,  275,  274,  360,  281,  276,  281,  361,  281,
933
 
      281,  312,  273,  362,  283,  274,  284,  284,  284,  284,
934
 
      308,  308,  274,  308,  275,  286,  160,  284,  284,  284,
935
 
      284,  816,  276,  286,  225,  284,  284,  284,  284,  288,
936
 
      293,  227,  294,  225,  295,  296,  287,  288,  815,  225,
937
 
      227,  155,  155,  289,  155,  299,  227,  290,  288,  155,
938
 
 
939
 
      155,  299,  155,  287,  225,  225,  288,  300,  300,  300,
940
 
      300,  227,  227,  385,  369,  289,  299,  299,  225,  814,
941
 
      225,  225,  386,  290,  302,  227,  301,  227,  227,  370,
942
 
      299,  303,  299,  299,  268,  813,  269,  269,  269,  269,
943
 
      270,  270,  270,  270,  272,  264,  269,  269,  269,  269,
944
 
      162,  313,  163,  313,  304,  313,  313,  363,  274,  305,
945
 
      812,  364,  315,  307,  316,  316,  316,  316,  306,  317,
946
 
      317,  317,  317,  365,  329,  366,  324,  274,  316,  316,
947
 
      316,  316,  330,  265,  331,  332,  399,  400,  333,  811,
948
 
      326,  336,  336,  336,  336,  335,  337,  337,  337,  337,
949
 
 
950
 
      335,  319,  342,  395,  342,  342,  320,  321,  322,  326,
951
 
      323,  324,  396,  316,  316,  316,  316,  338,  338,  338,
952
 
      338,  335,  423,  423,  325,  326,  339,  339,  339,  339,
953
 
      335,  327,  378,  378,  378,  328,  343,  343,  343,  343,
954
 
      486,  325,  487,  279,  326,  344,  344,  344,  344,  345,
955
 
      345,  345,  345,  327,  346,  346,  346,  346,  431,  431,
956
 
      225,  328,  180,  180,  180,  180,  202,  227,  176,  176,
957
 
      176,  176,  180,  180,  180,  180,  374,  374,  374,  374,
958
 
      204,  280,  387,  810,  348,  376,  388,  376,  348,  392,
959
 
      377,  377,  377,  377,  393,  225,  311,  225,  809,  204,
960
 
 
961
 
      808,  389,  227,  348,  227,  225,  225,  348,  228,  228,
962
 
      228,  228,  227,  227,  225,  225,  225,  240,  240,  521,
963
 
      240,  227,  227,  227,  240,  240,  455,  240,  243,  243,
964
 
      456,  243,  243,  243,  312,  243,  248,  248,  505,  248,
965
 
      807,  248,  248,  404,  248,  405,  406,  407,  408,  256,
966
 
      256,  506,  256,  256,  256,  410,  256,  522,  261,  261,
967
 
      409,  261,  261,  261,  806,  261,  419,  419,  419,  419,
968
 
      270,  270,  270,  270,  272,  805,  269,  269,  269,  269,
969
 
      270,  270,  270,  270,  422,  422,  422,  422,  274,  426,
970
 
      426,  426,  420,  424,  561,  424,  420,  521,  425,  425,
971
 
 
972
 
      425,  425,  428,  428,  428,  428,  562,  274,  434,  434,
973
 
      434,  420,  461,  461,  225,  420,  285,  285,  285,  285,
974
 
      286,  227,  284,  284,  284,  284,  285,  285,  285,  285,
975
 
      430,  430,  430,  430,  288,  522,  225,  804,  429,  432,
976
 
      803,  432,  429,  227,  433,  433,  433,  433,  299,  438,
977
 
      438,  438,  438,  288,  464,  464,  464,  429,  437,  467,
978
 
      468,  429,  439,  439,  439,  439,  440,  440,  440,  440,
979
 
      342,  437,  342,  342,  720,  437,  441,  441,  441,  441,
980
 
      375,  375,  721,  225,  225,  437,  300,  300,  300,  300,
981
 
      227,  227,  225,  225,  225,  299,  299,  423,  423,  227,
982
 
 
983
 
      227,  227,  225,  225,  299,  299,  299,  225,  501,  227,
984
 
      227,  225,  431,  431,  227,  299,  802,  502,  227,  299,
985
 
      503,  308,  308,  299,  308,  308,  308,  801,  308,  378,
986
 
      378,  378,  444,  225,  446,  447,  426,  426,  426,  448,
987
 
      227,  445,  451,  451,  451,  451,  434,  434,  434,  449,
988
 
      225,  450,  317,  317,  317,  317,  324,  227,  316,  316,
989
 
      316,  316,  317,  317,  317,  317,  460,  460,  460,  460,
990
 
      326,  800,  225,  799,  452,  462,  525,  462,  452,  227,
991
 
      463,  463,  463,  463,  336,  336,  336,  336,  335,  326,
992
 
      526,  461,  461,  452,  464,  464,  464,  452,  337,  337,
993
 
 
994
 
      337,  337,  335,  338,  338,  338,  338,  335,  339,  339,
995
 
      339,  339,  335,  343,  343,  343,  343,  344,  344,  344,
996
 
      344,  345,  345,  345,  345,  346,  346,  346,  346,  472,
997
 
      798,  472,  797,  796,  473,  473,  473,  473,  374,  374,
998
 
      374,  374,  377,  377,  377,  377,  377,  377,  377,  377,
999
 
      348,  225,  225,  419,  419,  419,  419,  225,  227,  227,
1000
 
      533,  795,  533,  794,  227,  534,  534,  534,  534,  348,
1001
 
      422,  422,  422,  422,  425,  425,  425,  425,  425,  425,
1002
 
      425,  425,  420,  755,  793,  592,  528,  792,  225,  527,
1003
 
      428,  428,  428,  428,  593,  227,  756,  535,  791,  535,
1004
 
 
1005
 
      299,  420,  536,  536,  536,  536,  430,  430,  430,  430,
1006
 
      433,  433,  433,  433,  433,  433,  433,  433,  429,  438,
1007
 
      438,  438,  438,  439,  439,  439,  439,  790,  437,  789,
1008
 
      788,  539,  437,  440,  440,  440,  440,  429,  441,  441,
1009
 
      441,  441,  437,  225,  225,  225,  225,  437,  787,  786,
1010
 
      227,  227,  227,  227,  225,  299,  299,  299,  299,  785,
1011
 
      225,  227,  451,  451,  451,  451,  299,  227,  543,  771,
1012
 
      543,  784,  299,  544,  544,  544,  544,  460,  460,  460,
1013
 
      460,  783,  772,  225,  540,  463,  463,  463,  463,  452,
1014
 
      227,  782,  541,  781,  542,  463,  463,  463,  463,  473,
1015
 
 
1016
 
      473,  473,  473,  473,  473,  473,  473,  225,  452,  225,
1017
 
      534,  534,  534,  534,  227,  780,  227,  534,  534,  534,
1018
 
      534,  536,  536,  536,  536,  536,  536,  536,  536,  225,
1019
 
      225,  225,  225,  779,  659,  778,  227,  227,  227,  227,
1020
 
      623,  299,  299,  299,  299,  544,  544,  544,  544,  601,
1021
 
      544,  544,  544,  544,  624,  637,  602,  225,  225,  659,
1022
 
      625,  225,  225,  225,  227,  227,  777,  776,  227,  227,
1023
 
      227,  638,  660,  607,  299,  299,  225,  639,  225,  608,
1024
 
      225,  710,  775,  227,  774,  227,  773,  227,  770,  769,
1025
 
      299,  768,  299,  661,  767,  711,  766,  660,  666,  765,
1026
 
 
1027
 
      764,  712,  763,  762,  761,  662,  760,  759,  758,  757,
1028
 
      667,   72,   72,   72,   72,   72,   72,   72,   72,   72,
1029
 
       72,   72,   64,   64,   64,   64,   64,   64,   64,   64,
1030
 
       64,   64,   64,  133,  133,  133,  133,  133,  133,  133,
1031
 
      133,  133,  133,  133,  158,  754,  158,  158,  158,  158,
1032
 
      158,  158,  158,  158,  158,  161,  161,  161,  161,  161,
1033
 
      161,  161,  161,  161,  161,  161,  171,  753,  171,  171,
1034
 
      171,  171,  171,  171,  171,  171,  171,  207,  207,  207,
1035
 
      226,  226,  226,  752,  226,  226,  226,  242,  751,  750,
1036
 
      242,  242,  242,  250,  250,  250,  251,  749,  748,  251,
1037
 
 
1038
 
      251,  251,  258,  258,  258,  259,  259,  747,  259,  259,
1039
 
      259,  263,  746,  263,  263,  263,  263,  263,  263,  263,
1040
 
      263,  263,  267,  745,  267,  267,  267,  267,  267,  267,
1041
 
      267,  267,  267,  271,  744,  743,  271,  271,  271,  277,
1042
 
      742,  741,  277,  277,  277,  278,  740,  278,  278,  278,
1043
 
      278,  278,  278,  278,  278,  278,  282,  739,  282,  282,
1044
 
      282,  282,  282,  282,  282,  282,  282,  291,  738,  737,
1045
 
      291,  291,  291,  292,  292,  292,  298,  298,  298,  298,
1046
 
      298,  298,  298,  310,  736,  310,  310,  310,  310,  310,
1047
 
      310,  310,  310,  310,  314,  735,  314,  314,  314,  314,
1048
 
 
1049
 
      314,  314,  314,  314,  314,  318,  734,  733,  318,  318,
1050
 
      318,  334,  334,  732,  334,  334,  334,  340,  340,  340,
1051
 
      340,  340,  340,  340,  340,  340,  158,  731,  158,  158,
1052
 
      158,  158,  158,  158,  158,  158,  158,  161,  161,  161,
1053
 
      161,  161,  161,  161,  161,  161,  161,  161,  171,  730,
1054
 
      171,  171,  171,  171,  171,  171,  171,  171,  171,  349,
1055
 
      729,  728,  349,  349,  349,  379,  727,  726,  379,  380,
1056
 
      725,  724,  380,  380,  380,  225,  225,  225,  723,  225,
1057
 
      225,  225,  226,  226,  226,  722,  226,  226,  226,  403,
1058
 
      719,  718,  717,  716,  403,  403,  403,  242,  715,  714,
1059
 
 
1060
 
      242,  242,  242,  414,  713,  709,  414,  414,  414,  251,
1061
 
      708,  707,  251,  251,  251,  259,  259,  706,  259,  259,
1062
 
      259,  421,  705,  704,  421,  421,  421,  427,  703,  702,
1063
 
      427,  277,  701,  700,  277,  277,  277,  278,  699,  278,
1064
 
      278,  278,  278,  278,  278,  278,  278,  278,  282,  698,
1065
 
      282,  282,  282,  282,  282,  282,  282,  282,  282,  435,
1066
 
      697,  696,  435,  291,  695,  694,  291,  291,  291,  436,
1067
 
      693,  436,  436,  436,  436,  442,  442,  442,  298,  298,
1068
 
      298,  298,  298,  298,  298,  310,  692,  310,  310,  310,
1069
 
      310,  310,  310,  310,  310,  310,  314,  691,  314,  314,
1070
 
 
1071
 
      314,  314,  314,  314,  314,  314,  314,  453,  690,  689,
1072
 
      453,  453,  453,  465,  688,  687,  465,  334,  334,  686,
1073
 
      334,  334,  334,  520,  685,  520,  520,  520,  520,  520,
1074
 
      520,  520,  520,  520,  523,  523,  523,  684,  523,  523,
1075
 
      523,  226,  226,  226,  683,  226,  226,  226,  538,  682,
1076
 
      681,  538,  538,  538,  658,  680,  658,  658,  658,  658,
1077
 
      658,  658,  658,  658,  658,  679,  678,  677,  676,  675,
1078
 
      674,  673,  672,  671,  670,  669,  668,  665,  664,  663,
1079
 
      657,  656,  655,  654,  653,  652,  651,  650,  649,  648,
1080
 
      647,  646,  645,  644,  643,  642,  641,  640,  636,  635,
1081
 
 
1082
 
      634,  633,  632,  631,  630,  629,  628,  627,  626,  622,
1083
 
      621,  620,  619,  618,  617,  616,  615,  614,  613,  612,
1084
 
      611,  610,  609,  606,  605,  604,  603,  600,  524,  599,
1085
 
      598,  597,  596,  595,  594,  591,  590,  589,  588,  587,
1086
 
      586,  585,  584,  583,  582,  581,  580,  579,  578,  577,
1087
 
      576,  575,  574,  573,  572,  571,  570,  569,  568,  567,
1088
 
      566,  565,  564,  563,  560,  559,  558,  557,  556,  555,
1089
 
      554,  553,  552,  551,  550,  549,  548,  547,  546,  545,
1090
 
      537,  437,  532,  531,  530,  529,  524,  402,  519,  518,
1091
 
      517,  516,  515,  514,  513,  512,  511,  510,  509,  508,
1092
 
 
1093
 
      507,  504,  500,  499,  498,  497,  496,  495,  494,  493,
1094
 
      492,  491,  490,  489,  488,  485,  484,  483,  482,  481,
1095
 
      480,  479,  478,  477,  476,  475,  474,  335,  471,  470,
1096
 
      469,  466,  459,  458,  457,  454,  311,  443,  437,  279,
1097
 
      264,  260,  260,  418,  417,  416,  415,  413,  412,  411,
1098
 
      402,  401,  398,  397,  394,  382,  381,  373,  372,  371,
1099
 
      368,  367,  359,  356,  355,  352,  351,  350,  347,  172,
1100
 
      335,  311,  309,  264,  297,  279,  264,  262,  260,  257,
1101
 
      255,  254,  253,  252,  249,  244,  241,  172,  168,  157,
1102
 
      154,  824,   25,  824,  824,  824,  824,  824,  824,  824,
1103
 
 
1104
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1105
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1106
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1107
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1108
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1109
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1110
 
      824,  824,  824,  824,  824,  824,  824
1111
 
    } ;
1112
 
 
1113
 
static yyconst flex_int16_t yy_chk[2468] =
1114
 
    {   0,
1115
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1116
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1117
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1118
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1119
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1120
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1121
 
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1122
 
        1,    1,    1,    1,    3,    3,    3,    3,    3,    3,
1123
 
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1124
 
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1125
 
 
1126
 
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1127
 
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1128
 
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1129
 
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
1130
 
        3,    3,    3,    3,    3,    3,    3,    3,    5,    6,
1131
 
        5,    6,   28,   28,   32,   28,   32,   33,  161,   33,
1132
 
      161,   33,   33,  815,    5,    6,    7,    7,    7,    7,
1133
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1134
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1135
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1136
 
 
1137
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1138
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1139
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1140
 
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
1141
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1142
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1143
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1144
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1145
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1146
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1147
 
 
1148
 
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
1149
 
        9,    9,    9,    9,   11,   11,   11,   11,   11,   11,
1150
 
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
1151
 
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
1152
 
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
1153
 
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
1154
 
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
1155
 
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
1156
 
       11,   11,   11,   11,   11,   11,   11,   11,   13,   13,
1157
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1158
 
 
1159
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1160
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1161
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1162
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1163
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1164
 
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1165
 
       13,   13,   17,   17,   17,   17,   17,   17,   17,   17,
1166
 
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
1167
 
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
1168
 
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
1169
 
 
1170
 
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
1171
 
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
1172
 
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
1173
 
       17,   17,   17,   17,   17,   17,   19,   52,   44,   29,
1174
 
       35,   19,  213,   39,   52,   19,   44,   19,   19,   20,
1175
 
       19,   19,   19,   19,   20,   29,   39,   35,   20,  213,
1176
 
       20,   20,  814,   20,   20,   20,   20,   23,   23,   23,
1177
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1178
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1179
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1180
 
 
1181
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1182
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1183
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1184
 
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
1185
 
       23,   31,   40,   62,   40,   40,   40,   40,   49,   49,
1186
 
       42,   40,   42,   42,   42,   42,   50,   50,   46,   42,
1187
 
       46,   46,   46,   46,   51,   51,   66,   66,  813,   66,
1188
 
       53,   60,   46,   53,   53,   53,   53,   53,   60,   31,
1189
 
       43,  119,   43,   73,   73,   43,   73,   62,  119,  203,
1190
 
      203,   46,   75,  119,   43,   43,   43,   43,   75,   75,
1191
 
 
1192
 
      154,   43,  154,  154,   43,   43,   43,   43,   43,   43,
1193
 
       43,   43,   43,   43,   43,   43,   43,  210,  210,   60,
1194
 
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
1195
 
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
1196
 
       43,   43,   43,   43,   45,   56,   45,   45,   45,   45,
1197
 
       63,  812,   56,   58,   59,   61,   57,   45,   45,  187,
1198
 
       58,   59,   61,   57,   45,  808,   78,   78,   45,   78,
1199
 
       47,   94,  187,  190,   45,   47,  807,   45,   47,  190,
1200
 
       47,   47,   47,   47,   47,  109,   45,   47,   56,   47,
1201
 
       47,   57,  127,  806,   45,   59,   63,   61,   57,  805,
1202
 
 
1203
 
       86,   86,   58,   86,   92,   92,   95,   92,   95,   94,
1204
 
       95,   95,   99,  138,   99,   99,   99,   99,  101,  101,
1205
 
      101,  101,  102,  109,  102,  102,  102,  102,  158,  103,
1206
 
      127,  103,  103,  103,  103,  102,  102,  113,  113,  113,
1207
 
      113,  804,  102,  103,  192,  110,  102,  110,  192,  110,
1208
 
      110,  138,  102,  192,  112,  102,  112,  112,  112,  112,
1209
 
      136,  136,  103,  136,  102,  115,  158,  115,  115,  115,
1210
 
      115,  802,  102,  114,  226,  114,  114,  114,  114,  115,
1211
 
      117,  226,  117,  121,  117,  117,  114,  114,  801,  122,
1212
 
      121,  155,  155,  114,  155,  121,  122,  114,  115,  156,
1213
 
 
1214
 
      156,  122,  156,  114,  120,  123,  114,  120,  120,  120,
1215
 
      120,  120,  123,  211,  197,  114,  120,  123,  124,  797,
1216
 
      125,  126,  211,  114,  122,  124,  121,  125,  126,  197,
1217
 
      124,  122,  125,  126,  129,  796,  129,  129,  129,  129,
1218
 
      130,  130,  130,  130,  132,  263,  132,  132,  132,  132,
1219
 
      163,  139,  163,  139,  123,  139,  139,  193,  132,  124,
1220
 
      795,  193,  141,  126,  141,  141,  141,  141,  125,  143,
1221
 
      143,  143,  143,  194,  146,  194,  145,  132,  145,  145,
1222
 
      145,  145,  146,  263,  146,  146,  224,  224,  146,  794,
1223
 
      145,  148,  148,  148,  148,  148,  149,  149,  149,  149,
1224
 
 
1225
 
      149,  143,  162,  216,  162,  162,  143,  143,  143,  145,
1226
 
      143,  144,  216,  144,  144,  144,  144,  150,  150,  150,
1227
 
      150,  150,  273,  273,  144,  144,  151,  151,  151,  151,
1228
 
      151,  144,  205,  205,  205,  144,  164,  164,  164,  164,
1229
 
      362,  144,  362,  278,  144,  165,  165,  165,  165,  166,
1230
 
      166,  166,  166,  144,  167,  167,  167,  167,  287,  287,
1231
 
      230,  144,  175,  175,  175,  175,  176,  230,  176,  176,
1232
 
      176,  176,  180,  180,  180,  180,  202,  202,  202,  202,
1233
 
      176,  278,  212,  792,  180,  204,  212,  204,  202,  214,
1234
 
      204,  204,  204,  204,  214,  229,  310,  231,  789,  176,
1235
 
 
1236
 
      786,  212,  229,  180,  231,  228,  232,  202,  228,  228,
1237
 
      228,  228,  228,  232,  234,  235,  233,  240,  240,  402,
1238
 
      240,  234,  235,  233,  241,  241,  320,  241,  243,  243,
1239
 
      320,  243,  244,  244,  310,  244,  248,  248,  386,  248,
1240
 
      785,  249,  249,  229,  249,  231,  232,  232,  233,  256,
1241
 
      256,  386,  256,  257,  257,  235,  257,  402,  261,  261,
1242
 
      234,  261,  262,  262,  784,  262,  266,  266,  266,  266,
1243
 
      268,  268,  268,  268,  269,  783,  269,  269,  269,  269,
1244
 
      270,  270,  270,  270,  272,  272,  272,  272,  269,  275,
1245
 
      275,  275,  270,  274,  479,  274,  272,  520,  274,  274,
1246
 
 
1247
 
      274,  274,  281,  281,  281,  281,  479,  269,  289,  289,
1248
 
      289,  270,  325,  325,  405,  272,  283,  283,  283,  283,
1249
 
      284,  405,  284,  284,  284,  284,  285,  285,  285,  285,
1250
 
      286,  286,  286,  286,  284,  520,  298,  782,  285,  288,
1251
 
      780,  288,  286,  298,  288,  288,  288,  288,  298,  293,
1252
 
      293,  293,  293,  284,  327,  327,  327,  285,  293,  330,
1253
 
      330,  286,  294,  294,  294,  294,  295,  295,  295,  295,
1254
 
      342,  294,  342,  342,  682,  295,  296,  296,  296,  296,
1255
 
      375,  375,  682,  300,  301,  296,  300,  300,  300,  300,
1256
 
      300,  301,  302,  303,  304,  300,  301,  423,  423,  302,
1257
 
 
1258
 
      303,  304,  407,  306,  302,  303,  304,  305,  384,  407,
1259
 
      306,  307,  431,  431,  305,  306,  779,  384,  307,  305,
1260
 
      384,  308,  308,  307,  308,  309,  309,  778,  309,  378,
1261
 
      378,  378,  301,  404,  304,  304,  426,  426,  426,  305,
1262
 
      404,  303,  313,  313,  313,  313,  434,  434,  434,  306,
1263
 
      406,  307,  315,  315,  315,  315,  316,  406,  316,  316,
1264
 
      316,  316,  317,  317,  317,  317,  324,  324,  324,  324,
1265
 
      316,  777,  408,  775,  317,  326,  404,  326,  324,  408,
1266
 
      326,  326,  326,  326,  336,  336,  336,  336,  336,  316,
1267
 
      406,  461,  461,  317,  464,  464,  464,  324,  337,  337,
1268
 
 
1269
 
      337,  337,  337,  338,  338,  338,  338,  338,  339,  339,
1270
 
      339,  339,  339,  343,  343,  343,  343,  344,  344,  344,
1271
 
      344,  345,  345,  345,  345,  346,  346,  346,  346,  348,
1272
 
      774,  348,  773,  772,  348,  348,  348,  348,  374,  374,
1273
 
      374,  374,  376,  376,  376,  376,  377,  377,  377,  377,
1274
 
      374,  409,  410,  419,  419,  419,  419,  525,  409,  410,
1275
 
      420,  771,  420,  770,  525,  420,  420,  420,  420,  374,
1276
 
      422,  422,  422,  422,  424,  424,  424,  424,  425,  425,
1277
 
      425,  425,  422,  721,  766,  512,  410,  764,  444,  409,
1278
 
      428,  428,  428,  428,  512,  444,  721,  429,  763,  429,
1279
 
 
1280
 
      444,  422,  429,  429,  429,  429,  430,  430,  430,  430,
1281
 
      432,  432,  432,  432,  433,  433,  433,  433,  430,  438,
1282
 
      438,  438,  438,  439,  439,  439,  439,  761,  438,  760,
1283
 
      758,  444,  439,  440,  440,  440,  440,  430,  441,  441,
1284
 
      441,  441,  440,  445,  446,  447,  448,  441,  757,  756,
1285
 
      445,  446,  447,  448,  449,  445,  446,  447,  448,  755,
1286
 
      450,  449,  451,  451,  451,  451,  449,  450,  452,  738,
1287
 
      452,  754,  450,  452,  452,  452,  452,  460,  460,  460,
1288
 
      460,  752,  738,  526,  446,  462,  462,  462,  462,  460,
1289
 
      526,  751,  449,  750,  450,  463,  463,  463,  463,  472,
1290
 
 
1291
 
      472,  472,  472,  473,  473,  473,  473,  527,  460,  528,
1292
 
      533,  533,  533,  533,  527,  749,  528,  534,  534,  534,
1293
 
      534,  535,  535,  535,  535,  536,  536,  536,  536,  539,
1294
 
      540,  541,  542,  747,  600,  746,  539,  540,  541,  542,
1295
 
      561,  539,  540,  541,  542,  543,  543,  543,  543,  527,
1296
 
      544,  544,  544,  544,  561,  576,  528,  601,  602,  658,
1297
 
      561,  661,  607,  608,  601,  602,  745,  743,  661,  607,
1298
 
      608,  576,  600,  541,  607,  608,  662,  576,  666,  542,
1299
 
      667,  674,  742,  662,  740,  666,  739,  667,  737,  736,
1300
 
      666,  735,  667,  601,  734,  674,  732,  658,  607,  731,
1301
 
 
1302
 
      730,  674,  729,  728,  727,  602,  726,  724,  723,  722,
1303
 
      608,  825,  825,  825,  825,  825,  825,  825,  825,  825,
1304
 
      825,  825,  826,  826,  826,  826,  826,  826,  826,  826,
1305
 
      826,  826,  826,  827,  827,  827,  827,  827,  827,  827,
1306
 
      827,  827,  827,  827,  828,  720,  828,  828,  828,  828,
1307
 
      828,  828,  828,  828,  828,  829,  829,  829,  829,  829,
1308
 
      829,  829,  829,  829,  829,  829,  830,  718,  830,  830,
1309
 
      830,  830,  830,  830,  830,  830,  830,  831,  831,  831,
1310
 
      832,  832,  832,  717,  832,  832,  832,  833,  716,  715,
1311
 
      833,  833,  833,  834,  834,  834,  835,  714,  713,  835,
1312
 
 
1313
 
      835,  835,  836,  836,  836,  837,  837,  712,  837,  837,
1314
 
      837,  838,  711,  838,  838,  838,  838,  838,  838,  838,
1315
 
      838,  838,  839,  710,  839,  839,  839,  839,  839,  839,
1316
 
      839,  839,  839,  840,  709,  708,  840,  840,  840,  841,
1317
 
      707,  706,  841,  841,  841,  842,  705,  842,  842,  842,
1318
 
      842,  842,  842,  842,  842,  842,  843,  704,  843,  843,
1319
 
      843,  843,  843,  843,  843,  843,  843,  844,  703,  701,
1320
 
      844,  844,  844,  845,  845,  845,  846,  846,  846,  846,
1321
 
      846,  846,  846,  847,  699,  847,  847,  847,  847,  847,
1322
 
      847,  847,  847,  847,  848,  698,  848,  848,  848,  848,
1323
 
 
1324
 
      848,  848,  848,  848,  848,  849,  697,  696,  849,  849,
1325
 
      849,  850,  850,  694,  850,  850,  850,  851,  851,  851,
1326
 
      851,  851,  851,  851,  851,  851,  852,  693,  852,  852,
1327
 
      852,  852,  852,  852,  852,  852,  852,  853,  853,  853,
1328
 
      853,  853,  853,  853,  853,  853,  853,  853,  854,  692,
1329
 
      854,  854,  854,  854,  854,  854,  854,  854,  854,  855,
1330
 
      691,  690,  855,  855,  855,  856,  689,  688,  856,  857,
1331
 
      687,  685,  857,  857,  857,  858,  858,  858,  684,  858,
1332
 
      858,  858,  859,  859,  859,  683,  859,  859,  859,  860,
1333
 
      681,  680,  679,  678,  860,  860,  860,  861,  677,  676,
1334
 
 
1335
 
      861,  861,  861,  862,  675,  673,  862,  862,  862,  863,
1336
 
      672,  671,  863,  863,  863,  864,  864,  670,  864,  864,
1337
 
      864,  865,  669,  668,  865,  865,  865,  866,  664,  657,
1338
 
      866,  867,  656,  654,  867,  867,  867,  868,  653,  868,
1339
 
      868,  868,  868,  868,  868,  868,  868,  868,  869,  651,
1340
 
      869,  869,  869,  869,  869,  869,  869,  869,  869,  870,
1341
 
      650,  649,  870,  871,  646,  645,  871,  871,  871,  872,
1342
 
      644,  872,  872,  872,  872,  873,  873,  873,  874,  874,
1343
 
      874,  874,  874,  874,  874,  875,  643,  875,  875,  875,
1344
 
      875,  875,  875,  875,  875,  875,  876,  642,  876,  876,
1345
 
 
1346
 
      876,  876,  876,  876,  876,  876,  876,  877,  640,  639,
1347
 
      877,  877,  877,  878,  638,  637,  878,  879,  879,  636,
1348
 
      879,  879,  879,  880,  634,  880,  880,  880,  880,  880,
1349
 
      880,  880,  880,  880,  881,  881,  881,  633,  881,  881,
1350
 
      881,  882,  882,  882,  632,  882,  882,  882,  883,  631,
1351
 
      629,  883,  883,  883,  884,  628,  884,  884,  884,  884,
1352
 
      884,  884,  884,  884,  884,  627,  626,  625,  624,  623,
1353
 
      621,  620,  619,  615,  613,  612,  611,  606,  605,  604,
1354
 
      599,  598,  597,  596,  595,  594,  593,  592,  591,  590,
1355
 
      589,  588,  586,  584,  583,  581,  578,  577,  575,  574,
1356
 
 
1357
 
      573,  572,  571,  570,  569,  568,  566,  565,  564,  560,
1358
 
      558,  557,  556,  555,  554,  553,  552,  551,  550,  549,
1359
 
      548,  547,  545,  532,  531,  530,  529,  524,  523,  518,
1360
 
      517,  516,  515,  514,  513,  511,  510,  509,  508,  507,
1361
 
      506,  505,  503,  502,  501,  500,  499,  498,  497,  496,
1362
 
      494,  493,  492,  491,  490,  489,  488,  487,  486,  485,
1363
 
      483,  482,  481,  480,  478,  477,  476,  475,  471,  470,
1364
 
      469,  468,  467,  466,  459,  458,  457,  456,  455,  454,
1365
 
      437,  436,  418,  413,  412,  411,  403,  401,  400,  398,
1366
 
      397,  396,  395,  394,  393,  392,  391,  390,  389,  388,
1367
 
 
1368
 
      387,  385,  383,  382,  381,  372,  371,  370,  369,  368,
1369
 
      367,  366,  365,  364,  363,  361,  360,  359,  358,  357,
1370
 
      356,  355,  354,  353,  352,  351,  350,  334,  333,  332,
1371
 
      331,  329,  323,  322,  321,  319,  314,  299,  292,  282,
1372
 
      267,  259,  258,  255,  254,  253,  252,  247,  246,  245,
1373
 
      227,  225,  218,  217,  215,  209,  208,  200,  199,  198,
1374
 
      196,  195,  191,  189,  188,  186,  185,  183,  173,  171,
1375
 
      147,  140,  137,  128,  118,  111,   96,   93,   89,   87,
1376
 
       85,   84,   83,   82,   79,   74,   67,   36,   34,   30,
1377
 
       27,   25,  824,  824,  824,  824,  824,  824,  824,  824,
1378
 
 
1379
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1380
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1381
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1382
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1383
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1384
 
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
1385
 
      824,  824,  824,  824,  824,  824,  824
1386
 
    } ;
1387
 
 
1388
 
/* Table of booleans, true if rule could match eol. */
1389
 
static yyconst flex_int32_t yy_rule_can_match_eol[210] =
1390
 
    {   0,
1391
 
1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1392
 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1393
 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1394
 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1395
 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1396
 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1397
 
    0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1398
 
    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
1399
 
    0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
1400
 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1401
 
    0, 0, 0, 0, 0, 0, 0, 1, 0, 0,     };
1402
 
 
1403
 
static yyconst flex_int16_t yy_rule_linenum[209] =
1404
 
    {   0,
1405
 
      226,  248,  250,  252,  274,  275,  276,  277,  278,  279,
1406
 
      280,  281,  282,  283,  284,  285,  287,  288,  289,  290,
1407
 
      292,  293,  294,  295,  296,  297,  298,  299,  300,  301,
1408
 
      302,  303,  305,  310,  311,  313,  314,  315,  316,  317,
1409
 
      318,  319,  320,  321,  322,  323,  325,  326,  327,  328,
1410
 
      330,  331,  332,  333,  335,  336,  337,  338,  339,  341,
1411
 
      342,  343,  344,  345,  346,  347,  348,  350,  351,  352,
1412
 
      353,  354,  355,  356,  357,  358,  359,  360,  361,  362,
1413
 
      363,  364,  365,  366,  367,  370,  377,  378,  379,  380,
1414
 
      381,  382,  383,  384,  385,  386,  387,  388,  389,  390,
1415
 
 
1416
 
      392,  393,  394,  395,  396,  397,  398,  399,  401,  405,
1417
 
      427,  439,  468,  516,  517,  518,  519,  521,  530,  542,
1418
 
      571,  572,  573,  574,  575,  577,  585,  636,  649,  671,
1419
 
      676,  681,  688,  689,  704,  709,  710,  715,  716,  717,
1420
 
      719,  735,  789,  817,  822,  827,  828,  829,  830,  835,
1421
 
      846,  847,  849,  851,  862,  876,  881,  882,  883,  884,
1422
 
      886,  901,  915,  944,  969,  971,  976,  986,  991, 1009,
1423
 
     1015, 1022, 1055, 1057, 1062, 1098, 1099, 1100, 1102, 1103,
1424
 
     1104, 1105, 1106, 1107, 1109, 1110, 1111, 1113, 1118, 1123,
1425
 
     1124, 1127, 1161, 1166, 1169, 1170, 1171, 1172, 1174, 1179,
1426
 
 
1427
 
     1180, 1181, 1182, 1183, 1185, 1190, 1192, 1194
1428
 
    } ;
1429
 
 
1430
 
/* The intent behind this definition is that it'll catch
1431
 
 * any uses of REJECT which flex missed.
1432
 
 */
1433
 
#define REJECT reject_used_but_not_detected
1434
 
#define yymore() yymore_used_but_not_detected
1435
 
#define YY_MORE_ADJ 0
1436
 
#define YY_RESTORE_YY_MORE_OFFSET
1437
 
#line 1 "pir.l"
1438
 
 
1439
 
#line 40 "pir.l"
1440
 
 
1441
 
/*
1442
 
 * $Id: pirlexer.c 41681 2009-10-04 11:07:09Z kjs $
1443
 
 * Copyright (C) 2007-2009, Parrot Foundation.
1444
 
 */
1445
 
 
1446
 
/*
1447
 
 
1448
 
=head1 NAME
1449
 
 
1450
 
pir.l - implementation of the lexical analyzer of the PIR assembly language.
1451
 
 
1452
 
=head1 DESCRIPTION
1453
 
 
1454
 
This file implements the lexical analyzer of the PIR assembly language.
1455
 
The macro layer is implemented here as well. Heredocs and C<.include>
1456
 
are processed by a different preprocessor; see F<hdocprep.l>.
1457
 
 
1458
 
=cut
1459
 
 
1460
 
*/
1461
 
 
1462
 
#include <stdlib.h>
1463
 
#include <string.h>
1464
 
#include <ctype.h>
1465
 
#include "pirparser.h"
1466
 
#include "pircompiler.h"
1467
 
#include "pirmacro.h"
1468
 
#include "pirerr.h"
1469
 
 
1470
 
#include "parrot/parrot.h"
1471
 
 
1472
 
/* define the type of the extra field in the yyscan_t object that is passed around;
1473
 
 * this is the lexer_state structure, defined in "pircompiler.h"
1474
 
 */
1475
 
#define YY_EXTRA_TYPE  struct lexer_state *
1476
 
 
1477
 
/* accessor methods for setting and getting the column; flex doesn't generate
1478
 
 * prototypes for these for some reason. It's probably a missing feature, so
1479
 
 * let's do that here and now.
1480
 
 */
1481
 
extern int  yypirget_column(yyscan_t yyscanner);
1482
 
extern void yypirset_column(int col, yyscan_t yyscanner);
1483
 
 
1484
 
#ifdef _WIN32
1485
 
/* warning C4018: "signed/unsigned mismatch" */
1486
 
#  pragma warning (disable:4018)
1487
 
/* warning C4244: "conversion from 'int' to 'yytype_int16' */
1488
 
#  pragma warning (disable:4244)
1489
 
 
1490
 
#else
1491
 
/* is this possible on other platforms? */
1492
 
 
1493
 
#endif
1494
 
 
1495
 
void include_file(yyscan_t yyscanner, char const * const filename);
1496
 
char *expand_macro(yyscan_t yyscanner, macro_def * const macro, macro_param * args);
1497
 
 
1498
 
/* static prototypes */
1499
 
static int is_pir_directive(char * const text);
1500
 
static macro_table *pop_macro_table(lexer_state * const lexer);
1501
 
static macro_table *peek_macro_table(lexer_state * const lexer);
1502
 
static char * munge_id(char const * const id, lexer_state * const lexer);
1503
 
 
1504
 
static void save_filestate(yyscan_t yyscanner);
1505
 
static int restore_filestate(yyscan_t yyscanner);
1506
 
 
1507
 
/* make sure yytext is a pointer */
1508
 
/* slightly more efficient when this option is set; our parser is not interactive anyway. */
1509
 
/* define output file */
1510
 
/* name of header file */
1511
 
/* prefix on exported functions. */
1512
 
/* we don't use unput, so don't generate it */
1513
 
/* use flex' built-in capability for line counting */
1514
 
/* make the scanner re-entrant */
1515
 
/* needed for bison interaction. */
1516
 
/* make yypirwrap() always return true. */
1517
 
/* always show warnings if something's wrong with our spec. */
1518
 
/* create a scanner in debug mode; XXX remove this in production build. */
1519
 
/* we're pushing and popping lexer states, so we need a stack */
1520
 
/* override memory allocation function with Parrot's memory functions;
1521
 
 * don't generate built-ins.
1522
 
 */
1523
 
/* XXX document, and possibly rename, these states, when are they used? */
1524
 
 
1525
 
 
1526
 
/* The MACROLOCAL state is used ONLY when parsing ".macro_local <type> <ident>". */
1527
 
 
1528
 
/* The MACROLABEL state is used ONLY when parsing ".macro_label <ident>". */
1529
 
 
1530
 
/* The MACROEXPAND state is entered when we find a dot-identifier (e.g. ".foo"); */
1531
 
 
1532
 
 
1533
 
/* note that SCANSTR is an inclusive state, purely to override default action for <<EOF>> */
1534
 
 
1535
 
 
1536
 
 
1537
 
/* The SPECIALSTART state is only used when the parsing starts, and only to
1538
 
 * read a single character; we're not interested in the character, but we want
1539
 
 * a way for the lexer to check the PASM flag (indicating a PASM file), and this
1540
 
 * check must only be done once (it's a waste to do it for each token). The
1541
 
 * read character will be pushed back into the input stream immediately, and
1542
 
 * a token will be returned, indicating it's a PASM or PIR file.
1543
 
 */
1544
 
 
1545
 
/* The PASM state is an exclusive state, recognizing ONLY PASM tokens. */
1546
 
 
1547
 
#line 1548 "pirlexer.c"
1548
 
 
1549
 
#define INITIAL 0
1550
 
#define MACROHEAD 1
1551
 
#define MACROBODY 2
1552
 
#define MACROLOCAL 3
1553
 
#define MACROLABEL 4
1554
 
#define MACROEXPAND 5
1555
 
#define MACROCONST 6
1556
 
#define SCANSTR 7
1557
 
#define SCANMACRO 8
1558
 
#define STRINGEXPAND 9
1559
 
#define SPECIALSTART 10
1560
 
#define PASM 11
1561
 
 
1562
 
#ifndef YY_NO_UNISTD_H
1563
 
/* Special case for "unistd.h", since it is non-ANSI. We include it way
1564
 
 * down here because we want the user's section 1 to have been scanned first.
1565
 
 * The user has a chance to override it with an option.
1566
 
 */
1567
 
/* %if-c-only */
1568
 
#include <unistd.h>
1569
 
/* %endif */
1570
 
/* %if-c++-only */
1571
 
/* %endif */
1572
 
#endif
1573
 
 
1574
 
#ifndef YY_EXTRA_TYPE
1575
 
#define YY_EXTRA_TYPE void *
1576
 
#endif
1577
 
 
1578
 
/* %if-c-only Reentrant structure and macros (non-C++). */
1579
 
/* %if-reentrant */
1580
 
 
1581
 
/* Holds the entire state of the reentrant scanner. */
1582
 
struct yyguts_t
1583
 
    {
1584
 
 
1585
 
    /* User-defined. Not touched by flex. */
1586
 
    YY_EXTRA_TYPE yyextra_r;
1587
 
 
1588
 
    /* The rest are the same as the globals declared in the non-reentrant scanner. */
1589
 
    FILE *yyin_r, *yyout_r;
1590
 
    size_t yy_buffer_stack_top; /**< index of top of stack. */
1591
 
    size_t yy_buffer_stack_max; /**< capacity of stack. */
1592
 
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1593
 
    char yy_hold_char;
1594
 
    yy_size_t yy_n_chars;
1595
 
    yy_size_t yyleng_r;
1596
 
    char *yy_c_buf_p;
1597
 
    int yy_init;
1598
 
    int yy_start;
1599
 
    int yy_did_buffer_switch_on_eof;
1600
 
    int yy_start_stack_ptr;
1601
 
    int yy_start_stack_depth;
1602
 
    int *yy_start_stack;
1603
 
    yy_state_type yy_last_accepting_state;
1604
 
    char* yy_last_accepting_cpos;
1605
 
 
1606
 
    int yylineno_r;
1607
 
    int yy_flex_debug_r;
1608
 
 
1609
 
    char *yytext_r;
1610
 
    int yy_more_flag;
1611
 
    int yy_more_len;
1612
 
 
1613
 
    YYSTYPE * yylval_r;
1614
 
 
1615
 
    }; /* end struct yyguts_t */
1616
 
 
1617
 
/* %if-c-only */
1618
 
 
1619
 
static int yy_init_globals (yyscan_t yyscanner );
1620
 
 
1621
 
/* %endif */
1622
 
 
1623
 
/* %if-reentrant */
1624
 
 
1625
 
    /* This must go here because YYSTYPE and YYLTYPE are included
1626
 
     * from bison output in section 1.*/
1627
 
    #    define yylval yyg->yylval_r
1628
 
    
1629
 
int yypirlex_init (yyscan_t* scanner);
1630
 
 
1631
 
int yypirlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1632
 
 
1633
 
/* %endif */
1634
 
 
1635
 
/* %endif End reentrant structures and macros. */
1636
 
 
1637
 
/* Accessor methods to globals.
1638
 
   These are made visible to non-reentrant scanners for convenience. */
1639
 
 
1640
 
int yypirlex_destroy (yyscan_t yyscanner );
1641
 
 
1642
 
int yypirget_debug (yyscan_t yyscanner );
1643
 
 
1644
 
void yypirset_debug (int debug_flag ,yyscan_t yyscanner );
1645
 
 
1646
 
YY_EXTRA_TYPE yypirget_extra (yyscan_t yyscanner );
1647
 
 
1648
 
void yypirset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1649
 
 
1650
 
FILE *yypirget_in (yyscan_t yyscanner );
1651
 
 
1652
 
void yypirset_in  (FILE * in_str ,yyscan_t yyscanner );
1653
 
 
1654
 
FILE *yypirget_out (yyscan_t yyscanner );
1655
 
 
1656
 
void yypirset_out  (FILE * out_str ,yyscan_t yyscanner );
1657
 
 
1658
 
yy_size_t yypirget_leng (yyscan_t yyscanner );
1659
 
 
1660
 
char *yypirget_text (yyscan_t yyscanner );
1661
 
 
1662
 
int yypirget_lineno (yyscan_t yyscanner );
1663
 
 
1664
 
void yypirset_lineno (int line_number ,yyscan_t yyscanner );
1665
 
 
1666
 
/* %if-bison-bridge */
1667
 
 
1668
 
YYSTYPE * yypirget_lval (yyscan_t yyscanner );
1669
 
 
1670
 
void yypirset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1671
 
 
1672
 
/* %endif */
1673
 
 
1674
 
/* Macros after this point can all be overridden by user definitions in
1675
 
 * section 1.
1676
 
 */
1677
 
 
1678
 
#ifndef YY_SKIP_YYWRAP
1679
 
#ifdef __cplusplus
1680
 
extern "C" int yypirwrap (yyscan_t yyscanner );
1681
 
#else
1682
 
extern int yypirwrap (yyscan_t yyscanner );
1683
 
#endif
1684
 
#endif
1685
 
 
1686
 
/* %not-for-header */
1687
 
 
1688
 
/* %ok-for-header */
1689
 
 
1690
 
/* %endif */
1691
 
 
1692
 
#ifndef yytext_ptr
1693
 
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1694
 
#endif
1695
 
 
1696
 
#ifdef YY_NEED_STRLEN
1697
 
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1698
 
#endif
1699
 
 
1700
 
#ifndef YY_NO_INPUT
1701
 
/* %if-c-only Standard (non-C++) definition */
1702
 
/* %not-for-header */
1703
 
 
1704
 
#ifdef __cplusplus
1705
 
static int yyinput (yyscan_t yyscanner );
1706
 
#else
1707
 
static int input (yyscan_t yyscanner );
1708
 
#endif
1709
 
/* %ok-for-header */
1710
 
 
1711
 
/* %endif */
1712
 
#endif
1713
 
 
1714
 
/* %if-c-only */
1715
 
 
1716
 
    static void yy_push_state (int new_state ,yyscan_t yyscanner);
1717
 
    
1718
 
    static void yy_pop_state (yyscan_t yyscanner );
1719
 
    
1720
 
    static int yy_top_state (yyscan_t yyscanner );
1721
 
    
1722
 
/* %endif */
1723
 
 
1724
 
/* Amount of stuff to slurp up with each read. */
1725
 
#ifndef YY_READ_BUF_SIZE
1726
 
#define YY_READ_BUF_SIZE 8192
1727
 
#endif
1728
 
 
1729
 
/* Copy whatever the last rule matched to the standard output. */
1730
 
#ifndef ECHO
1731
 
/* %if-c-only Standard (non-C++) definition */
1732
 
/* This used to be an fputs(), but since the string might contain NUL's,
1733
 
 * we now use fwrite().
1734
 
 */
1735
 
#define ECHO fwrite( yytext, yyleng, 1, yyout )
1736
 
/* %endif */
1737
 
/* %if-c++-only C++ definition */
1738
 
/* %endif */
1739
 
#endif
1740
 
 
1741
 
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1742
 
 * is returned in "result".
1743
 
 */
1744
 
#ifndef YY_INPUT
1745
 
#define YY_INPUT(buf,result,max_size) \
1746
 
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1747
 
        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1748
 
                { \
1749
 
                int c = '*'; \
1750
 
                yy_size_t n; \
1751
 
                for ( n = 0; n < max_size && \
1752
 
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1753
 
                        buf[n] = (char) c; \
1754
 
                if ( c == '\n' ) \
1755
 
                        buf[n++] = (char) c; \
1756
 
                if ( c == EOF && ferror( yyin ) ) \
1757
 
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
1758
 
                result = n; \
1759
 
                } \
1760
 
        else \
1761
 
                { \
1762
 
                errno=0; \
1763
 
                while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1764
 
                        { \
1765
 
                        if( errno != EINTR) \
1766
 
                                { \
1767
 
                                YY_FATAL_ERROR( "input in flex scanner failed" ); \
1768
 
                                break; \
1769
 
                                } \
1770
 
                        errno=0; \
1771
 
                        clearerr(yyin); \
1772
 
                        } \
1773
 
                }\
1774
 
\
1775
 
/* %if-c++-only C++ definition \ */\
1776
 
/* %endif */
1777
 
 
1778
 
#endif
1779
 
 
1780
 
/* No semi-colon after return; correct usage is to write "yyterminate();" -
1781
 
 * we don't want an extra ';' after the "return" because that will cause
1782
 
 * some compilers to complain about unreachable statements.
1783
 
 */
1784
 
#ifndef yyterminate
1785
 
#define yyterminate() return YY_NULL
1786
 
#endif
1787
 
 
1788
 
/* Number of entries by which start-condition stack grows. */
1789
 
#ifndef YY_START_STACK_INCR
1790
 
#define YY_START_STACK_INCR 25
1791
 
#endif
1792
 
 
1793
 
/* Report a fatal error. */
1794
 
#ifndef YY_FATAL_ERROR
1795
 
/* %if-c-only */
1796
 
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1797
 
/* %endif */
1798
 
/* %if-c++-only */
1799
 
/* %endif */
1800
 
#endif
1801
 
 
1802
 
/* %if-tables-serialization structures and prototypes */
1803
 
/* %not-for-header */
1804
 
 
1805
 
/* %ok-for-header */
1806
 
 
1807
 
/* %not-for-header */
1808
 
 
1809
 
/* %tables-yydmap generated elements */
1810
 
/* %endif */
1811
 
/* end tables serialization structures and prototypes */
1812
 
 
1813
 
/* %ok-for-header */
1814
 
 
1815
 
/* Default declaration of generated scanner - a define so the user can
1816
 
 * easily add parameters.
1817
 
 */
1818
 
#ifndef YY_DECL
1819
 
#define YY_DECL_IS_OURS 1
1820
 
/* %if-c-only Standard (non-C++) definition */
1821
 
 
1822
 
extern int yypirlex \
1823
 
               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
1824
 
 
1825
 
#define YY_DECL int yypirlex \
1826
 
               (YYSTYPE * yylval_param , yyscan_t yyscanner)
1827
 
/* %endif */
1828
 
/* %if-c++-only C++ definition */
1829
 
/* %endif */
1830
 
#endif /* !YY_DECL */
1831
 
 
1832
 
/* Code executed at the beginning of each rule, after yytext and yyleng
1833
 
 * have been set up.
1834
 
 */
1835
 
#ifndef YY_USER_ACTION
1836
 
#define YY_USER_ACTION
1837
 
#endif
1838
 
 
1839
 
/* Code executed at the end of each rule. */
1840
 
#ifndef YY_BREAK
1841
 
#define YY_BREAK break;
1842
 
#endif
1843
 
 
1844
 
/* %% [6.0] YY_RULE_SETUP definition goes here */
1845
 
#define YY_RULE_SETUP \
1846
 
        YY_USER_ACTION
1847
 
 
1848
 
/* %not-for-header */
1849
 
 
1850
 
/** The main scanner function which does all the work.
1851
 
 */
1852
 
YY_DECL
1853
 
{
1854
 
        register yy_state_type yy_current_state;
1855
 
        register char *yy_cp, *yy_bp;
1856
 
        register int yy_act;
1857
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1858
 
 
1859
 
/* %% [7.0] user's declarations go here */
1860
 
#line 223 "pir.l"
1861
 
 
1862
 
 
1863
 
 
1864
 
#line 1865 "pirlexer.c"
1865
 
 
1866
 
    yylval = yylval_param;
1867
 
 
1868
 
        if ( !yyg->yy_init )
1869
 
                {
1870
 
                yyg->yy_init = 1;
1871
 
 
1872
 
#ifdef YY_USER_INIT
1873
 
                YY_USER_INIT;
1874
 
#endif
1875
 
 
1876
 
                if ( ! yyg->yy_start )
1877
 
                        yyg->yy_start = 1;      /* first start state */
1878
 
 
1879
 
                if ( ! yyin )
1880
 
/* %if-c-only */
1881
 
                        yyin = stdin;
1882
 
/* %endif */
1883
 
/* %if-c++-only */
1884
 
/* %endif */
1885
 
 
1886
 
                if ( ! yyout )
1887
 
/* %if-c-only */
1888
 
                        yyout = stdout;
1889
 
/* %endif */
1890
 
/* %if-c++-only */
1891
 
/* %endif */
1892
 
 
1893
 
                if ( ! YY_CURRENT_BUFFER ) {
1894
 
                        yypirensure_buffer_stack (yyscanner);
1895
 
                        YY_CURRENT_BUFFER_LVALUE =
1896
 
                                yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1897
 
                }
1898
 
 
1899
 
                yypir_load_buffer_state(yyscanner );
1900
 
                }
1901
 
 
1902
 
        while ( 1 )             /* loops until end-of-file is reached */
1903
 
                {
1904
 
/* %% [8.0] yymore()-related code goes here */
1905
 
                yy_cp = yyg->yy_c_buf_p;
1906
 
 
1907
 
                /* Support of yytext. */
1908
 
                *yy_cp = yyg->yy_hold_char;
1909
 
 
1910
 
                /* yy_bp points to the position in yy_ch_buf of the start of
1911
 
                 * the current run.
1912
 
                 */
1913
 
                yy_bp = yy_cp;
1914
 
 
1915
 
/* %% [9.0] code to set up and find next match goes here */
1916
 
                yy_current_state = yyg->yy_start;
1917
 
yy_match:
1918
 
                do
1919
 
                        {
1920
 
                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1921
 
                        if ( yy_accept[yy_current_state] )
1922
 
                                {
1923
 
                                yyg->yy_last_accepting_state = yy_current_state;
1924
 
                                yyg->yy_last_accepting_cpos = yy_cp;
1925
 
                                }
1926
 
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1927
 
                                {
1928
 
                                yy_current_state = (int) yy_def[yy_current_state];
1929
 
                                if ( yy_current_state >= 825 )
1930
 
                                        yy_c = yy_meta[(unsigned int) yy_c];
1931
 
                                }
1932
 
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1933
 
                        ++yy_cp;
1934
 
                        }
1935
 
                while ( yy_current_state != 824 );
1936
 
                yy_cp = yyg->yy_last_accepting_cpos;
1937
 
                yy_current_state = yyg->yy_last_accepting_state;
1938
 
 
1939
 
yy_find_action:
1940
 
/* %% [10.0] code to find the action number goes here */
1941
 
                yy_act = yy_accept[yy_current_state];
1942
 
 
1943
 
                YY_DO_BEFORE_ACTION;
1944
 
 
1945
 
/* %% [11.0] code for yylineno update goes here */
1946
 
 
1947
 
                if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1948
 
                        {
1949
 
                        int yyl;
1950
 
                        for ( yyl = 0; yyl < yyleng; ++yyl )
1951
 
                                if ( yytext[yyl] == '\n' )
1952
 
                                           
1953
 
    do{ yylineno++;
1954
 
        yycolumn=0;
1955
 
    }while(0)
1956
 
;
1957
 
                        }
1958
 
 
1959
 
do_action:      /* This label is used only to access EOF actions. */
1960
 
 
1961
 
/* %% [12.0] debug code goes here */
1962
 
                if ( yy_flex_debug )
1963
 
                        {
1964
 
                        if ( yy_act == 0 )
1965
 
                                fprintf( stderr, "--scanner backing up\n" );
1966
 
                        else if ( yy_act < 209 )
1967
 
                                fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1968
 
                                         (long)yy_rule_linenum[yy_act], yytext );
1969
 
                        else if ( yy_act == 209 )
1970
 
                                fprintf( stderr, "--accepting default rule (\"%s\")\n",
1971
 
                                         yytext );
1972
 
                        else if ( yy_act == 210 )
1973
 
                                fprintf( stderr, "--(end of buffer or a NUL)\n" );
1974
 
                        else
1975
 
                                fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1976
 
                        }
1977
 
 
1978
 
                switch ( yy_act )
1979
 
        { /* beginning of action switch */
1980
 
/* %% [13.0] actions go here */
1981
 
                        case 0: /* must back up */
1982
 
                        /* undo the effects of YY_DO_BEFORE_ACTION */
1983
 
                        *yy_cp = yyg->yy_hold_char;
1984
 
                        yy_cp = yyg->yy_last_accepting_cpos;
1985
 
                        yy_current_state = yyg->yy_last_accepting_state;
1986
 
                        goto yy_find_action;
1987
 
 
1988
 
case 1:
1989
 
/* rule 1 can match eol */
1990
 
YY_RULE_SETUP
1991
 
#line 226 "pir.l"
1992
 
{ /* only when the scanning starts, is this state used. Only a single
1993
 
                         * character is read, pushed back, and then, depending on the
1994
 
                         * lexer flags, either PASM or PIR mode (INITIAL state) is activated.
1995
 
                         * The alternative (documented in Bison's info) would be to have a
1996
 
                         * check on some variable, which is written right after the %% marker
1997
 
                         * above. However, that code would be executed on every call to the
1998
 
                         * lexer, which is a bit of a waste.
1999
 
                         */
2000
 
                        yyless(0); /* put everything back. It's only 1 character anyway. */
2001
 
                        yy_pop_state(yyscanner); /* SPECIALSTART was pushed on state stack. */
2002
 
 
2003
 
                        if (TEST_FLAG(yypirget_extra(yyscanner)->flags, LEXER_FLAG_PASMFILE)) {
2004
 
                            BEGIN(PASM);
2005
 
                            return TK_PASM_MARKER_START;
2006
 
                        }
2007
 
                        else {
2008
 
                            BEGIN(INITIAL); /* this is the normal case. */
2009
 
                            return TK_PIR_MARKER_START;
2010
 
                        }
2011
 
 
2012
 
                      }
2013
 
        YY_BREAK
2014
 
case 2:
2015
 
YY_RULE_SETUP
2016
 
#line 248 "pir.l"
2017
 
{ /* ignore whitespace */ }
2018
 
        YY_BREAK
2019
 
case 3:
2020
 
/* rule 3 can match eol */
2021
 
YY_RULE_SETUP
2022
 
#line 250 "pir.l"
2023
 
{ /* ignore line comments */ }
2024
 
        YY_BREAK
2025
 
case 4:
2026
 
/* rule 4 can match eol */
2027
 
YY_RULE_SETUP
2028
 
#line 252 "pir.l"
2029
 
{ /* a set of continuous newlines yields a single newline token. */
2030
 
                    int index        = 0;
2031
 
                    int num_newlines = 0;
2032
 
 
2033
 
                    /* count number of newlines in the matched text;
2034
 
                     * iterate explicitly using an index is somewhat safer
2035
 
                     * than with a character pointer, as you'd have to
2036
 
                     * check for (*iter != '\0'), not (iter != NULL) for
2037
 
                     * some reason. Just do it safely, and hope the compiler
2038
 
                     * optimizes this a bit.
2039
 
                     */
2040
 
                    while (index < yyleng) {
2041
 
                        if (yytext[index] == '\n')
2042
 
                            ++num_newlines;
2043
 
 
2044
 
                        ++index;
2045
 
                    }
2046
 
                    /* pass the number of matched newlines */
2047
 
                    yylval->ival = num_newlines;
2048
 
                    return TK_NL;
2049
 
                  }
2050
 
        YY_BREAK
2051
 
case 5:
2052
 
YY_RULE_SETUP
2053
 
#line 274 "pir.l"
2054
 
{ return TK_ASSIGN_USHIFT; }
2055
 
        YY_BREAK
2056
 
case 6:
2057
 
YY_RULE_SETUP
2058
 
#line 275 "pir.l"
2059
 
{ return TK_USHIFT; }
2060
 
        YY_BREAK
2061
 
case 7:
2062
 
YY_RULE_SETUP
2063
 
#line 276 "pir.l"
2064
 
{ return TK_ASSIGN_RSHIFT; }
2065
 
        YY_BREAK
2066
 
case 8:
2067
 
YY_RULE_SETUP
2068
 
#line 277 "pir.l"
2069
 
{ return TK_RSHIFT; }
2070
 
        YY_BREAK
2071
 
case 9:
2072
 
YY_RULE_SETUP
2073
 
#line 278 "pir.l"
2074
 
{ return TK_LSHIFT; }
2075
 
        YY_BREAK
2076
 
case 10:
2077
 
YY_RULE_SETUP
2078
 
#line 279 "pir.l"
2079
 
{ return TK_ARROW; }
2080
 
        YY_BREAK
2081
 
case 11:
2082
 
YY_RULE_SETUP
2083
 
#line 280 "pir.l"
2084
 
{ return TK_EQ; }
2085
 
        YY_BREAK
2086
 
case 12:
2087
 
YY_RULE_SETUP
2088
 
#line 281 "pir.l"
2089
 
{ return TK_NE; }
2090
 
        YY_BREAK
2091
 
case 13:
2092
 
YY_RULE_SETUP
2093
 
#line 282 "pir.l"
2094
 
{ return TK_LE; }
2095
 
        YY_BREAK
2096
 
case 14:
2097
 
YY_RULE_SETUP
2098
 
#line 283 "pir.l"
2099
 
{ return TK_GE; }
2100
 
        YY_BREAK
2101
 
case 15:
2102
 
YY_RULE_SETUP
2103
 
#line 284 "pir.l"
2104
 
{ return TK_LT; }
2105
 
        YY_BREAK
2106
 
case 16:
2107
 
YY_RULE_SETUP
2108
 
#line 285 "pir.l"
2109
 
{ return TK_GT; }
2110
 
        YY_BREAK
2111
 
case 17:
2112
 
YY_RULE_SETUP
2113
 
#line 287 "pir.l"
2114
 
{ return TK_FDIV; }
2115
 
        YY_BREAK
2116
 
case 18:
2117
 
YY_RULE_SETUP
2118
 
#line 288 "pir.l"
2119
 
{ return TK_AND; }
2120
 
        YY_BREAK
2121
 
case 19:
2122
 
YY_RULE_SETUP
2123
 
#line 289 "pir.l"
2124
 
{ return TK_OR; }
2125
 
        YY_BREAK
2126
 
case 20:
2127
 
YY_RULE_SETUP
2128
 
#line 290 "pir.l"
2129
 
{ return TK_XOR; }
2130
 
        YY_BREAK
2131
 
case 21:
2132
 
YY_RULE_SETUP
2133
 
#line 292 "pir.l"
2134
 
{ return '+'; }
2135
 
        YY_BREAK
2136
 
case 22:
2137
 
YY_RULE_SETUP
2138
 
#line 293 "pir.l"
2139
 
{ return '%'; }
2140
 
        YY_BREAK
2141
 
case 23:
2142
 
YY_RULE_SETUP
2143
 
#line 294 "pir.l"
2144
 
{ return '*'; }
2145
 
        YY_BREAK
2146
 
case 24:
2147
 
YY_RULE_SETUP
2148
 
#line 295 "pir.l"
2149
 
{ return '/'; }
2150
 
        YY_BREAK
2151
 
case 25:
2152
 
YY_RULE_SETUP
2153
 
#line 296 "pir.l"
2154
 
{ return '!'; }
2155
 
        YY_BREAK
2156
 
case 26:
2157
 
YY_RULE_SETUP
2158
 
#line 297 "pir.l"
2159
 
{ return '~'; }
2160
 
        YY_BREAK
2161
 
case 27:
2162
 
YY_RULE_SETUP
2163
 
#line 298 "pir.l"
2164
 
{ return '-'; }
2165
 
        YY_BREAK
2166
 
case 28:
2167
 
YY_RULE_SETUP
2168
 
#line 299 "pir.l"
2169
 
{ return '('; }
2170
 
        YY_BREAK
2171
 
case 29:
2172
 
YY_RULE_SETUP
2173
 
#line 300 "pir.l"
2174
 
{ return ')'; }
2175
 
        YY_BREAK
2176
 
case 30:
2177
 
YY_RULE_SETUP
2178
 
#line 301 "pir.l"
2179
 
{ return ','; }
2180
 
        YY_BREAK
2181
 
case 31:
2182
 
YY_RULE_SETUP
2183
 
#line 302 "pir.l"
2184
 
{ return '['; }
2185
 
        YY_BREAK
2186
 
case 32:
2187
 
YY_RULE_SETUP
2188
 
#line 303 "pir.l"
2189
 
{ return ']'; }
2190
 
        YY_BREAK
2191
 
case 33:
2192
 
YY_RULE_SETUP
2193
 
#line 305 "pir.l"
2194
 
{ /* if the dot is surrounded by whitespace, it's a concatenation operator */
2195
 
                    return TK_CONC;
2196
 
                  }
2197
 
        YY_BREAK
2198
 
case 34:
2199
 
YY_RULE_SETUP
2200
 
#line 310 "pir.l"
2201
 
{ return '='; }
2202
 
        YY_BREAK
2203
 
case 35:
2204
 
YY_RULE_SETUP
2205
 
#line 311 "pir.l"
2206
 
{ return ';'; }
2207
 
        YY_BREAK
2208
 
case 36:
2209
 
YY_RULE_SETUP
2210
 
#line 313 "pir.l"
2211
 
{ return TK_ASSIGN_INC; }
2212
 
        YY_BREAK
2213
 
case 37:
2214
 
YY_RULE_SETUP
2215
 
#line 314 "pir.l"
2216
 
{ return TK_ASSIGN_DEC; }
2217
 
        YY_BREAK
2218
 
case 38:
2219
 
YY_RULE_SETUP
2220
 
#line 315 "pir.l"
2221
 
{ return TK_ASSIGN_DIV; }
2222
 
        YY_BREAK
2223
 
case 39:
2224
 
YY_RULE_SETUP
2225
 
#line 316 "pir.l"
2226
 
{ return TK_ASSIGN_MUL; }
2227
 
        YY_BREAK
2228
 
case 40:
2229
 
YY_RULE_SETUP
2230
 
#line 317 "pir.l"
2231
 
{ return TK_ASSIGN_MOD; }
2232
 
        YY_BREAK
2233
 
case 41:
2234
 
YY_RULE_SETUP
2235
 
#line 318 "pir.l"
2236
 
{ return TK_ASSIGN_POW; }
2237
 
        YY_BREAK
2238
 
case 42:
2239
 
YY_RULE_SETUP
2240
 
#line 319 "pir.l"
2241
 
{ return TK_ASSIGN_BOR; }
2242
 
        YY_BREAK
2243
 
case 43:
2244
 
YY_RULE_SETUP
2245
 
#line 320 "pir.l"
2246
 
{ return TK_ASSIGN_BAND; }
2247
 
        YY_BREAK
2248
 
case 44:
2249
 
YY_RULE_SETUP
2250
 
#line 321 "pir.l"
2251
 
{ return TK_ASSIGN_FDIV; }
2252
 
        YY_BREAK
2253
 
case 45:
2254
 
YY_RULE_SETUP
2255
 
#line 322 "pir.l"
2256
 
{ return TK_ASSIGN_BNOT; }
2257
 
        YY_BREAK
2258
 
case 46:
2259
 
YY_RULE_SETUP
2260
 
#line 323 "pir.l"
2261
 
{ return TK_ASSIGN_CONC; }
2262
 
        YY_BREAK
2263
 
case 47:
2264
 
YY_RULE_SETUP
2265
 
#line 325 "pir.l"
2266
 
{ return TK_IF; }
2267
 
        YY_BREAK
2268
 
case 48:
2269
 
YY_RULE_SETUP
2270
 
#line 326 "pir.l"
2271
 
{ return TK_GOTO; }
2272
 
        YY_BREAK
2273
 
case 49:
2274
 
YY_RULE_SETUP
2275
 
#line 327 "pir.l"
2276
 
{ return TK_UNLESS; }
2277
 
        YY_BREAK
2278
 
case 50:
2279
 
YY_RULE_SETUP
2280
 
#line 328 "pir.l"
2281
 
{ return TK_NULL; }
2282
 
        YY_BREAK
2283
 
case 51:
2284
 
YY_RULE_SETUP
2285
 
#line 330 "pir.l"
2286
 
{ return TK_INT; }
2287
 
        YY_BREAK
2288
 
case 52:
2289
 
YY_RULE_SETUP
2290
 
#line 331 "pir.l"
2291
 
{ return TK_NUM; }
2292
 
        YY_BREAK
2293
 
case 53:
2294
 
YY_RULE_SETUP
2295
 
#line 332 "pir.l"
2296
 
{ return TK_PMC; }
2297
 
        YY_BREAK
2298
 
case 54:
2299
 
YY_RULE_SETUP
2300
 
#line 333 "pir.l"
2301
 
{ return TK_STRING; }
2302
 
        YY_BREAK
2303
 
case 55:
2304
 
YY_RULE_SETUP
2305
 
#line 335 "pir.l"
2306
 
{ return TK_ANNOTATE; }
2307
 
        YY_BREAK
2308
 
case 56:
2309
 
YY_RULE_SETUP
2310
 
#line 336 "pir.l"
2311
 
{ return TK_SET_ARG; }
2312
 
        YY_BREAK
2313
 
case 57:
2314
 
YY_RULE_SETUP
2315
 
#line 337 "pir.l"
2316
 
{ return TK_CONST; }
2317
 
        YY_BREAK
2318
 
case 58:
2319
 
YY_RULE_SETUP
2320
 
#line 338 "pir.l"
2321
 
{ return TK_END; }
2322
 
        YY_BREAK
2323
 
case 59:
2324
 
YY_RULE_SETUP
2325
 
#line 339 "pir.l"
2326
 
{ return TK_FILE; }
2327
 
        YY_BREAK
2328
 
case 60:
2329
 
YY_RULE_SETUP
2330
 
#line 341 "pir.l"
2331
 
{ return TK_GET_RESULTS; }
2332
 
        YY_BREAK
2333
 
case 61:
2334
 
YY_RULE_SETUP
2335
 
#line 342 "pir.l"
2336
 
{ return TK_GLOBALCONST; }
2337
 
        YY_BREAK
2338
 
case 62:
2339
 
YY_RULE_SETUP
2340
 
#line 343 "pir.l"
2341
 
{ return TK_HLL; }
2342
 
        YY_BREAK
2343
 
case 63:
2344
 
YY_RULE_SETUP
2345
 
#line 344 "pir.l"
2346
 
{ return TK_INVOCANT; }
2347
 
        YY_BREAK
2348
 
case 64:
2349
 
YY_RULE_SETUP
2350
 
#line 345 "pir.l"
2351
 
{ return TK_LEX; }
2352
 
        YY_BREAK
2353
 
case 65:
2354
 
YY_RULE_SETUP
2355
 
#line 346 "pir.l"
2356
 
{ return TK_LINE; }
2357
 
        YY_BREAK
2358
 
case 66:
2359
 
YY_RULE_SETUP
2360
 
#line 347 "pir.l"
2361
 
{ return TK_LOADLIB; }
2362
 
        YY_BREAK
2363
 
case 67:
2364
 
YY_RULE_SETUP
2365
 
#line 348 "pir.l"
2366
 
{ return TK_LOCAL; }
2367
 
        YY_BREAK
2368
 
case 68:
2369
 
YY_RULE_SETUP
2370
 
#line 350 "pir.l"
2371
 
{ return TK_METH_CALL; }
2372
 
        YY_BREAK
2373
 
case 69:
2374
 
YY_RULE_SETUP
2375
 
#line 351 "pir.l"
2376
 
{ return TK_NAMESPACE; }
2377
 
        YY_BREAK
2378
 
case 70:
2379
 
YY_RULE_SETUP
2380
 
#line 352 "pir.l"
2381
 
{ return TK_NCI_CALL; }
2382
 
        YY_BREAK
2383
 
case 71:
2384
 
YY_RULE_SETUP
2385
 
#line 353 "pir.l"
2386
 
{ return TK_PARAM; }
2387
 
        YY_BREAK
2388
 
case 72:
2389
 
YY_RULE_SETUP
2390
 
#line 354 "pir.l"
2391
 
{ return TK_BEGIN_CALL; }
2392
 
        YY_BREAK
2393
 
case 73:
2394
 
YY_RULE_SETUP
2395
 
#line 355 "pir.l"
2396
 
{ return TK_BEGIN_RETURN; }
2397
 
        YY_BREAK
2398
 
case 74:
2399
 
YY_RULE_SETUP
2400
 
#line 356 "pir.l"
2401
 
{ return TK_BEGIN_YIELD; }
2402
 
        YY_BREAK
2403
 
case 75:
2404
 
YY_RULE_SETUP
2405
 
#line 357 "pir.l"
2406
 
{ return TK_CALL; }
2407
 
        YY_BREAK
2408
 
case 76:
2409
 
YY_RULE_SETUP
2410
 
#line 358 "pir.l"
2411
 
{ return TK_END_CALL; }
2412
 
        YY_BREAK
2413
 
case 77:
2414
 
YY_RULE_SETUP
2415
 
#line 359 "pir.l"
2416
 
{ return TK_END_RETURN; }
2417
 
        YY_BREAK
2418
 
case 78:
2419
 
YY_RULE_SETUP
2420
 
#line 360 "pir.l"
2421
 
{ return TK_END_YIELD; }
2422
 
        YY_BREAK
2423
 
case 79:
2424
 
YY_RULE_SETUP
2425
 
#line 361 "pir.l"
2426
 
{ return TK_GET_RESULT; }
2427
 
        YY_BREAK
2428
 
case 80:
2429
 
YY_RULE_SETUP
2430
 
#line 362 "pir.l"
2431
 
{ return TK_RETURN; }
2432
 
        YY_BREAK
2433
 
case 81:
2434
 
YY_RULE_SETUP
2435
 
#line 363 "pir.l"
2436
 
{ return TK_SUB; }
2437
 
        YY_BREAK
2438
 
case 82:
2439
 
YY_RULE_SETUP
2440
 
#line 364 "pir.l"
2441
 
{ return TK_YIELD; }
2442
 
        YY_BREAK
2443
 
case 83:
2444
 
YY_RULE_SETUP
2445
 
#line 365 "pir.l"
2446
 
{ return TK_SET_RETURN; }
2447
 
        YY_BREAK
2448
 
case 84:
2449
 
YY_RULE_SETUP
2450
 
#line 366 "pir.l"
2451
 
{ return TK_SET_YIELD; }
2452
 
        YY_BREAK
2453
 
case 85:
2454
 
YY_RULE_SETUP
2455
 
#line 367 "pir.l"
2456
 
{ return TK_TAILCALL; }
2457
 
        YY_BREAK
2458
 
case 86:
2459
 
YY_RULE_SETUP
2460
 
#line 370 "pir.l"
2461
 
{ /* make sure these are not used outside macro defs */
2462
 
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
2463
 
                               "cannot use '%s' outside of macro definitions", yytext);
2464
 
                  }
2465
 
        YY_BREAK
2466
 
case 87:
2467
 
YY_RULE_SETUP
2468
 
#line 377 "pir.l"
2469
 
{ return TK_FLAG_ANON; }
2470
 
        YY_BREAK
2471
 
case 88:
2472
 
YY_RULE_SETUP
2473
 
#line 378 "pir.l"
2474
 
{ return TK_FLAG_INIT; }
2475
 
        YY_BREAK
2476
 
case 89:
2477
 
YY_RULE_SETUP
2478
 
#line 379 "pir.l"
2479
 
{ return TK_FLAG_LOAD; }
2480
 
        YY_BREAK
2481
 
case 90:
2482
 
YY_RULE_SETUP
2483
 
#line 380 "pir.l"
2484
 
{ return TK_FLAG_POSTCOMP; }
2485
 
        YY_BREAK
2486
 
case 91:
2487
 
YY_RULE_SETUP
2488
 
#line 381 "pir.l"
2489
 
{ return TK_FLAG_IMMEDIATE; }
2490
 
        YY_BREAK
2491
 
case 92:
2492
 
YY_RULE_SETUP
2493
 
#line 382 "pir.l"
2494
 
{ return TK_FLAG_MAIN; }
2495
 
        YY_BREAK
2496
 
case 93:
2497
 
YY_RULE_SETUP
2498
 
#line 383 "pir.l"
2499
 
{ return TK_FLAG_METHOD; }
2500
 
        YY_BREAK
2501
 
case 94:
2502
 
YY_RULE_SETUP
2503
 
#line 384 "pir.l"
2504
 
{ return TK_FLAG_LEX; }
2505
 
        YY_BREAK
2506
 
case 95:
2507
 
YY_RULE_SETUP
2508
 
#line 385 "pir.l"
2509
 
{ return TK_FLAG_OUTER; }
2510
 
        YY_BREAK
2511
 
case 96:
2512
 
YY_RULE_SETUP
2513
 
#line 386 "pir.l"
2514
 
{ return TK_FLAG_VTABLE; }
2515
 
        YY_BREAK
2516
 
case 97:
2517
 
YY_RULE_SETUP
2518
 
#line 387 "pir.l"
2519
 
{ return TK_FLAG_MULTI; }
2520
 
        YY_BREAK
2521
 
case 98:
2522
 
YY_RULE_SETUP
2523
 
#line 388 "pir.l"
2524
 
{ return TK_FLAG_SUBID; }
2525
 
        YY_BREAK
2526
 
case 99:
2527
 
YY_RULE_SETUP
2528
 
#line 389 "pir.l"
2529
 
{ return TK_FLAG_INSTANCEOF; }
2530
 
        YY_BREAK
2531
 
case 100:
2532
 
YY_RULE_SETUP
2533
 
#line 390 "pir.l"
2534
 
{ return TK_FLAG_NSENTRY; }
2535
 
        YY_BREAK
2536
 
case 101:
2537
 
YY_RULE_SETUP
2538
 
#line 392 "pir.l"
2539
 
{ return TK_FLAG_UNIQUE_REG; }
2540
 
        YY_BREAK
2541
 
case 102:
2542
 
YY_RULE_SETUP
2543
 
#line 393 "pir.l"
2544
 
{ return TK_FLAG_OPTIONAL; }
2545
 
        YY_BREAK
2546
 
case 103:
2547
 
YY_RULE_SETUP
2548
 
#line 394 "pir.l"
2549
 
{ return TK_FLAG_OPT_FLAG; }
2550
 
        YY_BREAK
2551
 
case 104:
2552
 
YY_RULE_SETUP
2553
 
#line 395 "pir.l"
2554
 
{ return TK_FLAG_SLURPY; }
2555
 
        YY_BREAK
2556
 
case 105:
2557
 
YY_RULE_SETUP
2558
 
#line 396 "pir.l"
2559
 
{ return TK_FLAG_NAMED; }
2560
 
        YY_BREAK
2561
 
case 106:
2562
 
YY_RULE_SETUP
2563
 
#line 397 "pir.l"
2564
 
{ return TK_FLAG_FLAT; }
2565
 
        YY_BREAK
2566
 
case 107:
2567
 
YY_RULE_SETUP
2568
 
#line 398 "pir.l"
2569
 
{ return TK_FLAG_INVOCANT; }
2570
 
        YY_BREAK
2571
 
case 108:
2572
 
YY_RULE_SETUP
2573
 
#line 399 "pir.l"
2574
 
{ return TK_FLAG_LOOKAHEAD; }
2575
 
        YY_BREAK
2576
 
case 109:
2577
 
YY_RULE_SETUP
2578
 
#line 401 "pir.l"
2579
 
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
2580
 
                               "unrecognized flag: '%s'", yytext);
2581
 
                  }
2582
 
        YY_BREAK
2583
 
case 110:
2584
 
YY_RULE_SETUP
2585
 
#line 405 "pir.l"
2586
 
{ /* XXX this is a bit hacky. First the string is unescaped, but that
2587
 
                     * returns a STRING * object; that's not what we want at this point.
2588
 
                     * So, convert it back to a C string, and return that. Later, that
2589
 
                     * string is converted into a STRING again, so this must be fixed.
2590
 
                     * Preferably there would be an unescape function returning a C-string.
2591
 
                     */
2592
 
                    lexer_state * const lexer = yypirget_extra(yyscanner);
2593
 
 
2594
 
                    STRING *pstr = Parrot_str_unescape(lexer->interp,
2595
 
                                                           yytext + 1, '"', "ascii");
2596
 
 
2597
 
                    char *str = Parrot_str_to_cstring(lexer->interp, pstr);
2598
 
 
2599
 
                    yylval->sval = str;
2600
 
                    
2601
 
                    /* store the STRING in lexer's sval buffer; once PIRC is doing
2602
 
                    only STRINGs, it can be stored in yylval.sval. */
2603
 
                    lexer->sval = pstr;
2604
 
                    
2605
 
                    return TK_STRINGC;
2606
 
                  }
2607
 
        YY_BREAK
2608
 
case 111:
2609
 
YY_RULE_SETUP
2610
 
#line 427 "pir.l"
2611
 
{ /* copy the string, remove the quotes. */
2612
 
                    lexer_state * const lexer = yypirget_extra(yyscanner);
2613
 
                    
2614
 
                    STRING *str = Parrot_str_unescape(lexer->interp, yytext + 1, '\'', "ascii");
2615
 
                    lexer->sval = str;
2616
 
                    
2617
 
                    yylval->sval = dupstrn(lexer, yytext + 1, yyleng - 2);
2618
 
 
2619
 
                    
2620
 
                    return TK_STRINGC;
2621
 
                  }
2622
 
        YY_BREAK
2623
 
case 112:
2624
 
YY_RULE_SETUP
2625
 
#line 439 "pir.l"
2626
 
{ /* XXX these double-quoted strings are not unescaped (yet) */
2627
 
                    /* parse yytext, which contains the charset, a ':', and the quoted string */
2628
 
                    char        *colon = strchr(yytext, ':');
2629
 
                    lexer_state *lexer = yypirget_extra(yyscanner);
2630
 
                    ucstring    *ustr  = (ucstring *)pir_mem_allocate(lexer, sizeof (ucstring));
2631
 
                    /* copy the charset part */
2632
 
                    ustr->charset      = dupstrn(lexer, yytext, colon - yytext);
2633
 
                    /* the colon becomes a NULL character to end the encoding string */
2634
 
                    *colon = '\0';
2635
 
                    /* copy the string contents, strip the quotes. Example:
2636
 
                     *   iso-8859-1:"hi there"
2637
 
                     *   123456789012345678901
2638
 
                     *             ^
2639
 
                     *          (colon)
2640
 
                     * colon points to the colon, add 2 to point to the first character
2641
 
                     * in the string ('h'). yyleng is 20 in the example, subtract
2642
 
                     * string length of the charset part (10) and 3 for the quotes and colon.
2643
 
                     */
2644
 
 
2645
 
                    ustr->contents = dupstrn(lexer, colon + 2, yyleng - strlen(ustr->charset) - 3);
2646
 
 
2647
 
                    ustr->encoding = NULL;
2648
 
 
2649
 
                    /* fprintf(stderr, "ucstring: [%s]:[%s]\n", ustr->charset, ustr->contents); */
2650
 
 
2651
 
                    yylval->ustr = ustr;
2652
 
                    return TK_USTRINGC;
2653
 
                  }
2654
 
        YY_BREAK
2655
 
case 113:
2656
 
YY_RULE_SETUP
2657
 
#line 468 "pir.l"
2658
 
{ /* XXX these double-quoted strings are not unescaped (yet) */
2659
 
                    /* parse yytext, which contains the encoding, a ':', a charset,
2660
 
                     * a ':', and the quoted string
2661
 
                     */
2662
 
                    char        *colon1 = strchr(yytext, ':');
2663
 
                    char        *colon2;
2664
 
                    lexer_state *lexer = yypirget_extra(yyscanner);
2665
 
                    ucstring    *ustr  = (ucstring *)pir_mem_allocate(lexer, sizeof (ucstring));
2666
 
 
2667
 
                    /* yytext has the following structure:
2668
 
                     *
2669
 
                     * <charset><encoding><contents>
2670
 
                     *
2671
 
                     *   utf:unicode:"hi there"
2672
 
                     *   1234567890123456789012
2673
 
                     *      ^       ^
2674
 
                     *   (colon1) (colon2)
2675
 
                     *
2676
 
                     * colon1 points to the first colon, colon2 points to the second.
2677
 
                     */
2678
 
 
2679
 
                    /* copy the encoding part */
2680
 
                    ustr->encoding = dupstrn(lexer, yytext, colon1 - yytext);
2681
 
 
2682
 
                    /* look for the second colon after this one */
2683
 
                    colon2 = strchr(colon1 + 1, ':');
2684
 
                    /* the colon becomes a NULL character to end the encoding string */
2685
 
                    *colon1 = '\0';
2686
 
 
2687
 
                    ustr->charset  = dupstrn(lexer, colon1 + 1, colon2 - colon1 - 1);
2688
 
 
2689
 
                    /* start copying after the second colon, and skip the quote as well.
2690
 
                     * yyleng contains the total length, substract length of encoding,
2691
 
                     * length of charset, 2 quotes, and 2 colons (hence -4).
2692
 
                     */
2693
 
                    ustr->contents = dupstrn(lexer, colon2 + 2,
2694
 
                                 yyleng - strlen(ustr->charset) - strlen(ustr->encoding) - 4);
2695
 
 
2696
 
                    /* fprintf(stderr, "ucstring: [%s]:[%s]:[%s]\n", ustr->encoding, ustr->charset,
2697
 
                                   ustr->contents);
2698
 
                    */
2699
 
 
2700
 
                    yylval->ustr = ustr;
2701
 
                    return TK_USTRINGC;
2702
 
 
2703
 
                  }
2704
 
        YY_BREAK
2705
 
case 114:
2706
 
YY_RULE_SETUP
2707
 
#line 516 "pir.l"
2708
 
{ yylval->ival = atoi(yytext + 2); return TK_PREG; }
2709
 
        YY_BREAK
2710
 
case 115:
2711
 
YY_RULE_SETUP
2712
 
#line 517 "pir.l"
2713
 
{ yylval->ival = atoi(yytext + 2); return TK_SREG; }
2714
 
        YY_BREAK
2715
 
case 116:
2716
 
YY_RULE_SETUP
2717
 
#line 518 "pir.l"
2718
 
{ yylval->ival = atoi(yytext + 2); return TK_NREG; }
2719
 
        YY_BREAK
2720
 
case 117:
2721
 
YY_RULE_SETUP
2722
 
#line 519 "pir.l"
2723
 
{ yylval->ival = atoi(yytext + 2); return TK_IREG; }
2724
 
        YY_BREAK
2725
 
case 118:
2726
 
YY_RULE_SETUP
2727
 
#line 521 "pir.l"
2728
 
{ /* make the label Id available in the parser. remove the ":" first. */
2729
 
                    lexer_state * const lexer = yypirget_extra(yyscanner);
2730
 
                    STRING *str = Parrot_str_new(lexer->interp, yytext, yyleng - 1);
2731
 
                    lexer->sval = str;
2732
 
                    
2733
 
                    yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
2734
 
                    return TK_LABEL;
2735
 
                  }
2736
 
        YY_BREAK
2737
 
case 119:
2738
 
YY_RULE_SETUP
2739
 
#line 530 "pir.l"
2740
 
{ /* give a warning when using PASM registers as PIR identifiers */
2741
 
                    lexer_state * const lexer = yypirget_extra(yyscanner);
2742
 
 
2743
 
                    if (TEST_FLAG(lexer->flags, LEXER_FLAG_WARNINGS))
2744
 
                        pirwarning(lexer, yypirget_lineno(yyscanner),
2745
 
                                   "Use of PASM register identifier ('%s') "
2746
 
                                   "is not encouraged for readable code", yytext);
2747
 
 
2748
 
                    yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
2749
 
                    return TK_IDENT;
2750
 
                  }
2751
 
        YY_BREAK
2752
 
case 120:
2753
 
YY_RULE_SETUP
2754
 
#line 542 "pir.l"
2755
 
{ /* identifier; can be a global (sub or const), local or parrot op */
2756
 
                    lexer_state * const lexer = yypirget_extra(yyscanner);
2757
 
                    constdecl   * const c = find_global_constant(lexer, yytext);
2758
 
 
2759
 
                    if (c) { /* it's  a global const */
2760
 
                        switch (c->type) {
2761
 
                            case INT_VAL:
2762
 
                                yylval->ival = c->val.ival;
2763
 
                                return TK_INTC;
2764
 
                            case STRING_VAL:
2765
 
                                yylval->sval = c->val.sval;
2766
 
                                return TK_STRINGC;
2767
 
                            case NUM_VAL:
2768
 
                                yylval->dval = c->val.nval;
2769
 
                                return TK_NUMC;
2770
 
                            case USTRING_VAL:
2771
 
                                yylval->sval = c->val.ustr->contents;
2772
 
                                return TK_USTRINGC;
2773
 
                            default:
2774
 
                                panic(lexer, "unsupported constant type");
2775
 
                                break;
2776
 
                        }
2777
 
                    }
2778
 
                    lexer->sval = Parrot_str_new(lexer->interp, yytext, yyleng);
2779
 
                                                        
2780
 
                    yylval->sval = dupstr(lexer, yytext);
2781
 
                    return TK_IDENT;
2782
 
                  }
2783
 
        YY_BREAK
2784
 
case 121:
2785
 
YY_RULE_SETUP
2786
 
#line 571 "pir.l"
2787
 
{ yylval->dval = atof(yytext); return TK_NUMC; }
2788
 
        YY_BREAK
2789
 
case 122:
2790
 
YY_RULE_SETUP
2791
 
#line 572 "pir.l"
2792
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
2793
 
        YY_BREAK
2794
 
case 123:
2795
 
YY_RULE_SETUP
2796
 
#line 573 "pir.l"
2797
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
2798
 
        YY_BREAK
2799
 
case 124:
2800
 
YY_RULE_SETUP
2801
 
#line 574 "pir.l"
2802
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
2803
 
        YY_BREAK
2804
 
case 125:
2805
 
YY_RULE_SETUP
2806
 
#line 575 "pir.l"
2807
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
2808
 
        YY_BREAK
2809
 
case 126:
2810
 
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
2811
 
yyg->yy_c_buf_p = yy_cp = yy_bp + 1;
2812
 
YY_DO_BEFORE_ACTION; /* set up yytext again */
2813
 
YY_RULE_SETUP
2814
 
#line 577 "pir.l"
2815
 
{ /* Make sure the dot is followed by a character that
2816
 
                     * starts a method object. $ for registers,
2817
 
                     * quotes for quoted strings, and letters for identifiers.
2818
 
                     *
2819
 
                     */
2820
 
                     return '.';
2821
 
                  }
2822
 
        YY_BREAK
2823
 
case 127:
2824
 
/* rule 127 can match eol */
2825
 
YY_RULE_SETUP
2826
 
#line 585 "pir.l"
2827
 
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
2828
 
                    "no space allowed before a methodcall dot, "
2829
 
                    "or space expected after the '.' operator");
2830
 
                    return '.';
2831
 
                  }
2832
 
        YY_BREAK
2833
 
 
2834
 
 
2835
 
/* SCANSTR<<EOF>> and SCANMACRO<<EOF>> must be defined before <INTIAL><<EOF>>,
2836
 
 * because they are %s states, which means they are inclusive, not exclusive states.
2837
 
 * An inclusive scanner state will recognize all other tokens defined in <INITIAL>
2838
 
 * state, but they are used here to override the action when scanning <INITIAL><<EOF>>.
2839
 
 */
2840
 
 
2841
 
/* SCANSTR and SCANMACRO are states that are active when expanding a macro_const
2842
 
 * or a macro, respectively. When expanding a macro_const, no new macro_table
2843
 
 * is created, which acts as a local symbol table for parameters. Hence, there
2844
 
 * are two different <<EOF>> actions for them.
2845
 
 */
2846
 
 
2847
 
 
2848
 
case YY_STATE_EOF(SCANSTR):
2849
 
#line 607 "pir.l"
2850
 
{ /* switch back from .macro_const buffer to file. */
2851
 
                     lexer_state * const lexer = yypirget_extra(yyscanner);
2852
 
                     yy_pop_state(yyscanner);
2853
 
                     yypir_switch_to_buffer(lexer->buffer,yyscanner);
2854
 
                   }
2855
 
        YY_BREAK
2856
 
case YY_STATE_EOF(SCANMACRO):
2857
 
#line 613 "pir.l"
2858
 
{ /* override the default <<EOF>> action; go back to normal state and
2859
 
                      * switch back to the saved file.
2860
 
                      */
2861
 
                     lexer_state * const lexer = yypirget_extra(yyscanner);
2862
 
                     macro_table * const table = pop_macro_table(lexer);
2863
 
 
2864
 
                     yy_pop_state(yyscanner); /* pop off the SCANMACRO scanner state */
2865
 
 
2866
 
                     /* switch back to whatever buffer we were scanning before we started
2867
 
                      * to read the macro's buffer.
2868
 
                      */
2869
 
                     yypir_switch_to_buffer(table->prev_buff,yyscanner);
2870
 
 
2871
 
                     /* restore line number */
2872
 
                     yypirset_lineno(table->lineno,yyscanner);
2873
 
 
2874
 
                     /* restore current scope id */
2875
 
                     lexer->unique_id = table->scopeno;
2876
 
 
2877
 
                     delete_macro_table(table);
2878
 
 
2879
 
                   }
2880
 
        YY_BREAK
2881
 
case 128:
2882
 
YY_RULE_SETUP
2883
 
#line 636 "pir.l"
2884
 
{ /* when scanning a macro body, the @ marker indicates the {IDENT} must
2885
 
                          * be munged.
2886
 
                          */
2887
 
                            lexer_state * const lexer = yypirget_extra(yyscanner);
2888
 
                            char const  * const id    = dupstrn(lexer, yytext, yyleng - 1);
2889
 
                            yylval->sval              = munge_id(id, lexer);
2890
 
                            return TK_IDENT;
2891
 
                       }
2892
 
        YY_BREAK
2893
 
case YY_STATE_EOF(INITIAL):
2894
 
#line 645 "pir.l"
2895
 
{ /* end of file, stop scanning. */
2896
 
                    yyterminate();
2897
 
                  }
2898
 
        YY_BREAK
2899
 
case 129:
2900
 
YY_RULE_SETUP
2901
 
#line 649 "pir.l"
2902
 
{ /* any character not covered in the rules above is an error. */
2903
 
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
2904
 
                               "unexpected character: '%c'", yytext[0]);
2905
 
                  }
2906
 
        YY_BREAK
2907
 
 
2908
 
 
2909
 
/*****************************************************************************
2910
 
*
2911
 
*  the following rules implement the macro layer.
2912
 
*
2913
 
*****************************************************************************/
2914
 
 
2915
 
 
2916
 
 
2917
 
/********************** .macro_const ****************************************/
2918
 
 
2919
 
 
2920
 
case 130:
2921
 
YY_RULE_SETUP
2922
 
#line 671 "pir.l"
2923
 
{
2924
 
                               yy_push_state(MACROCONST, yyscanner);
2925
 
                               return TK_MACRO_CONST;
2926
 
                             }
2927
 
        YY_BREAK
2928
 
case 131:
2929
 
YY_RULE_SETUP
2930
 
#line 676 "pir.l"
2931
 
{
2932
 
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
2933
 
                               return TK_IDENT;
2934
 
                             }
2935
 
        YY_BREAK
2936
 
case 132:
2937
 
YY_RULE_SETUP
2938
 
#line 681 "pir.l"
2939
 
{
2940
 
                               /* only these tokens can be macro constant values */
2941
 
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
2942
 
                               yy_pop_state(yyscanner);
2943
 
                               return TK_MACRO_CONST_VAL;
2944
 
                             }
2945
 
        YY_BREAK
2946
 
case 133:
2947
 
YY_RULE_SETUP
2948
 
#line 688 "pir.l"
2949
 
{ /* ignore whitespace */ }
2950
 
        YY_BREAK
2951
 
case 134:
2952
 
YY_RULE_SETUP
2953
 
#line 689 "pir.l"
2954
 
{
2955
 
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
2956
 
                                          "unknown character: '%c'", yytext[0]);
2957
 
                             }
2958
 
        YY_BREAK
2959
 
case YY_STATE_EOF(MACROCONST):
2960
 
#line 693 "pir.l"
2961
 
{
2962
 
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
2963
 
                                          "read end of file during .macro_const definition");
2964
 
                             }
2965
 
        YY_BREAK
2966
 
 
2967
 
 
2968
 
/**************** macro header (.macro <ident> <parameters> ) ***************/
2969
 
 
2970
 
 
2971
 
case 135:
2972
 
YY_RULE_SETUP
2973
 
#line 704 "pir.l"
2974
 
{ /* start a macro definition */
2975
 
                               yy_push_state(MACROHEAD, yyscanner);
2976
 
                               return TK_MACRO;
2977
 
                             }
2978
 
        YY_BREAK
2979
 
case 136:
2980
 
YY_RULE_SETUP
2981
 
#line 709 "pir.l"
2982
 
{ /* ignore whitespace */ }
2983
 
        YY_BREAK
2984
 
case 137:
2985
 
YY_RULE_SETUP
2986
 
#line 710 "pir.l"
2987
 
{
2988
 
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
2989
 
                               return TK_IDENT;
2990
 
                             }
2991
 
        YY_BREAK
2992
 
case 138:
2993
 
YY_RULE_SETUP
2994
 
#line 715 "pir.l"
2995
 
{ return '('; }
2996
 
        YY_BREAK
2997
 
case 139:
2998
 
YY_RULE_SETUP
2999
 
#line 716 "pir.l"
3000
 
{ return ')'; }
3001
 
        YY_BREAK
3002
 
case 140:
3003
 
YY_RULE_SETUP
3004
 
#line 717 "pir.l"
3005
 
{ return ','; }
3006
 
        YY_BREAK
3007
 
case 141:
3008
 
/* rule 141 can match eol */
3009
 
YY_RULE_SETUP
3010
 
#line 719 "pir.l"
3011
 
{ /* a set of continuous newlines yields a single newline token. */
3012
 
                               yy_pop_state(yyscanner); /* remove MACROHEAD state */
3013
 
                               yy_push_state(MACROBODY, yyscanner); /* enter MACROBODY state */
3014
 
                               return TK_NL;
3015
 
                             }
3016
 
        YY_BREAK
3017
 
 
3018
 
 
3019
 
/******************************* macro expansion ***************************/
3020
 
 
3021
 
/*
3022
 
 * Only identifiers, constants and registers are recognized.
3023
 
 */
3024
 
 
3025
 
 
3026
 
case 142:
3027
 
YY_RULE_SETUP
3028
 
#line 735 "pir.l"
3029
 
{ /* .foo; it can be a macro, macro_local, or just $P0.foo(),
3030
 
                                * but we need to check that.
3031
 
                                */
3032
 
                               lexer_state * const lexer = yypirget_extra(yyscanner);
3033
 
                               macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
3034
 
 
3035
 
                               if (macro == NULL) { /* it's not a macro */
3036
 
 
3037
 
                                   /* it may be a .macro_local */
3038
 
                                   macro_table *table = peek_macro_table(lexer);
3039
 
 
3040
 
                                   if (table->thismacro != NULL) { /* not expanding a macro */
3041
 
 
3042
 
                                       if (is_macro_local(table->thismacro, yytext + 1)) {
3043
 
                                           yylval->sval = munge_id(yytext + 1, lexer);
3044
 
                                           return TK_IDENT;
3045
 
                                       }
3046
 
                                       /* else fall through */
3047
 
                                   }
3048
 
 
3049
 
                                   /* table->thismacro == NULL || is_macro_local() == FALSE */
3050
 
                                   yyless(1); /* return all but first character */
3051
 
                                   return '.';
3052
 
 
3053
 
                               }
3054
 
                               else { /* it's a macro */
3055
 
                                   /* fprintf(stderr, "found .ident: %s\n", yytext + 1); */
3056
 
 
3057
 
                                   /* store current buffer at this point, because we'll be
3058
 
                                    * scanning a string buffer later on. Saving must be done
3059
 
                                    * in the lexer specification, otherwise YY_CURRENT_BUFFER
3060
 
                                    * cannot be used (it's a macro).
3061
 
                                    */
3062
 
                                   lexer->buffer = YY_CURRENT_BUFFER;
3063
 
 
3064
 
                                   /* if it's a .macro, (not .macro_const), then go into
3065
 
                                    * MACROEXPAND state, to correctly parse the arguments.
3066
 
                                    * For .macro_const, we don't want this, because a .macro_const
3067
 
                                    * is expanded here, hidden from the parser.
3068
 
                                    */
3069
 
                                   if (macro->takes_args) {
3070
 
                                       yylval->mval = macro;
3071
 
                                       yy_push_state(MACROEXPAND, yyscanner);
3072
 
                                       return TK_MACRO_IDENT;
3073
 
                                   }
3074
 
                                   else { /* expand the .macro_const here; no need for
3075
 
                                           * adding this to the grammar. */
3076
 
                                       /* goto SCANSTR state, and scan macro->body */
3077
 
                                       yy_push_state(SCANSTR, yyscanner);
3078
 
                                       yypir_scan_string(macro->body,yyscanner);
3079
 
                                   }
3080
 
                               }
3081
 
                             }
3082
 
        YY_BREAK
3083
 
case 143:
3084
 
YY_RULE_SETUP
3085
 
#line 789 "pir.l"
3086
 
{ /* expand a .macro_const or parameter in argument list */
3087
 
                               lexer_state * const lexer = yypirget_extra(yyscanner);
3088
 
                               macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
3089
 
 
3090
 
                               if (macro) {
3091
 
                                   /* .foo( .bar() ) is not allowed; that's too fancy for PIR. */
3092
 
                                   if (macro->takes_args) {
3093
 
                                      /*
3094
 
                                       yypirerror(yyscanner, lexer, "cannot expand a .macro"
3095
 
                                                  "in another .macro's argument list");
3096
 
 
3097
 
                                       */
3098
 
 
3099
 
                                       yylval->mval = macro;
3100
 
                                       /* yy_push_state(MACROEXPAND, yyscanner);
3101
 
                                       */
3102
 
                                      return TK_MACRO_IDENT;
3103
 
                                   }
3104
 
                                   else { /* we do allow expansion of .macro_consts as macro args */
3105
 
                                       lexer->buffer = YY_CURRENT_BUFFER;
3106
 
                                       yy_push_state(STRINGEXPAND, yyscanner);
3107
 
                                       yypir_scan_string(macro->body,yyscanner);
3108
 
                                   }
3109
 
                               }
3110
 
                               else
3111
 
                                   yypirerror(yyscanner, lexer, "'%s' is not a macro", yytext + 1);
3112
 
                             }
3113
 
        YY_BREAK
3114
 
case 144:
3115
 
YY_RULE_SETUP
3116
 
#line 817 "pir.l"
3117
 
{
3118
 
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
3119
 
                               return TK_MACRO_ARG_IDENT;
3120
 
                             }
3121
 
        YY_BREAK
3122
 
case 145:
3123
 
YY_RULE_SETUP
3124
 
#line 822 "pir.l"
3125
 
{
3126
 
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
3127
 
                               return TK_MACRO_ARG_OTHER;
3128
 
                             }
3129
 
        YY_BREAK
3130
 
case 146:
3131
 
YY_RULE_SETUP
3132
 
#line 827 "pir.l"
3133
 
{ /* ignore whitespace */ }
3134
 
        YY_BREAK
3135
 
case 147:
3136
 
YY_RULE_SETUP
3137
 
#line 828 "pir.l"
3138
 
{ return ','; }
3139
 
        YY_BREAK
3140
 
case 148:
3141
 
YY_RULE_SETUP
3142
 
#line 829 "pir.l"
3143
 
{ return '('; }
3144
 
        YY_BREAK
3145
 
case 149:
3146
 
YY_RULE_SETUP
3147
 
#line 830 "pir.l"
3148
 
{
3149
 
                               yy_pop_state(yyscanner); /* leave MACROEXPAND state */
3150
 
                               return ')';
3151
 
                             }
3152
 
        YY_BREAK
3153
 
case 150:
3154
 
YY_RULE_SETUP
3155
 
#line 835 "pir.l"
3156
 
{
3157
 
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
3158
 
                               return TK_MACRO_ARG_OTHER;
3159
 
                             }
3160
 
        YY_BREAK
3161
 
case YY_STATE_EOF(STRINGEXPAND):
3162
 
#line 840 "pir.l"
3163
 
{
3164
 
                               lexer_state * const lexer = yypirget_extra(yyscanner);
3165
 
                               yy_pop_state(yyscanner);
3166
 
                               yypir_switch_to_buffer(lexer->buffer,yyscanner);
3167
 
                             }
3168
 
        YY_BREAK
3169
 
case 151:
3170
 
YY_RULE_SETUP
3171
 
#line 846 "pir.l"
3172
 
{ return '{'; }
3173
 
        YY_BREAK
3174
 
case 152:
3175
 
YY_RULE_SETUP
3176
 
#line 847 "pir.l"
3177
 
{ return '}'; }
3178
 
        YY_BREAK
3179
 
case 153:
3180
 
/* rule 153 can match eol */
3181
 
YY_RULE_SETUP
3182
 
#line 849 "pir.l"
3183
 
{ yylval->sval = "\n"; return TK_NL; }
3184
 
        YY_BREAK
3185
 
case 154:
3186
 
YY_RULE_SETUP
3187
 
#line 851 "pir.l"
3188
 
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
3189
 
                                          "unknown character in macro expansion: %c", yytext[0]);
3190
 
                             }
3191
 
        YY_BREAK
3192
 
 
3193
 
 
3194
 
/******************************** .macro_local *****************************/
3195
 
 
3196
 
 
3197
 
case 155:
3198
 
YY_RULE_SETUP
3199
 
#line 862 "pir.l"
3200
 
{ /* give a warning if the right flag is set */
3201
 
                              /*
3202
 
                              lexer_state * const lexer = yypirget_extra(yyscanner);
3203
 
                              if (TEST_FLAG(lexer->flags, LEXER_FLAG_WARNINGS))
3204
 
                                  pirwarning(lexer, yypirget_lineno(yyscanner),
3205
 
                                             "use of .local in macros prevents multiple "
3206
 
                                             "usage of macro in one sub. Use .macro_local instead");
3207
 
                              return TK_LOCAL;
3208
 
                              XXX we should disallow .local altogether in macros.
3209
 
                              Doesn't make sense to use it.
3210
 
                              */
3211
 
                            }
3212
 
        YY_BREAK
3213
 
case 156:
3214
 
YY_RULE_SETUP
3215
 
#line 876 "pir.l"
3216
 
{
3217
 
                              yy_push_state(MACROLOCAL, yyscanner);
3218
 
                              return TK_MACRO_LOCAL;
3219
 
                            }
3220
 
        YY_BREAK
3221
 
case 157:
3222
 
YY_RULE_SETUP
3223
 
#line 881 "pir.l"
3224
 
{ return TK_INT; }
3225
 
        YY_BREAK
3226
 
case 158:
3227
 
YY_RULE_SETUP
3228
 
#line 882 "pir.l"
3229
 
{ return TK_PMC; }
3230
 
        YY_BREAK
3231
 
case 159:
3232
 
YY_RULE_SETUP
3233
 
#line 883 "pir.l"
3234
 
{ return TK_NUM; }
3235
 
        YY_BREAK
3236
 
case 160:
3237
 
YY_RULE_SETUP
3238
 
#line 884 "pir.l"
3239
 
{ return TK_STRING; }
3240
 
        YY_BREAK
3241
 
case 161:
3242
 
YY_RULE_SETUP
3243
 
#line 886 "pir.l"
3244
 
{ /* normal .macro_local */
3245
 
                              lexer_state * const lexer = yypirget_extra(yyscanner);
3246
 
                              /* reserve space for {IDENT}, the @ marker and the NULL char. */
3247
 
                              char * temp = (char *)mem_sys_allocate((yyleng + 2) * sizeof (char));
3248
 
                              /* stick a special marker "@" so we can recognize this as a id
3249
 
                               * that must be munged.
3250
 
                               */
3251
 
                              sprintf(temp, "%s@", yytext);
3252
 
                              yylval->sval = temp;
3253
 
 
3254
 
                              /* declare it as a macro local symbol */
3255
 
                              declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
3256
 
                              return TK_MACRO_LOCAL_ID;
3257
 
                            }
3258
 
        YY_BREAK
3259
 
case 162:
3260
 
YY_RULE_SETUP
3261
 
#line 901 "pir.l"
3262
 
{ /* declare a .macro_local based on a parameter */
3263
 
                              lexer_state * const lexer = yypirget_extra(yyscanner);
3264
 
 
3265
 
                              char * temp = (char *)mem_sys_allocate((yyleng + 2) * sizeof (char));
3266
 
                              /* stick a "@" after, so it can be recognized later */
3267
 
                              sprintf(temp, "%s@", yytext);
3268
 
                              yylval->sval = temp;
3269
 
 
3270
 
                              /* declare the {IDENT} part as a local */
3271
 
                              declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext + 1));
3272
 
                              return TK_MACRO_LOCAL_ID;
3273
 
 
3274
 
                            }
3275
 
        YY_BREAK
3276
 
case 163:
3277
 
YY_RULE_SETUP
3278
 
#line 915 "pir.l"
3279
 
{ /* .$foo */
3280
 
                              lexer_state * const lexer = yypirget_extra(yyscanner);
3281
 
                              macro_table * const table = peek_macro_table(lexer);
3282
 
                              macro_def   * const param = find_macro(table, yytext + 2);
3283
 
 
3284
 
                              if (param == NULL)
3285
 
                                  yypirerror(yyscanner, lexer, "Cannot expand '%s', as it is "
3286
 
                                             "not a macro parameter", yytext);
3287
 
                              else {
3288
 
                                  unsigned len = strlen(param->body);
3289
 
                                  /* length includes quotes, so substract 2, + 1 for NULL char. */
3290
 
                                  char *unquoted = (char *)mem_sys_allocate_zeroed(
3291
 
                                                                        (len - 1) * sizeof (char));
3292
 
                                  /* remove the quotes */
3293
 
                                  if (param->body[0] != '"')
3294
 
                                      yypirerror(yyscanner, lexer,
3295
 
                                         "value of macro argument '%s' must be a quoted string",
3296
 
                                         yytext);
3297
 
 
3298
 
                                  strncpy(unquoted, param->body + 1, len - 2);
3299
 
                                  yylval->sval = munge_id(unquoted, lexer);
3300
 
 
3301
 
                                  mem_sys_free(unquoted);
3302
 
                                  return TK_IDENT;
3303
 
 
3304
 
                              }
3305
 
 
3306
 
                            }
3307
 
        YY_BREAK
3308
 
case 164:
3309
 
YY_RULE_SETUP
3310
 
#line 944 "pir.l"
3311
 
{ /* expanding a .macro_local using a macro parameter value */
3312
 
                             lexer_state * const lexer     = yypirget_extra(yyscanner);
3313
 
                             char  const * const paramname = dupstrn(lexer, yytext + 1, yyleng - 2);
3314
 
                             macro_def   * const param     = find_macro(lexer->macros, paramname);
3315
 
 
3316
 
                             if (param == NULL) {
3317
 
                                yypirerror(yyscanner, lexer, "Cannot expand %s; '%s' was not "
3318
 
                                           "declared as a macro parameter", yytext, paramname);
3319
 
                             }
3320
 
                             else {
3321
 
                                unsigned  len      = strlen(param->body);
3322
 
                                char     *unquoted = (char *)mem_sys_allocate_zeroed(
3323
 
                                                                      (len - 1) * sizeof (char));
3324
 
 
3325
 
                                /* unquote the string */
3326
 
                                strncpy(unquoted, param->body + 1, len - 2);
3327
 
 
3328
 
                                yylval->sval       = munge_id(unquoted, lexer);
3329
 
                                mem_sys_free(unquoted);
3330
 
                             }
3331
 
                             /* fprintf(stderr, "scanmacro:$id@: [%s]\n", yylval->sval); */
3332
 
 
3333
 
                             return TK_IDENT;
3334
 
                           }
3335
 
        YY_BREAK
3336
 
case 165:
3337
 
YY_RULE_SETUP
3338
 
#line 969 "pir.l"
3339
 
{ /* ignore whitespace */ }
3340
 
        YY_BREAK
3341
 
case 166:
3342
 
/* rule 166 can match eol */
3343
 
YY_RULE_SETUP
3344
 
#line 971 "pir.l"
3345
 
{ /* newline after .macro_local <type> <ident> line */
3346
 
                              yy_pop_state(yyscanner);
3347
 
                              return TK_NL;
3348
 
                            }
3349
 
        YY_BREAK
3350
 
case 167:
3351
 
YY_RULE_SETUP
3352
 
#line 976 "pir.l"
3353
 
{ /* this state is only used for declaring .macro_locals */
3354
 
                              yypirerror(yyscanner, yypirget_extra(yyscanner),
3355
 
                                 "unknown character '%c' when declaring .macro_local", yytext[0]);
3356
 
                            }
3357
 
        YY_BREAK
3358
 
 
3359
 
 
3360
 
/****************************** .macro_label ********************************/
3361
 
 
3362
 
 
3363
 
case 168:
3364
 
YY_RULE_SETUP
3365
 
#line 986 "pir.l"
3366
 
{
3367
 
                              yy_push_state(MACROLABEL, yyscanner);
3368
 
                              return TK_MACRO_LABEL;
3369
 
                            }
3370
 
        YY_BREAK
3371
 
case 169:
3372
 
YY_RULE_SETUP
3373
 
#line 991 "pir.l"
3374
 
{ /* if the "$" is there, it's a macro label using a macro
3375
 
                               * parameter's value; otherwise it's a normal macro label
3376
 
                               */
3377
 
                              lexer_state * const lexer = yypirget_extra(yyscanner);
3378
 
                              char * temp = (char *)pir_mem_allocate(lexer,
3379
 
                                                                     (yyleng + 2) * sizeof (char));
3380
 
                              /* stick a special marker "@" so we can recognize this as a label
3381
 
                               * that must be munged.
3382
 
                               */
3383
 
                              strncpy(temp, yytext, yyleng - 1);
3384
 
                              strcpy(temp + yyleng - 1, "@:");
3385
 
 
3386
 
                              yylval->sval = temp;
3387
 
                              declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
3388
 
                              return TK_MACRO_LABEL_ID;
3389
 
                            }
3390
 
        YY_BREAK
3391
 
case 170:
3392
 
/* rule 170 can match eol */
3393
 
YY_RULE_SETUP
3394
 
#line 1009 "pir.l"
3395
 
{ /* the newline character after a ".macro_label $foo:" declaration */
3396
 
                              yy_pop_state(yyscanner); /* leave MACROLABEL state */
3397
 
                              return TK_NL;
3398
 
                            }
3399
 
        YY_BREAK
3400
 
case 171:
3401
 
YY_RULE_SETUP
3402
 
#line 1015 "pir.l"
3403
 
{ /* scan a label when expanding a buffer; declared as .macro_label */
3404
 
                              lexer_state * const lexer = yypirget_extra(yyscanner);
3405
 
                              char const  * const label = dupstrn(lexer, yytext, yyleng - 2);
3406
 
                              yylval->sval = munge_id(label, lexer);
3407
 
                              return TK_LABEL;
3408
 
                            }
3409
 
        YY_BREAK
3410
 
case 172:
3411
 
YY_RULE_SETUP
3412
 
#line 1022 "pir.l"
3413
 
{ /* scan a label when expanding macro; was a macro parameter */
3414
 
                             lexer_state * const lexer     = yypirget_extra(yyscanner);
3415
 
                             char const  * const paramname = dupstrn(lexer, yytext + 1, yyleng - 3);
3416
 
                             macro_def   * const param     = find_macro(lexer->macros, paramname);
3417
 
 
3418
 
                             if (param == NULL) {
3419
 
                                 yypirerror(yyscanner, lexer, "Cannot expand %s; '%s' was not "
3420
 
                                            "declared as a macro parameter", yytext, paramname);
3421
 
                             }
3422
 
                             else {
3423
 
                                 unsigned len   = strlen(param->body);
3424
 
                                 char *unquoted = (char *)mem_sys_allocate_zeroed(
3425
 
                                                                       (len - 1) * sizeof (char));
3426
 
                                 /* unquote the string */
3427
 
                                 if (param->body[0] != '"')
3428
 
                                     yypirerror(yyscanner, lexer,
3429
 
                                         "value of macro argument '%s' must be a quoted string",
3430
 
                                         yytext);
3431
 
 
3432
 
                                 strncpy(unquoted, param->body + 1, len - 2);
3433
 
                                 yylval->sval = munge_id(unquoted, lexer);
3434
 
                                 mem_sys_free(unquoted);
3435
 
                             }
3436
 
                             return TK_LABEL;
3437
 
                           }
3438
 
        YY_BREAK
3439
 
 
3440
 
 
3441
 
/*************************** macro body scanning (storing) ****************************/
3442
 
 
3443
 
 
3444
 
case 173:
3445
 
/* rule 173 can match eol */
3446
 
YY_RULE_SETUP
3447
 
#line 1055 "pir.l"
3448
 
{ store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), '\n'); }
3449
 
        YY_BREAK
3450
 
case 174:
3451
 
YY_RULE_SETUP
3452
 
#line 1057 "pir.l"
3453
 
{
3454
 
                               yy_pop_state(yyscanner); /* leave MACROBODY state */
3455
 
                               return TK_ENDM;
3456
 
                             }
3457
 
        YY_BREAK
3458
 
case 175:
3459
 
YY_RULE_SETUP
3460
 
#line 1062 "pir.l"
3461
 
{ /* store everything else */
3462
 
                               store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), yytext[0]);
3463
 
                             }
3464
 
        YY_BREAK
3465
 
case YY_STATE_EOF(MACROBODY):
3466
 
#line 1066 "pir.l"
3467
 
{ /* catch run-away macro bodys */
3468
 
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
3469
 
                                          "read end of file while reading macro body");
3470
 
                             }
3471
 
        YY_BREAK
3472
 
 /*
3473
 
{WS}"."           {
3474
 
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
3475
 
                          "ambiguous '.'; must be enclosed in space on both sides or none at all.");
3476
 
                    return TK_CONC;
3477
 
                  }
3478
 
 
3479
 
 
3480
 
"."{WS}           {
3481
 
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
3482
 
                          "ambiguous '.'; must be enclosed in space on both sides or none at all.");
3483
 
                    return TK_CONC;
3484
 
                  }
3485
 
 
3486
 
       */
3487
 
 
3488
 
 
3489
 
 
3490
 
/* PASM tokens.
3491
 
 *
3492
 
 * do not mix with other tokens, using <state1,state2> notation.
3493
 
 * This becomes unmanageable
3494
 
 */
3495
 
 
3496
 
case 176:
3497
 
YY_RULE_SETUP
3498
 
#line 1098 "pir.l"
3499
 
{ return ','; }
3500
 
        YY_BREAK
3501
 
case 177:
3502
 
YY_RULE_SETUP
3503
 
#line 1099 "pir.l"
3504
 
{ return '['; }
3505
 
        YY_BREAK
3506
 
case 178:
3507
 
YY_RULE_SETUP
3508
 
#line 1100 "pir.l"
3509
 
{ return ']'; }
3510
 
        YY_BREAK
3511
 
case 179:
3512
 
YY_RULE_SETUP
3513
 
#line 1102 "pir.l"
3514
 
{ return TK_FLAG_MAIN; }
3515
 
        YY_BREAK
3516
 
case 180:
3517
 
YY_RULE_SETUP
3518
 
#line 1103 "pir.l"
3519
 
{ return TK_FLAG_LOAD; }
3520
 
        YY_BREAK
3521
 
case 181:
3522
 
YY_RULE_SETUP
3523
 
#line 1104 "pir.l"
3524
 
{ return TK_FLAG_INIT; }
3525
 
        YY_BREAK
3526
 
case 182:
3527
 
YY_RULE_SETUP
3528
 
#line 1105 "pir.l"
3529
 
{ return TK_FLAG_ANON; }
3530
 
        YY_BREAK
3531
 
case 183:
3532
 
YY_RULE_SETUP
3533
 
#line 1106 "pir.l"
3534
 
{ return TK_FLAG_POSTCOMP; }
3535
 
        YY_BREAK
3536
 
case 184:
3537
 
YY_RULE_SETUP
3538
 
#line 1107 "pir.l"
3539
 
{ return TK_FLAG_IMMEDIATE; }
3540
 
        YY_BREAK
3541
 
case 185:
3542
 
YY_RULE_SETUP
3543
 
#line 1109 "pir.l"
3544
 
{ return TK_PCC_SUB; }
3545
 
        YY_BREAK
3546
 
case 186:
3547
 
YY_RULE_SETUP
3548
 
#line 1110 "pir.l"
3549
 
{ return TK_LEX; }
3550
 
        YY_BREAK
3551
 
case 187:
3552
 
YY_RULE_SETUP
3553
 
#line 1111 "pir.l"
3554
 
{ return TK_NAMESPACE; }
3555
 
        YY_BREAK
3556
 
case 188:
3557
 
YY_RULE_SETUP
3558
 
#line 1113 "pir.l"
3559
 
{
3560
 
                          yy_push_state(MACROHEAD, yyscanner);
3561
 
                          return TK_MACRO;
3562
 
                        }
3563
 
        YY_BREAK
3564
 
case 189:
3565
 
YY_RULE_SETUP
3566
 
#line 1118 "pir.l"
3567
 
{
3568
 
                          yy_push_state(MACROCONST, yyscanner);
3569
 
                          return TK_MACRO_CONST;
3570
 
                        }
3571
 
        YY_BREAK
3572
 
case 190:
3573
 
YY_RULE_SETUP
3574
 
#line 1123 "pir.l"
3575
 
{ return TK_LINE; }
3576
 
        YY_BREAK
3577
 
case 191:
3578
 
YY_RULE_SETUP
3579
 
#line 1124 "pir.l"
3580
 
{ return TK_FILE; }
3581
 
        YY_BREAK
3582
 
case 192:
3583
 
YY_RULE_SETUP
3584
 
#line 1127 "pir.l"
3585
 
{ /* macro expansion in PASM mode. */
3586
 
                          lexer_state * const lexer = yypirget_extra(yyscanner);
3587
 
                          macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
3588
 
 
3589
 
                          if (macro == NULL) { /* it's not a macro */
3590
 
                              yypirerror(yyscanner, lexer, "cannot find macro '%s'", yytext + 1);
3591
 
                          }
3592
 
                          else { /* it's a macro */
3593
 
                              /* store current buffer at this point, because we'll be
3594
 
                               * scanning a string buffer later on. Saving must be done
3595
 
                               * in the lexer specification, otherwise YY_CURRENT_BUFFER
3596
 
                               * cannot be used (it's a macro).
3597
 
                               */
3598
 
                              lexer->buffer = YY_CURRENT_BUFFER;
3599
 
 
3600
 
                              /* if it's a .macro, (not .macro_const), then go into
3601
 
                               * MACROEXPAND state, to correctly parse the arguments.
3602
 
                               * For .macro_const, we don't want this, because a .macro_const
3603
 
                               * is expanded here, hidden from the parser.
3604
 
                               */
3605
 
                              if (macro->takes_args) {
3606
 
                                  yylval->mval = macro;
3607
 
                                  yy_push_state(MACROEXPAND, yyscanner);
3608
 
                                  return TK_MACRO_IDENT;
3609
 
                              }
3610
 
                              else { /* expand the .macro_const here; no need for
3611
 
                                      * adding this to the grammar. */
3612
 
                                  /* goto SCANSTR state, and scan macro->body */
3613
 
                                  yy_push_state(SCANSTR, yyscanner);
3614
 
                                  yypir_scan_string(macro->body,yyscanner);
3615
 
                              }
3616
 
                          }
3617
 
                        }
3618
 
        YY_BREAK
3619
 
case 193:
3620
 
YY_RULE_SETUP
3621
 
#line 1161 "pir.l"
3622
 
{ /* a label in PASM */
3623
 
                          yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
3624
 
                          return TK_LABEL;
3625
 
                        }
3626
 
        YY_BREAK
3627
 
case 194:
3628
 
YY_RULE_SETUP
3629
 
#line 1166 "pir.l"
3630
 
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
3631
 
                                     "symbolic registers are not allowed in PASM mode");
3632
 
                        }
3633
 
        YY_BREAK
3634
 
case 195:
3635
 
YY_RULE_SETUP
3636
 
#line 1169 "pir.l"
3637
 
{ yylval->ival = atoi(yytext + 1); return TK_PREG; }
3638
 
        YY_BREAK
3639
 
case 196:
3640
 
YY_RULE_SETUP
3641
 
#line 1170 "pir.l"
3642
 
{ yylval->ival = atoi(yytext + 1); return TK_NREG; }
3643
 
        YY_BREAK
3644
 
case 197:
3645
 
YY_RULE_SETUP
3646
 
#line 1171 "pir.l"
3647
 
{ yylval->ival = atoi(yytext + 1); return TK_IREG; }
3648
 
        YY_BREAK
3649
 
case 198:
3650
 
YY_RULE_SETUP
3651
 
#line 1172 "pir.l"
3652
 
{ yylval->ival = atoi(yytext + 1); return TK_SREG; }
3653
 
        YY_BREAK
3654
 
case 199:
3655
 
YY_RULE_SETUP
3656
 
#line 1174 "pir.l"
3657
 
{ /* can be a parrot op or a label; the check is done in the parser. */
3658
 
                          yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
3659
 
                          return TK_IDENT;
3660
 
                        }
3661
 
        YY_BREAK
3662
 
case 200:
3663
 
YY_RULE_SETUP
3664
 
#line 1179 "pir.l"
3665
 
{ yylval->dval = atof(yytext); return TK_NUMC; }
3666
 
        YY_BREAK
3667
 
case 201:
3668
 
YY_RULE_SETUP
3669
 
#line 1180 "pir.l"
3670
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
3671
 
        YY_BREAK
3672
 
case 202:
3673
 
YY_RULE_SETUP
3674
 
#line 1181 "pir.l"
3675
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
3676
 
        YY_BREAK
3677
 
case 203:
3678
 
YY_RULE_SETUP
3679
 
#line 1182 "pir.l"
3680
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
3681
 
        YY_BREAK
3682
 
case 204:
3683
 
YY_RULE_SETUP
3684
 
#line 1183 "pir.l"
3685
 
{ yylval->ival = atoi(yytext); return TK_INTC; }
3686
 
        YY_BREAK
3687
 
case 205:
3688
 
YY_RULE_SETUP
3689
 
#line 1185 "pir.l"
3690
 
{ /* copy the string, remove the quotes. */
3691
 
                          yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
3692
 
                          return TK_STRINGC;
3693
 
                        }
3694
 
        YY_BREAK
3695
 
case 206:
3696
 
YY_RULE_SETUP
3697
 
#line 1190 "pir.l"
3698
 
{ /* ignore whitespace */ }
3699
 
        YY_BREAK
3700
 
case 207:
3701
 
/* rule 207 can match eol */
3702
 
YY_RULE_SETUP
3703
 
#line 1192 "pir.l"
3704
 
{ return TK_NL; }
3705
 
        YY_BREAK
3706
 
case 208:
3707
 
YY_RULE_SETUP
3708
 
#line 1194 "pir.l"
3709
 
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
3710
 
                                     "unrecognized character: %c", yytext[0]);
3711
 
                        }
3712
 
        YY_BREAK
3713
 
case YY_STATE_EOF(PASM):
3714
 
#line 1197 "pir.l"
3715
 
{ yyterminate(); }
3716
 
        YY_BREAK
3717
 
case 209:
3718
 
YY_RULE_SETUP
3719
 
#line 1199 "pir.l"
3720
 
ECHO;
3721
 
        YY_BREAK
3722
 
#line 3723 "pirlexer.c"
3723
 
case YY_STATE_EOF(MACROHEAD):
3724
 
case YY_STATE_EOF(MACROLOCAL):
3725
 
case YY_STATE_EOF(MACROLABEL):
3726
 
case YY_STATE_EOF(MACROEXPAND):
3727
 
case YY_STATE_EOF(SPECIALSTART):
3728
 
        yyterminate();
3729
 
 
3730
 
        case YY_END_OF_BUFFER:
3731
 
                {
3732
 
                /* Amount of text matched not including the EOB char. */
3733
 
                int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
3734
 
 
3735
 
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
3736
 
                *yy_cp = yyg->yy_hold_char;
3737
 
                YY_RESTORE_YY_MORE_OFFSET
3738
 
 
3739
 
                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
3740
 
                        {
3741
 
                        /* We're scanning a new file or input source.  It's
3742
 
                         * possible that this happened because the user
3743
 
                         * just pointed yyin at a new source and called
3744
 
                         * yypirlex().  If so, then we have to assure
3745
 
                         * consistency between YY_CURRENT_BUFFER and our
3746
 
                         * globals.  Here is the right place to do so, because
3747
 
                         * this is the first action (other than possibly a
3748
 
                         * back-up) that will match for the new input source.
3749
 
                         */
3750
 
                        yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3751
 
                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
3752
 
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
3753
 
                        }
3754
 
 
3755
 
                /* Note that here we test for yy_c_buf_p "<=" to the position
3756
 
                 * of the first EOB in the buffer, since yy_c_buf_p will
3757
 
                 * already have been incremented past the NUL character
3758
 
                 * (since all states make transitions on EOB to the
3759
 
                 * end-of-buffer state).  Contrast this with the test
3760
 
                 * in input().
3761
 
                 */
3762
 
                if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
3763
 
                        { /* This was really a NUL. */
3764
 
                        yy_state_type yy_next_state;
3765
 
 
3766
 
                        yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
3767
 
 
3768
 
                        yy_current_state = yy_get_previous_state( yyscanner );
3769
 
 
3770
 
                        /* Okay, we're now positioned to make the NUL
3771
 
                         * transition.  We couldn't have
3772
 
                         * yy_get_previous_state() go ahead and do it
3773
 
                         * for us because it doesn't know how to deal
3774
 
                         * with the possibility of jamming (and we don't
3775
 
                         * want to build jamming into it because then it
3776
 
                         * will run more slowly).
3777
 
                         */
3778
 
 
3779
 
                        yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
3780
 
 
3781
 
                        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
3782
 
 
3783
 
                        if ( yy_next_state )
3784
 
                                {
3785
 
                                /* Consume the NUL. */
3786
 
                                yy_cp = ++yyg->yy_c_buf_p;
3787
 
                                yy_current_state = yy_next_state;
3788
 
                                goto yy_match;
3789
 
                                }
3790
 
 
3791
 
                        else
3792
 
                                {
3793
 
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
3794
 
                                yy_cp = yyg->yy_last_accepting_cpos;
3795
 
                                yy_current_state = yyg->yy_last_accepting_state;
3796
 
                                goto yy_find_action;
3797
 
                                }
3798
 
                        }
3799
 
 
3800
 
                else switch ( yy_get_next_buffer( yyscanner ) )
3801
 
                        {
3802
 
                        case EOB_ACT_END_OF_FILE:
3803
 
                                {
3804
 
                                yyg->yy_did_buffer_switch_on_eof = 0;
3805
 
 
3806
 
                                if ( yypirwrap(yyscanner ) )
3807
 
                                        {
3808
 
                                        /* Note: because we've taken care in
3809
 
                                         * yy_get_next_buffer() to have set up
3810
 
                                         * yytext, we can now set up
3811
 
                                         * yy_c_buf_p so that if some total
3812
 
                                         * hoser (like flex itself) wants to
3813
 
                                         * call the scanner after we return the
3814
 
                                         * YY_NULL, it'll still work - another
3815
 
                                         * YY_NULL will get returned.
3816
 
                                         */
3817
 
                                        yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
3818
 
 
3819
 
                                        yy_act = YY_STATE_EOF(YY_START);
3820
 
                                        goto do_action;
3821
 
                                        }
3822
 
 
3823
 
                                else
3824
 
                                        {
3825
 
                                        if ( ! yyg->yy_did_buffer_switch_on_eof )
3826
 
                                                YY_NEW_FILE;
3827
 
                                        }
3828
 
                                break;
3829
 
                                }
3830
 
 
3831
 
                        case EOB_ACT_CONTINUE_SCAN:
3832
 
                                yyg->yy_c_buf_p =
3833
 
                                        yyg->yytext_ptr + yy_amount_of_matched_text;
3834
 
 
3835
 
                                yy_current_state = yy_get_previous_state( yyscanner );
3836
 
 
3837
 
                                yy_cp = yyg->yy_c_buf_p;
3838
 
                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
3839
 
                                goto yy_match;
3840
 
 
3841
 
                        case EOB_ACT_LAST_MATCH:
3842
 
                                yyg->yy_c_buf_p =
3843
 
                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
3844
 
 
3845
 
                                yy_current_state = yy_get_previous_state( yyscanner );
3846
 
 
3847
 
                                yy_cp = yyg->yy_c_buf_p;
3848
 
                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
3849
 
                                goto yy_find_action;
3850
 
                        }
3851
 
                break;
3852
 
                }
3853
 
 
3854
 
        default:
3855
 
                YY_FATAL_ERROR(
3856
 
                        "fatal flex scanner internal error--no action found" );
3857
 
        } /* end of action switch */
3858
 
                } /* end of scanning one token */
3859
 
} /* end of yypirlex */
3860
 
/* %ok-for-header */
3861
 
 
3862
 
/* %if-c++-only */
3863
 
/* %not-for-header */
3864
 
 
3865
 
/* %ok-for-header */
3866
 
 
3867
 
/* %endif */
3868
 
 
3869
 
/* yy_get_next_buffer - try to read in a new buffer
3870
 
 *
3871
 
 * Returns a code representing an action:
3872
 
 *      EOB_ACT_LAST_MATCH -
3873
 
 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3874
 
 *      EOB_ACT_END_OF_FILE - end of file
3875
 
 */
3876
 
/* %if-c-only */
3877
 
static int yy_get_next_buffer (yyscan_t yyscanner)
3878
 
/* %endif */
3879
 
/* %if-c++-only */
3880
 
/* %endif */
3881
 
{
3882
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3883
 
        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
3884
 
        register char *source = yyg->yytext_ptr;
3885
 
        register int number_to_move, i;
3886
 
        int ret_val;
3887
 
 
3888
 
        if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
3889
 
                YY_FATAL_ERROR(
3890
 
                "fatal flex scanner internal error--end of buffer missed" );
3891
 
 
3892
 
        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
3893
 
                { /* Don't try to fill the buffer, so this is an EOF. */
3894
 
                if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
3895
 
                        {
3896
 
                        /* We matched a single character, the EOB, so
3897
 
                         * treat this as a final EOF.
3898
 
                         */
3899
 
                        return EOB_ACT_END_OF_FILE;
3900
 
                        }
3901
 
 
3902
 
                else
3903
 
                        {
3904
 
                        /* We matched some text prior to the EOB, first
3905
 
                         * process it.
3906
 
                         */
3907
 
                        return EOB_ACT_LAST_MATCH;
3908
 
                        }
3909
 
                }
3910
 
 
3911
 
        /* Try to read more data. */
3912
 
 
3913
 
        /* First move last chars to start of buffer. */
3914
 
        number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
3915
 
 
3916
 
        for ( i = 0; i < number_to_move; ++i )
3917
 
                *(dest++) = *(source++);
3918
 
 
3919
 
        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3920
 
                /* don't do the read, it's not guaranteed to return an EOF,
3921
 
                 * just force an EOF
3922
 
                 */
3923
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
3924
 
 
3925
 
        else
3926
 
                {
3927
 
                        yy_size_t num_to_read =
3928
 
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
3929
 
 
3930
 
                while ( num_to_read <= 0 )
3931
 
                        { /* Not enough room in the buffer - grow it. */
3932
 
 
3933
 
                        /* just a shorter name for the current buffer */
3934
 
                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
3935
 
 
3936
 
                        int yy_c_buf_p_offset =
3937
 
                                (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
3938
 
 
3939
 
                        if ( b->yy_is_our_buffer )
3940
 
                                {
3941
 
                                yy_size_t new_size = b->yy_buf_size * 2;
3942
 
 
3943
 
                                if ( new_size <= 0 )
3944
 
                                        b->yy_buf_size += b->yy_buf_size / 8;
3945
 
                                else
3946
 
                                        b->yy_buf_size *= 2;
3947
 
 
3948
 
                                b->yy_ch_buf = (char *)
3949
 
                                        /* Include room in for 2 EOB chars. */
3950
 
                                        yypirrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
3951
 
                                }
3952
 
                        else
3953
 
                                /* Can't grow it, we don't own it. */
3954
 
                                b->yy_ch_buf = 0;
3955
 
 
3956
 
                        if ( ! b->yy_ch_buf )
3957
 
                                YY_FATAL_ERROR(
3958
 
                                "fatal error - scanner input buffer overflow" );
3959
 
 
3960
 
                        yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3961
 
 
3962
 
                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
3963
 
                                                number_to_move - 1;
3964
 
 
3965
 
                        }
3966
 
 
3967
 
                if ( num_to_read > YY_READ_BUF_SIZE )
3968
 
                        num_to_read = YY_READ_BUF_SIZE;
3969
 
 
3970
 
                /* Read in more data. */
3971
 
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
3972
 
                        yyg->yy_n_chars, num_to_read );
3973
 
 
3974
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3975
 
                }
3976
 
 
3977
 
        if ( yyg->yy_n_chars == 0 )
3978
 
                {
3979
 
                if ( number_to_move == YY_MORE_ADJ )
3980
 
                        {
3981
 
                        ret_val = EOB_ACT_END_OF_FILE;
3982
 
                        yypirrestart(yyin  ,yyscanner);
3983
 
                        }
3984
 
 
3985
 
                else
3986
 
                        {
3987
 
                        ret_val = EOB_ACT_LAST_MATCH;
3988
 
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3989
 
                                YY_BUFFER_EOF_PENDING;
3990
 
                        }
3991
 
                }
3992
 
 
3993
 
        else
3994
 
                ret_val = EOB_ACT_CONTINUE_SCAN;
3995
 
 
3996
 
        if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
3997
 
                /* Extend the array by 50%, plus the number we really need. */
3998
 
                yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
3999
 
                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yypirrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
4000
 
                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
4001
 
                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
4002
 
        }
4003
 
 
4004
 
        yyg->yy_n_chars += number_to_move;
4005
 
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
4006
 
        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
4007
 
 
4008
 
        yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
4009
 
 
4010
 
        return ret_val;
4011
 
}
4012
 
 
4013
 
/* yy_get_previous_state - get the state just before the EOB char was reached */
4014
 
 
4015
 
/* %if-c-only */
4016
 
/* %not-for-header */
4017
 
 
4018
 
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
4019
 
/* %endif */
4020
 
/* %if-c++-only */
4021
 
/* %endif */
4022
 
{
4023
 
        register yy_state_type yy_current_state;
4024
 
        register char *yy_cp;
4025
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4026
 
 
4027
 
/* %% [15.0] code to get the start state into yy_current_state goes here */
4028
 
        yy_current_state = yyg->yy_start;
4029
 
 
4030
 
        for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
4031
 
                {
4032
 
/* %% [16.0] code to find the next state goes here */
4033
 
                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
4034
 
                if ( yy_accept[yy_current_state] )
4035
 
                        {
4036
 
                        yyg->yy_last_accepting_state = yy_current_state;
4037
 
                        yyg->yy_last_accepting_cpos = yy_cp;
4038
 
                        }
4039
 
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4040
 
                        {
4041
 
                        yy_current_state = (int) yy_def[yy_current_state];
4042
 
                        if ( yy_current_state >= 825 )
4043
 
                                yy_c = yy_meta[(unsigned int) yy_c];
4044
 
                        }
4045
 
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4046
 
                }
4047
 
 
4048
 
        return yy_current_state;
4049
 
}
4050
 
 
4051
 
/* yy_try_NUL_trans - try to make a transition on the NUL character
4052
 
 *
4053
 
 * synopsis
4054
 
 *      next_state = yy_try_NUL_trans( current_state );
4055
 
 */
4056
 
/* %if-c-only */
4057
 
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
4058
 
/* %endif */
4059
 
/* %if-c++-only */
4060
 
/* %endif */
4061
 
{
4062
 
        register int yy_is_jam;
4063
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
4064
 
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
4065
 
        register char *yy_cp = yyg->yy_c_buf_p;
4066
 
 
4067
 
        register YY_CHAR yy_c = 1;
4068
 
        if ( yy_accept[yy_current_state] )
4069
 
                {
4070
 
                yyg->yy_last_accepting_state = yy_current_state;
4071
 
                yyg->yy_last_accepting_cpos = yy_cp;
4072
 
                }
4073
 
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4074
 
                {
4075
 
                yy_current_state = (int) yy_def[yy_current_state];
4076
 
                if ( yy_current_state >= 825 )
4077
 
                        yy_c = yy_meta[(unsigned int) yy_c];
4078
 
                }
4079
 
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4080
 
        yy_is_jam = (yy_current_state == 824);
4081
 
 
4082
 
        return yy_is_jam ? 0 : yy_current_state;
4083
 
}
4084
 
 
4085
 
/* %if-c-only */
4086
 
 
4087
 
/* %endif */
4088
 
 
4089
 
/* %if-c-only */
4090
 
#ifndef YY_NO_INPUT
4091
 
#ifdef __cplusplus
4092
 
    static int yyinput (yyscan_t yyscanner)
4093
 
#else
4094
 
    static int input  (yyscan_t yyscanner)
4095
 
#endif
4096
 
 
4097
 
/* %endif */
4098
 
/* %if-c++-only */
4099
 
/* %endif */
4100
 
{
4101
 
        int c;
4102
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4103
 
 
4104
 
        *yyg->yy_c_buf_p = yyg->yy_hold_char;
4105
 
 
4106
 
        if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
4107
 
                {
4108
 
                /* yy_c_buf_p now points to the character we want to return.
4109
 
                 * If this occurs *before* the EOB characters, then it's a
4110
 
                 * valid NUL; if not, then we've hit the end of the buffer.
4111
 
                 */
4112
 
                if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
4113
 
                        /* This was really a NUL. */
4114
 
                        *yyg->yy_c_buf_p = '\0';
4115
 
 
4116
 
                else
4117
 
                        { /* need more input */
4118
 
                        yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
4119
 
                        ++yyg->yy_c_buf_p;
4120
 
 
4121
 
                        switch ( yy_get_next_buffer( yyscanner ) )
4122
 
                                {
4123
 
                                case EOB_ACT_LAST_MATCH:
4124
 
                                        /* This happens because yy_g_n_b()
4125
 
                                         * sees that we've accumulated a
4126
 
                                         * token and flags that we need to
4127
 
                                         * try matching the token before
4128
 
                                         * proceeding.  But for input(),
4129
 
                                         * there's no matching to consider.
4130
 
                                         * So convert the EOB_ACT_LAST_MATCH
4131
 
                                         * to EOB_ACT_END_OF_FILE.
4132
 
                                         */
4133
 
 
4134
 
                                        /* Reset buffer status. */
4135
 
                                        yypirrestart(yyin ,yyscanner);
4136
 
 
4137
 
                                        /*FALLTHROUGH*/
4138
 
 
4139
 
                                case EOB_ACT_END_OF_FILE:
4140
 
                                        {
4141
 
                                        if ( yypirwrap(yyscanner ) )
4142
 
                                                return 0;
4143
 
 
4144
 
                                        if ( ! yyg->yy_did_buffer_switch_on_eof )
4145
 
                                                YY_NEW_FILE;
4146
 
#ifdef __cplusplus
4147
 
                                        return yyinput(yyscanner);
4148
 
#else
4149
 
                                        return input(yyscanner);
4150
 
#endif
4151
 
                                        }
4152
 
 
4153
 
                                case EOB_ACT_CONTINUE_SCAN:
4154
 
                                        yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
4155
 
                                        break;
4156
 
                                }
4157
 
                        }
4158
 
                }
4159
 
 
4160
 
        c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
4161
 
        *yyg->yy_c_buf_p = '\0';        /* preserve yytext */
4162
 
        yyg->yy_hold_char = *++yyg->yy_c_buf_p;
4163
 
 
4164
 
/* %% [19.0] update BOL and yylineno */
4165
 
        if ( c == '\n' )
4166
 
                   
4167
 
    do{ yylineno++;
4168
 
        yycolumn=0;
4169
 
    }while(0)
4170
 
;
4171
 
 
4172
 
        return c;
4173
 
}
4174
 
/* %if-c-only */
4175
 
#endif  /* ifndef YY_NO_INPUT */
4176
 
/* %endif */
4177
 
 
4178
 
/** Immediately switch to a different input stream.
4179
 
 * @param input_file A readable stream.
4180
 
 * @param yyscanner The scanner object.
4181
 
 * @note This function does not reset the start condition to @c INITIAL .
4182
 
 */
4183
 
/* %if-c-only */
4184
 
    void yypirrestart  (FILE * input_file , yyscan_t yyscanner)
4185
 
/* %endif */
4186
 
/* %if-c++-only */
4187
 
/* %endif */
4188
 
{
4189
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4190
 
 
4191
 
        if ( ! YY_CURRENT_BUFFER ){
4192
 
        yypirensure_buffer_stack (yyscanner);
4193
 
                YY_CURRENT_BUFFER_LVALUE =
4194
 
            yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
4195
 
        }
4196
 
 
4197
 
        yypir_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
4198
 
        yypir_load_buffer_state(yyscanner );
4199
 
}
4200
 
 
4201
 
/** Switch to a different input buffer.
4202
 
 * @param new_buffer The new input buffer.
4203
 
 * @param yyscanner The scanner object.
4204
 
 */
4205
 
/* %if-c-only */
4206
 
    void yypir_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
4207
 
/* %endif */
4208
 
/* %if-c++-only */
4209
 
/* %endif */
4210
 
{
4211
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4212
 
 
4213
 
        /* TODO. We should be able to replace this entire function body
4214
 
         * with
4215
 
         *              yypirpop_buffer_state();
4216
 
         *              yypirpush_buffer_state(new_buffer);
4217
 
     */
4218
 
        yypirensure_buffer_stack (yyscanner);
4219
 
        if ( YY_CURRENT_BUFFER == new_buffer )
4220
 
                return;
4221
 
 
4222
 
        if ( YY_CURRENT_BUFFER )
4223
 
                {
4224
 
                /* Flush out information for old buffer. */
4225
 
                *yyg->yy_c_buf_p = yyg->yy_hold_char;
4226
 
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
4227
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
4228
 
                }
4229
 
 
4230
 
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
4231
 
        yypir_load_buffer_state(yyscanner );
4232
 
 
4233
 
        /* We don't actually know whether we did this switch during
4234
 
         * EOF (yypirwrap()) processing, but the only time this flag
4235
 
         * is looked at is after yypirwrap() is called, so it's safe
4236
 
         * to go ahead and always set it.
4237
 
         */
4238
 
        yyg->yy_did_buffer_switch_on_eof = 1;
4239
 
}
4240
 
 
4241
 
/* %if-c-only */
4242
 
static void yypir_load_buffer_state  (yyscan_t yyscanner)
4243
 
/* %endif */
4244
 
/* %if-c++-only */
4245
 
/* %endif */
4246
 
{
4247
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4248
 
        yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
4249
 
        yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
4250
 
        yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
4251
 
        yyg->yy_hold_char = *yyg->yy_c_buf_p;
4252
 
}
4253
 
 
4254
 
/** Allocate and initialize an input buffer state.
4255
 
 * @param file A readable stream.
4256
 
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
4257
 
 * @param yyscanner The scanner object.
4258
 
 * @return the allocated buffer state.
4259
 
 */
4260
 
/* %if-c-only */
4261
 
    YY_BUFFER_STATE yypir_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
4262
 
/* %endif */
4263
 
/* %if-c++-only */
4264
 
/* %endif */
4265
 
{
4266
 
        YY_BUFFER_STATE b;
4267
 
    
4268
 
        b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
4269
 
        if ( ! b )
4270
 
                YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
4271
 
 
4272
 
        b->yy_buf_size = size;
4273
 
 
4274
 
        /* yy_ch_buf has to be 2 characters longer than the size given because
4275
 
         * we need to put in 2 end-of-buffer characters.
4276
 
         */
4277
 
        b->yy_ch_buf = (char *) yypiralloc(b->yy_buf_size + 2 ,yyscanner );
4278
 
        if ( ! b->yy_ch_buf )
4279
 
                YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
4280
 
 
4281
 
        b->yy_is_our_buffer = 1;
4282
 
 
4283
 
        yypir_init_buffer(b,file ,yyscanner);
4284
 
 
4285
 
        return b;
4286
 
}
4287
 
 
4288
 
/** Destroy the buffer.
4289
 
 * @param b a buffer created with yypir_create_buffer()
4290
 
 * @param yyscanner The scanner object.
4291
 
 */
4292
 
/* %if-c-only */
4293
 
    void yypir_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
4294
 
/* %endif */
4295
 
/* %if-c++-only */
4296
 
/* %endif */
4297
 
{
4298
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4299
 
 
4300
 
        if ( ! b )
4301
 
                return;
4302
 
 
4303
 
        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
4304
 
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
4305
 
 
4306
 
        if ( b->yy_is_our_buffer )
4307
 
                yypirfree((void *) b->yy_ch_buf ,yyscanner );
4308
 
 
4309
 
        yypirfree((void *) b ,yyscanner );
4310
 
}
4311
 
 
4312
 
/* %if-c-only */
4313
 
 
4314
 
/* %endif */
4315
 
 
4316
 
/* %if-c++-only */
4317
 
/* %endif */
4318
 
 
4319
 
/* Initializes or reinitializes a buffer.
4320
 
 * This function is sometimes called more than once on the same buffer,
4321
 
 * such as during a yypirrestart() or at EOF.
4322
 
 */
4323
 
/* %if-c-only */
4324
 
    static void yypir_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
4325
 
/* %endif */
4326
 
/* %if-c++-only */
4327
 
/* %endif */
4328
 
 
4329
 
{
4330
 
        int oerrno = errno;
4331
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4332
 
 
4333
 
        yypir_flush_buffer(b ,yyscanner);
4334
 
 
4335
 
        b->yy_input_file = file;
4336
 
        b->yy_fill_buffer = 1;
4337
 
 
4338
 
    /* If b is the current buffer, then yypir_init_buffer was _probably_
4339
 
     * called from yypirrestart() or through yy_get_next_buffer.
4340
 
     * In that case, we don't want to reset the lineno or column.
4341
 
     */
4342
 
    if (b != YY_CURRENT_BUFFER){
4343
 
        b->yy_bs_lineno = 1;
4344
 
        b->yy_bs_column = 0;
4345
 
    }
4346
 
 
4347
 
/* %if-c-only */
4348
 
 
4349
 
        b->yy_is_interactive = 0;
4350
 
    
4351
 
/* %endif */
4352
 
/* %if-c++-only */
4353
 
/* %endif */
4354
 
        errno = oerrno;
4355
 
}
4356
 
 
4357
 
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
4358
 
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
4359
 
 * @param yyscanner The scanner object.
4360
 
 */
4361
 
/* %if-c-only */
4362
 
    void yypir_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
4363
 
/* %endif */
4364
 
/* %if-c++-only */
4365
 
/* %endif */
4366
 
{
4367
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4368
 
        if ( ! b )
4369
 
                return;
4370
 
 
4371
 
        b->yy_n_chars = 0;
4372
 
 
4373
 
        /* We always need two end-of-buffer characters.  The first causes
4374
 
         * a transition to the end-of-buffer state.  The second causes
4375
 
         * a jam in that state.
4376
 
         */
4377
 
        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
4378
 
        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
4379
 
 
4380
 
        b->yy_buf_pos = &b->yy_ch_buf[0];
4381
 
 
4382
 
        b->yy_at_bol = 1;
4383
 
        b->yy_buffer_status = YY_BUFFER_NEW;
4384
 
 
4385
 
        if ( b == YY_CURRENT_BUFFER )
4386
 
                yypir_load_buffer_state(yyscanner );
4387
 
}
4388
 
 
4389
 
/* %if-c-or-c++ */
4390
 
/** Pushes the new state onto the stack. The new state becomes
4391
 
 *  the current state. This function will allocate the stack
4392
 
 *  if necessary.
4393
 
 *  @param new_buffer The new state.
4394
 
 *  @param yyscanner The scanner object.
4395
 
 */
4396
 
/* %if-c-only */
4397
 
void yypirpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
4398
 
/* %endif */
4399
 
/* %if-c++-only */
4400
 
/* %endif */
4401
 
{
4402
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4403
 
        if (new_buffer == NULL)
4404
 
                return;
4405
 
 
4406
 
        yypirensure_buffer_stack(yyscanner);
4407
 
 
4408
 
        /* This block is copied from yypir_switch_to_buffer. */
4409
 
        if ( YY_CURRENT_BUFFER )
4410
 
                {
4411
 
                /* Flush out information for old buffer. */
4412
 
                *yyg->yy_c_buf_p = yyg->yy_hold_char;
4413
 
                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
4414
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
4415
 
                }
4416
 
 
4417
 
        /* Only push if top exists. Otherwise, replace top. */
4418
 
        if (YY_CURRENT_BUFFER)
4419
 
                yyg->yy_buffer_stack_top++;
4420
 
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
4421
 
 
4422
 
        /* copied from yypir_switch_to_buffer. */
4423
 
        yypir_load_buffer_state(yyscanner );
4424
 
        yyg->yy_did_buffer_switch_on_eof = 1;
4425
 
}
4426
 
/* %endif */
4427
 
 
4428
 
/* %if-c-or-c++ */
4429
 
/** Removes and deletes the top of the stack, if present.
4430
 
 *  The next element becomes the new top.
4431
 
 *  @param yyscanner The scanner object.
4432
 
 */
4433
 
/* %if-c-only */
4434
 
void yypirpop_buffer_state (yyscan_t yyscanner)
4435
 
/* %endif */
4436
 
/* %if-c++-only */
4437
 
/* %endif */
4438
 
{
4439
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4440
 
        if (!YY_CURRENT_BUFFER)
4441
 
                return;
4442
 
 
4443
 
        yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
4444
 
        YY_CURRENT_BUFFER_LVALUE = NULL;
4445
 
        if (yyg->yy_buffer_stack_top > 0)
4446
 
                --yyg->yy_buffer_stack_top;
4447
 
 
4448
 
        if (YY_CURRENT_BUFFER) {
4449
 
                yypir_load_buffer_state(yyscanner );
4450
 
                yyg->yy_did_buffer_switch_on_eof = 1;
4451
 
        }
4452
 
}
4453
 
/* %endif */
4454
 
 
4455
 
/* %if-c-or-c++ */
4456
 
/* Allocates the stack if it does not exist.
4457
 
 *  Guarantees space for at least one push.
4458
 
 */
4459
 
/* %if-c-only */
4460
 
static void yypirensure_buffer_stack (yyscan_t yyscanner)
4461
 
/* %endif */
4462
 
/* %if-c++-only */
4463
 
/* %endif */
4464
 
{
4465
 
        yy_size_t num_to_alloc;
4466
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4467
 
 
4468
 
        if (!yyg->yy_buffer_stack) {
4469
 
 
4470
 
                /* First allocation is just for 2 elements, since we don't know if this
4471
 
                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
4472
 
                 * immediate realloc on the next call.
4473
 
         */
4474
 
                num_to_alloc = 1;
4475
 
                yyg->yy_buffer_stack = (struct yy_buffer_state**)yypiralloc
4476
 
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
4477
 
                                                                , yyscanner);
4478
 
                if ( ! yyg->yy_buffer_stack )
4479
 
                        YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
4480
 
                                                                  
4481
 
                memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
4482
 
                                
4483
 
                yyg->yy_buffer_stack_max = num_to_alloc;
4484
 
                yyg->yy_buffer_stack_top = 0;
4485
 
                return;
4486
 
        }
4487
 
 
4488
 
        if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
4489
 
 
4490
 
                /* Increase the buffer to prepare for a possible push. */
4491
 
                int grow_size = 8 /* arbitrary grow size */;
4492
 
 
4493
 
                num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
4494
 
                yyg->yy_buffer_stack = (struct yy_buffer_state**)yypirrealloc
4495
 
                                                                (yyg->yy_buffer_stack,
4496
 
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
4497
 
                                                                , yyscanner);
4498
 
                if ( ! yyg->yy_buffer_stack )
4499
 
                        YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
4500
 
 
4501
 
                /* zero only the new slots.*/
4502
 
                memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
4503
 
                yyg->yy_buffer_stack_max = num_to_alloc;
4504
 
        }
4505
 
}
4506
 
/* %endif */
4507
 
 
4508
 
/* %if-c-only */
4509
 
/** Setup the input buffer state to scan directly from a user-specified character buffer.
4510
 
 * @param base the character buffer
4511
 
 * @param size the size in bytes of the character buffer
4512
 
 * @param yyscanner The scanner object.
4513
 
 * @return the newly allocated buffer state object. 
4514
 
 */
4515
 
YY_BUFFER_STATE yypir_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
4516
 
{
4517
 
        YY_BUFFER_STATE b;
4518
 
    
4519
 
        if ( size < 2 ||
4520
 
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
4521
 
             base[size-1] != YY_END_OF_BUFFER_CHAR )
4522
 
                /* They forgot to leave room for the EOB's. */
4523
 
                return 0;
4524
 
 
4525
 
        b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
4526
 
        if ( ! b )
4527
 
                YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_buffer()" );
4528
 
 
4529
 
        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
4530
 
        b->yy_buf_pos = b->yy_ch_buf = base;
4531
 
        b->yy_is_our_buffer = 0;
4532
 
        b->yy_input_file = 0;
4533
 
        b->yy_n_chars = b->yy_buf_size;
4534
 
        b->yy_is_interactive = 0;
4535
 
        b->yy_at_bol = 1;
4536
 
        b->yy_fill_buffer = 0;
4537
 
        b->yy_buffer_status = YY_BUFFER_NEW;
4538
 
 
4539
 
        yypir_switch_to_buffer(b ,yyscanner );
4540
 
 
4541
 
        return b;
4542
 
}
4543
 
/* %endif */
4544
 
 
4545
 
/* %if-c-only */
4546
 
/** Setup the input buffer state to scan a string. The next call to yypirlex() will
4547
 
 * scan from a @e copy of @a str.
4548
 
 * @param yystr a NUL-terminated string to scan
4549
 
 * @param yyscanner The scanner object.
4550
 
 * @return the newly allocated buffer state object.
4551
 
 * @note If you want to scan bytes that may contain NUL values, then use
4552
 
 *       yypir_scan_bytes() instead.
4553
 
 */
4554
 
YY_BUFFER_STATE yypir_scan_string (yyconst char * yystr , yyscan_t yyscanner)
4555
 
{
4556
 
    
4557
 
        return yypir_scan_bytes(yystr,strlen(yystr) ,yyscanner);
4558
 
}
4559
 
/* %endif */
4560
 
 
4561
 
/* %if-c-only */
4562
 
/** Setup the input buffer state to scan the given bytes. The next call to yypirlex() will
4563
 
 * scan from a @e copy of @a bytes.
4564
 
 * @param bytes the byte buffer to scan
4565
 
 * @param len the number of bytes in the buffer pointed to by @a bytes.
4566
 
 * @param yyscanner The scanner object.
4567
 
 * @return the newly allocated buffer state object.
4568
 
 */
4569
 
YY_BUFFER_STATE yypir_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
4570
 
{
4571
 
        YY_BUFFER_STATE b;
4572
 
        char *buf;
4573
 
        yy_size_t n, i;
4574
 
    
4575
 
        /* Get memory for full buffer, including space for trailing EOB's. */
4576
 
        n = _yybytes_len + 2;
4577
 
        buf = (char *) yypiralloc(n ,yyscanner );
4578
 
        if ( ! buf )
4579
 
                YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_bytes()" );
4580
 
 
4581
 
        for ( i = 0; i < _yybytes_len; ++i )
4582
 
                buf[i] = yybytes[i];
4583
 
 
4584
 
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
4585
 
 
4586
 
        b = yypir_scan_buffer(buf,n ,yyscanner);
4587
 
        if ( ! b )
4588
 
                YY_FATAL_ERROR( "bad buffer in yypir_scan_bytes()" );
4589
 
 
4590
 
        /* It's okay to grow etc. this buffer, and we should throw it
4591
 
         * away when we're done.
4592
 
         */
4593
 
        b->yy_is_our_buffer = 1;
4594
 
 
4595
 
        return b;
4596
 
}
4597
 
/* %endif */
4598
 
 
4599
 
/* %if-c-only */
4600
 
    static void yy_push_state (int  new_state , yyscan_t yyscanner)
4601
 
/* %endif */
4602
 
/* %if-c++-only */
4603
 
/* %endif */
4604
 
{
4605
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4606
 
        if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
4607
 
                {
4608
 
                yy_size_t new_size;
4609
 
 
4610
 
                yyg->yy_start_stack_depth += YY_START_STACK_INCR;
4611
 
                new_size = yyg->yy_start_stack_depth * sizeof( int );
4612
 
 
4613
 
                if ( ! yyg->yy_start_stack )
4614
 
                        yyg->yy_start_stack = (int *) yypiralloc(new_size ,yyscanner );
4615
 
 
4616
 
                else
4617
 
                        yyg->yy_start_stack = (int *) yypirrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
4618
 
 
4619
 
                if ( ! yyg->yy_start_stack )
4620
 
                        YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
4621
 
                }
4622
 
 
4623
 
        yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
4624
 
 
4625
 
        BEGIN(new_state);
4626
 
}
4627
 
 
4628
 
/* %if-c-only */
4629
 
    static void yy_pop_state  (yyscan_t yyscanner)
4630
 
/* %endif */
4631
 
/* %if-c++-only */
4632
 
/* %endif */
4633
 
{
4634
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4635
 
        if ( --yyg->yy_start_stack_ptr < 0 )
4636
 
                YY_FATAL_ERROR( "start-condition stack underflow" );
4637
 
 
4638
 
        BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
4639
 
}
4640
 
 
4641
 
/* %if-c-only */
4642
 
    static int yy_top_state  (yyscan_t yyscanner)
4643
 
/* %endif */
4644
 
/* %if-c++-only */
4645
 
/* %endif */
4646
 
{
4647
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4648
 
        return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
4649
 
}
4650
 
 
4651
 
#ifndef YY_EXIT_FAILURE
4652
 
#define YY_EXIT_FAILURE 2
4653
 
#endif
4654
 
 
4655
 
/* %if-c-only */
4656
 
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
4657
 
{
4658
 
        (void) fprintf( stderr, "%s\n", msg );
4659
 
        exit( YY_EXIT_FAILURE );
4660
 
}
4661
 
/* %endif */
4662
 
/* %if-c++-only */
4663
 
/* %endif */
4664
 
 
4665
 
/* Redefine yyless() so it works in section 3 code. */
4666
 
 
4667
 
#undef yyless
4668
 
#define yyless(n) \
4669
 
        do \
4670
 
                { \
4671
 
                /* Undo effects of setting up yytext. */ \
4672
 
        int yyless_macro_arg = (n); \
4673
 
        YY_LESS_LINENO(yyless_macro_arg);\
4674
 
                yytext[yyleng] = yyg->yy_hold_char; \
4675
 
                yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
4676
 
                yyg->yy_hold_char = *yyg->yy_c_buf_p; \
4677
 
                *yyg->yy_c_buf_p = '\0'; \
4678
 
                yyleng = yyless_macro_arg; \
4679
 
                } \
4680
 
        while ( 0 )
4681
 
 
4682
 
/* Accessor  methods (get/set functions) to struct members. */
4683
 
 
4684
 
/* %if-c-only */
4685
 
/* %if-reentrant */
4686
 
 
4687
 
/** Get the user-defined data for this scanner.
4688
 
 * @param yyscanner The scanner object.
4689
 
 */
4690
 
YY_EXTRA_TYPE yypirget_extra  (yyscan_t yyscanner)
4691
 
{
4692
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4693
 
    return yyextra;
4694
 
}
4695
 
 
4696
 
/* %endif */
4697
 
 
4698
 
/** Get the current line number.
4699
 
 * @param yyscanner The scanner object.
4700
 
 */
4701
 
int yypirget_lineno  (yyscan_t yyscanner)
4702
 
{
4703
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4704
 
    
4705
 
        if (! YY_CURRENT_BUFFER)
4706
 
            return 0;
4707
 
    
4708
 
    return yylineno;
4709
 
}
4710
 
 
4711
 
/** Get the current column number.
4712
 
 * @param yyscanner The scanner object.
4713
 
 */
4714
 
int yypirget_column  (yyscan_t yyscanner)
4715
 
{
4716
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4717
 
    
4718
 
        if (! YY_CURRENT_BUFFER)
4719
 
            return 0;
4720
 
    
4721
 
    return yycolumn;
4722
 
}
4723
 
 
4724
 
/** Get the input stream.
4725
 
 * @param yyscanner The scanner object.
4726
 
 */
4727
 
FILE *yypirget_in  (yyscan_t yyscanner)
4728
 
{
4729
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4730
 
    return yyin;
4731
 
}
4732
 
 
4733
 
/** Get the output stream.
4734
 
 * @param yyscanner The scanner object.
4735
 
 */
4736
 
FILE *yypirget_out  (yyscan_t yyscanner)
4737
 
{
4738
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4739
 
    return yyout;
4740
 
}
4741
 
 
4742
 
/** Get the length of the current token.
4743
 
 * @param yyscanner The scanner object.
4744
 
 */
4745
 
yy_size_t yypirget_leng  (yyscan_t yyscanner)
4746
 
{
4747
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4748
 
    return yyleng;
4749
 
}
4750
 
 
4751
 
/** Get the current token.
4752
 
 * @param yyscanner The scanner object.
4753
 
 */
4754
 
 
4755
 
char *yypirget_text  (yyscan_t yyscanner)
4756
 
{
4757
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4758
 
    return yytext;
4759
 
}
4760
 
 
4761
 
/* %if-reentrant */
4762
 
 
4763
 
/** Set the user-defined data. This data is never touched by the scanner.
4764
 
 * @param user_defined The data to be associated with this scanner.
4765
 
 * @param yyscanner The scanner object.
4766
 
 */
4767
 
void yypirset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
4768
 
{
4769
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4770
 
    yyextra = user_defined ;
4771
 
}
4772
 
 
4773
 
/* %endif */
4774
 
 
4775
 
/** Set the current line number.
4776
 
 * @param line_number
4777
 
 * @param yyscanner The scanner object.
4778
 
 */
4779
 
void yypirset_lineno (int  line_number , yyscan_t yyscanner)
4780
 
{
4781
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4782
 
 
4783
 
        /* lineno is only valid if an input buffer exists. */
4784
 
        if (! YY_CURRENT_BUFFER )
4785
 
           yy_fatal_error( "yypirset_lineno called with no buffer" , yyscanner); 
4786
 
    
4787
 
    yylineno = line_number;
4788
 
}
4789
 
 
4790
 
/** Set the current column.
4791
 
 * @param line_number
4792
 
 * @param yyscanner The scanner object.
4793
 
 */
4794
 
void yypirset_column (int  column_no , yyscan_t yyscanner)
4795
 
{
4796
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4797
 
 
4798
 
        /* column is only valid if an input buffer exists. */
4799
 
        if (! YY_CURRENT_BUFFER )
4800
 
           yy_fatal_error( "yypirset_column called with no buffer" , yyscanner); 
4801
 
    
4802
 
    yycolumn = column_no;
4803
 
}
4804
 
 
4805
 
/** Set the input stream. This does not discard the current
4806
 
 * input buffer.
4807
 
 * @param in_str A readable stream.
4808
 
 * @param yyscanner The scanner object.
4809
 
 * @see yypir_switch_to_buffer
4810
 
 */
4811
 
void yypirset_in (FILE *  in_str , yyscan_t yyscanner)
4812
 
{
4813
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4814
 
    yyin = in_str ;
4815
 
}
4816
 
 
4817
 
void yypirset_out (FILE *  out_str , yyscan_t yyscanner)
4818
 
{
4819
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4820
 
    yyout = out_str ;
4821
 
}
4822
 
 
4823
 
int yypirget_debug  (yyscan_t yyscanner)
4824
 
{
4825
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4826
 
    return yy_flex_debug;
4827
 
}
4828
 
 
4829
 
void yypirset_debug (int  bdebug , yyscan_t yyscanner)
4830
 
{
4831
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4832
 
    yy_flex_debug = bdebug ;
4833
 
}
4834
 
 
4835
 
/* %endif */
4836
 
 
4837
 
/* %if-reentrant */
4838
 
/* Accessor methods for yylval and yylloc */
4839
 
 
4840
 
/* %if-bison-bridge */
4841
 
 
4842
 
YYSTYPE * yypirget_lval  (yyscan_t yyscanner)
4843
 
{
4844
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4845
 
    return yylval;
4846
 
}
4847
 
 
4848
 
void yypirset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
4849
 
{
4850
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4851
 
    yylval = yylval_param;
4852
 
}
4853
 
 
4854
 
/* %endif */
4855
 
 
4856
 
/* User-visible API */
4857
 
 
4858
 
/* yypirlex_init is special because it creates the scanner itself, so it is
4859
 
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
4860
 
 * That's why we explicitly handle the declaration, instead of using our macros.
4861
 
 */
4862
 
 
4863
 
int yypirlex_init(yyscan_t* ptr_yy_globals)
4864
 
 
4865
 
{
4866
 
    if (ptr_yy_globals == NULL){
4867
 
        errno = EINVAL;
4868
 
        return 1;
4869
 
    }
4870
 
 
4871
 
    *ptr_yy_globals = (yyscan_t) yypiralloc ( sizeof( struct yyguts_t ), NULL );
4872
 
 
4873
 
    if (*ptr_yy_globals == NULL){
4874
 
        errno = ENOMEM;
4875
 
        return 1;
4876
 
    }
4877
 
 
4878
 
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
4879
 
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
4880
 
 
4881
 
    return yy_init_globals ( *ptr_yy_globals );
4882
 
}
4883
 
 
4884
 
/* yypirlex_init_extra has the same functionality as yypirlex_init, but follows the
4885
 
 * convention of taking the scanner as the last argument. Note however, that
4886
 
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
4887
 
 * is the reason, too, why this function also must handle its own declaration).
4888
 
 * The user defined value in the first argument will be available to yypiralloc in
4889
 
 * the yyextra field.
4890
 
 */
4891
 
 
4892
 
int yypirlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
4893
 
 
4894
 
{
4895
 
    struct yyguts_t dummy_yyguts;
4896
 
 
4897
 
    yypirset_extra (yy_user_defined, &dummy_yyguts);
4898
 
 
4899
 
    if (ptr_yy_globals == NULL){
4900
 
        errno = EINVAL;
4901
 
        return 1;
4902
 
    }
4903
 
        
4904
 
    *ptr_yy_globals = (yyscan_t) yypiralloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
4905
 
        
4906
 
    if (*ptr_yy_globals == NULL){
4907
 
        errno = ENOMEM;
4908
 
        return 1;
4909
 
    }
4910
 
    
4911
 
    /* By setting to 0xAA, we expose bugs in
4912
 
    yy_init_globals. Leave at 0x00 for releases. */
4913
 
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
4914
 
    
4915
 
    yypirset_extra (yy_user_defined, *ptr_yy_globals);
4916
 
    
4917
 
    return yy_init_globals ( *ptr_yy_globals );
4918
 
}
4919
 
 
4920
 
/* %endif if-c-only */
4921
 
 
4922
 
/* %if-c-only */
4923
 
static int yy_init_globals (yyscan_t yyscanner)
4924
 
{
4925
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4926
 
    /* Initialization is the same as for the non-reentrant scanner.
4927
 
     * This function is called from yypirlex_destroy(), so don't allocate here.
4928
 
     */
4929
 
 
4930
 
    yyg->yy_buffer_stack = 0;
4931
 
    yyg->yy_buffer_stack_top = 0;
4932
 
    yyg->yy_buffer_stack_max = 0;
4933
 
    yyg->yy_c_buf_p = (char *) 0;
4934
 
    yyg->yy_init = 0;
4935
 
    yyg->yy_start = 0;
4936
 
 
4937
 
    yyg->yy_start_stack_ptr = 0;
4938
 
    yyg->yy_start_stack_depth = 0;
4939
 
    yyg->yy_start_stack =  NULL;
4940
 
 
4941
 
/* Defined in main.c */
4942
 
#ifdef YY_STDINIT
4943
 
    yyin = stdin;
4944
 
    yyout = stdout;
4945
 
#else
4946
 
    yyin = (FILE *) 0;
4947
 
    yyout = (FILE *) 0;
4948
 
#endif
4949
 
 
4950
 
    /* For future reference: Set errno on error, since we are called by
4951
 
     * yypirlex_init()
4952
 
     */
4953
 
    return 0;
4954
 
}
4955
 
/* %endif */
4956
 
 
4957
 
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
4958
 
/* yypirlex_destroy is for both reentrant and non-reentrant scanners. */
4959
 
int yypirlex_destroy  (yyscan_t yyscanner)
4960
 
{
4961
 
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
4962
 
 
4963
 
    /* Pop the buffer stack, destroying each element. */
4964
 
        while(YY_CURRENT_BUFFER){
4965
 
                yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
4966
 
                YY_CURRENT_BUFFER_LVALUE = NULL;
4967
 
                yypirpop_buffer_state(yyscanner);
4968
 
        }
4969
 
 
4970
 
        /* Destroy the stack itself. */
4971
 
        yypirfree(yyg->yy_buffer_stack ,yyscanner);
4972
 
        yyg->yy_buffer_stack = NULL;
4973
 
 
4974
 
    /* Destroy the start condition stack. */
4975
 
        yypirfree(yyg->yy_start_stack ,yyscanner );
4976
 
        yyg->yy_start_stack = NULL;
4977
 
 
4978
 
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
4979
 
     * yypirlex() is called, initialization will occur. */
4980
 
    yy_init_globals( yyscanner);
4981
 
 
4982
 
/* %if-reentrant */
4983
 
    /* Destroy the main struct (reentrant only). */
4984
 
    yypirfree ( yyscanner , yyscanner );
4985
 
    yyscanner = NULL;
4986
 
/* %endif */
4987
 
    return 0;
4988
 
}
4989
 
/* %endif */
4990
 
 
4991
 
/*
4992
 
 * Internal utility routines.
4993
 
 */
4994
 
 
4995
 
#ifndef yytext_ptr
4996
 
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
4997
 
{
4998
 
        register int i;
4999
 
        for ( i = 0; i < n; ++i )
5000
 
                s1[i] = s2[i];
5001
 
}
5002
 
#endif
5003
 
 
5004
 
#ifdef YY_NEED_STRLEN
5005
 
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
5006
 
{
5007
 
        register int n;
5008
 
        for ( n = 0; s[n]; ++n )
5009
 
                ;
5010
 
 
5011
 
        return n;
5012
 
}
5013
 
#endif
5014
 
 
5015
 
/* %if-tables-serialization definitions */
5016
 
/* %define-yytables   The name for this specific scanner's tables. */
5017
 
#define YYTABLES_NAME "yytables"
5018
 
/* %endif */
5019
 
 
5020
 
/* %ok-for-header */
5021
 
 
5022
 
#line 1199 "pir.l"
5023
 
 
5024
 
 
5025
 
 
5026
 
 
5027
 
 
5028
 
/*
5029
 
 
5030
 
=head1 FUNCTIONS
5031
 
 
5032
 
Helper functions for macro expansion. These function are only used by the lexer,
5033
 
so keep them local to this file.
5034
 
 
5035
 
=over 4
5036
 
 
5037
 
=cut
5038
 
 
5039
 
*/
5040
 
 
5041
 
 
5042
 
/*
5043
 
 
5044
 
=item C<void
5045
 
init_scanner_state(yyscan_t yyscanner)>
5046
 
 
5047
 
Initializes C<yyscanner> to the SPECIALSTART state, which can then decide
5048
 
whether to scan PASM or PIR tokens. State identifiers (e.g. SPECIALSTART)
5049
 
are not exported (private to the generated lexer), so this function wraps
5050
 
the call to yy_push_state().
5051
 
 
5052
 
=cut
5053
 
 
5054
 
*/
5055
 
void
5056
 
init_scanner_state(yyscan_t yyscanner) {
5057
 
    yy_push_state(SPECIALSTART, yyscanner);
5058
 
}
5059
 
 
5060
 
 
5061
 
/*
5062
 
 
5063
 
=item C<static macro_table *
5064
 
peek_macro_table(lexer_state * const lexer)>
5065
 
 
5066
 
Return the top of the macro_table stack; this is the currently
5067
 
active macro_table object.
5068
 
 
5069
 
=cut
5070
 
 
5071
 
*/
5072
 
PARROT_WARN_UNUSED_RESULT
5073
 
static macro_table *
5074
 
peek_macro_table(lexer_state * const lexer) {
5075
 
    return lexer->macros;
5076
 
}
5077
 
 
5078
 
/*
5079
 
 
5080
 
=item C<static char *
5081
 
munge_id(char const * const id, lexer_state * const lexer)>
5082
 
 
5083
 
Generate an identifier based on a macro label or local expansion.
5084
 
 
5085
 
A label expansion looks like ".$<LABEL>", from which a label identifier is
5086
 
generated, formatted as: "$macro_<MACRO>_<LABEL>_<SCOPE>".
5087
 
 
5088
 
In this format, C<MACRO> refers to the macro name of the macro in which
5089
 
the .macro_local or .macro_label was defined; C<LABEL> refers to the runtime
5090
 
value of the label or local variable (this can be a macro's argument's value).
5091
 
C<SCOPE> refers to the unique scope ID of this macro expansion.
5092
 
 
5093
 
=cut
5094
 
 
5095
 
*/
5096
 
PARROT_MALLOC
5097
 
PARROT_CANNOT_RETURN_NULL
5098
 
PARROT_WARN_UNUSED_RESULT
5099
 
static char *
5100
 
munge_id(char const * const id, lexer_state * const lexer) {
5101
 
    /* the format of the generated label; note that it has a $ character,
5102
 
     * which is not allowed in normal PIR identifiers. This way, you cannot
5103
 
     * use the generated names outside of macros. We dont't want people
5104
 
     * write outside of macros:
5105
 
     *
5106
 
     *   macro_foo_bar_1 = 42
5107
 
     *
5108
 
     * Hence the $ character.
5109
 
     */
5110
 
    char       *       munged_id;
5111
 
    char const * const format        = "$macro_%s_%s_%d"; /* 15 characters */
5112
 
    int  const         format_length = strlen(format);
5113
 
 
5114
 
 
5115
 
    macro_table *table = peek_macro_table(lexer);
5116
 
 
5117
 
    /* calculate length of the generated label: length of macro name,
5118
 
     * plus length of label name.
5119
 
     */
5120
 
    int length = format_length;
5121
 
 
5122
 
    /* add length of the macro name */
5123
 
    length += strlen(table->thismacro->name);
5124
 
 
5125
 
    /* add length of unique id to total length */
5126
 
    length += lexer->num_digits;
5127
 
 
5128
 
    /* add length of the actual label id */
5129
 
    length += strlen(id);
5130
 
 
5131
 
    munged_id = (char *)pir_mem_allocate_zeroed(lexer, (length + 1) * sizeof (char));
5132
 
 
5133
 
    sprintf(munged_id, format, table->thismacro->name, id, lexer->unique_id);
5134
 
 
5135
 
    return munged_id;
5136
 
}
5137
 
 
5138
 
 
5139
 
 
5140
 
/*
5141
 
 
5142
 
=item C<static macro_table *
5143
 
pop_macro_table(lexer_state * const lexer)>
5144
 
 
5145
 
Pop off the current macro symbol table from the
5146
 
macro symbol table stack and return it.
5147
 
 
5148
 
=cut
5149
 
 
5150
 
*/
5151
 
PARROT_IGNORABLE_RESULT
5152
 
PARROT_CANNOT_RETURN_NULL
5153
 
static macro_table *
5154
 
pop_macro_table(lexer_state * const lexer) {
5155
 
    macro_table *popped = lexer->macros;
5156
 
    lexer->macros       = popped->prev;
5157
 
    return popped;
5158
 
}
5159
 
 
5160
 
 
5161
 
/*
5162
 
 
5163
 
=item C<static void
5164
 
push_macro_table(lexer_state * const lexer, macro_table * const table)>
5165
 
 
5166
 
Push macro_table C<table> onto the macro scope stack. Any attempt to find
5167
 
a macro definition will start in C<table>. If not found, the stack will be walked
5168
 
down (recursing into older entries).
5169
 
 
5170
 
=cut
5171
 
 
5172
 
*/
5173
 
static void
5174
 
push_macro_table(lexer_state * const lexer, macro_table * const table) {
5175
 
    table->prev   = lexer->macros;
5176
 
    lexer->macros = table;
5177
 
}
5178
 
 
5179
 
/*
5180
 
 
5181
 
=item C<static void
5182
 
update_unique_id(lexer_state * const lexer)>
5183
 
 
5184
 
Update the unique ID generator; the number of characters that the new number
5185
 
is taking in a string is recalculated, as the unique IDs are used in string
5186
 
context.
5187
 
 
5188
 
=cut
5189
 
 
5190
 
*/
5191
 
static void
5192
 
update_unique_id(lexer_state * const lexer) {
5193
 
    /* each expansion has a unique id that is used for label/local munging */
5194
 
    ++lexer->id_gen;
5195
 
    /* Count number of digits:
5196
 
     * log10 returns a double, get the part before the dot (so, "3.14" -> "3")
5197
 
     * using the floor() function.
5198
 
     * log10(1000) -> 3, so add 1 more digit.
5199
 
     */
5200
 
    lexer->num_digits = (int)floor(log10(lexer->id_gen)) + 1;
5201
 
}
5202
 
 
5203
 
 
5204
 
/*
5205
 
 
5206
 
=item C<static void
5207
 
expand(yyscan_t yyscanner, macro_def * const macro, list * args, lexer_state * const lexer)>
5208
 
 
5209
 
Expand the specified macro (or constant). The current yy_buffer_state is saved, as well
5210
 
as the current scope ID (for macro expansions; each expansion has its own unique scope ID);
5211
 
as well as the current line number. The macro_table, which defines the macro parameters/arguments,
5212
 
gets a reference to the macro definition that is being expanded; that's the C<thismacro> field
5213
 
of the C<macro_table> structure.
5214
 
 
5215
 
An argument count check is done to make sure there's exactly enough arguments for the defined
5216
 
parameters. Then, the macro definition's body (a string buffer) is scanned (instead of the
5217
 
file that we were scanning).
5218
 
 
5219
 
The function returns the body of the macro being expanded.
5220
 
 
5221
 
=cut
5222
 
 
5223
 
*/
5224
 
char *
5225
 
expand_macro(yyscan_t yyscanner, macro_def * const macro, macro_param * args) {
5226
 
    /* construct a map data structure that maps the argument values to the parameter names */
5227
 
    /* enter the parameters as temporary symbols (.macro_const) */
5228
 
    lexer_state *lexer        = yypirget_extra(yyscanner);
5229
 
    macro_table *macro_params = new_macro_table(lexer->macros);
5230
 
    macro_param *params       = macro->parameters;
5231
 
 
5232
 
    /* push the new macro_table, acting as a local symbol scope */
5233
 
    push_macro_table(lexer, macro_params);
5234
 
 
5235
 
    /* save the current line, unique_id and current buffer in the macro_table,
5236
 
     * so they can be restored when the macro_table is popped from the stack.
5237
 
     */
5238
 
    macro_params->lineno     = yypirget_lineno(yyscanner);
5239
 
    /* save current scope id */
5240
 
    macro_params->scopeno    = lexer->unique_id;
5241
 
    macro_params->prev_buff  = lexer->buffer; /* cannot use YY_CURRENT_BUFFER here, but it was
5242
 
                                                 stored in lexer->buffer anyway, so store that. */
5243
 
    macro_params->thismacro  = macro; /* let the macro_table point to the macro-definition that
5244
 
                                         is being expanded; this allows access to macro name etc. */
5245
 
 
5246
 
    while (params && args) {
5247
 
        new_macro_const(macro_params, params->name, args->name, yypirget_lineno(yyscanner));
5248
 
      /*  fprintf(stderr, "defining parameter '%s' as '%s'\n", params->name, args->name); */
5249
 
        params = params->next;
5250
 
        args   = args->next;
5251
 
    }
5252
 
 
5253
 
    /* check for both conditions; either can be non-null, indicating an error.
5254
 
     * If both are null, then all went ok.
5255
 
     */
5256
 
    if (params != NULL)  /* args must be null, so too few arguments */
5257
 
        yypirerror(yyscanner, lexer, "Too few arguments for macro expansion '%s'", macro->name);
5258
 
 
5259
 
    if (args != NULL)  /* params must be null, so too many arguments */
5260
 
        yypirerror(yyscanner, lexer, "Too many arguments for macro expansion '%s'", macro->name);
5261
 
 
5262
 
 
5263
 
    update_unique_id(lexer);
5264
 
    lexer->unique_id = lexer->id_gen;
5265
 
 
5266
 
    /* switch to SCANMACRO state, and tell the lexer to get
5267
 
     * next tokens from the string buffer by calling yypir_scan_string().
5268
 
     */
5269
 
    yy_push_state(SCANMACRO, yyscanner);
5270
 
    yypir_scan_string(macro->body,yyscanner);
5271
 
    /* update the line number in the yyscanner so that any error message occuring
5272
 
     * refers to the bad line in the macro definition. Note that this must done
5273
 
     * **after** the call to yypir_scan_string(), which sets the line number to 1.
5274
 
     */
5275
 
    yypirset_lineno(macro->linedefined,yyscanner);
5276
 
 
5277
 
    return macro->body;
5278
 
}
5279
 
 
5280
 
 
5281
 
/* override Flex generated memory functions: all memory allocated
5282
 
 * by Flex goes through Parrot's memory allocators.
5283
 
 */
5284
 
 
5285
 
/*
5286
 
 
5287
 
=item C<void *
5288
 
yypiralloc(yy_size_t bytes,yyscan_t yyscanner)>
5289
 
 
5290
 
Allocate C<bytes> of memory; the C<yyscanner> argument is not used.
5291
 
 
5292
 
=cut
5293
 
 
5294
 
*/
5295
 
PARROT_MALLOC
5296
 
void *
5297
 
yypiralloc(yy_size_t bytes,yyscan_t yyscanner) {
5298
 
    return mem_sys_allocate(bytes);
5299
 
}
5300
 
 
5301
 
/*
5302
 
 
5303
 
=item C<void *
5304
 
yypirrealloc(void * ptr,yy_size_t bytes,yyscan_t yyscanner)>
5305
 
 
5306
 
Reallocate memory pointed to by C<ptr>. The new memory region is C<bytes> in size;
5307
 
the C<yyscanner> argument is not used.
5308
 
 
5309
 
=cut
5310
 
 
5311
 
*/
5312
 
void *
5313
 
yypirrealloc(void * ptr,yy_size_t bytes,yyscan_t yyscanner) {
5314
 
    return mem_sys_realloc(ptr, bytes);
5315
 
}
5316
 
 
5317
 
/*
5318
 
 
5319
 
=item C<void
5320
 
yypirfree(void *ptr,yyscan_t yyscanner)>
5321
 
 
5322
 
Free memory pointed to by C<ptr>. The C<yyscanner> argument is not used,
5323
 
but part of the signature as it is a Flex-generated function.
5324
 
 
5325
 
=cut
5326
 
 
5327
 
*/
5328
 
void
5329
 
yypirfree(void *ptr,yyscan_t yyscanner) {
5330
 
    mem_sys_free(ptr);
5331
 
}
5332
 
 
5333
 
 
5334
 
 
5335
 
 
5336
 
/*
5337
 
 
5338
 
=back
5339
 
 
5340
 
=cut
5341
 
 
5342
 
*/
5343
 
 
5344
 
/*
5345
 
 * Local variables:
5346
 
 *   c-file-style: "parrot"
5347
 
 * End:
5348
 
 * vim: expandtab shiftwidth=4:
5349
 
 */
5350