~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/imagemap/imap_csim_lex.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

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