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

« back to all changes in this revision

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