source: heimdal/trunk/lib/sl/slc-lex.c@ 4

Last change on this file since 4 was 4, checked in by Paul Smedley, 10 years ago

heimdal: applied os2 patches, added conf.cmd

File size: 40.5 KB
Line 
1/* A lexical scanner generated by flex */
2
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 $
5 */
6
7#define FLEX_SCANNER
8#define YY_FLEX_MAJOR_VERSION 2
9#define YY_FLEX_MINOR_VERSION 5
10
11#include <stdio.h>
12
13
14/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15#ifdef c_plusplus
16#ifndef __cplusplus
17#define __cplusplus
18#endif
19#endif
20
21
22#ifdef __cplusplus
23
24#include <stdlib.h>
25#include <unistd.h>
26
27/* Use prototypes in function declarations. */
28#define YY_USE_PROTOS
29
30/* The "const" storage-class-modifier is valid. */
31#define YY_USE_CONST
32
33#else /* ! __cplusplus */
34
35#if __STDC__
36
37#define YY_USE_PROTOS
38#define YY_USE_CONST
39
40#endif /* __STDC__ */
41#endif /* ! __cplusplus */
42
43#ifdef __TURBOC__
44 #pragma warn -rch
45 #pragma warn -use
46#include <io.h>
47#include <stdlib.h>
48#define YY_USE_CONST
49#define YY_USE_PROTOS
50#endif
51
52#ifdef YY_USE_CONST
53#define yyconst const
54#else
55#define yyconst
56#endif
57
58
59#ifdef YY_USE_PROTOS
60#define YY_PROTO(proto) proto
61#else
62#define YY_PROTO(proto) ()
63#endif
64
65/* Returned upon end-of-file. */
66#define YY_NULL 0
67
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
71 * double cast.
72 */
73#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74
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.
78 */
79#define BEGIN yy_start = 1 + 2 *
80
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
83 * compatibility.
84 */
85#define YY_START ((yy_start - 1) / 2)
86#define YYSTATE YY_START
87
88/* Action number for EOF rule of a given start state. */
89#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90
91/* Special action meaning "start processing a new file". */
92#define YY_NEW_FILE yyrestart( yyin )
93
94#define YY_END_OF_BUFFER_CHAR 0
95
96/* Size of default input buffer. */
97#define YY_BUF_SIZE 16384
98
99typedef struct yy_buffer_state *YY_BUFFER_STATE;
100
101extern int yyleng;
102extern FILE *yyin, *yyout;
103
104#define EOB_ACT_CONTINUE_SCAN 0
105#define EOB_ACT_END_OF_FILE 1
106#define EOB_ACT_LAST_MATCH 2
107
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:
111 *
112 * if ( condition_holds )
113 * yyless( 5 );
114 * else
115 * do_something_else();
116 *
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.
120 */
121
122/* Return all but the first 'n' matched characters back to the input stream. */
123
124#define yyless(n) \
125 do \
126 { \
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 */ \
132 } \
133 while ( 0 )
134
135#define unput(c) yyunput( c, yytext_ptr )
136
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).
140 */
141typedef unsigned int yy_size_t;
142
143
144struct yy_buffer_state
145 {
146 FILE *yy_input_file;
147
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
150
151 /* Size of input buffer in bytes, not including room for EOB
152 * characters.
153 */
154 yy_size_t yy_buf_size;
155
156 /* Number of characters read into yy_ch_buf, not including EOB
157 * characters.
158 */
159 int yy_n_chars;
160
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
163 * delete it.
164 */
165 int yy_is_our_buffer;
166
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
170 * each newline.
171 */
172 int yy_is_interactive;
173
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
176 * not.
177 */
178 int yy_at_bol;
179
180 /* Whether to try to fill the input buffer when we reach the
181 * end of it.
182 */
183 int yy_fill_buffer;
184
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.
193 *
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.
197 */
198#define YY_BUFFER_EOF_PENDING 2
199 };
200
201static YY_BUFFER_STATE yy_current_buffer = 0;
202
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
205 * "scanner state".
206 */
207#define YY_CURRENT_BUFFER yy_current_buffer
208
209
210/* yy_hold_char holds the character lost when yytext is formed. */
211static char yy_hold_char;
212
213static int yy_n_chars; /* number of characters read into yy_ch_buf */
214
215
216int yyleng;
217
218/* Points to current character in buffer. */
219static char *yy_c_buf_p = (char *) 0;
220static int yy_init = 1; /* whether we need to initialize */
221static int yy_start = 0; /* start state number */
222
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 ...
225 */
226static int yy_did_buffer_switch_on_eof;
227
228void yyrestart YY_PROTO(( FILE *input_file ));
229
230void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231void yy_load_buffer_state YY_PROTO(( void ));
232YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
237
238YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
241
242static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244static void yy_flex_free YY_PROTO(( void * ));
245
246#define yy_new_buffer yy_create_buffer
247
248#define yy_set_interactive(is_interactive) \
249 { \
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; \
253 }
254
255#define yy_set_bol(at_bol) \
256 { \
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; \
260 }
261
262#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
263
264typedef unsigned char YY_CHAR;
265FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266typedef int yy_state_type;
267extern char *yytext;
268#define yytext_ptr yytext
269
270static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272static int yy_get_next_buffer YY_PROTO(( void ));
273static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
274
275/* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
277 */
278#define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
282 *yy_cp = '\0'; \
283 yy_c_buf_p = yy_cp;
284
285#define YY_NUM_RULES 7
286#define YY_END_OF_BUFFER 8
287static yyconst short int yy_accept[14] =
288 { 0,
289 0, 0, 8, 7, 6, 3, 2, 7, 5, 1,
290 4, 1, 0
291 } ;
292
293static yyconst int yy_ec[256] =
294 { 0,
295 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
296 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
297 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
298 1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
299 1, 5, 1, 1, 6, 1, 7, 6, 6, 6,
300 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
301 8, 1, 1, 1, 9, 9, 9, 9, 9, 9,
302 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
303 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
304 1, 1, 1, 1, 6, 1, 9, 9, 9, 9,
305
306 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
307 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
308 9, 9, 8, 1, 8, 1, 1, 1, 1, 1,
309 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
310 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
311 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
312 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
316
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,
322 1, 1, 1, 1, 1
323 } ;
324
325static yyconst int yy_meta[10] =
326 { 0,
327 1, 1, 1, 1, 1, 2, 1, 1, 2
328 } ;
329
330static yyconst short int yy_base[15] =
331 { 0,
332 0, 0, 12, 13, 13, 13, 13, 6, 13, 0,
333 13, 0, 13, 8
334 } ;
335
336static yyconst short int yy_def[15] =
337 { 0,
338 13, 1, 13, 13, 13, 13, 13, 13, 13, 14,
339 13, 14, 0, 13
340 } ;
341
342static yyconst short int yy_nxt[23] =
343 { 0,
344 4, 5, 6, 7, 4, 4, 8, 9, 10, 12,
345 11, 13, 3, 13, 13, 13, 13, 13, 13, 13,
346 13, 13
347 } ;
348
349static yyconst short int yy_chk[23] =
350 { 0,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 14,
352 8, 3, 13, 13, 13, 13, 13, 13, 13, 13,
353 13, 13
354 } ;
355
356static yy_state_type yy_last_accepting_state;
357static char *yy_last_accepting_cpos;
358
359/* The intent behind this definition is that it'll catch
360 * any uses of REJECT which flex missed.
361 */
362#define REJECT reject_used_but_not_detected
363#define yymore() yymore_used_but_not_detected
364#define YY_MORE_ADJ 0
365#define YY_RESTORE_YY_MORE_OFFSET
366char *yytext;
367#line 1 "slc-lex.l"
368#define INITIAL 0
369#line 2 "slc-lex.l"
370/*
371 * Copyright (c) 2004 Kungliga Tekniska Högskolan
372 * (Royal Institute of Technology, Stockholm, Sweden).
373 * All rights reserved.
374 *
375 * Redistribution and use in source and binary forms, with or without
376 * modification, are permitted provided that the following conditions
377 * are met:
378 *
379 * 1. Redistributions of source code must retain the above copyright
380 * notice, this list of conditions and the following disclaimer.
381 *
382 * 2. Redistributions in binary form must reproduce the above copyright
383 * notice, this list of conditions and the following disclaimer in the
384 * documentation and/or other materials provided with the distribution.
385 *
386 * 3. Neither the name of the Institute nor the names of its contributors
387 * may be used to endorse or promote products derived from this software
388 * without specific prior written permission.
389 *
390 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
391 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
392 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
393 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
394 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
395 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
396 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
397 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
398 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
399 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
400 * SUCH DAMAGE.
401 */
402
403/* $Id$ */
404
405#undef ECHO
406
407#include <stdio.h>
408#include <string.h>
409#include <stdarg.h>
410#include <stdlib.h>
411#include "slc.h"
412#include "slc-gram.h"
413unsigned lineno = 1;
414
415static void handle_comment(void);
416static char * handle_string(void);
417
418#define YY_NO_UNPUT
419
420#undef ECHO
421
422#define YY_NO_UNPUT 1
423#line 424 "slc-lex.c"
424
425/* Macros after this point can all be overridden by user definitions in
426 * section 1.
427 */
428
429#ifndef YY_SKIP_YYWRAP
430#ifdef __cplusplus
431extern "C" int yywrap YY_PROTO(( void ));
432#else
433extern int yywrap YY_PROTO(( void ));
434#endif
435#endif
436
437#ifndef YY_NO_UNPUT
438static void yyunput YY_PROTO(( int c, char *buf_ptr ));
439#endif
440
441#ifndef yytext_ptr
442static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
443#endif
444
445#ifdef YY_NEED_STRLEN
446static int yy_flex_strlen YY_PROTO(( yyconst char * ));
447#endif
448
449#ifndef YY_NO_INPUT
450#ifdef __cplusplus
451static int yyinput YY_PROTO(( void ));
452#else
453static int input YY_PROTO(( void ));
454#endif
455#endif
456
457#if YY_STACK_USED
458static int yy_start_stack_ptr = 0;
459static int yy_start_stack_depth = 0;
460static int *yy_start_stack = 0;
461#ifndef YY_NO_PUSH_STATE
462static void yy_push_state YY_PROTO(( int new_state ));
463#endif
464#ifndef YY_NO_POP_STATE
465static void yy_pop_state YY_PROTO(( void ));
466#endif
467#ifndef YY_NO_TOP_STATE
468static int yy_top_state YY_PROTO(( void ));
469#endif
470
471#else
472#define YY_NO_PUSH_STATE 1
473#define YY_NO_POP_STATE 1
474#define YY_NO_TOP_STATE 1
475#endif
476
477#ifdef YY_MALLOC_DECL
478YY_MALLOC_DECL
479#else
480#if __STDC__
481#ifndef __cplusplus
482#include <stdlib.h>
483#endif
484#else
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).
488 */
489#endif
490#endif
491
492/* Amount of stuff to slurp up with each read. */
493#ifndef YY_READ_BUF_SIZE
494#define YY_READ_BUF_SIZE 8192
495#endif
496
497/* Copy whatever the last rule matched to the standard output. */
498
499#ifndef ECHO
500/* This used to be an fputs(), but since the string might contain NUL's,
501 * we now use fwrite().
502 */
503#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
504#endif
505
506/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
507 * is returned in "result".
508 */
509#ifndef YY_INPUT
510#define YY_INPUT(buf,result,max_size) \
511 if ( yy_current_buffer->yy_is_interactive ) \
512 { \
513 int c = '*', n; \
514 for ( n = 0; n < max_size && \
515 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
516 buf[n] = (char) c; \
517 if ( c == '\n' ) \
518 buf[n++] = (char) c; \
519 if ( c == EOF && ferror( yyin ) ) \
520 YY_FATAL_ERROR( "input in flex scanner failed" ); \
521 result = n; \
522 } \
523 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
524 && ferror( yyin ) ) \
525 YY_FATAL_ERROR( "input in flex scanner failed" );
526#endif
527
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.
531 */
532#ifndef yyterminate
533#define yyterminate() return YY_NULL
534#endif
535
536/* Number of entries by which start-condition stack grows. */
537#ifndef YY_START_STACK_INCR
538#define YY_START_STACK_INCR 25
539#endif
540
541/* Report a fatal error. */
542#ifndef YY_FATAL_ERROR
543#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
544#endif
545
546/* Default declaration of generated scanner - a define so the user can
547 * easily add parameters.
548 */
549#ifndef YY_DECL
550#define YY_DECL int yylex YY_PROTO(( void ))
551#endif
552
553/* Code executed at the beginning of each rule, after yytext and yyleng
554 * have been set up.
555 */
556#ifndef YY_USER_ACTION
557#define YY_USER_ACTION
558#endif
559
560/* Code executed at the end of each rule. */
561#ifndef YY_BREAK
562#define YY_BREAK break;
563#endif
564
565#define YY_RULE_SETUP \
566 YY_USER_ACTION
567
568YY_DECL
569 {
570 register yy_state_type yy_current_state;
571 register char *yy_cp, *yy_bp;
572 register int yy_act;
573
574#line 58 "slc-lex.l"
575
576#line 577 "slc-lex.c"
577
578 if ( yy_init )
579 {
580 yy_init = 0;
581
582#ifdef YY_USER_INIT
583 YY_USER_INIT;
584#endif
585
586 if ( ! yy_start )
587 yy_start = 1; /* first start state */
588
589 if ( ! yyin )
590 yyin = stdin;
591
592 if ( ! yyout )
593 yyout = stdout;
594
595 if ( ! yy_current_buffer )
596 yy_current_buffer =
597 yy_create_buffer( yyin, YY_BUF_SIZE );
598
599 yy_load_buffer_state();
600 }
601
602 while ( 1 ) /* loops until end-of-file is reached */
603 {
604 yy_cp = yy_c_buf_p;
605
606 /* Support of yytext. */
607 *yy_cp = yy_hold_char;
608
609 /* yy_bp points to the position in yy_ch_buf of the start of
610 * the current run.
611 */
612 yy_bp = yy_cp;
613
614 yy_current_state = yy_start;
615yy_match:
616 do
617 {
618 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
619 if ( yy_accept[yy_current_state] )
620 {
621 yy_last_accepting_state = yy_current_state;
622 yy_last_accepting_cpos = yy_cp;
623 }
624 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
625 {
626 yy_current_state = (int) yy_def[yy_current_state];
627 if ( yy_current_state >= 14 )
628 yy_c = yy_meta[(unsigned int) yy_c];
629 }
630 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
631 ++yy_cp;
632 }
633 while ( yy_base[yy_current_state] != 13 );
634
635yy_find_action:
636 yy_act = yy_accept[yy_current_state];
637 if ( yy_act == 0 )
638 { /* have to back up */
639 yy_cp = yy_last_accepting_cpos;
640 yy_current_state = yy_last_accepting_state;
641 yy_act = yy_accept[yy_current_state];
642 }
643
644 YY_DO_BEFORE_ACTION;
645
646
647do_action: /* This label is used only to access EOF actions. */
648
649
650 switch ( yy_act )
651 { /* beginning of action switch */
652 case 0: /* must back up */
653 /* undo the effects of YY_DO_BEFORE_ACTION */
654 *yy_cp = yy_hold_char;
655 yy_cp = yy_last_accepting_cpos;
656 yy_current_state = yy_last_accepting_state;
657 goto yy_find_action;
658
659case 1:
660YY_RULE_SETUP
661#line 59 "slc-lex.l"
662{
663 yylval.string = strdup ((const char *)yytext);
664 return LITERAL;
665 }
666 YY_BREAK
667case 2:
668YY_RULE_SETUP
669#line 63 "slc-lex.l"
670{ yylval.string = handle_string(); return STRING; }
671 YY_BREAK
672case 3:
673YY_RULE_SETUP
674#line 64 "slc-lex.l"
675{ ++lineno; }
676 YY_BREAK
677case 4:
678YY_RULE_SETUP
679#line 65 "slc-lex.l"
680{ handle_comment(); }
681 YY_BREAK
682case 5:
683YY_RULE_SETUP
684#line 66 "slc-lex.l"
685{ return *yytext; }
686 YY_BREAK
687case 6:
688YY_RULE_SETUP
689#line 67 "slc-lex.l"
690;
691 YY_BREAK
692case 7:
693YY_RULE_SETUP
694#line 68 "slc-lex.l"
695ECHO;
696 YY_BREAK
697#line 698 "slc-lex.c"
698case YY_STATE_EOF(INITIAL):
699 yyterminate();
700
701 case YY_END_OF_BUFFER:
702 {
703 /* Amount of text matched not including the EOB char. */
704 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
705
706 /* Undo the effects of YY_DO_BEFORE_ACTION. */
707 *yy_cp = yy_hold_char;
708 YY_RESTORE_YY_MORE_OFFSET
709
710 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
711 {
712 /* We're scanning a new file or input source. It's
713 * possible that this happened because the user
714 * just pointed yyin at a new source and called
715 * yylex(). If so, then we have to assure
716 * consistency between yy_current_buffer and our
717 * globals. Here is the right place to do so, because
718 * this is the first action (other than possibly a
719 * back-up) that will match for the new input source.
720 */
721 yy_n_chars = yy_current_buffer->yy_n_chars;
722 yy_current_buffer->yy_input_file = yyin;
723 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
724 }
725
726 /* Note that here we test for yy_c_buf_p "<=" to the position
727 * of the first EOB in the buffer, since yy_c_buf_p will
728 * already have been incremented past the NUL character
729 * (since all states make transitions on EOB to the
730 * end-of-buffer state). Contrast this with the test
731 * in input().
732 */
733 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
734 { /* This was really a NUL. */
735 yy_state_type yy_next_state;
736
737 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
738
739 yy_current_state = yy_get_previous_state();
740
741 /* Okay, we're now positioned to make the NUL
742 * transition. We couldn't have
743 * yy_get_previous_state() go ahead and do it
744 * for us because it doesn't know how to deal
745 * with the possibility of jamming (and we don't
746 * want to build jamming into it because then it
747 * will run more slowly).
748 */
749
750 yy_next_state = yy_try_NUL_trans( yy_current_state );
751
752 yy_bp = yytext_ptr + YY_MORE_ADJ;
753
754 if ( yy_next_state )
755 {
756 /* Consume the NUL. */
757 yy_cp = ++yy_c_buf_p;
758 yy_current_state = yy_next_state;
759 goto yy_match;
760 }
761
762 else
763 {
764 yy_cp = yy_c_buf_p;
765 goto yy_find_action;
766 }
767 }
768
769 else switch ( yy_get_next_buffer() )
770 {
771 case EOB_ACT_END_OF_FILE:
772 {
773 yy_did_buffer_switch_on_eof = 0;
774
775 if ( yywrap() )
776 {
777 /* Note: because we've taken care in
778 * yy_get_next_buffer() to have set up
779 * yytext, we can now set up
780 * yy_c_buf_p so that if some total
781 * hoser (like flex itself) wants to
782 * call the scanner after we return the
783 * YY_NULL, it'll still work - another
784 * YY_NULL will get returned.
785 */
786 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
787
788 yy_act = YY_STATE_EOF(YY_START);
789 goto do_action;
790 }
791
792 else
793 {
794 if ( ! yy_did_buffer_switch_on_eof )
795 YY_NEW_FILE;
796 }
797 break;
798 }
799
800 case EOB_ACT_CONTINUE_SCAN:
801 yy_c_buf_p =
802 yytext_ptr + yy_amount_of_matched_text;
803
804 yy_current_state = yy_get_previous_state();
805
806 yy_cp = yy_c_buf_p;
807 yy_bp = yytext_ptr + YY_MORE_ADJ;
808 goto yy_match;
809
810 case EOB_ACT_LAST_MATCH:
811 yy_c_buf_p =
812 &yy_current_buffer->yy_ch_buf[yy_n_chars];
813
814 yy_current_state = yy_get_previous_state();
815
816 yy_cp = yy_c_buf_p;
817 yy_bp = yytext_ptr + YY_MORE_ADJ;
818 goto yy_find_action;
819 }
820 break;
821 }
822
823 default:
824 YY_FATAL_ERROR(
825 "fatal flex scanner internal error--no action found" );
826 } /* end of action switch */
827 } /* end of scanning one token */
828 } /* end of yylex */
829
830
831/* yy_get_next_buffer - try to read in a new buffer
832 *
833 * Returns a code representing an action:
834 * EOB_ACT_LAST_MATCH -
835 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
836 * EOB_ACT_END_OF_FILE - end of file
837 */
838
839static int yy_get_next_buffer()
840 {
841 register char *dest = yy_current_buffer->yy_ch_buf;
842 register char *source = yytext_ptr;
843 register int number_to_move, i;
844 int ret_val;
845
846 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
847 YY_FATAL_ERROR(
848 "fatal flex scanner internal error--end of buffer missed" );
849
850 if ( yy_current_buffer->yy_fill_buffer == 0 )
851 { /* Don't try to fill the buffer, so this is an EOF. */
852 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
853 {
854 /* We matched a single character, the EOB, so
855 * treat this as a final EOF.
856 */
857 return EOB_ACT_END_OF_FILE;
858 }
859
860 else
861 {
862 /* We matched some text prior to the EOB, first
863 * process it.
864 */
865 return EOB_ACT_LAST_MATCH;
866 }
867 }
868
869 /* Try to read more data. */
870
871 /* First move last chars to start of buffer. */
872 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
873
874 for ( i = 0; i < number_to_move; ++i )
875 *(dest++) = *(source++);
876
877 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
878 /* don't do the read, it's not guaranteed to return an EOF,
879 * just force an EOF
880 */
881 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
882
883 else
884 {
885 int num_to_read =
886 yy_current_buffer->yy_buf_size - number_to_move - 1;
887
888 while ( num_to_read <= 0 )
889 { /* Not enough room in the buffer - grow it. */
890#ifdef YY_USES_REJECT
891 YY_FATAL_ERROR(
892"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
893#else
894
895 /* just a shorter name for the current buffer */
896 YY_BUFFER_STATE b = yy_current_buffer;
897
898 int yy_c_buf_p_offset =
899 (int) (yy_c_buf_p - b->yy_ch_buf);
900
901 if ( b->yy_is_our_buffer )
902 {
903 int new_size = b->yy_buf_size * 2;
904
905 if ( new_size <= 0 )
906 b->yy_buf_size += b->yy_buf_size / 8;
907 else
908 b->yy_buf_size *= 2;
909
910 b->yy_ch_buf = (char *)
911 /* Include room in for 2 EOB chars. */
912 yy_flex_realloc( (void *) b->yy_ch_buf,
913 b->yy_buf_size + 2 );
914 }
915 else
916 /* Can't grow it, we don't own it. */
917 b->yy_ch_buf = 0;
918
919 if ( ! b->yy_ch_buf )
920 YY_FATAL_ERROR(
921 "fatal error - scanner input buffer overflow" );
922
923 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
924
925 num_to_read = yy_current_buffer->yy_buf_size -
926 number_to_move - 1;
927#endif
928 }
929
930 if ( num_to_read > YY_READ_BUF_SIZE )
931 num_to_read = YY_READ_BUF_SIZE;
932
933 /* Read in more data. */
934 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
935 yy_n_chars, num_to_read );
936
937 yy_current_buffer->yy_n_chars = yy_n_chars;
938 }
939
940 if ( yy_n_chars == 0 )
941 {
942 if ( number_to_move == YY_MORE_ADJ )
943 {
944 ret_val = EOB_ACT_END_OF_FILE;
945 yyrestart( yyin );
946 }
947
948 else
949 {
950 ret_val = EOB_ACT_LAST_MATCH;
951 yy_current_buffer->yy_buffer_status =
952 YY_BUFFER_EOF_PENDING;
953 }
954 }
955
956 else
957 ret_val = EOB_ACT_CONTINUE_SCAN;
958
959 yy_n_chars += number_to_move;
960 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
961 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
962
963 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
964
965 return ret_val;
966 }
967
968
969/* yy_get_previous_state - get the state just before the EOB char was reached */
970
971static yy_state_type yy_get_previous_state()
972 {
973 register yy_state_type yy_current_state;
974 register char *yy_cp;
975
976 yy_current_state = yy_start;
977
978 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
979 {
980 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
981 if ( yy_accept[yy_current_state] )
982 {
983 yy_last_accepting_state = yy_current_state;
984 yy_last_accepting_cpos = yy_cp;
985 }
986 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
987 {
988 yy_current_state = (int) yy_def[yy_current_state];
989 if ( yy_current_state >= 14 )
990 yy_c = yy_meta[(unsigned int) yy_c];
991 }
992 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
993 }
994
995 return yy_current_state;
996 }
997
998
999/* yy_try_NUL_trans - try to make a transition on the NUL character
1000 *
1001 * synopsis
1002 * next_state = yy_try_NUL_trans( current_state );
1003 */
1004
1005#ifdef YY_USE_PROTOS
1006static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1007#else
1008static yy_state_type yy_try_NUL_trans( yy_current_state )
1009yy_state_type yy_current_state;
1010#endif
1011 {
1012 register int yy_is_jam;
1013 register char *yy_cp = yy_c_buf_p;
1014
1015 register YY_CHAR yy_c = 1;
1016 if ( yy_accept[yy_current_state] )
1017 {
1018 yy_last_accepting_state = yy_current_state;
1019 yy_last_accepting_cpos = yy_cp;
1020 }
1021 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1022 {
1023 yy_current_state = (int) yy_def[yy_current_state];
1024 if ( yy_current_state >= 14 )
1025 yy_c = yy_meta[(unsigned int) yy_c];
1026 }
1027 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1028 yy_is_jam = (yy_current_state == 13);
1029
1030 return yy_is_jam ? 0 : yy_current_state;
1031 }
1032
1033
1034#ifndef YY_NO_UNPUT
1035#ifdef YY_USE_PROTOS
1036static void yyunput( int c, register char *yy_bp )
1037#else
1038static void yyunput( c, yy_bp )
1039int c;
1040register char *yy_bp;
1041#endif
1042 {
1043 register char *yy_cp = yy_c_buf_p;
1044
1045 /* undo effects of setting up yytext */
1046 *yy_cp = yy_hold_char;
1047
1048 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1049 { /* need to shift things up to make room */
1050 /* +2 for EOB chars. */
1051 register int number_to_move = yy_n_chars + 2;
1052 register char *dest = &yy_current_buffer->yy_ch_buf[
1053 yy_current_buffer->yy_buf_size + 2];
1054 register char *source =
1055 &yy_current_buffer->yy_ch_buf[number_to_move];
1056
1057 while ( source > yy_current_buffer->yy_ch_buf )
1058 *--dest = *--source;
1059
1060 yy_cp += (int) (dest - source);
1061 yy_bp += (int) (dest - source);
1062 yy_current_buffer->yy_n_chars =
1063 yy_n_chars = yy_current_buffer->yy_buf_size;
1064
1065 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1066 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1067 }
1068
1069 *--yy_cp = (char) c;
1070
1071
1072 yytext_ptr = yy_bp;
1073 yy_hold_char = *yy_cp;
1074 yy_c_buf_p = yy_cp;
1075 }
1076#endif /* ifndef YY_NO_UNPUT */
1077
1078
1079#ifdef __cplusplus
1080static int yyinput()
1081#else
1082static int input()
1083#endif
1084 {
1085 int c;
1086
1087 *yy_c_buf_p = yy_hold_char;
1088
1089 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1090 {
1091 /* yy_c_buf_p now points to the character we want to return.
1092 * If this occurs *before* the EOB characters, then it's a
1093 * valid NUL; if not, then we've hit the end of the buffer.
1094 */
1095 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1096 /* This was really a NUL. */
1097 *yy_c_buf_p = '\0';
1098
1099 else
1100 { /* need more input */
1101 int offset = yy_c_buf_p - yytext_ptr;
1102 ++yy_c_buf_p;
1103
1104 switch ( yy_get_next_buffer() )
1105 {
1106 case EOB_ACT_LAST_MATCH:
1107 /* This happens because yy_g_n_b()
1108 * sees that we've accumulated a
1109 * token and flags that we need to
1110 * try matching the token before
1111 * proceeding. But for input(),
1112 * there's no matching to consider.
1113 * So convert the EOB_ACT_LAST_MATCH
1114 * to EOB_ACT_END_OF_FILE.
1115 */
1116
1117 /* Reset buffer status. */
1118 yyrestart( yyin );
1119
1120 /* fall through */
1121
1122 case EOB_ACT_END_OF_FILE:
1123 {
1124 if ( yywrap() )
1125 return EOF;
1126
1127 if ( ! yy_did_buffer_switch_on_eof )
1128 YY_NEW_FILE;
1129#ifdef __cplusplus
1130 return yyinput();
1131#else
1132 return input();
1133#endif
1134 }
1135
1136 case EOB_ACT_CONTINUE_SCAN:
1137 yy_c_buf_p = yytext_ptr + offset;
1138 break;
1139 }
1140 }
1141 }
1142
1143 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1144 *yy_c_buf_p = '\0'; /* preserve yytext */
1145 yy_hold_char = *++yy_c_buf_p;
1146
1147
1148 return c;
1149 }
1150
1151
1152#ifdef YY_USE_PROTOS
1153void yyrestart( FILE *input_file )
1154#else
1155void yyrestart( input_file )
1156FILE *input_file;
1157#endif
1158 {
1159 if ( ! yy_current_buffer )
1160 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1161
1162 yy_init_buffer( yy_current_buffer, input_file );
1163 yy_load_buffer_state();
1164 }
1165
1166
1167#ifdef YY_USE_PROTOS
1168void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1169#else
1170void yy_switch_to_buffer( new_buffer )
1171YY_BUFFER_STATE new_buffer;
1172#endif
1173 {
1174 if ( yy_current_buffer == new_buffer )
1175 return;
1176
1177 if ( yy_current_buffer )
1178 {
1179 /* Flush out information for old buffer. */
1180 *yy_c_buf_p = yy_hold_char;
1181 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1182 yy_current_buffer->yy_n_chars = yy_n_chars;
1183 }
1184
1185 yy_current_buffer = new_buffer;
1186 yy_load_buffer_state();
1187
1188 /* We don't actually know whether we did this switch during
1189 * EOF (yywrap()) processing, but the only time this flag
1190 * is looked at is after yywrap() is called, so it's safe
1191 * to go ahead and always set it.
1192 */
1193 yy_did_buffer_switch_on_eof = 1;
1194 }
1195
1196
1197#ifdef YY_USE_PROTOS
1198void yy_load_buffer_state( void )
1199#else
1200void yy_load_buffer_state()
1201#endif
1202 {
1203 yy_n_chars = yy_current_buffer->yy_n_chars;
1204 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1205 yyin = yy_current_buffer->yy_input_file;
1206 yy_hold_char = *yy_c_buf_p;
1207 }
1208
1209
1210#ifdef YY_USE_PROTOS
1211YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1212#else
1213YY_BUFFER_STATE yy_create_buffer( file, size )
1214FILE *file;
1215int size;
1216#endif
1217 {
1218 YY_BUFFER_STATE b;
1219
1220 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1221 if ( ! b )
1222 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1223
1224 b->yy_buf_size = size;
1225
1226 /* yy_ch_buf has to be 2 characters longer than the size given because
1227 * we need to put in 2 end-of-buffer characters.
1228 */
1229 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1230 if ( ! b->yy_ch_buf )
1231 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1232
1233 b->yy_is_our_buffer = 1;
1234
1235 yy_init_buffer( b, file );
1236
1237 return b;
1238 }
1239
1240
1241#ifdef YY_USE_PROTOS
1242void yy_delete_buffer( YY_BUFFER_STATE b )
1243#else
1244void yy_delete_buffer( b )
1245YY_BUFFER_STATE b;
1246#endif
1247 {
1248 if ( ! b )
1249 return;
1250
1251 if ( b == yy_current_buffer )
1252 yy_current_buffer = (YY_BUFFER_STATE) 0;
1253
1254 if ( b->yy_is_our_buffer )
1255 yy_flex_free( (void *) b->yy_ch_buf );
1256
1257 yy_flex_free( (void *) b );
1258 }
1259
1260
1261#ifndef YY_ALWAYS_INTERACTIVE
1262#ifndef YY_NEVER_INTERACTIVE
1263extern int isatty YY_PROTO(( int ));
1264#endif
1265#endif
1266
1267#ifdef YY_USE_PROTOS
1268void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1269#else
1270void yy_init_buffer( b, file )
1271YY_BUFFER_STATE b;
1272FILE *file;
1273#endif
1274
1275
1276 {
1277 yy_flush_buffer( b );
1278
1279 b->yy_input_file = file;
1280 b->yy_fill_buffer = 1;
1281
1282#if YY_ALWAYS_INTERACTIVE
1283 b->yy_is_interactive = 1;
1284#else
1285#if YY_NEVER_INTERACTIVE
1286 b->yy_is_interactive = 0;
1287#else
1288 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1289#endif
1290#endif
1291 }
1292
1293
1294#ifdef YY_USE_PROTOS
1295void yy_flush_buffer( YY_BUFFER_STATE b )
1296#else
1297void yy_flush_buffer( b )
1298YY_BUFFER_STATE b;
1299#endif
1300
1301 {
1302 if ( ! b )
1303 return;
1304
1305 b->yy_n_chars = 0;
1306
1307 /* We always need two end-of-buffer characters. The first causes
1308 * a transition to the end-of-buffer state. The second causes
1309 * a jam in that state.
1310 */
1311 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1312 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1313
1314 b->yy_buf_pos = &b->yy_ch_buf[0];
1315
1316 b->yy_at_bol = 1;
1317 b->yy_buffer_status = YY_BUFFER_NEW;
1318
1319 if ( b == yy_current_buffer )
1320 yy_load_buffer_state();
1321 }
1322
1323
1324#ifndef YY_NO_SCAN_BUFFER
1325#ifdef YY_USE_PROTOS
1326YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1327#else
1328YY_BUFFER_STATE yy_scan_buffer( base, size )
1329char *base;
1330yy_size_t size;
1331#endif
1332 {
1333 YY_BUFFER_STATE b;
1334
1335 if ( size < 2 ||
1336 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1337 base[size-1] != YY_END_OF_BUFFER_CHAR )
1338 /* They forgot to leave room for the EOB's. */
1339 return 0;
1340
1341 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1342 if ( ! b )
1343 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1344
1345 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1346 b->yy_buf_pos = b->yy_ch_buf = base;
1347 b->yy_is_our_buffer = 0;
1348 b->yy_input_file = 0;
1349 b->yy_n_chars = b->yy_buf_size;
1350 b->yy_is_interactive = 0;
1351 b->yy_at_bol = 1;
1352 b->yy_fill_buffer = 0;
1353 b->yy_buffer_status = YY_BUFFER_NEW;
1354
1355 yy_switch_to_buffer( b );
1356
1357 return b;
1358 }
1359#endif
1360
1361
1362#ifndef YY_NO_SCAN_STRING
1363#ifdef YY_USE_PROTOS
1364YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1365#else
1366YY_BUFFER_STATE yy_scan_string( yy_str )
1367yyconst char *yy_str;
1368#endif
1369 {
1370 int len;
1371 for ( len = 0; yy_str[len]; ++len )
1372 ;
1373
1374 return yy_scan_bytes( yy_str, len );
1375 }
1376#endif
1377
1378
1379#ifndef YY_NO_SCAN_BYTES
1380#ifdef YY_USE_PROTOS
1381YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1382#else
1383YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1384yyconst char *bytes;
1385int len;
1386#endif
1387 {
1388 YY_BUFFER_STATE b;
1389 char *buf;
1390 yy_size_t n;
1391 int i;
1392
1393 /* Get memory for full buffer, including space for trailing EOB's. */
1394 n = len + 2;
1395 buf = (char *) yy_flex_alloc( n );
1396 if ( ! buf )
1397 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1398
1399 for ( i = 0; i < len; ++i )
1400 buf[i] = bytes[i];
1401
1402 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1403
1404 b = yy_scan_buffer( buf, n );
1405 if ( ! b )
1406 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1407
1408 /* It's okay to grow etc. this buffer, and we should throw it
1409 * away when we're done.
1410 */
1411 b->yy_is_our_buffer = 1;
1412
1413 return b;
1414 }
1415#endif
1416
1417
1418#ifndef YY_NO_PUSH_STATE
1419#ifdef YY_USE_PROTOS
1420static void yy_push_state( int new_state )
1421#else
1422static void yy_push_state( new_state )
1423int new_state;
1424#endif
1425 {
1426 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1427 {
1428 yy_size_t new_size;
1429
1430 yy_start_stack_depth += YY_START_STACK_INCR;
1431 new_size = yy_start_stack_depth * sizeof( int );
1432
1433 if ( ! yy_start_stack )
1434 yy_start_stack = (int *) yy_flex_alloc( new_size );
1435
1436 else
1437 yy_start_stack = (int *) yy_flex_realloc(
1438 (void *) yy_start_stack, new_size );
1439
1440 if ( ! yy_start_stack )
1441 YY_FATAL_ERROR(
1442 "out of memory expanding start-condition stack" );
1443 }
1444
1445 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1446
1447 BEGIN(new_state);
1448 }
1449#endif
1450
1451
1452#ifndef YY_NO_POP_STATE
1453static void yy_pop_state()
1454 {
1455 if ( --yy_start_stack_ptr < 0 )
1456 YY_FATAL_ERROR( "start-condition stack underflow" );
1457
1458 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1459 }
1460#endif
1461
1462
1463#ifndef YY_NO_TOP_STATE
1464static int yy_top_state()
1465 {
1466 return yy_start_stack[yy_start_stack_ptr - 1];
1467 }
1468#endif
1469
1470#ifndef YY_EXIT_FAILURE
1471#define YY_EXIT_FAILURE 2
1472#endif
1473
1474#ifdef YY_USE_PROTOS
1475static void yy_fatal_error( yyconst char msg[] )
1476#else
1477static void yy_fatal_error( msg )
1478char msg[];
1479#endif
1480 {
1481 (void) fprintf( stderr, "%s\n", msg );
1482 exit( YY_EXIT_FAILURE );
1483 }
1484
1485
1486
1487/* Redefine yyless() so it works in section 3 code. */
1488
1489#undef yyless
1490#define yyless(n) \
1491 do \
1492 { \
1493 /* Undo effects of setting up yytext. */ \
1494 yytext[yyleng] = yy_hold_char; \
1495 yy_c_buf_p = yytext + n; \
1496 yy_hold_char = *yy_c_buf_p; \
1497 *yy_c_buf_p = '\0'; \
1498 yyleng = n; \
1499 } \
1500 while ( 0 )
1501
1502
1503/* Internal utility routines. */
1504
1505#ifndef yytext_ptr
1506#ifdef YY_USE_PROTOS
1507static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1508#else
1509static void yy_flex_strncpy( s1, s2, n )
1510char *s1;
1511yyconst char *s2;
1512int n;
1513#endif
1514 {
1515 register int i;
1516 for ( i = 0; i < n; ++i )
1517 s1[i] = s2[i];
1518 }
1519#endif
1520
1521#ifdef YY_NEED_STRLEN
1522#ifdef YY_USE_PROTOS
1523static int yy_flex_strlen( yyconst char *s )
1524#else
1525static int yy_flex_strlen( s )
1526yyconst char *s;
1527#endif
1528 {
1529 register int n;
1530 for ( n = 0; s[n]; ++n )
1531 ;
1532
1533 return n;
1534 }
1535#endif
1536
1537
1538#ifdef YY_USE_PROTOS
1539static void *yy_flex_alloc( yy_size_t size )
1540#else
1541static void *yy_flex_alloc( size )
1542yy_size_t size;
1543#endif
1544 {
1545 return (void *) malloc( size );
1546 }
1547
1548#ifdef YY_USE_PROTOS
1549static void *yy_flex_realloc( void *ptr, yy_size_t size )
1550#else
1551static void *yy_flex_realloc( ptr, size )
1552void *ptr;
1553yy_size_t size;
1554#endif
1555 {
1556 /* The cast to (char *) in the following accommodates both
1557 * implementations that use char* generic pointers, and those
1558 * that use void* generic pointers. It works with the latter
1559 * because both ANSI C and C++ allow castless assignment from
1560 * any pointer type to void*, and deal with argument conversions
1561 * as though doing an assignment.
1562 */
1563 return (void *) realloc( (char *) ptr, size );
1564 }
1565
1566#ifdef YY_USE_PROTOS
1567static void yy_flex_free( void *ptr )
1568#else
1569static void yy_flex_free( ptr )
1570void *ptr;
1571#endif
1572 {
1573 free( ptr );
1574 }
1575
1576#if YY_MAIN
1577int main()
1578 {
1579 yylex();
1580 return 0;
1581 }
1582#endif
1583#line 68 "slc-lex.l"
1584
1585
1586void
1587error_message (const char *format, ...)
1588{
1589 va_list args;
1590
1591 va_start (args, format);
1592 fprintf (stderr, "%s:%d: ", filename, lineno);
1593 vfprintf (stderr, format, args);
1594 va_end (args);
1595 error_flag++;
1596}
1597
1598void
1599yyerror (char *s)
1600{
1601 error_message("%s\n", s);
1602}
1603
1604static void
1605handle_comment(void)
1606{
1607 int c;
1608 int start_lineno = lineno;
1609 int level = 1;
1610 int seen_star = 0;
1611 int seen_slash = 0;
1612 while((c = input()) != EOF) {
1613 if(c == '/') {
1614 if(seen_star) {
1615 if(--level == 0)
1616 return;
1617 seen_star = 0;
1618 continue;
1619 }
1620 seen_slash = 1;
1621 continue;
1622 } else if(c == '*') {
1623 if(seen_slash) {
1624 level++;
1625 seen_star = seen_slash = 0;
1626 continue;
1627 }
1628 seen_star = 1;
1629 continue;
1630 }
1631 seen_star = seen_slash = 0;
1632 if(c == '\n') {
1633 lineno++;
1634 continue;
1635 }
1636 }
1637 if(c == EOF)
1638 error_message("unterminated comment, possibly started on line %d\n", start_lineno);
1639}
1640
1641static char *
1642handle_string(void)
1643{
1644 char x[1024];
1645 int i = 0;
1646 int c;
1647 int quote = 0;
1648 while((c = input()) != EOF){
1649 if(quote) {
1650 x[i++] = '\\';
1651 x[i++] = c;
1652 quote = 0;
1653 continue;
1654 }
1655 if(c == '\n'){
1656 error_message("unterminated string");
1657 lineno++;
1658 break;
1659 }
1660 if(c == '\\'){
1661 quote++;
1662 continue;
1663 }
1664 if(c == '\"')
1665 break;
1666 x[i++] = c;
1667 }
1668 x[i] = '\0';
1669 return strdup(x);
1670}
1671
1672int
1673yywrap ()
1674{
1675 return 1;
1676}
Note: See TracBrowser for help on using the repository browser.