Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

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