1
/* A lexical scanner generated by flex */
3
/* Scanner skeleton version:
4
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
8
#define YY_FLEX_MAJOR_VERSION 2
9
#define YY_FLEX_MINOR_VERSION 5
15
/* 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 24
286
#define YY_END_OF_BUFFER 25
287
static yyconst short int yy_accept[75] =
289
0, 0, 0, 0, 0, 0, 0, 0, 25, 24,
290
24, 24, 2, 24, 9, 10, 11, 12, 8, 7,
291
5, 14, 13, 22, 24, 0, 4, 0, 0, 1,
292
3, 0, 6, 21, 23, 0, 0, 0, 0, 0,
293
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
294
0, 0, 0, 0, 16, 15, 0, 0, 0, 0,
295
0, 19, 18, 0, 0, 0, 0, 0, 0, 0,
299
static yyconst int yy_ec[256] =
301
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
302
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
303
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
304
1, 1, 1, 1, 3, 4, 5, 6, 1, 1,
305
1, 1, 1, 1, 1, 1, 7, 1, 1, 1,
306
1, 1, 1, 1, 1, 1, 1, 1, 1, 8,
307
1, 9, 1, 10, 1, 1, 1, 1, 1, 1,
308
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
309
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
310
1, 11, 1, 12, 1, 1, 1, 13, 14, 15,
312
16, 1, 17, 1, 18, 1, 1, 1, 1, 19,
313
20, 1, 1, 21, 1, 1, 1, 22, 1, 1,
314
1, 1, 23, 1, 24, 25, 1, 1, 1, 1,
315
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
316
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318
1, 1, 1, 1, 1, 1, 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,
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,
326
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331
static yyconst int yy_meta[26] =
333
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338
static yyconst short int yy_base[77] =
340
0, 0, 0, 7, 16, 0, 1, 8, 76, 77,
341
73, 9, 64, 22, 77, 77, 77, 77, 77, 77,
342
63, 77, 77, 66, 22, 69, 77, 50, 53, 77,
343
77, 52, 77, 77, 16, 51, 51, 44, 47, 43,
344
46, 42, 44, 46, 40, 42, 35, 40, 45, 44,
345
33, 35, 37, 26, 77, 77, 25, 38, 37, 31,
346
30, 77, 77, 23, 22, 25, 24, 21, 20, 10,
350
static yyconst short int yy_def[77] =
352
75, 75, 75, 75, 75, 5, 75, 75, 74, 74,
353
76, 74, 74, 74, 74, 74, 74, 74, 74, 74,
354
74, 74, 74, 74, 74, 76, 74, 74, 74, 74,
355
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
356
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
357
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
358
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
359
74, 74, 74, 0, 74, 74
362
static yyconst short int yy_nxt[103] =
364
26, 10, 74, 74, 11, 74, 24, 12, 25, 13,
365
14, 11, 74, 24, 12, 25, 13, 14, 15, 16,
366
17, 18, 28, 19, 20, 21, 31, 22, 35, 40,
367
29, 73, 36, 72, 32, 71, 70, 41, 69, 68,
368
23, 67, 66, 65, 64, 63, 62, 61, 60, 59,
369
58, 57, 56, 55, 54, 53, 52, 51, 50, 49,
370
48, 47, 46, 45, 44, 43, 42, 39, 38, 37,
371
27, 34, 33, 30, 27, 74, 9, 74, 74, 74,
372
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
373
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
378
static yyconst short int yy_chk[103] =
380
76, 75, 0, 0, 3, 0, 7, 3, 7, 3,
381
3, 4, 0, 8, 4, 8, 4, 4, 5, 5,
382
5, 5, 12, 5, 5, 5, 14, 5, 25, 35,
383
12, 71, 25, 70, 14, 69, 68, 35, 67, 66,
384
5, 65, 64, 61, 60, 59, 58, 57, 54, 53,
385
52, 51, 50, 49, 48, 47, 46, 45, 44, 43,
386
42, 41, 40, 39, 38, 37, 36, 32, 29, 28,
387
26, 24, 21, 13, 11, 9, 74, 74, 74, 74,
388
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
389
74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
394
static yy_state_type yy_last_accepting_state;
395
static char *yy_last_accepting_cpos;
397
/* The intent behind this definition is that it'll catch
398
* any uses of REJECT which flex missed.
400
#define REJECT reject_used_but_not_detected
401
#define yymore() yymore_used_but_not_detected
402
#define YY_MORE_ADJ 0
403
#define YY_RESTORE_YY_MORE_OFFSET
405
#line 1 "sgmlverb.lex"
407
/* This Lex script acts as a filter to pre-process Latex files.
408
It surrounds groups of lines beginning with a ">" sign, and
409
preceded and followed by a blank line, with \begin{verbatim}
410
and \end{verbatim}. The ">" may be preceded by a digit or digit
411
range (eg 4>, 2-5>, 3->); in this case the digits are removed.
412
They are meant to be used for filtering out versions.
413
It takes words surrounded with @ signs (thus @letrec@) and makes them
414
come out in typewriter font, regardless of the current mode.
420
#line 20 "sgmlverb.lex"
421
#define PUSH states[top++] =
422
#define POP BEGIN states[--top]
425
/* Macros after this point can all be overridden by user definitions in
429
#ifndef YY_SKIP_YYWRAP
431
extern "C" int yywrap YY_PROTO(( void ));
433
extern int yywrap YY_PROTO(( void ));
438
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
442
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
445
#ifdef YY_NEED_STRLEN
446
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
451
static int yyinput YY_PROTO(( void ));
453
static int input YY_PROTO(( void ));
458
static int yy_start_stack_ptr = 0;
459
static int yy_start_stack_depth = 0;
460
static int *yy_start_stack = 0;
461
#ifndef YY_NO_PUSH_STATE
462
static void yy_push_state YY_PROTO(( int new_state ));
464
#ifndef YY_NO_POP_STATE
465
static void yy_pop_state YY_PROTO(( void ));
467
#ifndef YY_NO_TOP_STATE
468
static int yy_top_state YY_PROTO(( void ));
472
#define YY_NO_PUSH_STATE 1
473
#define YY_NO_POP_STATE 1
474
#define YY_NO_TOP_STATE 1
477
#ifdef YY_MALLOC_DECL
485
/* Just try to get by without declaring the routines. This will fail
486
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
487
* or sizeof(void*) != sizeof(int).
492
/* Amount of stuff to slurp up with each read. */
493
#ifndef YY_READ_BUF_SIZE
494
#define YY_READ_BUF_SIZE 8192
497
/* Copy whatever the last rule matched to the standard output. */
500
/* This used to be an fputs(), but since the string might contain NUL's,
501
* we now use fwrite().
503
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
506
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
507
* is returned in "result".
510
#define YY_INPUT(buf,result,max_size) \
511
if ( yy_current_buffer->yy_is_interactive ) \
514
for ( n = 0; n < max_size && \
515
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
518
buf[n++] = (char) c; \
519
if ( c == EOF && ferror( yyin ) ) \
520
YY_FATAL_ERROR( "input in flex scanner failed" ); \
523
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
524
&& ferror( yyin ) ) \
525
YY_FATAL_ERROR( "input in flex scanner failed" );
528
/* No semi-colon after return; correct usage is to write "yyterminate();" -
529
* we don't want an extra ';' after the "return" because that will cause
530
* some compilers to complain about unreachable statements.
533
#define yyterminate() return YY_NULL
536
/* Number of entries by which start-condition stack grows. */
537
#ifndef YY_START_STACK_INCR
538
#define YY_START_STACK_INCR 25
541
/* Report a fatal error. */
542
#ifndef YY_FATAL_ERROR
543
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
546
/* Default declaration of generated scanner - a define so the user can
547
* easily add parameters.
550
#define YY_DECL int yylex YY_PROTO(( void ))
553
/* Code executed at the beginning of each rule, after yytext and yyleng
556
#ifndef YY_USER_ACTION
557
#define YY_USER_ACTION
560
/* Code executed at the end of each rule. */
562
#define YY_BREAK break;
565
#define YY_RULE_SETUP \
570
register yy_state_type yy_current_state;
571
register char *yy_cp = NULL, *yy_bp = NULL;
574
#line 24 "sgmlverb.lex"
590
yy_start = 1; /* first start state */
598
if ( ! yy_current_buffer )
600
yy_create_buffer( yyin, YY_BUF_SIZE );
602
yy_load_buffer_state();
605
while ( 1 ) /* loops until end-of-file is reached */
609
/* Support of yytext. */
610
*yy_cp = yy_hold_char;
612
/* yy_bp points to the position in yy_ch_buf of the start of
617
yy_current_state = yy_start;
621
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
622
if ( yy_accept[yy_current_state] )
624
yy_last_accepting_state = yy_current_state;
625
yy_last_accepting_cpos = yy_cp;
627
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
629
yy_current_state = (int) yy_def[yy_current_state];
630
if ( yy_current_state >= 75 )
631
yy_c = yy_meta[(unsigned int) yy_c];
633
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
636
while ( yy_base[yy_current_state] != 77 );
639
yy_act = yy_accept[yy_current_state];
641
{ /* have to back up */
642
yy_cp = yy_last_accepting_cpos;
643
yy_current_state = yy_last_accepting_state;
644
yy_act = yy_accept[yy_current_state];
650
do_action: /* This label is used only to access EOF actions. */
654
{ /* beginning of action switch */
655
case 0: /* must back up */
656
/* undo the effects of YY_DO_BEFORE_ACTION */
657
*yy_cp = yy_hold_char;
658
yy_cp = yy_last_accepting_cpos;
659
yy_current_state = yy_last_accepting_state;
664
#line 29 "sgmlverb.lex"
669
#line 30 "sgmlverb.lex"
670
{ printf ("<tt>"); PUSH NORM; BEGIN VERB; }
674
#line 31 "sgmlverb.lex"
675
{ printf ("%"); }
678
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
679
yy_c_buf_p = yy_cp -= 1;
680
YY_DO_BEFORE_ACTION; /* set up yytext again */
682
#line 32 "sgmlverb.lex"
687
#line 33 "sgmlverb.lex"
688
{ printf ("</tt>"); POP; }
692
#line 34 "sgmlverb.lex"
697
#line 35 "sgmlverb.lex"
702
#line 36 "sgmlverb.lex"
707
#line 37 "sgmlverb.lex"
708
{ printf ("#"); }
712
#line 38 "sgmlverb.lex"
713
{ printf ("$"); }
717
#line 39 "sgmlverb.lex"
718
{ printf ("%"); }
722
#line 40 "sgmlverb.lex"
723
{ printf ("&"); }
727
#line 41 "sgmlverb.lex"
728
{ printf ("˜"); }
732
#line 42 "sgmlverb.lex"
733
{ printf ("ˆ"); }
737
#line 44 "sgmlverb.lex"
738
{ printf ("<verb>"); PUSH NORM; BEGIN VERBENV; }
742
#line 45 "sgmlverb.lex"
743
{ printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
747
#line 46 "sgmlverb.lex"
748
{ printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
752
#line 47 "sgmlverb.lex"
753
{ printf ("</verb>"); POP; }
757
#line 48 "sgmlverb.lex"
758
{ printf ("</code>"); POP; }
762
#line 49 "sgmlverb.lex"
763
{ printf ("</code>"); POP; }
767
#line 50 "sgmlverb.lex"
772
#line 51 "sgmlverb.lex"
773
{ printf ("&ero;"); }
777
#line 52 "sgmlverb.lex"
778
{ printf ("&etago;"); }
782
#line 54 "sgmlverb.lex"
785
case YY_STATE_EOF(INITIAL):
786
case YY_STATE_EOF(NORM):
787
case YY_STATE_EOF(VERB):
788
case YY_STATE_EOF(VERBENV):
791
case YY_END_OF_BUFFER:
793
/* Amount of text matched not including the EOB char. */
794
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
796
/* Undo the effects of YY_DO_BEFORE_ACTION. */
797
*yy_cp = yy_hold_char;
798
YY_RESTORE_YY_MORE_OFFSET
800
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
802
/* We're scanning a new file or input source. It's
803
* possible that this happened because the user
804
* just pointed yyin at a new source and called
805
* yylex(). If so, then we have to assure
806
* consistency between yy_current_buffer and our
807
* globals. Here is the right place to do so, because
808
* this is the first action (other than possibly a
809
* back-up) that will match for the new input source.
811
yy_n_chars = yy_current_buffer->yy_n_chars;
812
yy_current_buffer->yy_input_file = yyin;
813
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
816
/* Note that here we test for yy_c_buf_p "<=" to the position
817
* of the first EOB in the buffer, since yy_c_buf_p will
818
* already have been incremented past the NUL character
819
* (since all states make transitions on EOB to the
820
* end-of-buffer state). Contrast this with the test
823
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
824
{ /* This was really a NUL. */
825
yy_state_type yy_next_state;
827
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
829
yy_current_state = yy_get_previous_state();
831
/* Okay, we're now positioned to make the NUL
832
* transition. We couldn't have
833
* yy_get_previous_state() go ahead and do it
834
* for us because it doesn't know how to deal
835
* with the possibility of jamming (and we don't
836
* want to build jamming into it because then it
837
* will run more slowly).
840
yy_next_state = yy_try_NUL_trans( yy_current_state );
842
yy_bp = yytext_ptr + YY_MORE_ADJ;
846
/* Consume the NUL. */
847
yy_cp = ++yy_c_buf_p;
848
yy_current_state = yy_next_state;
859
else switch ( yy_get_next_buffer() )
861
case EOB_ACT_END_OF_FILE:
863
yy_did_buffer_switch_on_eof = 0;
867
/* Note: because we've taken care in
868
* yy_get_next_buffer() to have set up
869
* yytext, we can now set up
870
* yy_c_buf_p so that if some total
871
* hoser (like flex itself) wants to
872
* call the scanner after we return the
873
* YY_NULL, it'll still work - another
874
* YY_NULL will get returned.
876
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
878
yy_act = YY_STATE_EOF(YY_START);
884
if ( ! yy_did_buffer_switch_on_eof )
890
case EOB_ACT_CONTINUE_SCAN:
892
yytext_ptr + yy_amount_of_matched_text;
894
yy_current_state = yy_get_previous_state();
897
yy_bp = yytext_ptr + YY_MORE_ADJ;
900
case EOB_ACT_LAST_MATCH:
902
&yy_current_buffer->yy_ch_buf[yy_n_chars];
904
yy_current_state = yy_get_previous_state();
907
yy_bp = yytext_ptr + YY_MORE_ADJ;
915
"fatal flex scanner internal error--no action found" );
916
} /* end of action switch */
917
} /* end of scanning one token */
921
/* yy_get_next_buffer - try to read in a new buffer
923
* Returns a code representing an action:
924
* EOB_ACT_LAST_MATCH -
925
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
926
* EOB_ACT_END_OF_FILE - end of file
929
static int yy_get_next_buffer()
931
register char *dest = yy_current_buffer->yy_ch_buf;
932
register char *source = yytext_ptr;
933
register int number_to_move, i;
936
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
938
"fatal flex scanner internal error--end of buffer missed" );
940
if ( yy_current_buffer->yy_fill_buffer == 0 )
941
{ /* Don't try to fill the buffer, so this is an EOF. */
942
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
944
/* We matched a single character, the EOB, so
945
* treat this as a final EOF.
947
return EOB_ACT_END_OF_FILE;
952
/* We matched some text prior to the EOB, first
955
return EOB_ACT_LAST_MATCH;
959
/* Try to read more data. */
961
/* First move last chars to start of buffer. */
962
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
964
for ( i = 0; i < number_to_move; ++i )
965
*(dest++) = *(source++);
967
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
968
/* don't do the read, it's not guaranteed to return an EOF,
971
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
976
yy_current_buffer->yy_buf_size - number_to_move - 1;
978
while ( num_to_read <= 0 )
979
{ /* Not enough room in the buffer - grow it. */
980
#ifdef YY_USES_REJECT
982
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
985
/* just a shorter name for the current buffer */
986
YY_BUFFER_STATE b = yy_current_buffer;
988
int yy_c_buf_p_offset =
989
(int) (yy_c_buf_p - b->yy_ch_buf);
991
if ( b->yy_is_our_buffer )
993
int new_size = b->yy_buf_size * 2;
996
b->yy_buf_size += b->yy_buf_size / 8;
1000
b->yy_ch_buf = (char *)
1001
/* Include room in for 2 EOB chars. */
1002
yy_flex_realloc( (void *) b->yy_ch_buf,
1003
b->yy_buf_size + 2 );
1006
/* Can't grow it, we don't own it. */
1009
if ( ! b->yy_ch_buf )
1011
"fatal error - scanner input buffer overflow" );
1013
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1015
num_to_read = yy_current_buffer->yy_buf_size -
1020
if ( num_to_read > YY_READ_BUF_SIZE )
1021
num_to_read = YY_READ_BUF_SIZE;
1023
/* Read in more data. */
1024
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1025
yy_n_chars, num_to_read );
1027
yy_current_buffer->yy_n_chars = yy_n_chars;
1030
if ( yy_n_chars == 0 )
1032
if ( number_to_move == YY_MORE_ADJ )
1034
ret_val = EOB_ACT_END_OF_FILE;
1040
ret_val = EOB_ACT_LAST_MATCH;
1041
yy_current_buffer->yy_buffer_status =
1042
YY_BUFFER_EOF_PENDING;
1047
ret_val = EOB_ACT_CONTINUE_SCAN;
1049
yy_n_chars += number_to_move;
1050
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1051
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1053
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1059
/* yy_get_previous_state - get the state just before the EOB char was reached */
1061
static yy_state_type yy_get_previous_state()
1063
register yy_state_type yy_current_state;
1064
register char *yy_cp;
1066
yy_current_state = yy_start;
1068
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1070
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1071
if ( yy_accept[yy_current_state] )
1073
yy_last_accepting_state = yy_current_state;
1074
yy_last_accepting_cpos = yy_cp;
1076
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1078
yy_current_state = (int) yy_def[yy_current_state];
1079
if ( yy_current_state >= 75 )
1080
yy_c = yy_meta[(unsigned int) yy_c];
1082
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1085
return yy_current_state;
1089
/* yy_try_NUL_trans - try to make a transition on the NUL character
1092
* next_state = yy_try_NUL_trans( current_state );
1095
#ifdef YY_USE_PROTOS
1096
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1098
static yy_state_type yy_try_NUL_trans( yy_current_state )
1099
yy_state_type yy_current_state;
1102
register int yy_is_jam;
1103
register char *yy_cp = yy_c_buf_p;
1105
register YY_CHAR yy_c = 1;
1106
if ( yy_accept[yy_current_state] )
1108
yy_last_accepting_state = yy_current_state;
1109
yy_last_accepting_cpos = yy_cp;
1111
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1113
yy_current_state = (int) yy_def[yy_current_state];
1114
if ( yy_current_state >= 75 )
1115
yy_c = yy_meta[(unsigned int) yy_c];
1117
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1118
yy_is_jam = (yy_current_state == 74);
1120
return yy_is_jam ? 0 : yy_current_state;
1125
#ifdef YY_USE_PROTOS
1126
static void yyunput( int c, register char *yy_bp )
1128
static void yyunput( c, yy_bp )
1130
register char *yy_bp;
1133
register char *yy_cp = yy_c_buf_p;
1135
/* undo effects of setting up yytext */
1136
*yy_cp = yy_hold_char;
1138
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1139
{ /* need to shift things up to make room */
1140
/* +2 for EOB chars. */
1141
register int number_to_move = yy_n_chars + 2;
1142
register char *dest = &yy_current_buffer->yy_ch_buf[
1143
yy_current_buffer->yy_buf_size + 2];
1144
register char *source =
1145
&yy_current_buffer->yy_ch_buf[number_to_move];
1147
while ( source > yy_current_buffer->yy_ch_buf )
1148
*--dest = *--source;
1150
yy_cp += (int) (dest - source);
1151
yy_bp += (int) (dest - source);
1152
yy_current_buffer->yy_n_chars =
1153
yy_n_chars = yy_current_buffer->yy_buf_size;
1155
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1156
YY_FATAL_ERROR( "flex scanner push-back overflow" );
1159
*--yy_cp = (char) c;
1163
yy_hold_char = *yy_cp;
1166
#endif /* ifndef YY_NO_UNPUT */
1170
static int yyinput()
1177
*yy_c_buf_p = yy_hold_char;
1179
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1181
/* yy_c_buf_p now points to the character we want to return.
1182
* If this occurs *before* the EOB characters, then it's a
1183
* valid NUL; if not, then we've hit the end of the buffer.
1185
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1186
/* This was really a NUL. */
1190
{ /* need more input */
1191
int offset = yy_c_buf_p - yytext_ptr;
1194
switch ( yy_get_next_buffer() )
1196
case EOB_ACT_LAST_MATCH:
1197
/* This happens because yy_g_n_b()
1198
* sees that we've accumulated a
1199
* token and flags that we need to
1200
* try matching the token before
1201
* proceeding. But for input(),
1202
* there's no matching to consider.
1203
* So convert the EOB_ACT_LAST_MATCH
1204
* to EOB_ACT_END_OF_FILE.
1207
/* Reset buffer status. */
1212
case EOB_ACT_END_OF_FILE:
1217
if ( ! yy_did_buffer_switch_on_eof )
1226
case EOB_ACT_CONTINUE_SCAN:
1227
yy_c_buf_p = yytext_ptr + offset;
1233
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1234
*yy_c_buf_p = '\0'; /* preserve yytext */
1235
yy_hold_char = *++yy_c_buf_p;
1242
#ifdef YY_USE_PROTOS
1243
void yyrestart( FILE *input_file )
1245
void yyrestart( input_file )
1249
if ( ! yy_current_buffer )
1250
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1252
yy_init_buffer( yy_current_buffer, input_file );
1253
yy_load_buffer_state();
1257
#ifdef YY_USE_PROTOS
1258
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1260
void yy_switch_to_buffer( new_buffer )
1261
YY_BUFFER_STATE new_buffer;
1264
if ( yy_current_buffer == new_buffer )
1267
if ( yy_current_buffer )
1269
/* Flush out information for old buffer. */
1270
*yy_c_buf_p = yy_hold_char;
1271
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1272
yy_current_buffer->yy_n_chars = yy_n_chars;
1275
yy_current_buffer = new_buffer;
1276
yy_load_buffer_state();
1278
/* We don't actually know whether we did this switch during
1279
* EOF (yywrap()) processing, but the only time this flag
1280
* is looked at is after yywrap() is called, so it's safe
1281
* to go ahead and always set it.
1283
yy_did_buffer_switch_on_eof = 1;
1287
#ifdef YY_USE_PROTOS
1288
void yy_load_buffer_state( void )
1290
void yy_load_buffer_state()
1293
yy_n_chars = yy_current_buffer->yy_n_chars;
1294
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1295
yyin = yy_current_buffer->yy_input_file;
1296
yy_hold_char = *yy_c_buf_p;
1300
#ifdef YY_USE_PROTOS
1301
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1303
YY_BUFFER_STATE yy_create_buffer( file, size )
1310
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1312
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1314
b->yy_buf_size = size;
1316
/* yy_ch_buf has to be 2 characters longer than the size given because
1317
* we need to put in 2 end-of-buffer characters.
1319
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1320
if ( ! b->yy_ch_buf )
1321
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1323
b->yy_is_our_buffer = 1;
1325
yy_init_buffer( b, file );
1331
#ifdef YY_USE_PROTOS
1332
void yy_delete_buffer( YY_BUFFER_STATE b )
1334
void yy_delete_buffer( b )
1341
if ( b == yy_current_buffer )
1342
yy_current_buffer = (YY_BUFFER_STATE) 0;
1344
if ( b->yy_is_our_buffer )
1345
yy_flex_free( (void *) b->yy_ch_buf );
1347
yy_flex_free( (void *) b );
1352
#ifdef YY_USE_PROTOS
1353
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1355
void yy_init_buffer( b, file )
1362
yy_flush_buffer( b );
1364
b->yy_input_file = file;
1365
b->yy_fill_buffer = 1;
1367
#if YY_ALWAYS_INTERACTIVE
1368
b->yy_is_interactive = 1;
1370
#if YY_NEVER_INTERACTIVE
1371
b->yy_is_interactive = 0;
1373
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1379
#ifdef YY_USE_PROTOS
1380
void yy_flush_buffer( YY_BUFFER_STATE b )
1382
void yy_flush_buffer( b )
1392
/* We always need two end-of-buffer characters. The first causes
1393
* a transition to the end-of-buffer state. The second causes
1394
* a jam in that state.
1396
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1397
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1399
b->yy_buf_pos = &b->yy_ch_buf[0];
1402
b->yy_buffer_status = YY_BUFFER_NEW;
1404
if ( b == yy_current_buffer )
1405
yy_load_buffer_state();
1409
#ifndef YY_NO_SCAN_BUFFER
1410
#ifdef YY_USE_PROTOS
1411
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1413
YY_BUFFER_STATE yy_scan_buffer( base, size )
1421
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1422
base[size-1] != YY_END_OF_BUFFER_CHAR )
1423
/* They forgot to leave room for the EOB's. */
1426
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1428
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1430
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1431
b->yy_buf_pos = b->yy_ch_buf = base;
1432
b->yy_is_our_buffer = 0;
1433
b->yy_input_file = 0;
1434
b->yy_n_chars = b->yy_buf_size;
1435
b->yy_is_interactive = 0;
1437
b->yy_fill_buffer = 0;
1438
b->yy_buffer_status = YY_BUFFER_NEW;
1440
yy_switch_to_buffer( b );
1447
#ifndef YY_NO_SCAN_STRING
1448
#ifdef YY_USE_PROTOS
1449
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1451
YY_BUFFER_STATE yy_scan_string( yy_str )
1452
yyconst char *yy_str;
1456
for ( len = 0; yy_str[len]; ++len )
1459
return yy_scan_bytes( yy_str, len );
1464
#ifndef YY_NO_SCAN_BYTES
1465
#ifdef YY_USE_PROTOS
1466
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1468
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1469
yyconst char *bytes;
1478
/* Get memory for full buffer, including space for trailing EOB's. */
1480
buf = (char *) yy_flex_alloc( n );
1482
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1484
for ( i = 0; i < len; ++i )
1487
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1489
b = yy_scan_buffer( buf, n );
1491
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1493
/* It's okay to grow etc. this buffer, and we should throw it
1494
* away when we're done.
1496
b->yy_is_our_buffer = 1;
1503
#ifndef YY_NO_PUSH_STATE
1504
#ifdef YY_USE_PROTOS
1505
static void yy_push_state( int new_state )
1507
static void yy_push_state( new_state )
1511
if ( yy_start_stack_ptr >= yy_start_stack_depth )
1515
yy_start_stack_depth += YY_START_STACK_INCR;
1516
new_size = yy_start_stack_depth * sizeof( int );
1518
if ( ! yy_start_stack )
1519
yy_start_stack = (int *) yy_flex_alloc( new_size );
1522
yy_start_stack = (int *) yy_flex_realloc(
1523
(void *) yy_start_stack, new_size );
1525
if ( ! yy_start_stack )
1527
"out of memory expanding start-condition stack" );
1530
yy_start_stack[yy_start_stack_ptr++] = YY_START;
1537
#ifndef YY_NO_POP_STATE
1538
static void yy_pop_state()
1540
if ( --yy_start_stack_ptr < 0 )
1541
YY_FATAL_ERROR( "start-condition stack underflow" );
1543
BEGIN(yy_start_stack[yy_start_stack_ptr]);
1548
#ifndef YY_NO_TOP_STATE
1549
static int yy_top_state()
1551
return yy_start_stack[yy_start_stack_ptr - 1];
1555
#ifndef YY_EXIT_FAILURE
1556
#define YY_EXIT_FAILURE 2
1559
#ifdef YY_USE_PROTOS
1560
static void yy_fatal_error( yyconst char msg[] )
1562
static void yy_fatal_error( msg )
1566
(void) fprintf( stderr, "%s\n", msg );
1567
exit( YY_EXIT_FAILURE );
1572
/* Redefine yyless() so it works in section 3 code. */
1578
/* Undo effects of setting up yytext. */ \
1579
yytext[yyleng] = yy_hold_char; \
1580
yy_c_buf_p = yytext + n; \
1581
yy_hold_char = *yy_c_buf_p; \
1582
*yy_c_buf_p = '\0'; \
1588
/* Internal utility routines. */
1591
#ifdef YY_USE_PROTOS
1592
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1594
static void yy_flex_strncpy( s1, s2, n )
1601
for ( i = 0; i < n; ++i )
1606
#ifdef YY_NEED_STRLEN
1607
#ifdef YY_USE_PROTOS
1608
static int yy_flex_strlen( yyconst char *s )
1610
static int yy_flex_strlen( s )
1615
for ( n = 0; s[n]; ++n )
1623
#ifdef YY_USE_PROTOS
1624
static void *yy_flex_alloc( yy_size_t size )
1626
static void *yy_flex_alloc( size )
1630
return (void *) malloc( size );
1633
#ifdef YY_USE_PROTOS
1634
static void *yy_flex_realloc( void *ptr, yy_size_t size )
1636
static void *yy_flex_realloc( ptr, size )
1641
/* The cast to (char *) in the following accommodates both
1642
* implementations that use char* generic pointers, and those
1643
* that use void* generic pointers. It works with the latter
1644
* because both ANSI C and C++ allow castless assignment from
1645
* any pointer type to void*, and deal with argument conversions
1646
* as though doing an assignment.
1648
return (void *) realloc( (char *) ptr, size );
1651
#ifdef YY_USE_PROTOS
1652
static void yy_flex_free( void *ptr )
1654
static void yy_flex_free( ptr )
1668
#line 54 "sgmlverb.lex"
1678
<VERB>\_ { printf ("{\\char'137}"); }
1679
<VERB>\\ { printf ("{\\char'134}"); }
1680
<VERB>\{ { printf ("{\\char'173}"); }
1681
<VERB>\} { printf ("{\\char'175}"); }