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
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
18
#line 19 "imap_ncsa_lex.c"
4
#define YY_INT_ALIGNED short int
19
6
/* A lexical scanner generated by flex */
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 $
25
8
#define FLEX_SCANNER
26
9
#define YY_FLEX_MAJOR_VERSION 2
27
10
#define YY_FLEX_MINOR_VERSION 5
11
#define YY_FLEX_SUBMINOR_VERSION 33
12
#if YY_FLEX_SUBMINOR_VERSION > 0
16
/* First, we deal with platform-specific or compiler-specific issues. */
18
/* begin standard C headers. */
32
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
24
/* end standard C headers. */
26
/* flex integer type definitions */
31
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
#if __STDC_VERSION__ >= 199901L
35
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36
* if you want the limit (max/min) macros for int types.
38
#ifndef __STDC_LIMIT_MACROS
39
#define __STDC_LIMIT_MACROS 1
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;
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;
58
/* Limits of integral types. */
60
#define INT8_MIN (-128)
63
#define INT16_MIN (-32767-1)
66
#define INT32_MIN (-2147483647-1)
69
#define INT8_MAX (127)
72
#define INT16_MAX (32767)
75
#define INT32_MAX (2147483647)
78
#define UINT8_MAX (255U)
81
#define UINT16_MAX (65535U)
84
#define UINT32_MAX (4294967295U)
87
#endif /* ! FLEXINT_H */
45
/* Use prototypes in function declarations. */
48
91
/* The "const" storage-class-modifier is valid. */
49
92
#define YY_USE_CONST
94
120
* but we do it the disgusting crufty way forced on us by the ()-less
95
121
* definition of BEGIN.
97
#define BEGIN yy_start = 1 + 2 *
123
#define BEGIN (yy_start) = 1 + 2 *
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
103
#define YY_START ((yy_start - 1) / 2)
129
#define YY_START (((yy_start) - 1) / 2)
104
130
#define YYSTATE YY_START
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)
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 )
112
138
#define YY_END_OF_BUFFER_CHAR 0
114
140
/* Size of default input buffer. */
115
142
#define YY_BUF_SIZE 16384
145
/* The state buf must be large enough to hold one state per character in the main buffer.
147
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
150
#define YY_TYPEDEF_YY_BUFFER_STATE
117
151
typedef struct yy_buffer_state *YY_BUFFER_STATE;
120
extern FILE *yyin, *yyout;
154
extern int ncsa_leng;
156
extern FILE *ncsa_in, *ncsa_out;
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
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:
130
* if ( condition_holds )
133
* do_something_else();
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.
140
/* Return all but the first 'n' matched characters back to the input stream. */
162
#define YY_LESS_LINENO(n)
164
/* Return all but the first "n" matched characters back to the input stream. */
142
165
#define yyless(n) \
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 */ \
153
#define unput(c) yyunput( c, yytext_ptr )
178
#define unput(c) yyunput( c, (yytext_ptr) )
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).
185
#ifndef YY_TYPEDEF_YY_SIZE_T
186
#define YY_TYPEDEF_YY_SIZE_T
159
187
typedef unsigned int yy_size_t;
190
#ifndef YY_STRUCT_YY_BUFFER_STATE
191
#define YY_STRUCT_YY_BUFFER_STATE
162
192
struct yy_buffer_state
164
194
FILE *yy_input_file;
210
244
* possible backing-up.
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.
216
250
#define YY_BUFFER_EOF_PENDING 2
253
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
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. */
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".
225
#define YY_CURRENT_BUFFER yy_current_buffer
228
/* yy_hold_char holds the character lost when yytext is formed. */
264
* Returns the top of the stack, or NULL.
266
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
267
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
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.
273
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275
/* yy_hold_char holds the character lost when ncsa_text is formed. */
229
276
static char yy_hold_char;
231
277
static int yy_n_chars; /* number of characters read into yy_ch_buf */
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 */
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 ...
244
288
static int yy_did_buffer_switch_on_eof;
246
void yyrestart YY_PROTO(( FILE *input_file ));
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 )
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 ));
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 * ));
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 );
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 );
302
#define YY_FLUSH_BUFFER ncsa__flush_buffer(YY_CURRENT_BUFFER )
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 );
308
void *ncsa_alloc (yy_size_t );
309
void *ncsa_realloc (void *,yy_size_t );
310
void ncsa_free (void * );
312
#define yy_new_buffer ncsa__create_buffer
266
314
#define yy_set_interactive(is_interactive) \
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 ); \
321
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
273
324
#define yy_set_bol(at_bol) \
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 ); \
331
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
280
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
334
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336
/* Begin user sect3 */
338
#define ncsa_wrap() 1
284
339
#define YY_SKIP_YYWRAP
285
341
typedef unsigned char YY_CHAR;
286
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
343
FILE *ncsa_in = (FILE *) 0, *ncsa_out = (FILE *) 0;
287
345
typedef int yy_state_type;
289
#define yytext_ptr yytext
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[] ));
347
extern int ncsa_lineno;
351
extern char *ncsa_text;
352
#define yytext_ptr ncsa_text
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[] );
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.
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; \
367
(yy_c_buf_p) = yy_cp;
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. */
375
flex_int32_t yy_verify;
378
static yyconst flex_int16_t yy_accept[76] =
310
380
11, 11, 0, 0, 5, 5, 15, 13, 12, 12,
311
381
4, 11, 11, 11, 13, 13, 11, 13, 13, 10,
352
static yyconst int yy_meta[28] =
422
static yyconst flex_int32_t yy_meta[28] =
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
359
static yyconst short int yy_base[80] =
429
static yyconst flex_int16_t yy_base[80] =
361
431
0, 0, 26, 28, 114, 113, 115, 118, 34, 36,
362
432
109, 31, 32, 34, 95, 97, 42, 90, 95, 0,
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 );
477
extern int yywrap YY_PROTO(( void ));
482
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
572
extern int ncsa_wrap (void );
576
static void yyunput (int c,char *buf_ptr );
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 );
489
582
#ifdef YY_NEED_STRLEN
490
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
583
static int yy_flex_strlen (yyconst char * );
493
586
#ifndef YY_NO_INPUT
494
588
#ifdef __cplusplus
495
static int yyinput YY_PROTO(( void ));
497
static int input YY_PROTO(( void ));
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 ));
508
#ifndef YY_NO_POP_STATE
509
static void yy_pop_state YY_PROTO(( void ));
511
#ifndef YY_NO_TOP_STATE
512
static int yy_top_state YY_PROTO(( void ));
516
#define YY_NO_PUSH_STATE 1
517
#define YY_NO_POP_STATE 1
518
#define YY_NO_TOP_STATE 1
521
#ifdef YY_MALLOC_DECL
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).
589
static int yyinput (void );
591
static int input (void );
536
596
/* Amount of stuff to slurp up with each read. */
609
688
#define YY_RULE_SETUP \
691
/** The main scanner function which does all the work.
614
695
register yy_state_type yy_current_state;
615
696
register char *yy_cp, *yy_bp;
616
697
register int yy_act;
618
#line 37 "imap_ncsa.l"
621
#line 620 "imap_ncsa_lex.c"
699
#line 46 "imap_ncsa.l"
627
708
#ifdef YY_USER_INIT
632
yy_start = 1; /* first start state */
640
if ( ! yy_current_buffer )
642
yy_create_buffer( yyin, YY_BUF_SIZE );
644
yy_load_buffer_state();
713
(yy_start) = 1; /* first start state */
721
if ( ! YY_CURRENT_BUFFER ) {
722
ncsa_ensure_buffer_stack ();
723
YY_CURRENT_BUFFER_LVALUE =
724
ncsa__create_buffer(ncsa_in,YY_BUF_SIZE );
727
ncsa__load_buffer_state( );
647
730
while ( 1 ) /* loops until end-of-file is reached */
732
yy_cp = (yy_c_buf_p);
651
/* Support of yytext. */
652
*yy_cp = yy_hold_char;
734
/* Support of ncsa_text. */
735
*yy_cp = (yy_hold_char);
654
737
/* yy_bp points to the position in yy_ch_buf of the start of
655
738
* the current run.
659
yy_current_state = yy_start;
742
yy_current_state = (yy_start);
663
746
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
664
747
if ( yy_accept[yy_current_state] )
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;
669
752
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
738
#line 59 "imap_ncsa.l"
819
#line 68 "imap_ncsa.l"
741
strcpy(ncsa_lval.id, yytext);
822
strcpy(ncsa_lval.id, ncsa_text);
747
#line 65 "imap_ncsa.l"
828
#line 74 "imap_ncsa.l"
750
831
return RECTANGLE;
755
#line 70 "imap_ncsa.l"
836
#line 79 "imap_ncsa.l"
763
#line 75 "imap_ncsa.l"
844
#line 84 "imap_ncsa.l"
771
#line 80 "imap_ncsa.l"
852
#line 89 "imap_ncsa.l"
779
#line 85 "imap_ncsa.l"
860
#line 94 "imap_ncsa.l"
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';
789
#line 92 "imap_ncsa.l"
870
#line 101 "imap_ncsa.l"
791
ncsa_lval.value = atof(yytext);
872
ncsa_lval.value = g_ascii_strtod (ncsa_text, NULL);
877
/* rule 12 can match eol */
797
#line 97 "imap_ncsa.l"
879
#line 106 "imap_ncsa.l"
798
880
; /* Eat white space */
802
#line 99 "imap_ncsa.l"
884
#line 108 "imap_ncsa.l"
807
#line 101 "imap_ncsa.l"
889
#line 110 "imap_ncsa.l"
810
#line 809 "imap_ncsa_lex.c"
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):
816
898
case YY_END_OF_BUFFER:
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;
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
825
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
907
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
841
923
/* Note that here we test for yy_c_buf_p "<=" to the position
1072
1147
ret_val = EOB_ACT_CONTINUE_SCAN;
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;
1078
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1153
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1080
1155
return ret_val;
1084
1158
/* yy_get_previous_state - get the state just before the EOB char was reached */
1086
static yy_state_type yy_get_previous_state()
1160
static yy_state_type yy_get_previous_state (void)
1088
1162
register yy_state_type yy_current_state;
1089
1163
register char *yy_cp;
1091
yy_current_state = yy_start;
1093
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1165
yy_current_state = (yy_start);
1167
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
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] )
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;
1101
1175
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1143
1210
yy_is_jam = (yy_current_state == 75);
1145
1212
return yy_is_jam ? 0 : yy_current_state;
1150
#ifdef YY_USE_PROTOS
1151
static void yyunput( int c, register char *yy_bp )
1153
static void yyunput( c, yy_bp )
1155
register char *yy_bp;
1158
register char *yy_cp = yy_c_buf_p;
1160
/* undo effects of setting up yytext */
1161
*yy_cp = yy_hold_char;
1163
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1215
static void yyunput (int c, register char * yy_bp )
1217
register char *yy_cp;
1219
yy_cp = (yy_c_buf_p);
1221
/* undo effects of setting up ncsa_text */
1222
*yy_cp = (yy_hold_char);
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];
1172
while ( source > yy_current_buffer->yy_ch_buf )
1233
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1173
1234
*--dest = *--source;
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;
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" );
1184
1245
*--yy_cp = (char) c;
1188
yy_hold_char = *yy_cp;
1191
#endif /* ifndef YY_NO_UNPUT */
1247
(yytext_ptr) = yy_bp;
1248
(yy_hold_char) = *yy_cp;
1249
(yy_c_buf_p) = yy_cp;
1194
1253
#ifdef __cplusplus
1195
static int yyinput()
1254
static int yyinput (void)
1256
static int input (void)
1202
*yy_c_buf_p = yy_hold_char;
1204
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1262
*(yy_c_buf_p) = (yy_hold_char);
1264
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
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.
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. */
1272
*(yy_c_buf_p) = '\0';
1215
1275
{ /* need more input */
1216
int offset = yy_c_buf_p - yytext_ptr;
1276
int offset = (yy_c_buf_p) - (yytext_ptr);
1219
switch ( yy_get_next_buffer() )
1279
switch ( yy_get_next_buffer( ) )
1221
1281
case EOB_ACT_LAST_MATCH:
1222
1282
/* This happens because yy_g_n_b()
1251
1311
case EOB_ACT_CONTINUE_SCAN:
1252
yy_c_buf_p = yytext_ptr + offset;
1312
(yy_c_buf_p) = (yytext_ptr) + offset;
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;
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);
1267
#ifdef YY_USE_PROTOS
1268
void yyrestart( FILE *input_file )
1270
void yyrestart( input_file )
1274
if ( ! yy_current_buffer )
1275
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1277
yy_init_buffer( yy_current_buffer, input_file );
1278
yy_load_buffer_state();
1282
#ifdef YY_USE_PROTOS
1283
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1285
void yy_switch_to_buffer( new_buffer )
1286
YY_BUFFER_STATE new_buffer;
1289
if ( yy_current_buffer == new_buffer )
1324
#endif /* ifndef YY_NO_INPUT */
1326
/** Immediately switch to a different input stream.
1327
* @param input_file A readable stream.
1329
* @note This function does not reset the start condition to @c INITIAL .
1331
void ncsa_restart (FILE * input_file )
1334
if ( ! YY_CURRENT_BUFFER ){
1335
ncsa_ensure_buffer_stack ();
1336
YY_CURRENT_BUFFER_LVALUE =
1337
ncsa__create_buffer(ncsa_in,YY_BUF_SIZE );
1340
ncsa__init_buffer(YY_CURRENT_BUFFER,input_file );
1341
ncsa__load_buffer_state( );
1344
/** Switch to a different input buffer.
1345
* @param new_buffer The new input buffer.
1348
void ncsa__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1351
/* TODO. We should be able to replace this entire function body
1353
* ncsa_pop_buffer_state();
1354
* ncsa_push_buffer_state(new_buffer);
1356
ncsa_ensure_buffer_stack ();
1357
if ( YY_CURRENT_BUFFER == new_buffer )
1292
if ( yy_current_buffer )
1360
if ( YY_CURRENT_BUFFER )
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);
1300
yy_current_buffer = new_buffer;
1301
yy_load_buffer_state();
1368
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1369
ncsa__load_buffer_state( );
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.
1308
yy_did_buffer_switch_on_eof = 1;
1312
#ifdef YY_USE_PROTOS
1313
void yy_load_buffer_state( void )
1315
void yy_load_buffer_state()
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;
1325
#ifdef YY_USE_PROTOS
1326
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1328
YY_BUFFER_STATE yy_create_buffer( file, size )
1376
(yy_did_buffer_switch_on_eof) = 1;
1379
static void ncsa__load_buffer_state (void)
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);
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.
1391
* @return the allocated buffer state.
1393
YY_BUFFER_STATE ncsa__create_buffer (FILE * file, int size )
1333
1395
YY_BUFFER_STATE b;
1335
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1397
b = (YY_BUFFER_STATE) ncsa_alloc(sizeof( struct yy_buffer_state ) );
1337
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1399
YY_FATAL_ERROR( "out of dynamic memory in ncsa__create_buffer()" );
1339
1401
b->yy_buf_size = size;
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.
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()" );
1348
1410
b->yy_is_our_buffer = 1;
1350
yy_init_buffer( b, file );
1412
ncsa__init_buffer(b,file );
1356
#ifdef YY_USE_PROTOS
1357
void yy_delete_buffer( YY_BUFFER_STATE b )
1359
void yy_delete_buffer( b )
1417
/** Destroy the buffer.
1418
* @param b a buffer created with ncsa__create_buffer()
1421
void ncsa__delete_buffer (YY_BUFFER_STATE b )
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;
1369
1430
if ( b->yy_is_our_buffer )
1370
yy_flex_free( (void *) b->yy_ch_buf );
1372
yy_flex_free( (void *) b );
1376
#ifndef YY_ALWAYS_INTERACTIVE
1377
#ifndef YY_NEVER_INTERACTIVE
1378
extern int isatty YY_PROTO(( int ));
1382
#ifdef YY_USE_PROTOS
1383
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1385
void yy_init_buffer( b, file )
1392
yy_flush_buffer( b );
1431
ncsa_free((void *) b->yy_ch_buf );
1433
ncsa_free((void *) b );
1437
extern int isatty (int );
1438
#endif /* __cplusplus */
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.
1444
static void ncsa__init_buffer (YY_BUFFER_STATE b, FILE * file )
1449
ncsa__flush_buffer(b );
1394
1451
b->yy_input_file = file;
1395
1452
b->yy_fill_buffer = 1;
1397
#if YY_ALWAYS_INTERACTIVE
1398
b->yy_is_interactive = 1;
1400
#if YY_NEVER_INTERACTIVE
1401
b->yy_is_interactive = 0;
1403
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1409
#ifdef YY_USE_PROTOS
1410
void yy_flush_buffer( YY_BUFFER_STATE b )
1412
void yy_flush_buffer( 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.
1458
if (b != YY_CURRENT_BUFFER){
1459
b->yy_bs_lineno = 1;
1460
b->yy_bs_column = 0;
1463
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
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.
1472
void ncsa__flush_buffer (YY_BUFFER_STATE b )
1420
1477
b->yy_n_chars = 0;
1431
1488
b->yy_at_bol = 1;
1432
1489
b->yy_buffer_status = YY_BUFFER_NEW;
1434
if ( b == yy_current_buffer )
1435
yy_load_buffer_state();
1439
#ifndef YY_NO_SCAN_BUFFER
1440
#ifdef YY_USE_PROTOS
1441
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1443
YY_BUFFER_STATE yy_scan_buffer( base, size )
1491
if ( b == YY_CURRENT_BUFFER )
1492
ncsa__load_buffer_state( );
1495
/** Pushes the new state onto the stack. The new state becomes
1496
* the current state. This function will allocate the stack
1498
* @param new_buffer The new state.
1501
void ncsa_push_buffer_state (YY_BUFFER_STATE new_buffer )
1503
if (new_buffer == NULL)
1506
ncsa_ensure_buffer_stack();
1508
/* This block is copied from ncsa__switch_to_buffer. */
1509
if ( YY_CURRENT_BUFFER )
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);
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;
1522
/* copied from ncsa__switch_to_buffer. */
1523
ncsa__load_buffer_state( );
1524
(yy_did_buffer_switch_on_eof) = 1;
1527
/** Removes and deletes the top of the stack, if present.
1528
* The next element becomes the new top.
1531
void ncsa_pop_buffer_state (void)
1533
if (!YY_CURRENT_BUFFER)
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);
1541
if (YY_CURRENT_BUFFER) {
1542
ncsa__load_buffer_state( );
1543
(yy_did_buffer_switch_on_eof) = 1;
1547
/* Allocates the stack if it does not exist.
1548
* Guarantees space for at least one push.
1550
static void ncsa_ensure_buffer_stack (void)
1554
if (!(yy_buffer_stack)) {
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.
1561
(yy_buffer_stack) = (struct yy_buffer_state**)ncsa_alloc
1562
(num_to_alloc * sizeof(struct yy_buffer_state*)
1565
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1567
(yy_buffer_stack_max) = num_to_alloc;
1568
(yy_buffer_stack_top) = 0;
1572
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1574
/* Increase the buffer to prepare for a possible push. */
1575
int grow_size = 8 /* arbitrary grow size */;
1577
num_to_alloc = (yy_buffer_stack_max) + grow_size;
1578
(yy_buffer_stack) = (struct yy_buffer_state**)ncsa_realloc
1580
num_to_alloc * sizeof(struct yy_buffer_state*)
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;
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
1593
* @return the newly allocated buffer state object.
1595
YY_BUFFER_STATE ncsa__scan_buffer (char * base, yy_size_t size )
1448
1597
YY_BUFFER_STATE b;
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. */
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 ) );
1458
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1607
YY_FATAL_ERROR( "out of dynamic memory in ncsa__scan_buffer()" );
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;
1470
yy_switch_to_buffer( b );
1619
ncsa__switch_to_buffer(b );
1477
#ifndef YY_NO_SCAN_STRING
1478
#ifdef YY_USE_PROTOS
1479
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1481
YY_BUFFER_STATE yy_scan_string( yy_str )
1482
yyconst char *yy_str;
1486
for ( len = 0; yy_str[len]; ++len )
1489
return yy_scan_bytes( yy_str, len );
1494
#ifndef YY_NO_SCAN_BYTES
1495
#ifdef YY_USE_PROTOS
1496
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1498
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1499
yyconst char *bytes;
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
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.
1632
YY_BUFFER_STATE ncsa__scan_string (yyconst char * yystr )
1635
return ncsa__scan_bytes(yystr,strlen(yystr) );
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.
1643
* @return the newly allocated buffer state object.
1645
YY_BUFFER_STATE ncsa__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1503
1647
YY_BUFFER_STATE b;
1508
1652
/* Get memory for full buffer, including space for trailing EOB's. */
1510
buf = (char *) yy_flex_alloc( n );
1653
n = _yybytes_len + 2;
1654
buf = (char *) ncsa_alloc(n );
1512
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1514
for ( i = 0; i < len; ++i )
1517
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1519
b = yy_scan_buffer( buf, n );
1656
YY_FATAL_ERROR( "out of dynamic memory in ncsa__scan_bytes()" );
1658
for ( i = 0; i < _yybytes_len; ++i )
1659
buf[i] = yybytes[i];
1661
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1663
b = ncsa__scan_buffer(buf,n );
1521
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1665
YY_FATAL_ERROR( "bad buffer in ncsa__scan_bytes()" );
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;
1533
#ifndef YY_NO_PUSH_STATE
1534
#ifdef YY_USE_PROTOS
1535
static void yy_push_state( int new_state )
1537
static void yy_push_state( new_state )
1541
if ( yy_start_stack_ptr >= yy_start_stack_depth )
1545
yy_start_stack_depth += YY_START_STACK_INCR;
1546
new_size = yy_start_stack_depth * sizeof( int );
1548
if ( ! yy_start_stack )
1549
yy_start_stack = (int *) yy_flex_alloc( new_size );
1552
yy_start_stack = (int *) yy_flex_realloc(
1553
(void *) yy_start_stack, new_size );
1555
if ( ! yy_start_stack )
1557
"out of memory expanding start-condition stack" );
1560
yy_start_stack[yy_start_stack_ptr++] = YY_START;
1567
#ifndef YY_NO_POP_STATE
1568
static void yy_pop_state()
1570
if ( --yy_start_stack_ptr < 0 )
1571
YY_FATAL_ERROR( "start-condition stack underflow" );
1573
BEGIN(yy_start_stack[yy_start_stack_ptr]);
1578
#ifndef YY_NO_TOP_STATE
1579
static int yy_top_state()
1581
return yy_start_stack[yy_start_stack_ptr - 1];
1585
1675
#ifndef YY_EXIT_FAILURE
1586
1676
#define YY_EXIT_FAILURE 2
1589
#ifdef YY_USE_PROTOS
1590
static void yy_fatal_error( yyconst char msg[] )
1592
static void yy_fatal_error( msg )
1596
(void) fprintf( stderr, "%s\n", msg );
1679
static void yy_fatal_error (yyconst char* msg )
1681
(void) fprintf( stderr, "%s\n", msg );
1597
1682
exit( YY_EXIT_FAILURE );
1602
1685
/* Redefine yyless() so it works in section 3 code. */
1605
1688
#define yyless(n) \
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'; \
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; \
1618
/* Internal utility routines. */
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. */
1704
/** Get the current line number.
1707
int ncsa_get_lineno (void)
1713
/** Get the input stream.
1716
FILE *ncsa_get_in (void)
1721
/** Get the output stream.
1724
FILE *ncsa_get_out (void)
1729
/** Get the length of the current token.
1732
int ncsa_get_leng (void)
1737
/** Get the current token.
1741
char *ncsa_get_text (void)
1746
/** Set the current line number.
1747
* @param line_number
1750
void ncsa_set_lineno (int line_number )
1753
ncsa_lineno = line_number;
1756
/** Set the input stream. This does not discard the current
1758
* @param in_str A readable stream.
1760
* @see ncsa__switch_to_buffer
1762
void ncsa_set_in (FILE * in_str )
1767
void ncsa_set_out (FILE * out_str )
1769
ncsa_out = out_str ;
1772
int ncsa_get_debug (void)
1774
return ncsa__flex_debug;
1777
void ncsa_set_debug (int bdebug )
1779
ncsa__flex_debug = bdebug ;
1782
static int yy_init_globals (void)
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.
1788
(yy_buffer_stack) = 0;
1789
(yy_buffer_stack_top) = 0;
1790
(yy_buffer_stack_max) = 0;
1791
(yy_c_buf_p) = (char *) 0;
1795
/* Defined in main.c */
1624
static void yy_flex_strncpy( s1, s2, n )
1800
ncsa_in = (FILE *) 0;
1801
ncsa_out = (FILE *) 0;
1804
/* For future reference: Set errno on error, since we are called by
1810
/* ncsa_lex_destroy is for both reentrant and non-reentrant scanners. */
1811
int ncsa_lex_destroy (void)
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();
1821
/* Destroy the stack itself. */
1822
ncsa_free((yy_buffer_stack) );
1823
(yy_buffer_stack) = NULL;
1825
/* Reset the globals. This is important in a non-reentrant scanner so the next time
1826
* ncsa_lex() is called, initialization will occur. */
1833
* Internal utility routines.
1837
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1630
1839
register int i;
1631
1840
for ( i = 0; i < n; ++i )
1636
1845
#ifdef YY_NEED_STRLEN
1637
#ifdef YY_USE_PROTOS
1638
static int yy_flex_strlen( yyconst char *s )
1640
static int yy_flex_strlen( s )
1846
static int yy_flex_strlen (yyconst char * s )
1644
1848
register int n;
1645
1849
for ( n = 0; s[n]; ++n )
1653
#ifdef YY_USE_PROTOS
1654
static void *yy_flex_alloc( yy_size_t size )
1656
static void *yy_flex_alloc( size )
1856
void *ncsa_alloc (yy_size_t size )
1660
1858
return (void *) malloc( size );
1663
#ifdef YY_USE_PROTOS
1664
static void *yy_flex_realloc( void *ptr, yy_size_t size )
1666
static void *yy_flex_realloc( ptr, size )
1861
void *ncsa_realloc (void * ptr, yy_size_t size )
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