1
/* A lexical scanner generated by flex */
3
/* Scanner skeleton version:
4
* $Header: /usr/people/mholst/cvsroot/fetk/maloc/src/vsh/vlex.c,v 1.10 2003/07/05 20:44:12 mholst Exp $
8
#define YY_FLEX_MAJOR_VERSION 2
9
#define YY_FLEX_MINOR_VERSION 5
14
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27
/* Use prototypes in function declarations. */
30
/* The "const" storage-class-modifier is valid. */
33
#else /* ! __cplusplus */
41
#endif /* ! __cplusplus */
60
#define YY_PROTO(proto) proto
62
#define YY_PROTO(proto) ()
65
/* Returned upon end-of-file. */
68
/* Promotes a possibly negative, possibly signed char to an unsigned
69
* integer for use as an array index. If the signed char is negative,
70
* we want to instead treat it as an 8-bit unsigned char, hence the
73
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75
/* Enter a start condition. This macro really ought to take a parameter,
76
* but we do it the disgusting crufty way forced on us by the ()-less
77
* definition of BEGIN.
79
#define BEGIN yy_start = 1 + 2 *
81
/* Translate the current start state into a value that can be later handed
82
* to BEGIN to return to the state. The YYSTATE alias is for lex
85
#define YY_START ((yy_start - 1) / 2)
86
#define YYSTATE YY_START
88
/* Action number for EOF rule of a given start state. */
89
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91
/* Special action meaning "start processing a new file". */
92
#define YY_NEW_FILE yyrestart( yyin )
94
#define YY_END_OF_BUFFER_CHAR 0
96
/* Size of default input buffer. */
97
#define YY_BUF_SIZE 16384
99
typedef struct yy_buffer_state *YY_BUFFER_STATE;
102
extern FILE *yyin, *yyout;
104
#define EOB_ACT_CONTINUE_SCAN 0
105
#define EOB_ACT_END_OF_FILE 1
106
#define EOB_ACT_LAST_MATCH 2
108
/* The funky do-while in the following #define is used to turn the definition
109
* int a single C statement (which needs a semi-colon terminator). This
110
* avoids problems with code like:
112
* if ( condition_holds )
115
* do_something_else();
117
* Prior to using the do-while the compiler would get upset at the
118
* "else" because it interpreted the "if" statement as being all
119
* done when it reached the ';' after the yyless() call.
122
/* Return all but the first 'n' matched characters back to the input stream. */
127
/* Undo effects of setting up yytext. */ \
128
*yy_cp = yy_hold_char; \
129
YY_RESTORE_YY_MORE_OFFSET \
130
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135
#define unput(c) yyunput( c, yytext_ptr )
137
/* The following is because we cannot portably get our hands on size_t
138
* (without autoconf's help, which isn't available because we want
139
* flex-generated scanners to compile on their own).
141
typedef unsigned int yy_size_t;
144
struct yy_buffer_state
148
char *yy_ch_buf; /* input buffer */
149
char *yy_buf_pos; /* current position in input buffer */
151
/* Size of input buffer in bytes, not including room for EOB
154
yy_size_t yy_buf_size;
156
/* Number of characters read into yy_ch_buf, not including EOB
161
/* Whether we "own" the buffer - i.e., we know we created it,
162
* and can realloc() it to grow it, and should free() it to
165
int yy_is_our_buffer;
167
/* Whether this is an "interactive" input source; if so, and
168
* if we're using stdio for input, then we want to use getc()
169
* instead of fread(), to make sure we stop fetching input after
172
int yy_is_interactive;
174
/* Whether we're considered to be at the beginning of a line.
175
* If so, '^' rules will be active on the next match, otherwise
180
/* Whether to try to fill the input buffer when we reach the
185
int yy_buffer_status;
186
#define YY_BUFFER_NEW 0
187
#define YY_BUFFER_NORMAL 1
188
/* When an EOF's been seen but there's still some text to process
189
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
190
* shouldn't try reading from the input source any more. We might
191
* still have a bunch of tokens to match, though, because of
192
* possible backing-up.
194
* When we actually see the EOF, we change the status to "new"
195
* (via yyrestart()), so that the user can continue scanning by
196
* just pointing yyin at a new input file.
198
#define YY_BUFFER_EOF_PENDING 2
201
static YY_BUFFER_STATE yy_current_buffer = 0;
203
/* We provide macros for accessing buffer states in case in the
204
* future we want to put the buffer states in a more general
207
#define YY_CURRENT_BUFFER yy_current_buffer
210
/* yy_hold_char holds the character lost when yytext is formed. */
211
static char yy_hold_char;
213
static int yy_n_chars; /* number of characters read into yy_ch_buf */
218
/* Points to current character in buffer. */
219
static char *yy_c_buf_p = (char *) 0;
220
static int yy_init = 1; /* whether we need to initialize */
221
static int yy_start = 0; /* start state number */
223
/* Flag which is used to allow yywrap()'s to do buffer switches
224
* instead of setting up a fresh yyin. A bit of a hack ...
226
static int yy_did_buffer_switch_on_eof;
228
void yyrestart YY_PROTO(( FILE *input_file ));
230
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231
void yy_load_buffer_state YY_PROTO(( void ));
232
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244
static void yy_flex_free YY_PROTO(( void * ));
246
#define yy_new_buffer yy_create_buffer
248
#define yy_set_interactive(is_interactive) \
250
if ( ! yy_current_buffer ) \
251
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252
yy_current_buffer->yy_is_interactive = is_interactive; \
255
#define yy_set_bol(at_bol) \
257
if ( ! yy_current_buffer ) \
258
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259
yy_current_buffer->yy_at_bol = at_bol; \
262
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264
typedef unsigned char YY_CHAR;
265
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266
typedef int yy_state_type;
268
#define yytext_ptr yytext
270
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272
static int yy_get_next_buffer YY_PROTO(( void ));
273
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
275
/* Done after the current pattern has been matched and before the
276
* corresponding action - sets up yytext.
278
#define YY_DO_BEFORE_ACTION \
279
yytext_ptr = yy_bp; \
280
yyleng = (int) (yy_cp - yy_bp); \
281
yy_hold_char = *yy_cp; \
285
#define YY_NUM_RULES 47
286
#define YY_END_OF_BUFFER 48
287
static yyconst short int yy_accept[103] =
289
0, 0, 48, 46, 1, 24, 46, 45, 45, 22,
290
46, 17, 18, 23, 19, 16, 20, 45, 46, 45,
291
46, 45, 45, 45, 45, 45, 45, 45, 45, 38,
292
21, 39, 2, 1, 1, 0, 41, 0, 0, 4,
293
45, 45, 6, 12, 0, 40, 0, 5, 10, 8,
294
13, 11, 9, 14, 45, 44, 45, 0, 0, 43,
295
3, 0, 0, 42, 45, 36, 45, 45, 29, 45,
296
25, 31, 45, 45, 45, 7, 2, 1, 41, 40,
297
15, 42, 45, 45, 45, 45, 45, 33, 45, 45,
298
45, 30, 37, 28, 27, 32, 26, 45, 45, 35,
303
static yyconst int yy_ec[256] =
305
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
306
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
307
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
308
1, 4, 1, 5, 6, 7, 7, 8, 9, 10,
309
11, 7, 7, 1, 12, 7, 7, 13, 13, 13,
310
13, 13, 13, 13, 13, 13, 13, 7, 14, 15,
311
16, 17, 1, 7, 18, 18, 18, 18, 18, 18,
312
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
313
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
314
19, 20, 21, 7, 18, 22, 23, 18, 24, 25,
316
26, 27, 18, 28, 29, 18, 18, 30, 18, 31,
317
32, 18, 18, 33, 34, 35, 36, 18, 37, 18,
318
18, 18, 38, 39, 40, 7, 1, 1, 1, 1,
319
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
321
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
323
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335
static yyconst int yy_meta[41] =
337
1, 1, 1, 1, 1, 2, 2, 1, 1, 1,
338
1, 2, 2, 1, 2, 3, 2, 2, 4, 2,
339
1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
340
2, 2, 2, 2, 2, 2, 2, 2, 2, 2
343
static yyconst short int yy_base[111] =
345
0, 38, 220, 221, 41, 221, 39, 59, 0, 38,
346
38, 221, 221, 205, 57, 221, 40, 76, 29, 187,
347
31, 166, 156, 22, 55, 59, 159, 155, 157, 0,
348
145, 0, 221, 115, 93, 115, 221, 116, 180, 221,
349
136, 0, 221, 221, 57, 221, 113, 221, 221, 170,
350
0, 221, 0, 0, 153, 221, 0, 103, 106, 108,
351
221, 110, 129, 221, 147, 149, 42, 156, 0, 145,
352
0, 0, 151, 141, 146, 0, 221, 159, 151, 122,
353
0, 144, 148, 146, 140, 128, 129, 0, 117, 114,
354
104, 0, 0, 0, 0, 0, 0, 68, 59, 0,
356
0, 221, 193, 197, 52, 201, 205, 208, 212, 215
359
static yyconst short int yy_def[111] =
361
102, 1, 102, 102, 102, 102, 103, 104, 105, 102,
362
106, 102, 102, 102, 105, 102, 105, 102, 107, 105,
363
108, 18, 18, 18, 18, 18, 18, 18, 18, 105,
364
105, 105, 102, 102, 102, 103, 102, 103, 109, 102,
365
104, 105, 102, 102, 106, 102, 106, 102, 102, 105,
366
105, 102, 105, 105, 110, 102, 18, 107, 107, 107,
367
102, 108, 108, 102, 18, 18, 18, 18, 18, 18,
368
18, 18, 18, 18, 18, 105, 102, 102, 103, 106,
369
105, 108, 18, 18, 18, 18, 18, 18, 18, 18,
370
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
372
18, 0, 102, 102, 102, 102, 102, 102, 102, 102
375
static yyconst short int yy_nxt[262] =
377
4, 5, 6, 5, 7, 8, 9, 10, 11, 12,
378
13, 9, 9, 14, 15, 16, 17, 18, 19, 20,
379
4, 21, 18, 22, 23, 24, 25, 18, 26, 18,
380
18, 18, 18, 18, 27, 28, 29, 30, 31, 32,
381
33, 34, 35, 37, 35, 43, 46, 52, 59, 60,
382
63, 67, 64, 42, 44, 68, 53, 47, 38, 39,
383
39, 40, 39, 39, 49, 46, 39, 39, 39, 39,
384
85, 50, 39, 51, 39, 86, 47, 39, 54, 39,
385
39, 42, 42, 69, 101, 71, 70, 42, 55, 72,
386
42, 56, 42, 57, 35, 42, 35, 100, 57, 57,
388
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
389
57, 57, 57, 42, 42, 42, 35, 77, 78, 37,
390
79, 80, 59, 60, 58, 59, 60, 59, 60, 63,
391
46, 64, 47, 99, 38, 38, 39, 39, 40, 39,
392
39, 47, 98, 39, 39, 39, 39, 97, 63, 39,
393
82, 39, 96, 95, 39, 37, 39, 39, 42, 42,
394
35, 77, 78, 63, 42, 64, 94, 42, 56, 42,
395
38, 93, 42, 92, 91, 90, 89, 88, 87, 84,
396
83, 81, 40, 76, 75, 74, 73, 66, 65, 61,
397
42, 42, 42, 36, 36, 36, 36, 41, 41, 41,
399
41, 45, 45, 45, 45, 58, 58, 58, 62, 62,
400
62, 62, 39, 39, 39, 39, 55, 55, 48, 102,
401
3, 102, 102, 102, 102, 102, 102, 102, 102, 102,
402
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
403
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
404
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
408
static yyconst short int yy_chk[262] =
410
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414
2, 2, 5, 7, 5, 10, 11, 17, 19, 19,
415
21, 24, 21, 105, 10, 24, 17, 11, 7, 8,
416
8, 8, 8, 8, 15, 45, 8, 8, 8, 8,
417
67, 15, 8, 15, 8, 67, 45, 8, 17, 8,
418
8, 18, 18, 25, 99, 26, 25, 18, 18, 26,
419
18, 18, 18, 18, 35, 18, 35, 98, 18, 18,
421
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
422
18, 18, 18, 18, 18, 18, 34, 34, 34, 36,
423
38, 47, 58, 58, 59, 59, 59, 60, 60, 62,
424
80, 62, 47, 91, 36, 38, 41, 41, 41, 41,
425
41, 80, 90, 41, 41, 41, 41, 89, 63, 41,
426
63, 41, 87, 86, 41, 79, 41, 41, 55, 55,
427
78, 78, 78, 82, 55, 82, 85, 55, 55, 55,
428
79, 84, 55, 83, 75, 74, 73, 70, 68, 66,
429
65, 50, 39, 31, 29, 28, 27, 23, 22, 20,
430
55, 55, 55, 103, 103, 103, 103, 104, 104, 104,
432
104, 106, 106, 106, 106, 107, 107, 107, 108, 108,
433
108, 108, 109, 109, 109, 109, 110, 110, 14, 3,
434
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
435
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
436
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
437
102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
441
static yy_state_type yy_last_accepting_state;
442
static char *yy_last_accepting_cpos;
444
/* The intent behind this definition is that it'll catch
445
* any uses of REJECT which flex missed.
447
#define REJECT reject_used_but_not_detected
448
#define yymore() yymore_used_but_not_detected
449
#define YY_MORE_ADJ 0
450
#define YY_RESTORE_YY_MORE_OFFSET
454
* ***************************************************************************
455
* MALOC = < Minimal Abstraction Layer for Object-oriented C >
456
* Copyright (C) 1994--2000 Michael Holst
458
* This program is free software; you can redistribute it and/or modify it
459
* under the terms of the GNU General Public License as published by the
460
* Free Software Foundation; either version 2 of the License, or (at your
461
* option) any later version.
463
* This program is distributed in the hope that it will be useful,
464
* but WITHOUT ANY WARRANTY; without even the implied warranty of
465
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
466
* See the GNU General Public License for more details.
468
* You should have received a copy of the GNU General Public License along
469
* with this program; if not, write to the Free Software Foundation, Inc.,
470
* 675 Mass Ave, Cambridge, MA 02139, USA.
472
* rcsid="$Id: vlex.c,v 1.10 2003/07/05 20:44:12 mholst Exp $"
473
* ***************************************************************************
476
* ***************************************************************************
479
* Purpose: Class Vsh: LEX Specification
481
* Author: Michael Holst
482
* ***************************************************************************
487
VEMBED(rcsid="$Id: vlex.c,v 1.10 2003/07/05 20:44:12 mholst Exp $")
489
#define YY_NO_UNPUT 1
491
#define YY_INPUT(buf,result,max_size) VSH_INPUT(buf,result,max_size)
496
* ***************************************************************************
498
* ***************************************************************************
501
* ***************************************************************************
503
* ***************************************************************************
506
/* Macros after this point can all be overridden by user definitions in
510
#ifndef YY_SKIP_YYWRAP
512
extern "C" int yywrap YY_PROTO(( void ));
514
extern int yywrap YY_PROTO(( void ));
519
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
523
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
526
#ifdef YY_NEED_STRLEN
527
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
532
static int yyinput YY_PROTO(( void ));
534
static int input YY_PROTO(( void ));
539
static int yy_start_stack_ptr = 0;
540
static int yy_start_stack_depth = 0;
541
static int *yy_start_stack = 0;
542
#ifndef YY_NO_PUSH_STATE
543
static void yy_push_state YY_PROTO(( int new_state ));
545
#ifndef YY_NO_POP_STATE
546
static void yy_pop_state YY_PROTO(( void ));
548
#ifndef YY_NO_TOP_STATE
549
static int yy_top_state YY_PROTO(( void ));
553
#define YY_NO_PUSH_STATE 1
554
#define YY_NO_POP_STATE 1
555
#define YY_NO_TOP_STATE 1
558
#ifdef YY_MALLOC_DECL
566
/* Just try to get by without declaring the routines. This will fail
567
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
568
* or sizeof(void*) != sizeof(int).
573
/* Amount of stuff to slurp up with each read. */
574
#ifndef YY_READ_BUF_SIZE
575
#define YY_READ_BUF_SIZE 8192
578
/* Copy whatever the last rule matched to the standard output. */
581
/* This used to be an fputs(), but since the string might contain NUL's,
582
* we now use fwrite().
584
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
587
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
588
* is returned in "result".
591
#define YY_INPUT(buf,result,max_size) \
592
if ( yy_current_buffer->yy_is_interactive ) \
595
for ( n = 0; n < max_size && \
596
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
599
buf[n++] = (char) c; \
600
if ( c == EOF && ferror( yyin ) ) \
601
YY_FATAL_ERROR( "input in flex scanner failed" ); \
604
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
605
&& ferror( yyin ) ) \
606
YY_FATAL_ERROR( "input in flex scanner failed" );
609
/* No semi-colon after return; correct usage is to write "yyterminate();" -
610
* we don't want an extra ';' after the "return" because that will cause
611
* some compilers to complain about unreachable statements.
614
#define yyterminate() return YY_NULL
617
/* Number of entries by which start-condition stack grows. */
618
#ifndef YY_START_STACK_INCR
619
#define YY_START_STACK_INCR 25
622
/* Report a fatal error. */
623
#ifndef YY_FATAL_ERROR
624
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
627
/* Default declaration of generated scanner - a define so the user can
628
* easily add parameters.
631
#define YY_DECL int yylex YY_PROTO(( void ))
634
/* Code executed at the beginning of each rule, after yytext and yyleng
637
#ifndef YY_USER_ACTION
638
#define YY_USER_ACTION
641
/* Code executed at the end of each rule. */
643
#define YY_BREAK break;
646
#define YY_RULE_SETUP \
648
yy_current_buffer->yy_at_bol = \
649
(yytext[yyleng - 1] == '\n'); \
654
register yy_state_type yy_current_state;
655
register char *yy_cp, *yy_bp;
661
* ***********************************************************************
663
* ***********************************************************************
676
yy_start = 1; /* first start state */
684
if ( ! yy_current_buffer )
686
yy_create_buffer( yyin, YY_BUF_SIZE );
688
yy_load_buffer_state();
691
while ( 1 ) /* loops until end-of-file is reached */
695
/* Support of yytext. */
696
*yy_cp = yy_hold_char;
698
/* yy_bp points to the position in yy_ch_buf of the start of
703
yy_current_state = yy_start;
704
yy_current_state += YY_AT_BOL();
708
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
709
if ( yy_accept[yy_current_state] )
711
yy_last_accepting_state = yy_current_state;
712
yy_last_accepting_cpos = yy_cp;
714
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
716
yy_current_state = (int) yy_def[yy_current_state];
717
if ( yy_current_state >= 103 )
718
yy_c = yy_meta[(unsigned int) yy_c];
720
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
723
while ( yy_base[yy_current_state] != 221 );
726
yy_act = yy_accept[yy_current_state];
728
{ /* have to back up */
729
yy_cp = yy_last_accepting_cpos;
730
yy_current_state = yy_last_accepting_state;
731
yy_act = yy_accept[yy_current_state];
737
do_action: /* This label is used only to access EOF actions. */
741
{ /* beginning of action switch */
742
case 0: /* must back up */
743
/* undo the effects of YY_DO_BEFORE_ACTION */
744
*yy_cp = yy_hold_char;
745
yy_cp = yy_last_accepting_cpos;
746
yy_current_state = yy_last_accepting_state;
751
{ /* no-op: ignore white space between tokens */ }
755
{ Vsh_trace("Lex","line of zero or more blanks with a newline"); }
759
{ Vsh_trace("Lex","an escaped newline"); }
762
* ***********************************************************************
764
* ***********************************************************************
766
/* ignore shell-style "to-end-of-line" comments (OReilly, page 31) */
769
{ Vsh_trace("Lex","single-line ``#'' comment"); }
772
* ***********************************************************************
773
* Legal 2-character symbol tokens (must encode them...)
774
* ***********************************************************************
779
Vsh_trace("Lex",yytext);
786
Vsh_trace("Lex",yytext);
793
Vsh_trace("Lex",yytext);
800
Vsh_trace("Lex",yytext);
807
Vsh_trace("Lex",yytext);
808
return GREATER_GREATER;
814
Vsh_trace("Lex",yytext);
821
Vsh_trace("Lex",yytext);
828
Vsh_trace("Lex",yytext);
835
Vsh_trace("Lex",yytext);
842
Vsh_trace("Lex",yytext);
847
* ***********************************************************************
848
* Legal 3-character symbol tokens (must encode them...)
849
* ***********************************************************************
854
Vsh_trace("Lex",yytext);
855
return LESS_LESS_MINUS;
859
* ***********************************************************************
860
* Legal 1-character symbol tokens (just forward them to the parser...)
861
* ***********************************************************************
874
Vsh_trace("Lex",yytext);
879
* ***********************************************************************
881
* ***********************************************************************
886
Vsh_trace("Lex","IF");
893
Vsh_trace("Lex","THEN");
900
Vsh_trace("Lex","ELSE");
907
Vsh_trace("Lex","ELIF");
914
Vsh_trace("Lex","FI");
921
Vsh_trace("Lex","CASE");
928
Vsh_trace("Lex","IN");
935
Vsh_trace("Lex","ESAC");
942
Vsh_trace("Lex","FOR");
949
Vsh_trace("Lex","WHILE");
956
Vsh_trace("Lex","UNTIL");
963
Vsh_trace("Lex","DO");
970
Vsh_trace("Lex","DONE");
977
Vsh_trace("Lex",yytext);
984
Vsh_trace("Lex",yytext);
989
* ***********************************************************************
991
* ***********************************************************************
996
Vsh_trace("Lex","WORD-SSTRING");
997
yylval.word = (WORD_DESC*)malloc(sizeof(WORD_DESC));
998
yylval.word->word = (char*)malloc(1024*sizeof(char));
999
strcpy(yylval.word->word,yytext);
1000
yylval.word->dollar_present = 0;
1001
yylval.word->quoted = 1;
1002
yylval.word->assignment = 0;
1009
Vsh_trace("Lex","WORD-DSTRING");
1010
yylval.word = (WORD_DESC*)malloc(sizeof(WORD_DESC));
1011
yylval.word->word = (char*)malloc(1024*sizeof(char));
1012
strcpy(yylval.word->word,yytext);
1013
yylval.word->dollar_present = 0;
1014
yylval.word->quoted = 1;
1015
yylval.word->assignment = 0;
1022
Vsh_trace("Lex","WORD-EXEC");
1023
yylval.word = (WORD_DESC*)malloc(sizeof(WORD_DESC));
1024
yylval.word->word = (char*)malloc(1024*sizeof(char));
1025
strcpy(yylval.word->word,yytext);
1026
yylval.word->dollar_present = 0;
1027
yylval.word->quoted = 1;
1028
yylval.word->assignment = 0;
1035
Vsh_trace("Lex","WORD-CONDITION");
1036
yylval.word = (WORD_DESC*)malloc(sizeof(WORD_DESC));
1037
yylval.word->word = (char*)malloc(1024*sizeof(char));
1038
strcpy(yylval.word->word,yytext);
1039
yylval.word->dollar_present = 0;
1040
yylval.word->quoted = 0;
1041
yylval.word->assignment = 0;
1048
/* struct symtab *sp = symlook(yytext); */
1049
/* yylval.symp = sp; */
1050
Vsh_trace("Lex","WORD-ASSIGN");
1051
yylval.word = (WORD_DESC*)malloc(sizeof(WORD_DESC));
1052
yylval.word->word = (char*)malloc(1024*sizeof(char));
1053
strcpy(yylval.word->word,yytext);
1054
VASSERT( yylval.word->word[strlen(yylval.word->word)-1] == '=' );
1055
yylval.word->word[strlen(yylval.word->word)-1] = '\0';
1056
yylval.word->dollar_present = 0;
1057
yylval.word->quoted = 0;
1058
yylval.word->assignment = 1;
1059
return ASSIGNMENT_WORD;
1065
/* struct symtab *sp = symlook(yytext); */
1066
/* yylval.symp = sp; */
1067
Vsh_trace("Lex","WORD");
1068
yylval.word = (WORD_DESC*)malloc(sizeof(WORD_DESC));
1069
yylval.word->word = (char*)malloc(1024*sizeof(char));
1070
strcpy(yylval.word->word,yytext);
1071
yylval.word->dollar_present = 0;
1072
yylval.word->quoted = 0;
1073
yylval.word->assignment = 0;
1077
case YY_STATE_EOF(INITIAL):
1079
Vsh_trace("Lex","vsh_EOF");
1084
* ***********************************************************************
1085
* Catchall (error exit)
1086
* ***********************************************************************
1091
yyerror("bad token");
1099
case YY_END_OF_BUFFER:
1101
/* Amount of text matched not including the EOB char. */
1102
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1104
/* Undo the effects of YY_DO_BEFORE_ACTION. */
1105
*yy_cp = yy_hold_char;
1106
YY_RESTORE_YY_MORE_OFFSET
1108
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1110
/* We're scanning a new file or input source. It's
1111
* possible that this happened because the user
1112
* just pointed yyin at a new source and called
1113
* yylex(). If so, then we have to assure
1114
* consistency between yy_current_buffer and our
1115
* globals. Here is the right place to do so, because
1116
* this is the first action (other than possibly a
1117
* back-up) that will match for the new input source.
1119
yy_n_chars = yy_current_buffer->yy_n_chars;
1120
yy_current_buffer->yy_input_file = yyin;
1121
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1124
/* Note that here we test for yy_c_buf_p "<=" to the position
1125
* of the first EOB in the buffer, since yy_c_buf_p will
1126
* already have been incremented past the NUL character
1127
* (since all states make transitions on EOB to the
1128
* end-of-buffer state). Contrast this with the test
1131
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1132
{ /* This was really a NUL. */
1133
yy_state_type yy_next_state;
1135
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1137
yy_current_state = yy_get_previous_state();
1139
/* Okay, we're now positioned to make the NUL
1140
* transition. We couldn't have
1141
* yy_get_previous_state() go ahead and do it
1142
* for us because it doesn't know how to deal
1143
* with the possibility of jamming (and we don't
1144
* want to build jamming into it because then it
1145
* will run more slowly).
1148
yy_next_state = yy_try_NUL_trans( yy_current_state );
1150
yy_bp = yytext_ptr + YY_MORE_ADJ;
1152
if ( yy_next_state )
1154
/* Consume the NUL. */
1155
yy_cp = ++yy_c_buf_p;
1156
yy_current_state = yy_next_state;
1163
goto yy_find_action;
1167
else switch ( yy_get_next_buffer() )
1169
case EOB_ACT_END_OF_FILE:
1171
yy_did_buffer_switch_on_eof = 0;
1175
/* Note: because we've taken care in
1176
* yy_get_next_buffer() to have set up
1177
* yytext, we can now set up
1178
* yy_c_buf_p so that if some total
1179
* hoser (like flex itself) wants to
1180
* call the scanner after we return the
1181
* YY_NULL, it'll still work - another
1182
* YY_NULL will get returned.
1184
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1186
yy_act = YY_STATE_EOF(YY_START);
1192
if ( ! yy_did_buffer_switch_on_eof )
1198
case EOB_ACT_CONTINUE_SCAN:
1200
yytext_ptr + yy_amount_of_matched_text;
1202
yy_current_state = yy_get_previous_state();
1205
yy_bp = yytext_ptr + YY_MORE_ADJ;
1208
case EOB_ACT_LAST_MATCH:
1210
&yy_current_buffer->yy_ch_buf[yy_n_chars];
1212
yy_current_state = yy_get_previous_state();
1215
yy_bp = yytext_ptr + YY_MORE_ADJ;
1216
goto yy_find_action;
1223
"fatal flex scanner internal error--no action found" );
1224
} /* end of action switch */
1225
} /* end of scanning one token */
1226
} /* end of yylex */
1229
/* yy_get_next_buffer - try to read in a new buffer
1231
* Returns a code representing an action:
1232
* EOB_ACT_LAST_MATCH -
1233
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1234
* EOB_ACT_END_OF_FILE - end of file
1237
static int yy_get_next_buffer()
1239
register char *dest = yy_current_buffer->yy_ch_buf;
1240
register char *source = yytext_ptr;
1241
register int number_to_move, i;
1244
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1246
"fatal flex scanner internal error--end of buffer missed" );
1248
if ( yy_current_buffer->yy_fill_buffer == 0 )
1249
{ /* Don't try to fill the buffer, so this is an EOF. */
1250
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1252
/* We matched a single character, the EOB, so
1253
* treat this as a final EOF.
1255
return EOB_ACT_END_OF_FILE;
1260
/* We matched some text prior to the EOB, first
1263
return EOB_ACT_LAST_MATCH;
1267
/* Try to read more data. */
1269
/* First move last chars to start of buffer. */
1270
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1272
for ( i = 0; i < number_to_move; ++i )
1273
*(dest++) = *(source++);
1275
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1276
/* don't do the read, it's not guaranteed to return an EOF,
1279
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1284
yy_current_buffer->yy_buf_size - number_to_move - 1;
1286
while ( num_to_read <= 0 )
1287
{ /* Not enough room in the buffer - grow it. */
1288
#ifdef YY_USES_REJECT
1290
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1293
/* just a shorter name for the current buffer */
1294
YY_BUFFER_STATE b = yy_current_buffer;
1296
int yy_c_buf_p_offset =
1297
(int) (yy_c_buf_p - b->yy_ch_buf);
1299
if ( b->yy_is_our_buffer )
1301
int new_size = b->yy_buf_size * 2;
1303
if ( new_size <= 0 )
1304
b->yy_buf_size += b->yy_buf_size / 8;
1306
b->yy_buf_size *= 2;
1308
b->yy_ch_buf = (char *)
1309
/* Include room in for 2 EOB chars. */
1310
yy_flex_realloc( (void *) b->yy_ch_buf,
1311
b->yy_buf_size + 2 );
1314
/* Can't grow it, we don't own it. */
1317
if ( ! b->yy_ch_buf )
1319
"fatal error - scanner input buffer overflow" );
1321
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1323
num_to_read = yy_current_buffer->yy_buf_size -
1328
if ( num_to_read > YY_READ_BUF_SIZE )
1329
num_to_read = YY_READ_BUF_SIZE;
1331
/* Read in more data. */
1332
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1333
yy_n_chars, num_to_read );
1335
yy_current_buffer->yy_n_chars = yy_n_chars;
1338
if ( yy_n_chars == 0 )
1340
if ( number_to_move == YY_MORE_ADJ )
1342
ret_val = EOB_ACT_END_OF_FILE;
1348
ret_val = EOB_ACT_LAST_MATCH;
1349
yy_current_buffer->yy_buffer_status =
1350
YY_BUFFER_EOF_PENDING;
1355
ret_val = EOB_ACT_CONTINUE_SCAN;
1357
yy_n_chars += number_to_move;
1358
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1359
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1361
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1367
/* yy_get_previous_state - get the state just before the EOB char was reached */
1369
static yy_state_type yy_get_previous_state()
1371
register yy_state_type yy_current_state;
1372
register char *yy_cp;
1374
yy_current_state = yy_start;
1375
yy_current_state += YY_AT_BOL();
1377
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1379
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1380
if ( yy_accept[yy_current_state] )
1382
yy_last_accepting_state = yy_current_state;
1383
yy_last_accepting_cpos = yy_cp;
1385
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1387
yy_current_state = (int) yy_def[yy_current_state];
1388
if ( yy_current_state >= 103 )
1389
yy_c = yy_meta[(unsigned int) yy_c];
1391
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1394
return yy_current_state;
1398
/* yy_try_NUL_trans - try to make a transition on the NUL character
1401
* next_state = yy_try_NUL_trans( current_state );
1404
#ifdef YY_USE_PROTOS
1405
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1407
static yy_state_type yy_try_NUL_trans( yy_current_state )
1408
yy_state_type yy_current_state;
1411
register int yy_is_jam;
1412
register char *yy_cp = yy_c_buf_p;
1414
register YY_CHAR yy_c = 1;
1415
if ( yy_accept[yy_current_state] )
1417
yy_last_accepting_state = yy_current_state;
1418
yy_last_accepting_cpos = yy_cp;
1420
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1422
yy_current_state = (int) yy_def[yy_current_state];
1423
if ( yy_current_state >= 103 )
1424
yy_c = yy_meta[(unsigned int) yy_c];
1426
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1427
yy_is_jam = (yy_current_state == 102);
1429
return yy_is_jam ? 0 : yy_current_state;
1434
#ifdef YY_USE_PROTOS
1435
static void yyunput( int c, register char *yy_bp )
1437
static void yyunput( c, yy_bp )
1439
register char *yy_bp;
1442
register char *yy_cp = yy_c_buf_p;
1444
/* undo effects of setting up yytext */
1445
*yy_cp = yy_hold_char;
1447
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1448
{ /* need to shift things up to make room */
1449
/* +2 for EOB chars. */
1450
register int number_to_move = yy_n_chars + 2;
1451
register char *dest = &yy_current_buffer->yy_ch_buf[
1452
yy_current_buffer->yy_buf_size + 2];
1453
register char *source =
1454
&yy_current_buffer->yy_ch_buf[number_to_move];
1456
while ( source > yy_current_buffer->yy_ch_buf )
1457
*--dest = *--source;
1459
yy_cp += (int) (dest - source);
1460
yy_bp += (int) (dest - source);
1461
yy_current_buffer->yy_n_chars =
1462
yy_n_chars = yy_current_buffer->yy_buf_size;
1464
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1465
YY_FATAL_ERROR( "flex scanner push-back overflow" );
1468
*--yy_cp = (char) c;
1472
yy_hold_char = *yy_cp;
1475
#endif /* ifndef YY_NO_UNPUT */
1479
static int yyinput()
1486
*yy_c_buf_p = yy_hold_char;
1488
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1490
/* yy_c_buf_p now points to the character we want to return.
1491
* If this occurs *before* the EOB characters, then it's a
1492
* valid NUL; if not, then we've hit the end of the buffer.
1494
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1495
/* This was really a NUL. */
1499
{ /* need more input */
1500
int offset = yy_c_buf_p - yytext_ptr;
1503
switch ( yy_get_next_buffer() )
1505
case EOB_ACT_LAST_MATCH:
1506
/* This happens because yy_g_n_b()
1507
* sees that we've accumulated a
1508
* token and flags that we need to
1509
* try matching the token before
1510
* proceeding. But for input(),
1511
* there's no matching to consider.
1512
* So convert the EOB_ACT_LAST_MATCH
1513
* to EOB_ACT_END_OF_FILE.
1516
/* Reset buffer status. */
1521
case EOB_ACT_END_OF_FILE:
1526
if ( ! yy_did_buffer_switch_on_eof )
1535
case EOB_ACT_CONTINUE_SCAN:
1536
yy_c_buf_p = yytext_ptr + offset;
1542
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1543
*yy_c_buf_p = '\0'; /* preserve yytext */
1544
yy_hold_char = *++yy_c_buf_p;
1546
yy_current_buffer->yy_at_bol = (c == '\n');
1552
#ifdef YY_USE_PROTOS
1553
void yyrestart( FILE *input_file )
1555
void yyrestart( input_file )
1559
if ( ! yy_current_buffer )
1560
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1562
yy_init_buffer( yy_current_buffer, input_file );
1563
yy_load_buffer_state();
1567
#ifdef YY_USE_PROTOS
1568
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1570
void yy_switch_to_buffer( new_buffer )
1571
YY_BUFFER_STATE new_buffer;
1574
if ( yy_current_buffer == new_buffer )
1577
if ( yy_current_buffer )
1579
/* Flush out information for old buffer. */
1580
*yy_c_buf_p = yy_hold_char;
1581
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1582
yy_current_buffer->yy_n_chars = yy_n_chars;
1585
yy_current_buffer = new_buffer;
1586
yy_load_buffer_state();
1588
/* We don't actually know whether we did this switch during
1589
* EOF (yywrap()) processing, but the only time this flag
1590
* is looked at is after yywrap() is called, so it's safe
1591
* to go ahead and always set it.
1593
yy_did_buffer_switch_on_eof = 1;
1597
#ifdef YY_USE_PROTOS
1598
void yy_load_buffer_state( void )
1600
void yy_load_buffer_state()
1603
yy_n_chars = yy_current_buffer->yy_n_chars;
1604
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1605
yyin = yy_current_buffer->yy_input_file;
1606
yy_hold_char = *yy_c_buf_p;
1610
#ifdef YY_USE_PROTOS
1611
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1613
YY_BUFFER_STATE yy_create_buffer( file, size )
1620
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1622
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1624
b->yy_buf_size = size;
1626
/* yy_ch_buf has to be 2 characters longer than the size given because
1627
* we need to put in 2 end-of-buffer characters.
1629
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1630
if ( ! b->yy_ch_buf )
1631
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1633
b->yy_is_our_buffer = 1;
1635
yy_init_buffer( b, file );
1641
#ifdef YY_USE_PROTOS
1642
void yy_delete_buffer( YY_BUFFER_STATE b )
1644
void yy_delete_buffer( b )
1651
if ( b == yy_current_buffer )
1652
yy_current_buffer = (YY_BUFFER_STATE) 0;
1654
if ( b->yy_is_our_buffer )
1655
yy_flex_free( (void *) b->yy_ch_buf );
1657
yy_flex_free( (void *) b );
1661
#ifndef YY_ALWAYS_INTERACTIVE
1662
#ifndef YY_NEVER_INTERACTIVE
1667
#ifdef YY_USE_PROTOS
1668
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1670
void yy_init_buffer( b, file )
1677
yy_flush_buffer( b );
1679
b->yy_input_file = file;
1680
b->yy_fill_buffer = 1;
1682
#if YY_ALWAYS_INTERACTIVE
1683
b->yy_is_interactive = 1;
1685
#if YY_NEVER_INTERACTIVE
1686
b->yy_is_interactive = 0;
1688
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1694
#ifdef YY_USE_PROTOS
1695
void yy_flush_buffer( YY_BUFFER_STATE b )
1697
void yy_flush_buffer( b )
1707
/* We always need two end-of-buffer characters. The first causes
1708
* a transition to the end-of-buffer state. The second causes
1709
* a jam in that state.
1711
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1712
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1714
b->yy_buf_pos = &b->yy_ch_buf[0];
1717
b->yy_buffer_status = YY_BUFFER_NEW;
1719
if ( b == yy_current_buffer )
1720
yy_load_buffer_state();
1724
#ifndef YY_NO_SCAN_BUFFER
1725
#ifdef YY_USE_PROTOS
1726
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1728
YY_BUFFER_STATE yy_scan_buffer( base, size )
1736
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1737
base[size-1] != YY_END_OF_BUFFER_CHAR )
1738
/* They forgot to leave room for the EOB's. */
1741
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1743
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1745
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1746
b->yy_buf_pos = b->yy_ch_buf = base;
1747
b->yy_is_our_buffer = 0;
1748
b->yy_input_file = 0;
1749
b->yy_n_chars = b->yy_buf_size;
1750
b->yy_is_interactive = 0;
1752
b->yy_fill_buffer = 0;
1753
b->yy_buffer_status = YY_BUFFER_NEW;
1755
yy_switch_to_buffer( b );
1762
#ifndef YY_NO_SCAN_STRING
1763
#ifdef YY_USE_PROTOS
1764
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1766
YY_BUFFER_STATE yy_scan_string( yy_str )
1767
yyconst char *yy_str;
1771
for ( len = 0; yy_str[len]; ++len )
1774
return yy_scan_bytes( yy_str, len );
1779
#ifndef YY_NO_SCAN_BYTES
1780
#ifdef YY_USE_PROTOS
1781
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1783
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1784
yyconst char *bytes;
1793
/* Get memory for full buffer, including space for trailing EOB's. */
1795
buf = (char *) yy_flex_alloc( n );
1797
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1799
for ( i = 0; i < len; ++i )
1802
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1804
b = yy_scan_buffer( buf, n );
1806
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1808
/* It's okay to grow etc. this buffer, and we should throw it
1809
* away when we're done.
1811
b->yy_is_our_buffer = 1;
1818
#ifndef YY_NO_PUSH_STATE
1819
#ifdef YY_USE_PROTOS
1820
static void yy_push_state( int new_state )
1822
static void yy_push_state( new_state )
1826
if ( yy_start_stack_ptr >= yy_start_stack_depth )
1830
yy_start_stack_depth += YY_START_STACK_INCR;
1831
new_size = yy_start_stack_depth * sizeof( int );
1833
if ( ! yy_start_stack )
1834
yy_start_stack = (int *) yy_flex_alloc( new_size );
1837
yy_start_stack = (int *) yy_flex_realloc(
1838
(void *) yy_start_stack, new_size );
1840
if ( ! yy_start_stack )
1842
"out of memory expanding start-condition stack" );
1845
yy_start_stack[yy_start_stack_ptr++] = YY_START;
1852
#ifndef YY_NO_POP_STATE
1853
static void yy_pop_state()
1855
if ( --yy_start_stack_ptr < 0 )
1856
YY_FATAL_ERROR( "start-condition stack underflow" );
1858
BEGIN(yy_start_stack[yy_start_stack_ptr]);
1863
#ifndef YY_NO_TOP_STATE
1864
static int yy_top_state()
1866
return yy_start_stack[yy_start_stack_ptr - 1];
1870
#ifndef YY_EXIT_FAILURE
1871
#define YY_EXIT_FAILURE 2
1874
#ifdef YY_USE_PROTOS
1875
static void yy_fatal_error( yyconst char msg[] )
1877
static void yy_fatal_error( msg )
1881
(void) fprintf( stderr, "%s\n", msg );
1882
exit( YY_EXIT_FAILURE );
1887
/* Redefine yyless() so it works in section 3 code. */
1893
/* Undo effects of setting up yytext. */ \
1894
yytext[yyleng] = yy_hold_char; \
1895
yy_c_buf_p = yytext + n; \
1896
yy_hold_char = *yy_c_buf_p; \
1897
*yy_c_buf_p = '\0'; \
1903
/* Internal utility routines. */
1906
#ifdef YY_USE_PROTOS
1907
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1909
static void yy_flex_strncpy( s1, s2, n )
1916
for ( i = 0; i < n; ++i )
1921
#ifdef YY_NEED_STRLEN
1922
#ifdef YY_USE_PROTOS
1923
static int yy_flex_strlen( yyconst char *s )
1925
static int yy_flex_strlen( s )
1930
for ( n = 0; s[n]; ++n )
1938
#ifdef YY_USE_PROTOS
1939
static void *yy_flex_alloc( yy_size_t size )
1941
static void *yy_flex_alloc( size )
1945
return (void *) malloc( size );
1948
#ifdef YY_USE_PROTOS
1949
static void *yy_flex_realloc( void *ptr, yy_size_t size )
1951
static void *yy_flex_realloc( ptr, size )
1956
/* The cast to (char *) in the following accommodates both
1957
* implementations that use char* generic pointers, and those
1958
* that use void* generic pointers. It works with the latter
1959
* because both ANSI C and C++ allow castless assignment from
1960
* any pointer type to void*, and deal with argument conversions
1961
* as though doing an assignment.
1963
return (void *) realloc( (char *) ptr, size );
1966
#ifdef YY_USE_PROTOS
1967
static void yy_flex_free( void *ptr )
1969
static void yy_flex_free( ptr )