Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

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