~ubuntu-branches/ubuntu/trusty/alliance/trusty

« back to all changes in this revision

Viewing changes to fvh/src/fbl_bcomp_l.c

  • Committer: Package Import Robot
  • Author(s): Roland Stigge
  • Date: 2012-05-16 22:10:18 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120516221018-n800ake8yf5g0an1
Tags: 5.0-20120515-1
* New upstream release
* Added 08-fix-libdir.patch - bad usage of configure's --libdir value,
  was FTBFS if other (binary) version of alliance was installed
* Adjusted 05-as-needed.patch - upstream changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A lexical scanner generated by flex*/
2
 
 
3
 
/* Scanner skeleton version:
4
 
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
5
 
 */
 
1
 
 
2
#line 3 "<stdout>"
 
3
 
 
4
#define  FBL_Y__INT_ALIGNED short int
 
5
 
 
6
/* A lexical scanner generated by flex */
6
7
 
7
8
#define FLEX_SCANNER
8
9
#define FBL_Y__FLEX_MAJOR_VERSION 2
9
10
#define FBL_Y__FLEX_MINOR_VERSION 5
10
 
 
 
11
#define FBL_Y__FLEX_SUBMINOR_VERSION 35
 
12
#if FBL_Y__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. */
11
19
#include <stdio.h>
12
 
#include <unistd.h>
13
 
 
14
 
 
15
 
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16
 
#ifdef c_plusplus
17
 
#ifndef __cplusplus
18
 
#define __cplusplus
19
 
#endif
20
 
#endif
21
 
 
 
20
#include <string.h>
 
21
#include <errno.h>
 
22
#include <stdlib.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
#endif /* ! C99 */
 
57
 
 
58
/* Limits of integral types. */
 
59
#ifndef INT8_MIN
 
60
#define INT8_MIN               (-128)
 
61
#endif
 
62
#ifndef INT16_MIN
 
63
#define INT16_MIN              (-32767-1)
 
64
#endif
 
65
#ifndef INT32_MIN
 
66
#define INT32_MIN              (-2147483647-1)
 
67
#endif
 
68
#ifndef INT8_MAX
 
69
#define INT8_MAX               (127)
 
70
#endif
 
71
#ifndef INT16_MAX
 
72
#define INT16_MAX              (32767)
 
73
#endif
 
74
#ifndef INT32_MAX
 
75
#define INT32_MAX              (2147483647)
 
76
#endif
 
77
#ifndef UINT8_MAX
 
78
#define UINT8_MAX              (255U)
 
79
#endif
 
80
#ifndef UINT16_MAX
 
81
#define UINT16_MAX             (65535U)
 
82
#endif
 
83
#ifndef UINT32_MAX
 
84
#define UINT32_MAX             (4294967295U)
 
85
#endif
 
86
 
 
87
#endif /* ! FLEXINT_H */
22
88
 
23
89
#ifdef __cplusplus
24
90
 
25
 
#include <stdlib.h>
26
 
 
27
 
/* Use prototypes in function declarations. */
28
 
#define FBL_Y__USE_PROTOS
29
 
 
30
91
/* The "const" storage-class-modifier is valid. */
31
92
#define FBL_Y__USE_CONST
32
93
 
33
94
#else   /* ! __cplusplus */
34
95
 
35
 
#if __STDC__
 
96
/* C99 requires __STDC__ to be defined as 1. */
 
97
#if defined (__STDC__)
36
98
 
37
 
#define FBL_Y__USE_PROTOS
38
99
#define FBL_Y__USE_CONST
39
100
 
40
 
#endif  /* __STDC__ */
 
101
#endif  /* defined (__STDC__) */
41
102
#endif  /* ! __cplusplus */
42
103
 
43
 
#ifdef __TURBOC__
44
 
 #pragma warn -rch
45
 
 #pragma warn -use
46
 
#include <io.h>
47
 
#include <stdlib.h>
48
 
#define FBL_Y__USE_CONST
49
 
#define FBL_Y__USE_PROTOS
50
 
#endif
51
 
 
52
104
#ifdef FBL_Y__USE_CONST
53
105
#define fbl_y_const const
54
106
#else
55
107
#define fbl_y_const
56
108
#endif
57
109
 
58
 
 
59
 
#ifdef FBL_Y__USE_PROTOS
60
 
#define FBL_Y__PROTO(proto) proto
61
 
#else
62
 
#define FBL_Y__PROTO(proto) ()
63
 
#endif
64
 
 
65
110
/* Returned upon end-of-file. */
66
111
#define FBL_Y__NULL 0
67
112
 
76
121
 * but we do it the disgusting crufty way forced on us by the ()-less
77
122
 * definition of BEGIN.
78
123
 */
79
 
#define BEGIN fbl_y__start = 1 + 2 *
 
124
#define BEGIN (fbl_y__start) = 1 + 2 *
80
125
 
81
126
/* Translate the current start state into a value that can be later handed
82
127
 * to BEGIN to return to the state.  The FBL_Y_STATE alias is for lex
83
128
 * compatibility.
84
129
 */
85
 
#define FBL_Y__START ((fbl_y__start - 1) / 2)
 
130
#define FBL_Y__START (((fbl_y__start) - 1) / 2)
86
131
#define FBL_Y_STATE FBL_Y__START
87
132
 
88
133
/* Action number for EOF rule of a given start state. */
89
134
#define FBL_Y__STATE_EOF(state) (FBL_Y__END_OF_BUFFER + state + 1)
90
135
 
91
136
/* Special action meaning "start processing a new file". */
92
 
#define FBL_Y__NEW_FILE fbl_y_restart( fbl_y_in )
 
137
#define FBL_Y__NEW_FILE fbl_y_restart(fbl_y_in  )
93
138
 
94
139
#define FBL_Y__END_OF_BUFFER_CHAR 0
95
140
 
96
141
/* Size of default input buffer. */
 
142
#ifndef FBL_Y__BUF_SIZE
97
143
#define FBL_Y__BUF_SIZE 16384
98
 
 
 
144
#endif
 
145
 
 
146
/* The state buf must be large enough to hold one state per character in the main buffer.
 
147
 */
 
148
#define FBL_Y__STATE_BUF_SIZE   ((FBL_Y__BUF_SIZE + 2) * sizeof(fbl_y__state_type))
 
149
 
 
150
#ifndef FBL_Y__TYPEDEF_FBL_Y__BUFFER_STATE
 
151
#define FBL_Y__TYPEDEF_FBL_Y__BUFFER_STATE
99
152
typedef struct fbl_y__buffer_state *FBL_Y__BUFFER_STATE;
 
153
#endif
100
154
 
101
155
extern int fbl_y_leng;
 
156
 
102
157
extern FILE *fbl_y_in, *fbl_y_out;
103
158
 
104
159
#define EOB_ACT_CONTINUE_SCAN 0
105
160
#define EOB_ACT_END_OF_FILE 1
106
161
#define EOB_ACT_LAST_MATCH 2
107
162
 
108
 
/* The funky do-while in the following #define is used to turn the definition
109
 
 * int a single C statement (which needs a semi-colon terminator).  This
110
 
 * avoids problems with code like:
111
 
 *
112
 
 *      if ( condition_holds )
113
 
 *              fbl_y_less( 5 );
114
 
 *      else
115
 
 *              do_something_else();
116
 
 *
117
 
 * Prior to using the do-while the compiler would get upset at the
118
 
 * "else" because it interpreted the "if" statement as being all
119
 
 * done when it reached the ';' after the fbl_y_less() call.
120
 
 */
121
 
 
122
 
/* Return all but the first 'n' matched characters back to the input stream. */
123
 
 
 
163
    #define FBL_Y__LESS_LINENO(n)
 
164
    
 
165
/* Return all but the first "n" matched characters back to the input stream. */
124
166
#define fbl_y_less(n) \
125
167
        do \
126
168
                { \
127
169
                /* Undo effects of setting up fbl_y_text. */ \
128
 
                *fbl_y__cp = fbl_y__hold_char; \
 
170
        int fbl_y_less_macro_arg = (n); \
 
171
        FBL_Y__LESS_LINENO(fbl_y_less_macro_arg);\
 
172
                *fbl_y__cp = (fbl_y__hold_char); \
129
173
                FBL_Y__RESTORE_FBL_Y__MORE_OFFSET \
130
 
                fbl_y__c_buf_p = fbl_y__cp = fbl_y__bp + n - FBL_Y__MORE_ADJ; \
 
174
                (fbl_y__c_buf_p) = fbl_y__cp = fbl_y__bp + fbl_y_less_macro_arg - FBL_Y__MORE_ADJ; \
131
175
                FBL_Y__DO_BEFORE_ACTION; /* set up fbl_y_text again */ \
132
176
                } \
133
177
        while ( 0 )
134
178
 
135
 
#define unput(c) fbl_y_unput( c, fbl_y_text_ptr )
 
179
#define unput(c) fbl_y_unput( c, (fbl_y_text_ptr)  )
136
180
 
137
 
/* Some routines like fbl_y__flex_realloc() are emitted as static but are
138
 
   not called by all lexers. This generates warnings in some compilers,
139
 
   notably GCC. Arrange to suppress these. */
140
 
#ifdef __GNUC__
141
 
#define FBL_Y__MAY_BE_UNUSED __attribute__((unused))
142
 
#else
143
 
#define FBL_Y__MAY_BE_UNUSED
 
181
#ifndef FBL_Y__TYPEDEF_FBL_Y__SIZE_T
 
182
#define FBL_Y__TYPEDEF_FBL_Y__SIZE_T
 
183
typedef size_t fbl_y__size_t;
144
184
#endif
145
185
 
146
 
/* The following is because we cannot portably get our hands on size_t
147
 
 * (without autoconf's help, which isn't available because we want
148
 
 * flex-generated scanners to compile on their own).
149
 
 */
150
 
typedef unsigned int fbl_y__size_t;
151
 
 
152
 
 
 
186
#ifndef FBL_Y__STRUCT_FBL_Y__BUFFER_STATE
 
187
#define FBL_Y__STRUCT_FBL_Y__BUFFER_STATE
153
188
struct fbl_y__buffer_state
154
189
        {
155
190
        FILE *fbl_y__input_file;
186
221
         */
187
222
        int fbl_y__at_bol;
188
223
 
 
224
    int fbl_y__bs_lineno; /**< The line count. */
 
225
    int fbl_y__bs_column; /**< The column count. */
 
226
    
189
227
        /* Whether to try to fill the input buffer when we reach the
190
228
         * end of it.
191
229
         */
192
230
        int fbl_y__fill_buffer;
193
231
 
194
232
        int fbl_y__buffer_status;
 
233
 
195
234
#define FBL_Y__BUFFER_NEW 0
196
235
#define FBL_Y__BUFFER_NORMAL 1
197
236
        /* When an EOF's been seen but there's still some text to process
205
244
         * just pointing fbl_y_in at a new input file.
206
245
         */
207
246
#define FBL_Y__BUFFER_EOF_PENDING 2
 
247
 
208
248
        };
 
249
#endif /* !FBL_Y__STRUCT_FBL_Y__BUFFER_STATE */
209
250
 
210
 
static FBL_Y__BUFFER_STATE fbl_y__current_buffer = 0;
 
251
/* Stack of input buffers. */
 
252
static size_t fbl_y__buffer_stack_top = 0; /**< index of top of stack. */
 
253
static size_t fbl_y__buffer_stack_max = 0; /**< capacity of stack. */
 
254
static FBL_Y__BUFFER_STATE * fbl_y__buffer_stack = 0; /**< Stack as an array. */
211
255
 
212
256
/* We provide macros for accessing buffer states in case in the
213
257
 * future we want to put the buffer states in a more general
214
258
 * "scanner state".
 
259
 *
 
260
 * Returns the top of the stack, or NULL.
215
261
 */
216
 
#define FBL_Y__CURRENT_BUFFER fbl_y__current_buffer
 
262
#define FBL_Y__CURRENT_BUFFER ( (fbl_y__buffer_stack) \
 
263
                          ? (fbl_y__buffer_stack)[(fbl_y__buffer_stack_top)] \
 
264
                          : NULL)
217
265
 
 
266
/* Same as previous macro, but useful when we know that the buffer stack is not
 
267
 * NULL or when we need an lvalue. For internal use only.
 
268
 */
 
269
#define FBL_Y__CURRENT_BUFFER_LVALUE (fbl_y__buffer_stack)[(fbl_y__buffer_stack_top)]
218
270
 
219
271
/* fbl_y__hold_char holds the character lost when fbl_y_text is formed. */
220
272
static char fbl_y__hold_char;
221
 
 
222
273
static int fbl_y__n_chars;              /* number of characters read into fbl_y__ch_buf */
223
 
 
224
 
 
225
274
int fbl_y_leng;
226
275
 
227
276
/* Points to current character in buffer. */
228
277
static char *fbl_y__c_buf_p = (char *) 0;
229
 
static int fbl_y__init = 1;             /* whether we need to initialize */
 
278
static int fbl_y__init = 0;             /* whether we need to initialize */
230
279
static int fbl_y__start = 0;    /* start state number */
231
280
 
232
281
/* Flag which is used to allow fbl_y_wrap()'s to do buffer switches
234
283
 */
235
284
static int fbl_y__did_buffer_switch_on_eof;
236
285
 
237
 
void fbl_y_restart FBL_Y__PROTO(( FILE *input_file ));
238
 
 
239
 
void fbl_y__switch_to_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE new_buffer ));
240
 
void fbl_y__load_buffer_state FBL_Y__PROTO(( void ));
241
 
FBL_Y__BUFFER_STATE fbl_y__create_buffer FBL_Y__PROTO(( FILE *file, int size ));
242
 
void fbl_y__delete_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE b ));
243
 
void fbl_y__init_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE b, FILE *file ));
244
 
void fbl_y__flush_buffer FBL_Y__PROTO(( FBL_Y__BUFFER_STATE b ));
245
 
#define FBL_Y__FLUSH_BUFFER fbl_y__flush_buffer( fbl_y__current_buffer )
246
 
 
247
 
FBL_Y__BUFFER_STATE fbl_y__scan_buffer FBL_Y__PROTO(( char *base, fbl_y__size_t size ));
248
 
FBL_Y__BUFFER_STATE fbl_y__scan_string FBL_Y__PROTO(( fbl_y_const char *fbl_y__str ));
249
 
FBL_Y__BUFFER_STATE fbl_y__scan_bytes FBL_Y__PROTO(( fbl_y_const char *bytes, int len ));
250
 
 
251
 
static void *fbl_y__flex_alloc FBL_Y__PROTO(( fbl_y__size_t ));
252
 
static void *fbl_y__flex_realloc FBL_Y__PROTO(( void *, fbl_y__size_t )) FBL_Y__MAY_BE_UNUSED;
253
 
static void fbl_y__flex_free FBL_Y__PROTO(( void * ));
 
286
void fbl_y_restart (FILE *input_file  );
 
287
void fbl_y__switch_to_buffer (FBL_Y__BUFFER_STATE new_buffer  );
 
288
FBL_Y__BUFFER_STATE fbl_y__create_buffer (FILE *file,int size  );
 
289
void fbl_y__delete_buffer (FBL_Y__BUFFER_STATE b  );
 
290
void fbl_y__flush_buffer (FBL_Y__BUFFER_STATE b  );
 
291
void fbl_y_push_buffer_state (FBL_Y__BUFFER_STATE new_buffer  );
 
292
void fbl_y_pop_buffer_state (void );
 
293
 
 
294
static void fbl_y_ensure_buffer_stack (void );
 
295
static void fbl_y__load_buffer_state (void );
 
296
static void fbl_y__init_buffer (FBL_Y__BUFFER_STATE b,FILE *file  );
 
297
 
 
298
#define FBL_Y__FLUSH_BUFFER fbl_y__flush_buffer(FBL_Y__CURRENT_BUFFER )
 
299
 
 
300
FBL_Y__BUFFER_STATE fbl_y__scan_buffer (char *base,fbl_y__size_t size  );
 
301
FBL_Y__BUFFER_STATE fbl_y__scan_string (fbl_y_const char *fbl_y__str  );
 
302
FBL_Y__BUFFER_STATE fbl_y__scan_bytes (fbl_y_const char *bytes,int len  );
 
303
 
 
304
void *fbl_y_alloc (fbl_y__size_t  );
 
305
void *fbl_y_realloc (void *,fbl_y__size_t  );
 
306
void fbl_y_free (void *  );
254
307
 
255
308
#define fbl_y__new_buffer fbl_y__create_buffer
256
309
 
257
310
#define fbl_y__set_interactive(is_interactive) \
258
311
        { \
259
 
        if ( ! fbl_y__current_buffer ) \
260
 
                fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE ); \
261
 
        fbl_y__current_buffer->fbl_y__is_interactive = is_interactive; \
 
312
        if ( ! FBL_Y__CURRENT_BUFFER ){ \
 
313
        fbl_y_ensure_buffer_stack (); \
 
314
                FBL_Y__CURRENT_BUFFER_LVALUE =    \
 
315
            fbl_y__create_buffer(fbl_y_in,FBL_Y__BUF_SIZE ); \
 
316
        } \
 
317
        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__is_interactive = is_interactive; \
262
318
        }
263
319
 
264
320
#define fbl_y__set_bol(at_bol) \
265
321
        { \
266
 
        if ( ! fbl_y__current_buffer ) \
267
 
                fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE ); \
268
 
        fbl_y__current_buffer->fbl_y__at_bol = at_bol; \
 
322
        if ( ! FBL_Y__CURRENT_BUFFER ){\
 
323
        fbl_y_ensure_buffer_stack (); \
 
324
                FBL_Y__CURRENT_BUFFER_LVALUE =    \
 
325
            fbl_y__create_buffer(fbl_y_in,FBL_Y__BUF_SIZE ); \
 
326
        } \
 
327
        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__at_bol = at_bol; \
269
328
        }
270
329
 
271
 
#define FBL_Y__AT_BOL() (fbl_y__current_buffer->fbl_y__at_bol)
 
330
#define FBL_Y__AT_BOL() (FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__at_bol)
 
331
 
 
332
/* Begin user sect3 */
272
333
 
273
334
typedef unsigned char FBL_Y__CHAR;
 
335
 
274
336
FILE *fbl_y_in = (FILE *) 0, *fbl_y_out = (FILE *) 0;
 
337
 
275
338
typedef int fbl_y__state_type;
 
339
 
 
340
extern int fbl_y_lineno;
 
341
 
 
342
int fbl_y_lineno = 1;
 
343
 
276
344
extern char *fbl_y_text;
277
345
#define fbl_y_text_ptr fbl_y_text
278
346
 
279
 
static fbl_y__state_type fbl_y__get_previous_state FBL_Y__PROTO(( void ));
280
 
static fbl_y__state_type fbl_y__try_NUL_trans FBL_Y__PROTO(( fbl_y__state_type current_state ));
281
 
static int fbl_y__get_next_buffer FBL_Y__PROTO(( void ));
282
 
static void fbl_y__fatal_error FBL_Y__PROTO(( fbl_y_const char msg[] ));
 
347
static fbl_y__state_type fbl_y__get_previous_state (void );
 
348
static fbl_y__state_type fbl_y__try_NUL_trans (fbl_y__state_type current_state  );
 
349
static int fbl_y__get_next_buffer (void );
 
350
static void fbl_y__fatal_error (fbl_y_const char msg[]  );
283
351
 
284
352
/* Done after the current pattern has been matched and before the
285
353
 * corresponding action - sets up fbl_y_text.
286
354
 */
287
355
#define FBL_Y__DO_BEFORE_ACTION \
288
 
        fbl_y_text_ptr = fbl_y__bp; \
289
 
        fbl_y_leng = (int) (fbl_y__cp - fbl_y__bp); \
290
 
        fbl_y__hold_char = *fbl_y__cp; \
 
356
        (fbl_y_text_ptr) = fbl_y__bp; \
 
357
        fbl_y_leng = (size_t) (fbl_y__cp - fbl_y__bp); \
 
358
        (fbl_y__hold_char) = *fbl_y__cp; \
291
359
        *fbl_y__cp = '\0'; \
292
 
        fbl_y__c_buf_p = fbl_y__cp;
 
360
        (fbl_y__c_buf_p) = fbl_y__cp;
293
361
 
294
362
#define FBL_Y__NUM_RULES 34
295
363
#define FBL_Y__END_OF_BUFFER 35
296
 
static fbl_y_const short int fbl_y__accept[105] =
 
364
/* This struct is not used in this scanner,
 
365
   but its presence is necessary. */
 
366
struct fbl_y__trans_info
 
367
        {
 
368
        flex_int32_t fbl_y__verify;
 
369
        flex_int32_t fbl_y__nxt;
 
370
        };
 
371
static fbl_y_const flex_int16_t fbl_y__accept[105] =
297
372
    {   0,
298
373
        0,    0,   35,   33,    1,   30,   23,   33,   33,    2,
299
374
        3,    4,    5,    7,    8,    9,   10,   24,   33,   26,
309
384
        0,    0,   31,    0
310
385
    } ;
311
386
 
312
 
static fbl_y_const int fbl_y__ec[256] =
 
387
static fbl_y_const flex_int32_t fbl_y__ec[256] =
313
388
    {   0,
314
389
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
315
390
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
341
416
        1,    1,    1,    1,    1
342
417
    } ;
343
418
 
344
 
static fbl_y_const int fbl_y__meta[49] =
 
419
static fbl_y_const flex_int32_t fbl_y__meta[49] =
345
420
    {   0,
346
421
        1,    2,    1,    2,    3,    4,    2,    5,    2,    2,
347
422
        2,    2,    2,    2,    2,    2,    6,    2,    7,    8,
350
425
        9,    9,    9,    9,    9,    9,    9,    2
351
426
    } ;
352
427
 
353
 
static fbl_y_const short int fbl_y__base[123] =
 
428
static fbl_y_const flex_int16_t fbl_y__base[123] =
354
429
    {   0,
355
430
        0,    0,  255,  274,  274,  274,  274,  249,  243,  274,
356
431
        0,  274,  274,  237,  274,  274,  232,  274,  222,   43,
368
443
      253,  263
369
444
    } ;
370
445
 
371
 
static fbl_y_const short int fbl_y__def[123] =
 
446
static fbl_y_const flex_int16_t fbl_y__def[123] =
372
447
    {   0,
373
448
      104,    1,  104,  104,  104,  104,  104,  105,  106,  104,
374
449
      107,  104,  104,  104,  104,  104,  104,  104,  104,  104,
386
461
      104,  104
387
462
    } ;
388
463
 
389
 
static fbl_y_const short int fbl_y__nxt[323] =
 
464
static fbl_y_const flex_int16_t fbl_y__nxt[323] =
390
465
    {   0,
391
466
        4,    5,    6,    7,    8,    4,    4,    9,   10,   11,
392
467
       12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
426
501
      104,  104
427
502
    } ;
428
503
 
429
 
static fbl_y_const short int fbl_y__chk[323] =
 
504
static fbl_y_const flex_int16_t fbl_y__chk[323] =
430
505
    {   0,
431
506
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
432
507
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
469
544
static fbl_y__state_type fbl_y__last_accepting_state;
470
545
static char *fbl_y__last_accepting_cpos;
471
546
 
 
547
extern int fbl_y__flex_debug;
 
548
int fbl_y__flex_debug = 0;
 
549
 
472
550
/* The intent behind this definition is that it'll catch
473
551
 * any uses of REJECT which flex missed.
474
552
 */
477
555
#define FBL_Y__MORE_ADJ 0
478
556
#define FBL_Y__RESTORE_FBL_Y__MORE_OFFSET
479
557
char *fbl_y_text;
480
 
#line 1 "../../../src/fvh/src/fbl_bcomp_l.l"
481
 
#define INITIAL 0
 
558
#line 1 "./fbl_bcomp_l.l"
482
559
/*------------------------------------------------------------\
483
560
|                                                             |
484
561
| This file is part of the Alliance CAD System Copyright      |
502
579
| You should have received a copy  of the GNU General Public  |
503
580
| License along with the GNU C Library; see the file COPYING. |
504
581
| If not, write to the Free Software Foundation, Inc.,        |
505
 
| 675 Mass Ave, Cambridge, MA 02139, USA.                     |
 
582
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                     |
506
583
|                                                             |
507
584
\------------------------------------------------------------*/
508
 
#line 28 "../../../src/fvh/src/fbl_bcomp_l.l"
 
585
#line 28 "./fbl_bcomp_l.l"
509
586
#include <stdio.h>
510
587
#include <stdlib.h>
511
588
#include <string.h>
649
726
  }
650
727
 
651
728
 
 
729
#line 730 "<stdout>"
 
730
 
 
731
#define INITIAL 0
 
732
 
 
733
#ifndef FBL_Y__NO_UNISTD_H
 
734
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 
735
 * down here because we want the user's section 1 to have been scanned first.
 
736
 * The user has a chance to override it with an option.
 
737
 */
 
738
#include <unistd.h>
 
739
#endif
 
740
 
 
741
#ifndef FBL_Y__EXTRA_TYPE
 
742
#define FBL_Y__EXTRA_TYPE void *
 
743
#endif
 
744
 
 
745
static int fbl_y__init_globals (void );
 
746
 
 
747
/* Accessor methods to globals.
 
748
   These are made visible to non-reentrant scanners for convenience. */
 
749
 
 
750
int fbl_y_lex_destroy (void );
 
751
 
 
752
int fbl_y_get_debug (void );
 
753
 
 
754
void fbl_y_set_debug (int debug_flag  );
 
755
 
 
756
FBL_Y__EXTRA_TYPE fbl_y_get_extra (void );
 
757
 
 
758
void fbl_y_set_extra (FBL_Y__EXTRA_TYPE user_defined  );
 
759
 
 
760
FILE *fbl_y_get_in (void );
 
761
 
 
762
void fbl_y_set_in  (FILE * in_str  );
 
763
 
 
764
FILE *fbl_y_get_out (void );
 
765
 
 
766
void fbl_y_set_out  (FILE * out_str  );
 
767
 
 
768
int fbl_y_get_leng (void );
 
769
 
 
770
char *fbl_y_get_text (void );
 
771
 
 
772
int fbl_y_get_lineno (void );
 
773
 
 
774
void fbl_y_set_lineno (int line_number  );
652
775
 
653
776
/* Macros after this point can all be overridden by user definitions in
654
777
 * section 1.
656
779
 
657
780
#ifndef FBL_Y__SKIP_FBL_Y_WRAP
658
781
#ifdef __cplusplus
659
 
extern "C" int fbl_y_wrap FBL_Y__PROTO(( void ));
 
782
extern "C" int fbl_y_wrap (void );
660
783
#else
661
 
extern int fbl_y_wrap FBL_Y__PROTO(( void ));
662
 
#endif
663
 
#endif
664
 
 
665
 
#ifndef FBL_Y__NO_UNPUT
666
 
static void fbl_y_unput FBL_Y__PROTO(( int c, char *buf_ptr ));
667
 
#endif
668
 
 
 
784
extern int fbl_y_wrap (void );
 
785
#endif
 
786
#endif
 
787
 
 
788
    static void fbl_y_unput (int c,char *buf_ptr  );
 
789
    
669
790
#ifndef fbl_y_text_ptr
670
 
static void fbl_y__flex_strncpy FBL_Y__PROTO(( char *, fbl_y_const char *, int ));
 
791
static void fbl_y__flex_strncpy (char *,fbl_y_const char *,int );
671
792
#endif
672
793
 
673
794
#ifdef FBL_Y__NEED_STRLEN
674
 
static int fbl_y__flex_strlen FBL_Y__PROTO(( fbl_y_const char * ));
 
795
static int fbl_y__flex_strlen (fbl_y_const char * );
675
796
#endif
676
797
 
677
798
#ifndef FBL_Y__NO_INPUT
 
799
 
678
800
#ifdef __cplusplus
679
 
static int fbl_y_input FBL_Y__PROTO(( void ));
680
 
#else
681
 
static int input FBL_Y__PROTO(( void ));
682
 
#endif
683
 
#endif
684
 
 
685
 
#if FBL_Y__STACK_USED
686
 
static int fbl_y__start_stack_ptr = 0;
687
 
static int fbl_y__start_stack_depth = 0;
688
 
static int *fbl_y__start_stack = 0;
689
 
#ifndef FBL_Y__NO_PUSH_STATE
690
 
static void fbl_y__push_state FBL_Y__PROTO(( int new_state ));
691
 
#endif
692
 
#ifndef FBL_Y__NO_POP_STATE
693
 
static void fbl_y__pop_state FBL_Y__PROTO(( void ));
694
 
#endif
695
 
#ifndef FBL_Y__NO_TOP_STATE
696
 
static int fbl_y__top_state FBL_Y__PROTO(( void ));
697
 
#endif
698
 
 
699
 
#else
700
 
#define FBL_Y__NO_PUSH_STATE 1
701
 
#define FBL_Y__NO_POP_STATE 1
702
 
#define FBL_Y__NO_TOP_STATE 1
703
 
#endif
704
 
 
705
 
#ifdef FBL_Y__MALLOC_DECL
706
 
FBL_Y__MALLOC_DECL
707
 
#else
708
 
#if __STDC__
709
 
#ifndef __cplusplus
710
 
#include <stdlib.h>
711
 
#endif
712
 
#else
713
 
/* Just try to get by without declaring the routines.  This will fail
714
 
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
715
 
 * or sizeof(void*) != sizeof(int).
716
 
 */
717
 
#endif
 
801
static int fbl_y_input (void );
 
802
#else
 
803
static int input (void );
 
804
#endif
 
805
 
718
806
#endif
719
807
 
720
808
/* Amount of stuff to slurp up with each read. */
723
811
#endif
724
812
 
725
813
/* Copy whatever the last rule matched to the standard output. */
726
 
 
727
814
#ifndef ECHO
728
815
/* This used to be an fputs(), but since the string might contain NUL's,
729
816
 * we now use fwrite().
730
817
 */
731
 
#define ECHO (void) fwrite( fbl_y_text, fbl_y_leng, 1, fbl_y_out )
 
818
#define ECHO do { if (fwrite( fbl_y_text, fbl_y_leng, 1, fbl_y_out )) {} } while (0)
732
819
#endif
733
820
 
734
821
/* Gets input and stuffs it into "buf".  number of characters read, or FBL_Y__NULL,
736
823
 */
737
824
#ifndef FBL_Y__INPUT
738
825
#define FBL_Y__INPUT(buf,result,max_size) \
739
 
        if ( fbl_y__current_buffer->fbl_y__is_interactive ) \
 
826
        if ( FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__is_interactive ) \
740
827
                { \
741
 
                int c = '*', n; \
 
828
                int c = '*'; \
 
829
                unsigned n; \
742
830
                for ( n = 0; n < max_size && \
743
831
                             (c = getc( fbl_y_in )) != EOF && c != '\n'; ++n ) \
744
832
                        buf[n] = (char) c; \
748
836
                        FBL_Y__FATAL_ERROR( "input in flex scanner failed" ); \
749
837
                result = n; \
750
838
                } \
751
 
        else if ( ((result = fread( buf, 1, max_size, fbl_y_in )) == 0) \
752
 
                  && ferror( fbl_y_in ) ) \
753
 
                FBL_Y__FATAL_ERROR( "input in flex scanner failed" );
 
839
        else \
 
840
                { \
 
841
                errno=0; \
 
842
                while ( (result = fread(buf, 1, max_size, fbl_y_in))==0 && ferror(fbl_y_in)) \
 
843
                        { \
 
844
                        if( errno != EINTR) \
 
845
                                { \
 
846
                                FBL_Y__FATAL_ERROR( "input in flex scanner failed" ); \
 
847
                                break; \
 
848
                                } \
 
849
                        errno=0; \
 
850
                        clearerr(fbl_y_in); \
 
851
                        } \
 
852
                }\
 
853
\
 
854
 
754
855
#endif
755
856
 
756
857
/* No semi-colon after return; correct usage is to write "fbl_y_terminate();" -
771
872
#define FBL_Y__FATAL_ERROR(msg) fbl_y__fatal_error( msg )
772
873
#endif
773
874
 
 
875
/* end tables serialization structures and prototypes */
 
876
 
774
877
/* Default declaration of generated scanner - a define so the user can
775
878
 * easily add parameters.
776
879
 */
777
880
#ifndef FBL_Y__DECL
778
 
#define FBL_Y__DECL int fbl_y_lex FBL_Y__PROTO(( void ))
779
 
#endif
 
881
#define FBL_Y__DECL_IS_OURS 1
 
882
 
 
883
extern int fbl_y_lex (void);
 
884
 
 
885
#define FBL_Y__DECL int fbl_y_lex (void)
 
886
#endif /* !FBL_Y__DECL */
780
887
 
781
888
/* Code executed at the beginning of each rule, after fbl_y_text and fbl_y_leng
782
889
 * have been set up.
793
900
#define FBL_Y__RULE_SETUP \
794
901
        FBL_Y__USER_ACTION
795
902
 
 
903
/** The main scanner function which does all the work.
 
904
 */
796
905
FBL_Y__DECL
797
 
        {
 
906
{
798
907
        register fbl_y__state_type fbl_y__current_state;
799
 
        register char *fbl_y__cp = NULL, *fbl_y__bp = NULL;
 
908
        register char *fbl_y__cp, *fbl_y__bp;
800
909
        register int fbl_y__act;
801
 
 
802
 
#line 194 "../../../src/fvh/src/fbl_bcomp_l.l"
803
 
 
804
 
 
805
 
        if ( fbl_y__init )
 
910
    
 
911
#line 194 "./fbl_bcomp_l.l"
 
912
 
 
913
#line 914 "<stdout>"
 
914
 
 
915
        if ( !(fbl_y__init) )
806
916
                {
807
 
                fbl_y__init = 0;
 
917
                (fbl_y__init) = 1;
808
918
 
809
919
#ifdef FBL_Y__USER_INIT
810
920
                FBL_Y__USER_INIT;
811
921
#endif
812
922
 
813
 
                if ( ! fbl_y__start )
814
 
                        fbl_y__start = 1;       /* first start state */
 
923
                if ( ! (fbl_y__start) )
 
924
                        (fbl_y__start) = 1;     /* first start state */
815
925
 
816
926
                if ( ! fbl_y_in )
817
927
                        fbl_y_in = stdin;
819
929
                if ( ! fbl_y_out )
820
930
                        fbl_y_out = stdout;
821
931
 
822
 
                if ( ! fbl_y__current_buffer )
823
 
                        fbl_y__current_buffer =
824
 
                                fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE );
 
932
                if ( ! FBL_Y__CURRENT_BUFFER ) {
 
933
                        fbl_y_ensure_buffer_stack ();
 
934
                        FBL_Y__CURRENT_BUFFER_LVALUE =
 
935
                                fbl_y__create_buffer(fbl_y_in,FBL_Y__BUF_SIZE );
 
936
                }
825
937
 
826
 
                fbl_y__load_buffer_state();
 
938
                fbl_y__load_buffer_state( );
827
939
                }
828
940
 
829
941
        while ( 1 )             /* loops until end-of-file is reached */
830
942
                {
831
 
                fbl_y__cp = fbl_y__c_buf_p;
 
943
                fbl_y__cp = (fbl_y__c_buf_p);
832
944
 
833
945
                /* Support of fbl_y_text. */
834
 
                *fbl_y__cp = fbl_y__hold_char;
 
946
                *fbl_y__cp = (fbl_y__hold_char);
835
947
 
836
948
                /* fbl_y__bp points to the position in fbl_y__ch_buf of the start of
837
949
                 * the current run.
838
950
                 */
839
951
                fbl_y__bp = fbl_y__cp;
840
952
 
841
 
                fbl_y__current_state = fbl_y__start;
 
953
                fbl_y__current_state = (fbl_y__start);
842
954
fbl_y__match:
843
955
                do
844
956
                        {
845
957
                        register FBL_Y__CHAR fbl_y__c = fbl_y__ec[FBL_Y__SC_TO_UI(*fbl_y__cp)];
846
958
                        if ( fbl_y__accept[fbl_y__current_state] )
847
959
                                {
848
 
                                fbl_y__last_accepting_state = fbl_y__current_state;
849
 
                                fbl_y__last_accepting_cpos = fbl_y__cp;
 
960
                                (fbl_y__last_accepting_state) = fbl_y__current_state;
 
961
                                (fbl_y__last_accepting_cpos) = fbl_y__cp;
850
962
                                }
851
963
                        while ( fbl_y__chk[fbl_y__base[fbl_y__current_state] + fbl_y__c] != fbl_y__current_state )
852
964
                                {
863
975
                fbl_y__act = fbl_y__accept[fbl_y__current_state];
864
976
                if ( fbl_y__act == 0 )
865
977
                        { /* have to back up */
866
 
                        fbl_y__cp = fbl_y__last_accepting_cpos;
867
 
                        fbl_y__current_state = fbl_y__last_accepting_state;
 
978
                        fbl_y__cp = (fbl_y__last_accepting_cpos);
 
979
                        fbl_y__current_state = (fbl_y__last_accepting_state);
868
980
                        fbl_y__act = fbl_y__accept[fbl_y__current_state];
869
981
                        }
870
982
 
871
983
                FBL_Y__DO_BEFORE_ACTION;
872
984
 
873
 
 
874
985
do_action:      /* This label is used only to access EOF actions. */
875
986
 
876
 
 
877
987
                switch ( fbl_y__act )
878
988
        { /* beginning of action switch */
879
989
                        case 0: /* must back up */
880
990
                        /* undo the effects of FBL_Y__DO_BEFORE_ACTION */
881
 
                        *fbl_y__cp = fbl_y__hold_char;
882
 
                        fbl_y__cp = fbl_y__last_accepting_cpos;
883
 
                        fbl_y__current_state = fbl_y__last_accepting_state;
 
991
                        *fbl_y__cp = (fbl_y__hold_char);
 
992
                        fbl_y__cp = (fbl_y__last_accepting_cpos);
 
993
                        fbl_y__current_state = (fbl_y__last_accepting_state);
884
994
                        goto fbl_y__find_action;
885
995
 
886
996
case 1:
887
997
FBL_Y__RULE_SETUP
888
 
#line 195 "../../../src/fvh/src/fbl_bcomp_l.l"
 
998
#line 195 "./fbl_bcomp_l.l"
889
999
;
890
1000
        FBL_Y__BREAK
891
1001
case 2:
892
1002
FBL_Y__RULE_SETUP
893
 
#line 196 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1003
#line 196 "./fbl_bcomp_l.l"
894
1004
{ return(Ampersand); }
895
1005
        FBL_Y__BREAK
896
1006
case 3:
897
1007
FBL_Y__RULE_SETUP
898
 
#line 197 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1008
#line 197 "./fbl_bcomp_l.l"
899
1009
{ return(Apostrophe); }
900
1010
        FBL_Y__BREAK
901
1011
case 4:
902
1012
FBL_Y__RULE_SETUP
903
 
#line 198 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1013
#line 198 "./fbl_bcomp_l.l"
904
1014
{ return(LeftParen); }
905
1015
        FBL_Y__BREAK
906
1016
case 5:
907
1017
FBL_Y__RULE_SETUP
908
 
#line 199 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1018
#line 199 "./fbl_bcomp_l.l"
909
1019
{ return(RightParen); }
910
1020
        FBL_Y__BREAK
911
1021
case 6:
912
1022
FBL_Y__RULE_SETUP
913
 
#line 200 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1023
#line 200 "./fbl_bcomp_l.l"
914
1024
{ return(DoubleStar); }
915
1025
        FBL_Y__BREAK
916
1026
case 7:
917
1027
FBL_Y__RULE_SETUP
918
 
#line 201 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1028
#line 201 "./fbl_bcomp_l.l"
919
1029
{ return(Star); }
920
1030
        FBL_Y__BREAK
921
1031
case 8:
922
1032
FBL_Y__RULE_SETUP
923
 
#line 202 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1033
#line 202 "./fbl_bcomp_l.l"
924
1034
{ return(Plus); }
925
1035
        FBL_Y__BREAK
926
1036
case 9:
927
1037
FBL_Y__RULE_SETUP
928
 
#line 203 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1038
#line 203 "./fbl_bcomp_l.l"
929
1039
{ return(Comma); }
930
1040
        FBL_Y__BREAK
931
1041
case 10:
932
1042
FBL_Y__RULE_SETUP
933
 
#line 204 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1043
#line 204 "./fbl_bcomp_l.l"
934
1044
{ return(Minus); }
935
1045
        FBL_Y__BREAK
936
1046
case 11:
937
1047
FBL_Y__RULE_SETUP
938
 
#line 205 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1048
#line 205 "./fbl_bcomp_l.l"
939
1049
{ return(VarAsgn); }
940
1050
        FBL_Y__BREAK
941
1051
case 12:
942
1052
FBL_Y__RULE_SETUP
943
 
#line 206 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1053
#line 206 "./fbl_bcomp_l.l"
944
1054
{ return(Colon); }
945
1055
        FBL_Y__BREAK
946
1056
case 13:
947
1057
FBL_Y__RULE_SETUP
948
 
#line 207 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1058
#line 207 "./fbl_bcomp_l.l"
949
1059
{ return(Semicolon); }
950
1060
        FBL_Y__BREAK
951
1061
case 14:
952
1062
FBL_Y__RULE_SETUP
953
 
#line 208 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1063
#line 208 "./fbl_bcomp_l.l"
954
1064
{ return(_LESym); }
955
1065
        FBL_Y__BREAK
956
1066
case 15:
957
1067
FBL_Y__RULE_SETUP
958
 
#line 209 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1068
#line 209 "./fbl_bcomp_l.l"
959
1069
{ return(_GESym); }
960
1070
        FBL_Y__BREAK
961
1071
case 16:
962
1072
FBL_Y__RULE_SETUP
963
 
#line 210 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1073
#line 210 "./fbl_bcomp_l.l"
964
1074
{ return(_LTSym); }
965
1075
        FBL_Y__BREAK
966
1076
case 17:
967
1077
FBL_Y__RULE_SETUP
968
 
#line 211 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1078
#line 211 "./fbl_bcomp_l.l"
969
1079
{ return(_GTSym); }
970
1080
        FBL_Y__BREAK
971
1081
case 18:
972
1082
FBL_Y__RULE_SETUP
973
 
#line 212 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1083
#line 212 "./fbl_bcomp_l.l"
974
1084
{ return(_EQSym); }
975
1085
        FBL_Y__BREAK
976
1086
case 19:
977
1087
FBL_Y__RULE_SETUP
978
 
#line 213 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1088
#line 213 "./fbl_bcomp_l.l"
979
1089
{ return(_NESym); }
980
1090
        FBL_Y__BREAK
981
1091
case 20:
982
1092
FBL_Y__RULE_SETUP
983
 
#line 214 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1093
#line 214 "./fbl_bcomp_l.l"
984
1094
{ return(Arrow); }
985
1095
        FBL_Y__BREAK
986
1096
case 21:
987
1097
FBL_Y__RULE_SETUP
988
 
#line 215 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1098
#line 215 "./fbl_bcomp_l.l"
989
1099
{ return(Box); }
990
1100
        FBL_Y__BREAK
991
1101
case 22:
992
1102
FBL_Y__RULE_SETUP
993
 
#line 216 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1103
#line 216 "./fbl_bcomp_l.l"
994
1104
{ return(Bar); }
995
1105
        FBL_Y__BREAK
996
1106
case 23:
997
1107
FBL_Y__RULE_SETUP
998
 
#line 217 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1108
#line 217 "./fbl_bcomp_l.l"
999
1109
{ return(Bar); }
1000
1110
        FBL_Y__BREAK
1001
1111
case 24:
1002
1112
FBL_Y__RULE_SETUP
1003
 
#line 218 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1113
#line 218 "./fbl_bcomp_l.l"
1004
1114
{ return(Dot); }
1005
1115
        FBL_Y__BREAK
1006
1116
case 25:
1007
1117
FBL_Y__RULE_SETUP
1008
 
#line 220 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1118
#line 220 "./fbl_bcomp_l.l"
1009
1119
{
1010
1120
                        int itoken;
1011
1121
                        itoken=find_mc(fbl_y_text);
1022
1132
        FBL_Y__BREAK
1023
1133
case 26:
1024
1134
FBL_Y__RULE_SETUP
1025
 
#line 233 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1135
#line 233 "./fbl_bcomp_l.l"
1026
1136
{
1027
1137
                        fbl_y_lval.text = mbkalloc((unsigned int)strlen(fbl_y_text)+1);
1028
1138
                        strcpy(fbl_y_lval.text,fbl_y_text);
1031
1141
        FBL_Y__BREAK
1032
1142
case 27:
1033
1143
FBL_Y__RULE_SETUP
1034
 
#line 238 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1144
#line 238 "./fbl_bcomp_l.l"
1035
1145
{
1036
1146
                        fbl_y_lval.text = namealloc (fbl_y_text);
1037
1147
                        return ( CharacterLit );
1039
1149
        FBL_Y__BREAK
1040
1150
case 28:
1041
1151
FBL_Y__RULE_SETUP
1042
 
#line 242 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1152
#line 242 "./fbl_bcomp_l.l"
1043
1153
{
1044
1154
                        fbl_y_lval.text = namealloc (fbl_y_text);
1045
1155
                        return ( StringLit );
1047
1157
        FBL_Y__BREAK
1048
1158
case 29:
1049
1159
FBL_Y__RULE_SETUP
1050
 
#line 246 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1160
#line 246 "./fbl_bcomp_l.l"
1051
1161
{
1052
1162
                        fbl_y_lval.text = namealloc (fbl_y_text);
1053
1163
                        return ( BitStringLit );
1054
1164
                                                                        }
1055
1165
        FBL_Y__BREAK
1056
1166
case 30:
 
1167
/* rule 30 can match eol */
1057
1168
FBL_Y__RULE_SETUP
1058
 
#line 250 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1169
#line 250 "./fbl_bcomp_l.l"
1059
1170
{
1060
1171
                        /* end of line */
1061
1172
                         FBL_LINNUM++;
1062
1173
                                                                        }
1063
1174
        FBL_Y__BREAK
1064
1175
case 31:
1065
 
*fbl_y__cp = fbl_y__hold_char; /* undo effects of setting up fbl_y_text */
1066
 
fbl_y__c_buf_p = fbl_y__cp -= 1;
 
1176
*fbl_y__cp = (fbl_y__hold_char); /* undo effects of setting up fbl_y_text */
 
1177
(fbl_y__c_buf_p) = fbl_y__cp -= 1;
1067
1178
FBL_Y__DO_BEFORE_ACTION; /* set up fbl_y_text again */
1068
1179
FBL_Y__RULE_SETUP
1069
 
#line 254 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1180
#line 254 "./fbl_bcomp_l.l"
1070
1181
{
1071
1182
                        /* pragma */
1072
1183
                        fbl_y_lval.text = namealloc (fbl_y_text);
1074
1185
                                                                        }
1075
1186
        FBL_Y__BREAK
1076
1187
case 32:
1077
 
*fbl_y__cp = fbl_y__hold_char; /* undo effects of setting up fbl_y_text */
1078
 
fbl_y__c_buf_p = fbl_y__cp -= 1;
 
1188
*fbl_y__cp = (fbl_y__hold_char); /* undo effects of setting up fbl_y_text */
 
1189
(fbl_y__c_buf_p) = fbl_y__cp -= 1;
1079
1190
FBL_Y__DO_BEFORE_ACTION; /* set up fbl_y_text again */
1080
1191
FBL_Y__RULE_SETUP
1081
 
#line 259 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1192
#line 259 "./fbl_bcomp_l.l"
1082
1193
{
1083
1194
                        /* comment */
1084
1195
                        /* nothing */
1086
1197
        FBL_Y__BREAK
1087
1198
case 33:
1088
1199
FBL_Y__RULE_SETUP
1089
 
#line 263 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1200
#line 263 "./fbl_bcomp_l.l"
1090
1201
{
1091
1202
                        return (*fbl_y_text);
1092
1203
                                                                        }
1093
1204
        FBL_Y__BREAK
1094
1205
case 34:
1095
1206
FBL_Y__RULE_SETUP
1096
 
#line 266 "../../../src/fvh/src/fbl_bcomp_l.l"
 
1207
#line 266 "./fbl_bcomp_l.l"
1097
1208
ECHO;
1098
1209
        FBL_Y__BREAK
 
1210
#line 1211 "<stdout>"
1099
1211
case FBL_Y__STATE_EOF(INITIAL):
1100
1212
        fbl_y_terminate();
1101
1213
 
1102
1214
        case FBL_Y__END_OF_BUFFER:
1103
1215
                {
1104
1216
                /* Amount of text matched not including the EOB char. */
1105
 
                int fbl_y__amount_of_matched_text = (int) (fbl_y__cp - fbl_y_text_ptr) - 1;
 
1217
                int fbl_y__amount_of_matched_text = (int) (fbl_y__cp - (fbl_y_text_ptr)) - 1;
1106
1218
 
1107
1219
                /* Undo the effects of FBL_Y__DO_BEFORE_ACTION. */
1108
 
                *fbl_y__cp = fbl_y__hold_char;
 
1220
                *fbl_y__cp = (fbl_y__hold_char);
1109
1221
                FBL_Y__RESTORE_FBL_Y__MORE_OFFSET
1110
1222
 
1111
 
                if ( fbl_y__current_buffer->fbl_y__buffer_status == FBL_Y__BUFFER_NEW )
 
1223
                if ( FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buffer_status == FBL_Y__BUFFER_NEW )
1112
1224
                        {
1113
1225
                        /* We're scanning a new file or input source.  It's
1114
1226
                         * possible that this happened because the user
1115
1227
                         * just pointed fbl_y_in at a new source and called
1116
1228
                         * fbl_y_lex().  If so, then we have to assure
1117
 
                         * consistency between fbl_y__current_buffer and our
 
1229
                         * consistency between FBL_Y__CURRENT_BUFFER and our
1118
1230
                         * globals.  Here is the right place to do so, because
1119
1231
                         * this is the first action (other than possibly a
1120
1232
                         * back-up) that will match for the new input source.
1121
1233
                         */
1122
 
                        fbl_y__n_chars = fbl_y__current_buffer->fbl_y__n_chars;
1123
 
                        fbl_y__current_buffer->fbl_y__input_file = fbl_y_in;
1124
 
                        fbl_y__current_buffer->fbl_y__buffer_status = FBL_Y__BUFFER_NORMAL;
 
1234
                        (fbl_y__n_chars) = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars;
 
1235
                        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__input_file = fbl_y_in;
 
1236
                        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buffer_status = FBL_Y__BUFFER_NORMAL;
1125
1237
                        }
1126
1238
 
1127
1239
                /* Note that here we test for fbl_y__c_buf_p "<=" to the position
1131
1243
                 * end-of-buffer state).  Contrast this with the test
1132
1244
                 * in input().
1133
1245
                 */
1134
 
                if ( fbl_y__c_buf_p <= &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars] )
 
1246
                if ( (fbl_y__c_buf_p) <= &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[(fbl_y__n_chars)] )
1135
1247
                        { /* This was really a NUL. */
1136
1248
                        fbl_y__state_type fbl_y__next_state;
1137
1249
 
1138
 
                        fbl_y__c_buf_p = fbl_y_text_ptr + fbl_y__amount_of_matched_text;
 
1250
                        (fbl_y__c_buf_p) = (fbl_y_text_ptr) + fbl_y__amount_of_matched_text;
1139
1251
 
1140
 
                        fbl_y__current_state = fbl_y__get_previous_state();
 
1252
                        fbl_y__current_state = fbl_y__get_previous_state(  );
1141
1253
 
1142
1254
                        /* Okay, we're now positioned to make the NUL
1143
1255
                         * transition.  We couldn't have
1150
1262
 
1151
1263
                        fbl_y__next_state = fbl_y__try_NUL_trans( fbl_y__current_state );
1152
1264
 
1153
 
                        fbl_y__bp = fbl_y_text_ptr + FBL_Y__MORE_ADJ;
 
1265
                        fbl_y__bp = (fbl_y_text_ptr) + FBL_Y__MORE_ADJ;
1154
1266
 
1155
1267
                        if ( fbl_y__next_state )
1156
1268
                                {
1157
1269
                                /* Consume the NUL. */
1158
 
                                fbl_y__cp = ++fbl_y__c_buf_p;
 
1270
                                fbl_y__cp = ++(fbl_y__c_buf_p);
1159
1271
                                fbl_y__current_state = fbl_y__next_state;
1160
1272
                                goto fbl_y__match;
1161
1273
                                }
1162
1274
 
1163
1275
                        else
1164
1276
                                {
1165
 
                                fbl_y__cp = fbl_y__c_buf_p;
 
1277
                                fbl_y__cp = (fbl_y__c_buf_p);
1166
1278
                                goto fbl_y__find_action;
1167
1279
                                }
1168
1280
                        }
1169
1281
 
1170
 
                else switch ( fbl_y__get_next_buffer() )
 
1282
                else switch ( fbl_y__get_next_buffer(  ) )
1171
1283
                        {
1172
1284
                        case EOB_ACT_END_OF_FILE:
1173
1285
                                {
1174
 
                                fbl_y__did_buffer_switch_on_eof = 0;
 
1286
                                (fbl_y__did_buffer_switch_on_eof) = 0;
1175
1287
 
1176
 
                                if ( fbl_y_wrap() )
 
1288
                                if ( fbl_y_wrap( ) )
1177
1289
                                        {
1178
1290
                                        /* Note: because we've taken care in
1179
1291
                                         * fbl_y__get_next_buffer() to have set up
1184
1296
                                         * FBL_Y__NULL, it'll still work - another
1185
1297
                                         * FBL_Y__NULL will get returned.
1186
1298
                                         */
1187
 
                                        fbl_y__c_buf_p = fbl_y_text_ptr + FBL_Y__MORE_ADJ;
 
1299
                                        (fbl_y__c_buf_p) = (fbl_y_text_ptr) + FBL_Y__MORE_ADJ;
1188
1300
 
1189
1301
                                        fbl_y__act = FBL_Y__STATE_EOF(FBL_Y__START);
1190
1302
                                        goto do_action;
1192
1304
 
1193
1305
                                else
1194
1306
                                        {
1195
 
                                        if ( ! fbl_y__did_buffer_switch_on_eof )
 
1307
                                        if ( ! (fbl_y__did_buffer_switch_on_eof) )
1196
1308
                                                FBL_Y__NEW_FILE;
1197
1309
                                        }
1198
1310
                                break;
1199
1311
                                }
1200
1312
 
1201
1313
                        case EOB_ACT_CONTINUE_SCAN:
1202
 
                                fbl_y__c_buf_p =
1203
 
                                        fbl_y_text_ptr + fbl_y__amount_of_matched_text;
1204
 
 
1205
 
                                fbl_y__current_state = fbl_y__get_previous_state();
1206
 
 
1207
 
                                fbl_y__cp = fbl_y__c_buf_p;
1208
 
                                fbl_y__bp = fbl_y_text_ptr + FBL_Y__MORE_ADJ;
 
1314
                                (fbl_y__c_buf_p) =
 
1315
                                        (fbl_y_text_ptr) + fbl_y__amount_of_matched_text;
 
1316
 
 
1317
                                fbl_y__current_state = fbl_y__get_previous_state(  );
 
1318
 
 
1319
                                fbl_y__cp = (fbl_y__c_buf_p);
 
1320
                                fbl_y__bp = (fbl_y_text_ptr) + FBL_Y__MORE_ADJ;
1209
1321
                                goto fbl_y__match;
1210
1322
 
1211
1323
                        case EOB_ACT_LAST_MATCH:
1212
 
                                fbl_y__c_buf_p =
1213
 
                                &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars];
1214
 
 
1215
 
                                fbl_y__current_state = fbl_y__get_previous_state();
1216
 
 
1217
 
                                fbl_y__cp = fbl_y__c_buf_p;
1218
 
                                fbl_y__bp = fbl_y_text_ptr + FBL_Y__MORE_ADJ;
 
1324
                                (fbl_y__c_buf_p) =
 
1325
                                &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[(fbl_y__n_chars)];
 
1326
 
 
1327
                                fbl_y__current_state = fbl_y__get_previous_state(  );
 
1328
 
 
1329
                                fbl_y__cp = (fbl_y__c_buf_p);
 
1330
                                fbl_y__bp = (fbl_y_text_ptr) + FBL_Y__MORE_ADJ;
1219
1331
                                goto fbl_y__find_action;
1220
1332
                        }
1221
1333
                break;
1226
1338
                        "fatal flex scanner internal error--no action found" );
1227
1339
        } /* end of action switch */
1228
1340
                } /* end of scanning one token */
1229
 
        } /* end of fbl_y_lex */
1230
 
 
 
1341
} /* end of fbl_y_lex */
1231
1342
 
1232
1343
/* fbl_y__get_next_buffer - try to read in a new buffer
1233
1344
 *
1236
1347
 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1237
1348
 *      EOB_ACT_END_OF_FILE - end of file
1238
1349
 */
1239
 
 
1240
 
static int fbl_y__get_next_buffer()
1241
 
        {
1242
 
        register char *dest = fbl_y__current_buffer->fbl_y__ch_buf;
1243
 
        register char *source = fbl_y_text_ptr;
 
1350
static int fbl_y__get_next_buffer (void)
 
1351
{
 
1352
        register char *dest = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf;
 
1353
        register char *source = (fbl_y_text_ptr);
1244
1354
        register int number_to_move, i;
1245
1355
        int ret_val;
1246
1356
 
1247
 
        if ( fbl_y__c_buf_p > &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars + 1] )
 
1357
        if ( (fbl_y__c_buf_p) > &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[(fbl_y__n_chars) + 1] )
1248
1358
                FBL_Y__FATAL_ERROR(
1249
1359
                "fatal flex scanner internal error--end of buffer missed" );
1250
1360
 
1251
 
        if ( fbl_y__current_buffer->fbl_y__fill_buffer == 0 )
 
1361
        if ( FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__fill_buffer == 0 )
1252
1362
                { /* Don't try to fill the buffer, so this is an EOF. */
1253
 
                if ( fbl_y__c_buf_p - fbl_y_text_ptr - FBL_Y__MORE_ADJ == 1 )
 
1363
                if ( (fbl_y__c_buf_p) - (fbl_y_text_ptr) - FBL_Y__MORE_ADJ == 1 )
1254
1364
                        {
1255
1365
                        /* We matched a single character, the EOB, so
1256
1366
                         * treat this as a final EOF.
1270
1380
        /* Try to read more data. */
1271
1381
 
1272
1382
        /* First move last chars to start of buffer. */
1273
 
        number_to_move = (int) (fbl_y__c_buf_p - fbl_y_text_ptr) - 1;
 
1383
        number_to_move = (int) ((fbl_y__c_buf_p) - (fbl_y_text_ptr)) - 1;
1274
1384
 
1275
1385
        for ( i = 0; i < number_to_move; ++i )
1276
1386
                *(dest++) = *(source++);
1277
1387
 
1278
 
        if ( fbl_y__current_buffer->fbl_y__buffer_status == FBL_Y__BUFFER_EOF_PENDING )
 
1388
        if ( FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buffer_status == FBL_Y__BUFFER_EOF_PENDING )
1279
1389
                /* don't do the read, it's not guaranteed to return an EOF,
1280
1390
                 * just force an EOF
1281
1391
                 */
1282
 
                fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars = 0;
 
1392
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars = (fbl_y__n_chars) = 0;
1283
1393
 
1284
1394
        else
1285
1395
                {
1286
 
                int num_to_read =
1287
 
                        fbl_y__current_buffer->fbl_y__buf_size - number_to_move - 1;
 
1396
                        int num_to_read =
 
1397
                        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_size - number_to_move - 1;
1288
1398
 
1289
1399
                while ( num_to_read <= 0 )
1290
1400
                        { /* Not enough room in the buffer - grow it. */
1291
 
#ifdef FBL_Y__USES_REJECT
1292
 
                        FBL_Y__FATAL_ERROR(
1293
 
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1294
 
#else
1295
1401
 
1296
1402
                        /* just a shorter name for the current buffer */
1297
 
                        FBL_Y__BUFFER_STATE b = fbl_y__current_buffer;
 
1403
                        FBL_Y__BUFFER_STATE b = FBL_Y__CURRENT_BUFFER;
1298
1404
 
1299
1405
                        int fbl_y__c_buf_p_offset =
1300
 
                                (int) (fbl_y__c_buf_p - b->fbl_y__ch_buf);
 
1406
                                (int) ((fbl_y__c_buf_p) - b->fbl_y__ch_buf);
1301
1407
 
1302
1408
                        if ( b->fbl_y__is_our_buffer )
1303
1409
                                {
1310
1416
 
1311
1417
                                b->fbl_y__ch_buf = (char *)
1312
1418
                                        /* Include room in for 2 EOB chars. */
1313
 
                                        fbl_y__flex_realloc( (void *) b->fbl_y__ch_buf,
1314
 
                                                         b->fbl_y__buf_size + 2 );
 
1419
                                        fbl_y_realloc((void *) b->fbl_y__ch_buf,b->fbl_y__buf_size + 2  );
1315
1420
                                }
1316
1421
                        else
1317
1422
                                /* Can't grow it, we don't own it. */
1321
1426
                                FBL_Y__FATAL_ERROR(
1322
1427
                                "fatal error - scanner input buffer overflow" );
1323
1428
 
1324
 
                        fbl_y__c_buf_p = &b->fbl_y__ch_buf[fbl_y__c_buf_p_offset];
 
1429
                        (fbl_y__c_buf_p) = &b->fbl_y__ch_buf[fbl_y__c_buf_p_offset];
1325
1430
 
1326
 
                        num_to_read = fbl_y__current_buffer->fbl_y__buf_size -
 
1431
                        num_to_read = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_size -
1327
1432
                                                number_to_move - 1;
1328
 
#endif
 
1433
 
1329
1434
                        }
1330
1435
 
1331
1436
                if ( num_to_read > FBL_Y__READ_BUF_SIZE )
1332
1437
                        num_to_read = FBL_Y__READ_BUF_SIZE;
1333
1438
 
1334
1439
                /* Read in more data. */
1335
 
                FBL_Y__INPUT( (&fbl_y__current_buffer->fbl_y__ch_buf[number_to_move]),
1336
 
                        fbl_y__n_chars, num_to_read );
 
1440
                FBL_Y__INPUT( (&FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[number_to_move]),
 
1441
                        (fbl_y__n_chars), (size_t) num_to_read );
1337
1442
 
1338
 
                fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars;
 
1443
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars = (fbl_y__n_chars);
1339
1444
                }
1340
1445
 
1341
 
        if ( fbl_y__n_chars == 0 )
 
1446
        if ( (fbl_y__n_chars) == 0 )
1342
1447
                {
1343
1448
                if ( number_to_move == FBL_Y__MORE_ADJ )
1344
1449
                        {
1345
1450
                        ret_val = EOB_ACT_END_OF_FILE;
1346
 
                        fbl_y_restart( fbl_y_in );
 
1451
                        fbl_y_restart(fbl_y_in  );
1347
1452
                        }
1348
1453
 
1349
1454
                else
1350
1455
                        {
1351
1456
                        ret_val = EOB_ACT_LAST_MATCH;
1352
 
                        fbl_y__current_buffer->fbl_y__buffer_status =
 
1457
                        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buffer_status =
1353
1458
                                FBL_Y__BUFFER_EOF_PENDING;
1354
1459
                        }
1355
1460
                }
1357
1462
        else
1358
1463
                ret_val = EOB_ACT_CONTINUE_SCAN;
1359
1464
 
1360
 
        fbl_y__n_chars += number_to_move;
1361
 
        fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars] = FBL_Y__END_OF_BUFFER_CHAR;
1362
 
        fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars + 1] = FBL_Y__END_OF_BUFFER_CHAR;
1363
 
 
1364
 
        fbl_y_text_ptr = &fbl_y__current_buffer->fbl_y__ch_buf[0];
 
1465
        if ((fbl_y__size_t) ((fbl_y__n_chars) + number_to_move) > FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_size) {
 
1466
                /* Extend the array by 50%, plus the number we really need. */
 
1467
                fbl_y__size_t new_size = (fbl_y__n_chars) + number_to_move + ((fbl_y__n_chars) >> 1);
 
1468
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf = (char *) fbl_y_realloc((void *) FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf,new_size  );
 
1469
                if ( ! FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf )
 
1470
                        FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__get_next_buffer()" );
 
1471
        }
 
1472
 
 
1473
        (fbl_y__n_chars) += number_to_move;
 
1474
        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[(fbl_y__n_chars)] = FBL_Y__END_OF_BUFFER_CHAR;
 
1475
        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[(fbl_y__n_chars) + 1] = FBL_Y__END_OF_BUFFER_CHAR;
 
1476
 
 
1477
        (fbl_y_text_ptr) = &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[0];
1365
1478
 
1366
1479
        return ret_val;
1367
 
        }
1368
 
 
 
1480
}
1369
1481
 
1370
1482
/* fbl_y__get_previous_state - get the state just before the EOB char was reached */
1371
1483
 
1372
 
static fbl_y__state_type fbl_y__get_previous_state()
1373
 
        {
 
1484
    static fbl_y__state_type fbl_y__get_previous_state (void)
 
1485
{
1374
1486
        register fbl_y__state_type fbl_y__current_state;
1375
1487
        register char *fbl_y__cp;
1376
 
 
1377
 
        fbl_y__current_state = fbl_y__start;
1378
 
 
1379
 
        for ( fbl_y__cp = fbl_y_text_ptr + FBL_Y__MORE_ADJ; fbl_y__cp < fbl_y__c_buf_p; ++fbl_y__cp )
 
1488
    
 
1489
        fbl_y__current_state = (fbl_y__start);
 
1490
 
 
1491
        for ( fbl_y__cp = (fbl_y_text_ptr) + FBL_Y__MORE_ADJ; fbl_y__cp < (fbl_y__c_buf_p); ++fbl_y__cp )
1380
1492
                {
1381
1493
                register FBL_Y__CHAR fbl_y__c = (*fbl_y__cp ? fbl_y__ec[FBL_Y__SC_TO_UI(*fbl_y__cp)] : 1);
1382
1494
                if ( fbl_y__accept[fbl_y__current_state] )
1383
1495
                        {
1384
 
                        fbl_y__last_accepting_state = fbl_y__current_state;
1385
 
                        fbl_y__last_accepting_cpos = fbl_y__cp;
 
1496
                        (fbl_y__last_accepting_state) = fbl_y__current_state;
 
1497
                        (fbl_y__last_accepting_cpos) = fbl_y__cp;
1386
1498
                        }
1387
1499
                while ( fbl_y__chk[fbl_y__base[fbl_y__current_state] + fbl_y__c] != fbl_y__current_state )
1388
1500
                        {
1394
1506
                }
1395
1507
 
1396
1508
        return fbl_y__current_state;
1397
 
        }
1398
 
 
 
1509
}
1399
1510
 
1400
1511
/* fbl_y__try_NUL_trans - try to make a transition on the NUL character
1401
1512
 *
1402
1513
 * synopsis
1403
1514
 *      next_state = fbl_y__try_NUL_trans( current_state );
1404
1515
 */
1405
 
 
1406
 
#ifdef FBL_Y__USE_PROTOS
1407
 
static fbl_y__state_type fbl_y__try_NUL_trans( fbl_y__state_type fbl_y__current_state )
1408
 
#else
1409
 
static fbl_y__state_type fbl_y__try_NUL_trans( fbl_y__current_state )
1410
 
fbl_y__state_type fbl_y__current_state;
1411
 
#endif
1412
 
        {
 
1516
    static fbl_y__state_type fbl_y__try_NUL_trans  (fbl_y__state_type fbl_y__current_state )
 
1517
{
1413
1518
        register int fbl_y__is_jam;
1414
 
        register char *fbl_y__cp = fbl_y__c_buf_p;
 
1519
        register char *fbl_y__cp = (fbl_y__c_buf_p);
1415
1520
 
1416
1521
        register FBL_Y__CHAR fbl_y__c = 1;
1417
1522
        if ( fbl_y__accept[fbl_y__current_state] )
1418
1523
                {
1419
 
                fbl_y__last_accepting_state = fbl_y__current_state;
1420
 
                fbl_y__last_accepting_cpos = fbl_y__cp;
 
1524
                (fbl_y__last_accepting_state) = fbl_y__current_state;
 
1525
                (fbl_y__last_accepting_cpos) = fbl_y__cp;
1421
1526
                }
1422
1527
        while ( fbl_y__chk[fbl_y__base[fbl_y__current_state] + fbl_y__c] != fbl_y__current_state )
1423
1528
                {
1429
1534
        fbl_y__is_jam = (fbl_y__current_state == 104);
1430
1535
 
1431
1536
        return fbl_y__is_jam ? 0 : fbl_y__current_state;
1432
 
        }
1433
 
 
1434
 
 
1435
 
#ifndef FBL_Y__NO_UNPUT
1436
 
#ifdef FBL_Y__USE_PROTOS
1437
 
static void fbl_y_unput( int c, register char *fbl_y__bp )
1438
 
#else
1439
 
static void fbl_y_unput( c, fbl_y__bp )
1440
 
int c;
1441
 
register char *fbl_y__bp;
1442
 
#endif
1443
 
        {
1444
 
        register char *fbl_y__cp = fbl_y__c_buf_p;
 
1537
}
 
1538
 
 
1539
    static void fbl_y_unput (int c, register char * fbl_y__bp )
 
1540
{
 
1541
        register char *fbl_y__cp;
 
1542
    
 
1543
    fbl_y__cp = (fbl_y__c_buf_p);
1445
1544
 
1446
1545
        /* undo effects of setting up fbl_y_text */
1447
 
        *fbl_y__cp = fbl_y__hold_char;
 
1546
        *fbl_y__cp = (fbl_y__hold_char);
1448
1547
 
1449
 
        if ( fbl_y__cp < fbl_y__current_buffer->fbl_y__ch_buf + 2 )
 
1548
        if ( fbl_y__cp < FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf + 2 )
1450
1549
                { /* need to shift things up to make room */
1451
1550
                /* +2 for EOB chars. */
1452
 
                register int number_to_move = fbl_y__n_chars + 2;
1453
 
                register char *dest = &fbl_y__current_buffer->fbl_y__ch_buf[
1454
 
                                        fbl_y__current_buffer->fbl_y__buf_size + 2];
 
1551
                register int number_to_move = (fbl_y__n_chars) + 2;
 
1552
                register char *dest = &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[
 
1553
                                        FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_size + 2];
1455
1554
                register char *source =
1456
 
                                &fbl_y__current_buffer->fbl_y__ch_buf[number_to_move];
 
1555
                                &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[number_to_move];
1457
1556
 
1458
 
                while ( source > fbl_y__current_buffer->fbl_y__ch_buf )
 
1557
                while ( source > FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf )
1459
1558
                        *--dest = *--source;
1460
1559
 
1461
1560
                fbl_y__cp += (int) (dest - source);
1462
1561
                fbl_y__bp += (int) (dest - source);
1463
 
                fbl_y__current_buffer->fbl_y__n_chars =
1464
 
                        fbl_y__n_chars = fbl_y__current_buffer->fbl_y__buf_size;
 
1562
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars =
 
1563
                        (fbl_y__n_chars) = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_size;
1465
1564
 
1466
 
                if ( fbl_y__cp < fbl_y__current_buffer->fbl_y__ch_buf + 2 )
 
1565
                if ( fbl_y__cp < FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf + 2 )
1467
1566
                        FBL_Y__FATAL_ERROR( "flex scanner push-back overflow" );
1468
1567
                }
1469
1568
 
1470
1569
        *--fbl_y__cp = (char) c;
1471
1570
 
1472
 
 
1473
 
        fbl_y_text_ptr = fbl_y__bp;
1474
 
        fbl_y__hold_char = *fbl_y__cp;
1475
 
        fbl_y__c_buf_p = fbl_y__cp;
1476
 
        }
1477
 
#endif  /* ifndef FBL_Y__NO_UNPUT */
1478
 
 
 
1571
        (fbl_y_text_ptr) = fbl_y__bp;
 
1572
        (fbl_y__hold_char) = *fbl_y__cp;
 
1573
        (fbl_y__c_buf_p) = fbl_y__cp;
 
1574
}
1479
1575
 
1480
1576
#ifndef FBL_Y__NO_INPUT
1481
1577
#ifdef __cplusplus
1482
 
static int fbl_y_input()
 
1578
    static int fbl_y_input (void)
1483
1579
#else
1484
 
static int input()
 
1580
    static int input  (void)
1485
1581
#endif
1486
 
        {
 
1582
 
 
1583
{
1487
1584
        int c;
1488
 
 
1489
 
        *fbl_y__c_buf_p = fbl_y__hold_char;
1490
 
 
1491
 
        if ( *fbl_y__c_buf_p == FBL_Y__END_OF_BUFFER_CHAR )
 
1585
    
 
1586
        *(fbl_y__c_buf_p) = (fbl_y__hold_char);
 
1587
 
 
1588
        if ( *(fbl_y__c_buf_p) == FBL_Y__END_OF_BUFFER_CHAR )
1492
1589
                {
1493
1590
                /* fbl_y__c_buf_p now points to the character we want to return.
1494
1591
                 * If this occurs *before* the EOB characters, then it's a
1495
1592
                 * valid NUL; if not, then we've hit the end of the buffer.
1496
1593
                 */
1497
 
                if ( fbl_y__c_buf_p < &fbl_y__current_buffer->fbl_y__ch_buf[fbl_y__n_chars] )
 
1594
                if ( (fbl_y__c_buf_p) < &FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__ch_buf[(fbl_y__n_chars)] )
1498
1595
                        /* This was really a NUL. */
1499
 
                        *fbl_y__c_buf_p = '\0';
 
1596
                        *(fbl_y__c_buf_p) = '\0';
1500
1597
 
1501
1598
                else
1502
1599
                        { /* need more input */
1503
 
                        int offset = fbl_y__c_buf_p - fbl_y_text_ptr;
1504
 
                        ++fbl_y__c_buf_p;
 
1600
                        int offset = (fbl_y__c_buf_p) - (fbl_y_text_ptr);
 
1601
                        ++(fbl_y__c_buf_p);
1505
1602
 
1506
 
                        switch ( fbl_y__get_next_buffer() )
 
1603
                        switch ( fbl_y__get_next_buffer(  ) )
1507
1604
                                {
1508
1605
                                case EOB_ACT_LAST_MATCH:
1509
1606
                                        /* This happens because fbl_y__g_n_b()
1517
1614
                                         */
1518
1615
 
1519
1616
                                        /* Reset buffer status. */
1520
 
                                        fbl_y_restart( fbl_y_in );
 
1617
                                        fbl_y_restart(fbl_y_in );
1521
1618
 
1522
 
                                        /* fall through */
 
1619
                                        /*FALLTHROUGH*/
1523
1620
 
1524
1621
                                case EOB_ACT_END_OF_FILE:
1525
1622
                                        {
1526
 
                                        if ( fbl_y_wrap() )
 
1623
                                        if ( fbl_y_wrap( ) )
1527
1624
                                                return EOF;
1528
1625
 
1529
 
                                        if ( ! fbl_y__did_buffer_switch_on_eof )
 
1626
                                        if ( ! (fbl_y__did_buffer_switch_on_eof) )
1530
1627
                                                FBL_Y__NEW_FILE;
1531
1628
#ifdef __cplusplus
1532
1629
                                        return fbl_y_input();
1536
1633
                                        }
1537
1634
 
1538
1635
                                case EOB_ACT_CONTINUE_SCAN:
1539
 
                                        fbl_y__c_buf_p = fbl_y_text_ptr + offset;
 
1636
                                        (fbl_y__c_buf_p) = (fbl_y_text_ptr) + offset;
1540
1637
                                        break;
1541
1638
                                }
1542
1639
                        }
1543
1640
                }
1544
1641
 
1545
 
        c = *(unsigned char *) fbl_y__c_buf_p;  /* cast for 8-bit char's */
1546
 
        *fbl_y__c_buf_p = '\0'; /* preserve fbl_y_text */
1547
 
        fbl_y__hold_char = *++fbl_y__c_buf_p;
1548
 
 
 
1642
        c = *(unsigned char *) (fbl_y__c_buf_p);        /* cast for 8-bit char's */
 
1643
        *(fbl_y__c_buf_p) = '\0';       /* preserve fbl_y_text */
 
1644
        (fbl_y__hold_char) = *++(fbl_y__c_buf_p);
1549
1645
 
1550
1646
        return c;
1551
 
        }
1552
 
#endif /* FBL_Y__NO_INPUT */
1553
 
 
1554
 
#ifdef FBL_Y__USE_PROTOS
1555
 
void fbl_y_restart( FILE *input_file )
1556
 
#else
1557
 
void fbl_y_restart( input_file )
1558
 
FILE *input_file;
1559
 
#endif
1560
 
        {
1561
 
        if ( ! fbl_y__current_buffer )
1562
 
                fbl_y__current_buffer = fbl_y__create_buffer( fbl_y_in, FBL_Y__BUF_SIZE );
1563
 
 
1564
 
        fbl_y__init_buffer( fbl_y__current_buffer, input_file );
1565
 
        fbl_y__load_buffer_state();
1566
 
        }
1567
 
 
1568
 
 
1569
 
#ifdef FBL_Y__USE_PROTOS
1570
 
void fbl_y__switch_to_buffer( FBL_Y__BUFFER_STATE new_buffer )
1571
 
#else
1572
 
void fbl_y__switch_to_buffer( new_buffer )
1573
 
FBL_Y__BUFFER_STATE new_buffer;
1574
 
#endif
1575
 
        {
1576
 
        if ( fbl_y__current_buffer == new_buffer )
 
1647
}
 
1648
#endif  /* ifndef FBL_Y__NO_INPUT */
 
1649
 
 
1650
/** Immediately switch to a different input stream.
 
1651
 * @param input_file A readable stream.
 
1652
 * 
 
1653
 * @note This function does not reset the start condition to @c INITIAL .
 
1654
 */
 
1655
    void fbl_y_restart  (FILE * input_file )
 
1656
{
 
1657
    
 
1658
        if ( ! FBL_Y__CURRENT_BUFFER ){
 
1659
        fbl_y_ensure_buffer_stack ();
 
1660
                FBL_Y__CURRENT_BUFFER_LVALUE =
 
1661
            fbl_y__create_buffer(fbl_y_in,FBL_Y__BUF_SIZE );
 
1662
        }
 
1663
 
 
1664
        fbl_y__init_buffer(FBL_Y__CURRENT_BUFFER,input_file );
 
1665
        fbl_y__load_buffer_state( );
 
1666
}
 
1667
 
 
1668
/** Switch to a different input buffer.
 
1669
 * @param new_buffer The new input buffer.
 
1670
 * 
 
1671
 */
 
1672
    void fbl_y__switch_to_buffer  (FBL_Y__BUFFER_STATE  new_buffer )
 
1673
{
 
1674
    
 
1675
        /* TODO. We should be able to replace this entire function body
 
1676
         * with
 
1677
         *              fbl_y_pop_buffer_state();
 
1678
         *              fbl_y_push_buffer_state(new_buffer);
 
1679
     */
 
1680
        fbl_y_ensure_buffer_stack ();
 
1681
        if ( FBL_Y__CURRENT_BUFFER == new_buffer )
1577
1682
                return;
1578
1683
 
1579
 
        if ( fbl_y__current_buffer )
 
1684
        if ( FBL_Y__CURRENT_BUFFER )
1580
1685
                {
1581
1686
                /* Flush out information for old buffer. */
1582
 
                *fbl_y__c_buf_p = fbl_y__hold_char;
1583
 
                fbl_y__current_buffer->fbl_y__buf_pos = fbl_y__c_buf_p;
1584
 
                fbl_y__current_buffer->fbl_y__n_chars = fbl_y__n_chars;
 
1687
                *(fbl_y__c_buf_p) = (fbl_y__hold_char);
 
1688
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_pos = (fbl_y__c_buf_p);
 
1689
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars = (fbl_y__n_chars);
1585
1690
                }
1586
1691
 
1587
 
        fbl_y__current_buffer = new_buffer;
1588
 
        fbl_y__load_buffer_state();
 
1692
        FBL_Y__CURRENT_BUFFER_LVALUE = new_buffer;
 
1693
        fbl_y__load_buffer_state( );
1589
1694
 
1590
1695
        /* We don't actually know whether we did this switch during
1591
1696
         * EOF (fbl_y_wrap()) processing, but the only time this flag
1592
1697
         * is looked at is after fbl_y_wrap() is called, so it's safe
1593
1698
         * to go ahead and always set it.
1594
1699
         */
1595
 
        fbl_y__did_buffer_switch_on_eof = 1;
1596
 
        }
1597
 
 
1598
 
 
1599
 
#ifdef FBL_Y__USE_PROTOS
1600
 
void fbl_y__load_buffer_state( void )
1601
 
#else
1602
 
void fbl_y__load_buffer_state()
1603
 
#endif
1604
 
        {
1605
 
        fbl_y__n_chars = fbl_y__current_buffer->fbl_y__n_chars;
1606
 
        fbl_y_text_ptr = fbl_y__c_buf_p = fbl_y__current_buffer->fbl_y__buf_pos;
1607
 
        fbl_y_in = fbl_y__current_buffer->fbl_y__input_file;
1608
 
        fbl_y__hold_char = *fbl_y__c_buf_p;
1609
 
        }
1610
 
 
1611
 
 
1612
 
#ifdef FBL_Y__USE_PROTOS
1613
 
FBL_Y__BUFFER_STATE fbl_y__create_buffer( FILE *file, int size )
1614
 
#else
1615
 
FBL_Y__BUFFER_STATE fbl_y__create_buffer( file, size )
1616
 
FILE *file;
1617
 
int size;
1618
 
#endif
1619
 
        {
 
1700
        (fbl_y__did_buffer_switch_on_eof) = 1;
 
1701
}
 
1702
 
 
1703
static void fbl_y__load_buffer_state  (void)
 
1704
{
 
1705
        (fbl_y__n_chars) = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars;
 
1706
        (fbl_y_text_ptr) = (fbl_y__c_buf_p) = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_pos;
 
1707
        fbl_y_in = FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__input_file;
 
1708
        (fbl_y__hold_char) = *(fbl_y__c_buf_p);
 
1709
}
 
1710
 
 
1711
/** Allocate and initialize an input buffer state.
 
1712
 * @param file A readable stream.
 
1713
 * @param size The character buffer size in bytes. When in doubt, use @c FBL_Y__BUF_SIZE.
 
1714
 * 
 
1715
 * @return the allocated buffer state.
 
1716
 */
 
1717
    FBL_Y__BUFFER_STATE fbl_y__create_buffer  (FILE * file, int  size )
 
1718
{
1620
1719
        FBL_Y__BUFFER_STATE b;
1621
 
 
1622
 
        b = (FBL_Y__BUFFER_STATE) fbl_y__flex_alloc( sizeof( struct fbl_y__buffer_state ) );
 
1720
    
 
1721
        b = (FBL_Y__BUFFER_STATE) fbl_y_alloc(sizeof( struct fbl_y__buffer_state )  );
1623
1722
        if ( ! b )
1624
1723
                FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__create_buffer()" );
1625
1724
 
1628
1727
        /* fbl_y__ch_buf has to be 2 characters longer than the size given because
1629
1728
         * we need to put in 2 end-of-buffer characters.
1630
1729
         */
1631
 
        b->fbl_y__ch_buf = (char *) fbl_y__flex_alloc( b->fbl_y__buf_size + 2 );
 
1730
        b->fbl_y__ch_buf = (char *) fbl_y_alloc(b->fbl_y__buf_size + 2  );
1632
1731
        if ( ! b->fbl_y__ch_buf )
1633
1732
                FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__create_buffer()" );
1634
1733
 
1635
1734
        b->fbl_y__is_our_buffer = 1;
1636
1735
 
1637
 
        fbl_y__init_buffer( b, file );
 
1736
        fbl_y__init_buffer(b,file );
1638
1737
 
1639
1738
        return b;
1640
 
        }
1641
 
 
1642
 
 
1643
 
#ifdef FBL_Y__USE_PROTOS
1644
 
void fbl_y__delete_buffer( FBL_Y__BUFFER_STATE b )
1645
 
#else
1646
 
void fbl_y__delete_buffer( b )
1647
 
FBL_Y__BUFFER_STATE b;
1648
 
#endif
1649
 
        {
 
1739
}
 
1740
 
 
1741
/** Destroy the buffer.
 
1742
 * @param b a buffer created with fbl_y__create_buffer()
 
1743
 * 
 
1744
 */
 
1745
    void fbl_y__delete_buffer (FBL_Y__BUFFER_STATE  b )
 
1746
{
 
1747
    
1650
1748
        if ( ! b )
1651
1749
                return;
1652
1750
 
1653
 
        if ( b == fbl_y__current_buffer )
1654
 
                fbl_y__current_buffer = (FBL_Y__BUFFER_STATE) 0;
 
1751
        if ( b == FBL_Y__CURRENT_BUFFER ) /* Not sure if we should pop here. */
 
1752
                FBL_Y__CURRENT_BUFFER_LVALUE = (FBL_Y__BUFFER_STATE) 0;
1655
1753
 
1656
1754
        if ( b->fbl_y__is_our_buffer )
1657
 
                fbl_y__flex_free( (void *) b->fbl_y__ch_buf );
1658
 
 
1659
 
        fbl_y__flex_free( (void *) b );
1660
 
        }
1661
 
 
1662
 
 
1663
 
 
1664
 
#ifdef FBL_Y__USE_PROTOS
1665
 
void fbl_y__init_buffer( FBL_Y__BUFFER_STATE b, FILE *file )
1666
 
#else
1667
 
void fbl_y__init_buffer( b, file )
1668
 
FBL_Y__BUFFER_STATE b;
1669
 
FILE *file;
1670
 
#endif
1671
 
 
1672
 
 
1673
 
        {
1674
 
        fbl_y__flush_buffer( b );
 
1755
                fbl_y_free((void *) b->fbl_y__ch_buf  );
 
1756
 
 
1757
        fbl_y_free((void *) b  );
 
1758
}
 
1759
 
 
1760
#ifndef __cplusplus
 
1761
extern int isatty (int );
 
1762
#endif /* __cplusplus */
 
1763
    
 
1764
/* Initializes or reinitializes a buffer.
 
1765
 * This function is sometimes called more than once on the same buffer,
 
1766
 * such as during a fbl_y_restart() or at EOF.
 
1767
 */
 
1768
    static void fbl_y__init_buffer  (FBL_Y__BUFFER_STATE  b, FILE * file )
 
1769
 
 
1770
{
 
1771
        int oerrno = errno;
 
1772
    
 
1773
        fbl_y__flush_buffer(b );
1675
1774
 
1676
1775
        b->fbl_y__input_file = file;
1677
1776
        b->fbl_y__fill_buffer = 1;
1678
1777
 
1679
 
#if FBL_Y__ALWAYS_INTERACTIVE
1680
 
        b->fbl_y__is_interactive = 1;
1681
 
#else
1682
 
#if FBL_Y__NEVER_INTERACTIVE
1683
 
        b->fbl_y__is_interactive = 0;
1684
 
#else
1685
 
        b->fbl_y__is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1686
 
#endif
1687
 
#endif
1688
 
        }
1689
 
 
1690
 
 
1691
 
#ifdef FBL_Y__USE_PROTOS
1692
 
void fbl_y__flush_buffer( FBL_Y__BUFFER_STATE b )
1693
 
#else
1694
 
void fbl_y__flush_buffer( b )
1695
 
FBL_Y__BUFFER_STATE b;
1696
 
#endif
1697
 
 
1698
 
        {
1699
 
        if ( ! b )
 
1778
    /* If b is the current buffer, then fbl_y__init_buffer was _probably_
 
1779
     * called from fbl_y_restart() or through fbl_y__get_next_buffer.
 
1780
     * In that case, we don't want to reset the lineno or column.
 
1781
     */
 
1782
    if (b != FBL_Y__CURRENT_BUFFER){
 
1783
        b->fbl_y__bs_lineno = 1;
 
1784
        b->fbl_y__bs_column = 0;
 
1785
    }
 
1786
 
 
1787
        b->fbl_y__is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
 
1788
    
 
1789
        errno = oerrno;
 
1790
}
 
1791
 
 
1792
/** Discard all buffered characters. On the next scan, FBL_Y__INPUT will be called.
 
1793
 * @param b the buffer state to be flushed, usually @c FBL_Y__CURRENT_BUFFER.
 
1794
 * 
 
1795
 */
 
1796
    void fbl_y__flush_buffer (FBL_Y__BUFFER_STATE  b )
 
1797
{
 
1798
        if ( ! b )
1700
1799
                return;
1701
1800
 
1702
1801
        b->fbl_y__n_chars = 0;
1713
1812
        b->fbl_y__at_bol = 1;
1714
1813
        b->fbl_y__buffer_status = FBL_Y__BUFFER_NEW;
1715
1814
 
1716
 
        if ( b == fbl_y__current_buffer )
1717
 
                fbl_y__load_buffer_state();
1718
 
        }
1719
 
 
1720
 
 
1721
 
#ifndef FBL_Y__NO_SCAN_BUFFER
1722
 
#ifdef FBL_Y__USE_PROTOS
1723
 
FBL_Y__BUFFER_STATE fbl_y__scan_buffer( char *base, fbl_y__size_t size )
1724
 
#else
1725
 
FBL_Y__BUFFER_STATE fbl_y__scan_buffer( base, size )
1726
 
char *base;
1727
 
fbl_y__size_t size;
1728
 
#endif
1729
 
        {
 
1815
        if ( b == FBL_Y__CURRENT_BUFFER )
 
1816
                fbl_y__load_buffer_state( );
 
1817
}
 
1818
 
 
1819
/** Pushes the new state onto the stack. The new state becomes
 
1820
 *  the current state. This function will allocate the stack
 
1821
 *  if necessary.
 
1822
 *  @param new_buffer The new state.
 
1823
 *  
 
1824
 */
 
1825
void fbl_y_push_buffer_state (FBL_Y__BUFFER_STATE new_buffer )
 
1826
{
 
1827
        if (new_buffer == NULL)
 
1828
                return;
 
1829
 
 
1830
        fbl_y_ensure_buffer_stack();
 
1831
 
 
1832
        /* This block is copied from fbl_y__switch_to_buffer. */
 
1833
        if ( FBL_Y__CURRENT_BUFFER )
 
1834
                {
 
1835
                /* Flush out information for old buffer. */
 
1836
                *(fbl_y__c_buf_p) = (fbl_y__hold_char);
 
1837
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__buf_pos = (fbl_y__c_buf_p);
 
1838
                FBL_Y__CURRENT_BUFFER_LVALUE->fbl_y__n_chars = (fbl_y__n_chars);
 
1839
                }
 
1840
 
 
1841
        /* Only push if top exists. Otherwise, replace top. */
 
1842
        if (FBL_Y__CURRENT_BUFFER)
 
1843
                (fbl_y__buffer_stack_top)++;
 
1844
        FBL_Y__CURRENT_BUFFER_LVALUE = new_buffer;
 
1845
 
 
1846
        /* copied from fbl_y__switch_to_buffer. */
 
1847
        fbl_y__load_buffer_state( );
 
1848
        (fbl_y__did_buffer_switch_on_eof) = 1;
 
1849
}
 
1850
 
 
1851
/** Removes and deletes the top of the stack, if present.
 
1852
 *  The next element becomes the new top.
 
1853
 *  
 
1854
 */
 
1855
void fbl_y_pop_buffer_state (void)
 
1856
{
 
1857
        if (!FBL_Y__CURRENT_BUFFER)
 
1858
                return;
 
1859
 
 
1860
        fbl_y__delete_buffer(FBL_Y__CURRENT_BUFFER );
 
1861
        FBL_Y__CURRENT_BUFFER_LVALUE = NULL;
 
1862
        if ((fbl_y__buffer_stack_top) > 0)
 
1863
                --(fbl_y__buffer_stack_top);
 
1864
 
 
1865
        if (FBL_Y__CURRENT_BUFFER) {
 
1866
                fbl_y__load_buffer_state( );
 
1867
                (fbl_y__did_buffer_switch_on_eof) = 1;
 
1868
        }
 
1869
}
 
1870
 
 
1871
/* Allocates the stack if it does not exist.
 
1872
 *  Guarantees space for at least one push.
 
1873
 */
 
1874
static void fbl_y_ensure_buffer_stack (void)
 
1875
{
 
1876
        int num_to_alloc;
 
1877
    
 
1878
        if (!(fbl_y__buffer_stack)) {
 
1879
 
 
1880
                /* First allocation is just for 2 elements, since we don't know if this
 
1881
                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
 
1882
                 * immediate realloc on the next call.
 
1883
         */
 
1884
                num_to_alloc = 1;
 
1885
                (fbl_y__buffer_stack) = (struct fbl_y__buffer_state**)fbl_y_alloc
 
1886
                                                                (num_to_alloc * sizeof(struct fbl_y__buffer_state*)
 
1887
                                                                );
 
1888
                if ( ! (fbl_y__buffer_stack) )
 
1889
                        FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y_ensure_buffer_stack()" );
 
1890
                                                                  
 
1891
                memset((fbl_y__buffer_stack), 0, num_to_alloc * sizeof(struct fbl_y__buffer_state*));
 
1892
                                
 
1893
                (fbl_y__buffer_stack_max) = num_to_alloc;
 
1894
                (fbl_y__buffer_stack_top) = 0;
 
1895
                return;
 
1896
        }
 
1897
 
 
1898
        if ((fbl_y__buffer_stack_top) >= ((fbl_y__buffer_stack_max)) - 1){
 
1899
 
 
1900
                /* Increase the buffer to prepare for a possible push. */
 
1901
                int grow_size = 8 /* arbitrary grow size */;
 
1902
 
 
1903
                num_to_alloc = (fbl_y__buffer_stack_max) + grow_size;
 
1904
                (fbl_y__buffer_stack) = (struct fbl_y__buffer_state**)fbl_y_realloc
 
1905
                                                                ((fbl_y__buffer_stack),
 
1906
                                                                num_to_alloc * sizeof(struct fbl_y__buffer_state*)
 
1907
                                                                );
 
1908
                if ( ! (fbl_y__buffer_stack) )
 
1909
                        FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y_ensure_buffer_stack()" );
 
1910
 
 
1911
                /* zero only the new slots.*/
 
1912
                memset((fbl_y__buffer_stack) + (fbl_y__buffer_stack_max), 0, grow_size * sizeof(struct fbl_y__buffer_state*));
 
1913
                (fbl_y__buffer_stack_max) = num_to_alloc;
 
1914
        }
 
1915
}
 
1916
 
 
1917
/** Setup the input buffer state to scan directly from a user-specified character buffer.
 
1918
 * @param base the character buffer
 
1919
 * @param size the size in bytes of the character buffer
 
1920
 * 
 
1921
 * @return the newly allocated buffer state object. 
 
1922
 */
 
1923
FBL_Y__BUFFER_STATE fbl_y__scan_buffer  (char * base, fbl_y__size_t  size )
 
1924
{
1730
1925
        FBL_Y__BUFFER_STATE b;
1731
 
 
 
1926
    
1732
1927
        if ( size < 2 ||
1733
1928
             base[size-2] != FBL_Y__END_OF_BUFFER_CHAR ||
1734
1929
             base[size-1] != FBL_Y__END_OF_BUFFER_CHAR )
1735
1930
                /* They forgot to leave room for the EOB's. */
1736
1931
                return 0;
1737
1932
 
1738
 
        b = (FBL_Y__BUFFER_STATE) fbl_y__flex_alloc( sizeof( struct fbl_y__buffer_state ) );
 
1933
        b = (FBL_Y__BUFFER_STATE) fbl_y_alloc(sizeof( struct fbl_y__buffer_state )  );
1739
1934
        if ( ! b )
1740
1935
                FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__scan_buffer()" );
1741
1936
 
1749
1944
        b->fbl_y__fill_buffer = 0;
1750
1945
        b->fbl_y__buffer_status = FBL_Y__BUFFER_NEW;
1751
1946
 
1752
 
        fbl_y__switch_to_buffer( b );
 
1947
        fbl_y__switch_to_buffer(b  );
1753
1948
 
1754
1949
        return b;
1755
 
        }
1756
 
#endif
1757
 
 
1758
 
 
1759
 
#ifndef FBL_Y__NO_SCAN_STRING
1760
 
#ifdef FBL_Y__USE_PROTOS
1761
 
FBL_Y__BUFFER_STATE fbl_y__scan_string( fbl_y_const char *fbl_y__str )
1762
 
#else
1763
 
FBL_Y__BUFFER_STATE fbl_y__scan_string( fbl_y__str )
1764
 
fbl_y_const char *fbl_y__str;
1765
 
#endif
1766
 
        {
1767
 
        int len;
1768
 
        for ( len = 0; fbl_y__str[len]; ++len )
1769
 
                ;
1770
 
 
1771
 
        return fbl_y__scan_bytes( fbl_y__str, len );
1772
 
        }
1773
 
#endif
1774
 
 
1775
 
 
1776
 
#ifndef FBL_Y__NO_SCAN_BYTES
1777
 
#ifdef FBL_Y__USE_PROTOS
1778
 
FBL_Y__BUFFER_STATE fbl_y__scan_bytes( fbl_y_const char *bytes, int len )
1779
 
#else
1780
 
FBL_Y__BUFFER_STATE fbl_y__scan_bytes( bytes, len )
1781
 
fbl_y_const char *bytes;
1782
 
int len;
1783
 
#endif
1784
 
        {
 
1950
}
 
1951
 
 
1952
/** Setup the input buffer state to scan a string. The next call to fbl_y_lex() will
 
1953
 * scan from a @e copy of @a str.
 
1954
 * @param fbl_y_str a NUL-terminated string to scan
 
1955
 * 
 
1956
 * @return the newly allocated buffer state object.
 
1957
 * @note If you want to scan bytes that may contain NUL values, then use
 
1958
 *       fbl_y__scan_bytes() instead.
 
1959
 */
 
1960
FBL_Y__BUFFER_STATE fbl_y__scan_string (fbl_y_const char * fbl_y_str )
 
1961
{
 
1962
    
 
1963
        return fbl_y__scan_bytes(fbl_y_str,strlen(fbl_y_str) );
 
1964
}
 
1965
 
 
1966
/** Setup the input buffer state to scan the given bytes. The next call to fbl_y_lex() will
 
1967
 * scan from a @e copy of @a bytes.
 
1968
 * @param bytes the byte buffer to scan
 
1969
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 
1970
 * 
 
1971
 * @return the newly allocated buffer state object.
 
1972
 */
 
1973
FBL_Y__BUFFER_STATE fbl_y__scan_bytes  (fbl_y_const char * fbl_y_bytes, int  _fbl_y_bytes_len )
 
1974
{
1785
1975
        FBL_Y__BUFFER_STATE b;
1786
1976
        char *buf;
1787
1977
        fbl_y__size_t n;
1788
1978
        int i;
1789
 
 
 
1979
    
1790
1980
        /* Get memory for full buffer, including space for trailing EOB's. */
1791
 
        n = len + 2;
1792
 
        buf = (char *) fbl_y__flex_alloc( n );
 
1981
        n = _fbl_y_bytes_len + 2;
 
1982
        buf = (char *) fbl_y_alloc(n  );
1793
1983
        if ( ! buf )
1794
1984
                FBL_Y__FATAL_ERROR( "out of dynamic memory in fbl_y__scan_bytes()" );
1795
1985
 
1796
 
        for ( i = 0; i < len; ++i )
1797
 
                buf[i] = bytes[i];
1798
 
 
1799
 
        buf[len] = buf[len+1] = FBL_Y__END_OF_BUFFER_CHAR;
1800
 
 
1801
 
        b = fbl_y__scan_buffer( buf, n );
 
1986
        for ( i = 0; i < _fbl_y_bytes_len; ++i )
 
1987
                buf[i] = fbl_y_bytes[i];
 
1988
 
 
1989
        buf[_fbl_y_bytes_len] = buf[_fbl_y_bytes_len+1] = FBL_Y__END_OF_BUFFER_CHAR;
 
1990
 
 
1991
        b = fbl_y__scan_buffer(buf,n );
1802
1992
        if ( ! b )
1803
1993
                FBL_Y__FATAL_ERROR( "bad buffer in fbl_y__scan_bytes()" );
1804
1994
 
1808
1998
        b->fbl_y__is_our_buffer = 1;
1809
1999
 
1810
2000
        return b;
1811
 
        }
1812
 
#endif
1813
 
 
1814
 
 
1815
 
#ifndef FBL_Y__NO_PUSH_STATE
1816
 
#ifdef FBL_Y__USE_PROTOS
1817
 
static void fbl_y__push_state( int new_state )
1818
 
#else
1819
 
static void fbl_y__push_state( new_state )
1820
 
int new_state;
1821
 
#endif
1822
 
        {
1823
 
        if ( fbl_y__start_stack_ptr >= fbl_y__start_stack_depth )
1824
 
                {
1825
 
                fbl_y__size_t new_size;
1826
 
 
1827
 
                fbl_y__start_stack_depth += FBL_Y__START_STACK_INCR;
1828
 
                new_size = fbl_y__start_stack_depth * sizeof( int );
1829
 
 
1830
 
                if ( ! fbl_y__start_stack )
1831
 
                        fbl_y__start_stack = (int *) fbl_y__flex_alloc( new_size );
1832
 
 
1833
 
                else
1834
 
                        fbl_y__start_stack = (int *) fbl_y__flex_realloc(
1835
 
                                        (void *) fbl_y__start_stack, new_size );
1836
 
 
1837
 
                if ( ! fbl_y__start_stack )
1838
 
                        FBL_Y__FATAL_ERROR(
1839
 
                        "out of memory expanding start-condition stack" );
1840
 
                }
1841
 
 
1842
 
        fbl_y__start_stack[fbl_y__start_stack_ptr++] = FBL_Y__START;
1843
 
 
1844
 
        BEGIN(new_state);
1845
 
        }
1846
 
#endif
1847
 
 
1848
 
 
1849
 
#ifndef FBL_Y__NO_POP_STATE
1850
 
static void fbl_y__pop_state()
1851
 
        {
1852
 
        if ( --fbl_y__start_stack_ptr < 0 )
1853
 
                FBL_Y__FATAL_ERROR( "start-condition stack underflow" );
1854
 
 
1855
 
        BEGIN(fbl_y__start_stack[fbl_y__start_stack_ptr]);
1856
 
        }
1857
 
#endif
1858
 
 
1859
 
 
1860
 
#ifndef FBL_Y__NO_TOP_STATE
1861
 
static int fbl_y__top_state()
1862
 
        {
1863
 
        return fbl_y__start_stack[fbl_y__start_stack_ptr - 1];
1864
 
        }
1865
 
#endif
 
2001
}
1866
2002
 
1867
2003
#ifndef FBL_Y__EXIT_FAILURE
1868
2004
#define FBL_Y__EXIT_FAILURE 2
1869
2005
#endif
1870
2006
 
1871
 
#ifdef FBL_Y__USE_PROTOS
1872
 
static void fbl_y__fatal_error( fbl_y_const char msg[] )
1873
 
#else
1874
 
static void fbl_y__fatal_error( msg )
1875
 
char msg[];
1876
 
#endif
1877
 
        {
1878
 
        (void) fprintf( stderr, "%s\n", msg );
 
2007
static void fbl_y__fatal_error (fbl_y_const char* msg )
 
2008
{
 
2009
        (void) fprintf( stderr, "%s\n", msg );
1879
2010
        exit( FBL_Y__EXIT_FAILURE );
1880
 
        }
1881
 
 
1882
 
 
 
2011
}
1883
2012
 
1884
2013
/* Redefine fbl_y_less() so it works in section 3 code. */
1885
2014
 
1888
2017
        do \
1889
2018
                { \
1890
2019
                /* Undo effects of setting up fbl_y_text. */ \
1891
 
                fbl_y_text[fbl_y_leng] = fbl_y__hold_char; \
1892
 
                fbl_y__c_buf_p = fbl_y_text + n; \
1893
 
                fbl_y__hold_char = *fbl_y__c_buf_p; \
1894
 
                *fbl_y__c_buf_p = '\0'; \
1895
 
                fbl_y_leng = n; \
 
2020
        int fbl_y_less_macro_arg = (n); \
 
2021
        FBL_Y__LESS_LINENO(fbl_y_less_macro_arg);\
 
2022
                fbl_y_text[fbl_y_leng] = (fbl_y__hold_char); \
 
2023
                (fbl_y__c_buf_p) = fbl_y_text + fbl_y_less_macro_arg; \
 
2024
                (fbl_y__hold_char) = *(fbl_y__c_buf_p); \
 
2025
                *(fbl_y__c_buf_p) = '\0'; \
 
2026
                fbl_y_leng = fbl_y_less_macro_arg; \
1896
2027
                } \
1897
2028
        while ( 0 )
1898
2029
 
1899
 
 
1900
 
/* Internal utility routines. */
1901
 
 
1902
 
#ifndef fbl_y_text_ptr
1903
 
#ifdef FBL_Y__USE_PROTOS
1904
 
static void fbl_y__flex_strncpy( char *s1, fbl_y_const char *s2, int n )
 
2030
/* Accessor  methods (get/set functions) to struct members. */
 
2031
 
 
2032
/** Get the current line number.
 
2033
 * 
 
2034
 */
 
2035
int fbl_y_get_lineno  (void)
 
2036
{
 
2037
        
 
2038
    return fbl_y_lineno;
 
2039
}
 
2040
 
 
2041
/** Get the input stream.
 
2042
 * 
 
2043
 */
 
2044
FILE *fbl_y_get_in  (void)
 
2045
{
 
2046
        return fbl_y_in;
 
2047
}
 
2048
 
 
2049
/** Get the output stream.
 
2050
 * 
 
2051
 */
 
2052
FILE *fbl_y_get_out  (void)
 
2053
{
 
2054
        return fbl_y_out;
 
2055
}
 
2056
 
 
2057
/** Get the length of the current token.
 
2058
 * 
 
2059
 */
 
2060
int fbl_y_get_leng  (void)
 
2061
{
 
2062
        return fbl_y_leng;
 
2063
}
 
2064
 
 
2065
/** Get the current token.
 
2066
 * 
 
2067
 */
 
2068
 
 
2069
char *fbl_y_get_text  (void)
 
2070
{
 
2071
        return fbl_y_text;
 
2072
}
 
2073
 
 
2074
/** Set the current line number.
 
2075
 * @param line_number
 
2076
 * 
 
2077
 */
 
2078
void fbl_y_set_lineno (int  line_number )
 
2079
{
 
2080
    
 
2081
    fbl_y_lineno = line_number;
 
2082
}
 
2083
 
 
2084
/** Set the input stream. This does not discard the current
 
2085
 * input buffer.
 
2086
 * @param in_str A readable stream.
 
2087
 * 
 
2088
 * @see fbl_y__switch_to_buffer
 
2089
 */
 
2090
void fbl_y_set_in (FILE *  in_str )
 
2091
{
 
2092
        fbl_y_in = in_str ;
 
2093
}
 
2094
 
 
2095
void fbl_y_set_out (FILE *  out_str )
 
2096
{
 
2097
        fbl_y_out = out_str ;
 
2098
}
 
2099
 
 
2100
int fbl_y_get_debug  (void)
 
2101
{
 
2102
        return fbl_y__flex_debug;
 
2103
}
 
2104
 
 
2105
void fbl_y_set_debug (int  bdebug )
 
2106
{
 
2107
        fbl_y__flex_debug = bdebug ;
 
2108
}
 
2109
 
 
2110
static int fbl_y__init_globals (void)
 
2111
{
 
2112
        /* Initialization is the same as for the non-reentrant scanner.
 
2113
     * This function is called from fbl_y_lex_destroy(), so don't allocate here.
 
2114
     */
 
2115
 
 
2116
    (fbl_y__buffer_stack) = 0;
 
2117
    (fbl_y__buffer_stack_top) = 0;
 
2118
    (fbl_y__buffer_stack_max) = 0;
 
2119
    (fbl_y__c_buf_p) = (char *) 0;
 
2120
    (fbl_y__init) = 0;
 
2121
    (fbl_y__start) = 0;
 
2122
 
 
2123
/* Defined in main.c */
 
2124
#ifdef FBL_Y__STDINIT
 
2125
    fbl_y_in = stdin;
 
2126
    fbl_y_out = stdout;
1905
2127
#else
1906
 
static void fbl_y__flex_strncpy( s1, s2, n )
1907
 
char *s1;
1908
 
fbl_y_const char *s2;
1909
 
int n;
 
2128
    fbl_y_in = (FILE *) 0;
 
2129
    fbl_y_out = (FILE *) 0;
1910
2130
#endif
1911
 
        {
 
2131
 
 
2132
    /* For future reference: Set errno on error, since we are called by
 
2133
     * fbl_y_lex_init()
 
2134
     */
 
2135
    return 0;
 
2136
}
 
2137
 
 
2138
/* fbl_y_lex_destroy is for both reentrant and non-reentrant scanners. */
 
2139
int fbl_y_lex_destroy  (void)
 
2140
{
 
2141
    
 
2142
    /* Pop the buffer stack, destroying each element. */
 
2143
        while(FBL_Y__CURRENT_BUFFER){
 
2144
                fbl_y__delete_buffer(FBL_Y__CURRENT_BUFFER  );
 
2145
                FBL_Y__CURRENT_BUFFER_LVALUE = NULL;
 
2146
                fbl_y_pop_buffer_state();
 
2147
        }
 
2148
 
 
2149
        /* Destroy the stack itself. */
 
2150
        fbl_y_free((fbl_y__buffer_stack) );
 
2151
        (fbl_y__buffer_stack) = NULL;
 
2152
 
 
2153
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
 
2154
     * fbl_y_lex() is called, initialization will occur. */
 
2155
    fbl_y__init_globals( );
 
2156
 
 
2157
    return 0;
 
2158
}
 
2159
 
 
2160
/*
 
2161
 * Internal utility routines.
 
2162
 */
 
2163
 
 
2164
#ifndef fbl_y_text_ptr
 
2165
static void fbl_y__flex_strncpy (char* s1, fbl_y_const char * s2, int n )
 
2166
{
1912
2167
        register int i;
1913
2168
        for ( i = 0; i < n; ++i )
1914
2169
                s1[i] = s2[i];
1915
 
        }
 
2170
}
1916
2171
#endif
1917
2172
 
1918
2173
#ifdef FBL_Y__NEED_STRLEN
1919
 
#ifdef FBL_Y__USE_PROTOS
1920
 
static int fbl_y__flex_strlen( fbl_y_const char *s )
1921
 
#else
1922
 
static int fbl_y__flex_strlen( s )
1923
 
fbl_y_const char *s;
1924
 
#endif
1925
 
        {
 
2174
static int fbl_y__flex_strlen (fbl_y_const char * s )
 
2175
{
1926
2176
        register int n;
1927
2177
        for ( n = 0; s[n]; ++n )
1928
2178
                ;
1929
2179
 
1930
2180
        return n;
1931
 
        }
1932
 
#endif
1933
 
 
1934
 
 
1935
 
#ifdef FBL_Y__USE_PROTOS
1936
 
static void *fbl_y__flex_alloc( fbl_y__size_t size )
1937
 
#else
1938
 
static void *fbl_y__flex_alloc( size )
1939
 
fbl_y__size_t size;
1940
 
#endif
1941
 
        {
 
2181
}
 
2182
#endif
 
2183
 
 
2184
void *fbl_y_alloc (fbl_y__size_t  size )
 
2185
{
1942
2186
        return (void *) malloc( size );
1943
 
        }
 
2187
}
1944
2188
 
1945
 
#ifdef FBL_Y__USE_PROTOS
1946
 
static void *fbl_y__flex_realloc( void *ptr, fbl_y__size_t size )
1947
 
#else
1948
 
static void *fbl_y__flex_realloc( ptr, size )
1949
 
void *ptr;
1950
 
fbl_y__size_t size;
1951
 
#endif
1952
 
        {
 
2189
void *fbl_y_realloc  (void * ptr, fbl_y__size_t  size )
 
2190
{
1953
2191
        /* The cast to (char *) in the following accommodates both
1954
2192
         * implementations that use char* generic pointers, and those
1955
2193
         * that use void* generic pointers.  It works with the latter
1958
2196
         * as though doing an assignment.
1959
2197
         */
1960
2198
        return (void *) realloc( (char *) ptr, size );
1961
 
        }
1962
 
 
1963
 
#ifdef FBL_Y__USE_PROTOS
1964
 
static void fbl_y__flex_free( void *ptr )
1965
 
#else
1966
 
static void fbl_y__flex_free( ptr )
1967
 
void *ptr;
1968
 
#endif
1969
 
        {
1970
 
        free( ptr );
1971
 
        }
1972
 
 
1973
 
#if FBL_Y__MAIN
1974
 
int main()
1975
 
        {
1976
 
        fbl_y_lex();
1977
 
        return 0;
1978
 
        }
1979
 
#endif
1980
 
#line 266 "../../../src/fvh/src/fbl_bcomp_l.l"
 
2199
}
 
2200
 
 
2201
void fbl_y_free (void * ptr )
 
2202
{
 
2203
        free( (char *) ptr );   /* see fbl_y_realloc() for (char *) cast */
 
2204
}
 
2205
 
 
2206
#define FBL_Y_TABLES_NAME "fbl_y_tables"
 
2207
 
 
2208
#line 266 "./fbl_bcomp_l.l"
 
2209
 
1981
2210
 
1982
2211
int fbl_y_wrap()
1983
2212
{
1984
2213
 return(1);
1985
2214
}
 
2215