1 /* scan.l - scanner for flex input -*-C-*- */
4 /* Copyright (c) 1990 The Regents of the University of California. */
5 /* All rights reserved. */
7 /* This code is derived from software contributed to Berkeley by */
10 /* The United States Government has rights in this work pursuant */
11 /* to contract no. DE-AC03-76SF00098 between the United States */
12 /* Department of Energy and the University of California. */
14 /* This file is part of flex. */
16 /* Redistribution and use in source and binary forms, with or without */
17 /* modification, are permitted provided that the following conditions */
20 /* 1. Redistributions of source code must retain the above copyright */
21 /* notice, this list of conditions and the following disclaimer. */
22 /* 2. Redistributions in binary form must reproduce the above copyright */
23 /* notice, this list of conditions and the following disclaimer in the */
24 /* documentation and/or other materials provided with the distribution. */
26 /* Neither the name of the University nor the names of its contributors */
27 /* may be used to endorse or promote products derived from this software */
28 /* without specific prior written permission. */
30 /* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
31 /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
32 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
37 extern bool tablesverify, tablesext;
38 extern int trlcontxt; /* Set in parse.y for each rule. */
39 extern const char *escaped_qstart, *escaped_qend;
41 #define ACTION_ECHO add_action( yytext )
42 #define ACTION_IFDEF(def, should_define) \
44 if ( should_define ) \
45 action_define( def, 1 ); \
48 #define ACTION_ECHO_QSTART add_action (escaped_qstart)
49 #define ACTION_ECHO_QEND add_action (escaped_qend)
51 #define ACTION_M4_IFDEF(def, should_define) \
53 if ( should_define ) \
54 buf_m4_define( &m4defs_buf, def, NULL);\
56 buf_m4_undefine( &m4defs_buf, def);\
59 #define MARK_END_OF_PROLOG mark_prolog();
65 yylval = (unsigned char) yytext[0]; \
69 if(yyleng < MAXLINE) \
71 strcpy( nmstr, yytext ); \
75 synerr(_("Input line too long\n")); \
76 FLEX_EXIT(EXIT_FAILURE); \
80 #define PUT_BACK_STRING(str, start) \
81 for ( i = strlen( str ) - 1; i >= start; --i ) \
84 #define CHECK_REJECT(str) \
85 if ( all_upper( str ) ) \
88 #define CHECK_YYMORE(str) \
89 if ( all_lower( str ) ) \
92 #define YY_USER_INIT \
93 if ( getenv("POSIXLY_CORRECT") ) \
98 %option caseless nodefault stack noyy_top_state
101 %x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE
102 %x FIRSTCCL CCL ACTION RECOVER COMMENT ACTION_STRING PERCENT_BRACE_ACTION
103 %x OPTION LINEDIR CODEBLOCK_MATCH_BRACE
105 %x GROUP_MINUS_PARAMS
111 NOT_WS [^[:blank:]\r\n]
115 NAME ([[:alpha:]_][[:alnum:]_-]*)
116 NOT_NAME [^[:alpha:]_*\n]+
120 ESCSEQ (\\([^\n]|[0-7]{1,3}|x[[:xdigit:]]{1,2}))
122 FIRST_CCL_CHAR ([^\\\n]|{ESCSEQ})
123 CCL_CHAR ([^\\\n\]]|{ESCSEQ})
124 CCL_EXPR ("[:"^?[[:alpha:]]+":]")
132 static int bracelevel, didadef, indented_code;
133 static int doing_rule_action = false;
134 static int option_sense;
136 int doing_codeblock = false;
137 int i, brace_depth=0, brace_start_line=0;
142 ^{WS} indented_code = true; BEGIN(CODEBLOCK);
143 ^"/*" ACTION_ECHO; yy_push_state( COMMENT );
144 ^#{OPTWS}line{WS} yy_push_state( LINEDIR );
145 ^"%s"{NAME}? return SCDECL;
146 ^"%x"{NAME}? return XSCDECL;
149 line_directive_out( (FILE *) 0, 1 );
150 indented_code = false;
153 ^"%top"[[:blank:]]*"{"[[:blank:]]*{NL} {
154 brace_start_line = linenum;
156 buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum);
158 yy_push_state(CODEBLOCK_MATCH_BRACE);
161 ^"%top".* synerr( _("malformed '%top' directive") );
169 line_directive_out( (FILE *) 0, 1 );
174 ^"%pointer".*{NL} yytext_is_array = false; ++linenum;
175 ^"%array".*{NL} yytext_is_array = true; ++linenum;
177 ^"%option" BEGIN(OPTION); return OPTION_OP;
179 ^"%"{LEXOPT}{OPTWS}[[:digit:]]*{OPTWS}{NL} ++linenum; /* ignore */
180 ^"%"{LEXOPT}{WS}.*{NL} ++linenum; /* ignore */
182 /* xgettext: no-c-format */
183 ^"%"[^sxaceknopr{}].* synerr( _( "unrecognized '%' directive" ) );
188 strcpy( nmstr, yytext );
192 synerr( _("Definition name too long\n"));
193 FLEX_EXIT(EXIT_FAILURE);
201 ^{OPTWS}{NL} ++linenum; /* allows blank lines in section 1 */
202 {OPTWS}{NL} ACTION_ECHO; ++linenum; /* maybe end of comment line */
207 "*/" ACTION_ECHO; yy_pop_state();
209 {M4QSTART} ACTION_ECHO_QSTART;
210 {M4QEND} ACTION_ECHO_QEND;
212 {NL} ++linenum; ACTION_ECHO;
216 /* This is the same as COMMENT, but is discarded rather than output. */
231 [[:digit:]]+ linenum = myctoi( yytext );
234 flex_free( (void *) infilename );
235 infilename = copy_string( yytext + 1 );
236 infilename[strlen( infilename ) - 1] = '\0';
238 . /* ignore spurious characters */
242 ^"%}".*{NL} ++linenum; BEGIN(INITIAL);
244 {M4QSTART} ACTION_ECHO_QSTART;
245 {M4QEND} ACTION_ECHO_QEND;
256 <CODEBLOCK_MATCH_BRACE>{
258 if( --brace_depth == 0){
262 buf_strnappend(&top_buf, yytext, yyleng);
267 buf_strnappend(&top_buf, yytext, yyleng);
272 buf_strnappend(&top_buf, yytext, yyleng);
275 {M4QSTART} buf_strnappend(&top_buf, escaped_qstart, strlen(escaped_qstart));
276 {M4QEND} buf_strnappend(&top_buf, escaped_qend, strlen(escaped_qend));
279 buf_strnappend(&top_buf, yytext, yyleng);
283 linenum = brace_start_line;
284 synerr(_("Unmatched '{'"));
291 {WS} /* separates name and definition */
296 strcpy( (char *) nmdef, yytext );
300 format_synerr( _("Definition value for {%s} too long\n"), nmstr);
301 FLEX_EXIT(EXIT_FAILURE);
303 /* Skip trailing whitespace. */
304 for ( i = strlen( (char *) nmdef ) - 1;
305 i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t');
311 ndinstal( nmstr, nmdef );
317 synerr( _( "incomplete name definition" ) );
325 {NL} ++linenum; BEGIN(INITIAL);
326 {WS} option_sense = true;
330 no option_sense = ! option_sense;
332 7bit csize = option_sense ? 128 : 256;
333 8bit csize = option_sense ? 256 : 128;
335 align long_align = option_sense;
337 ACTION_M4_IFDEF( "M4""_YY_ALWAYS_INTERACTIVE", option_sense );
338 interactive = option_sense;
340 array yytext_is_array = option_sense;
341 ansi-definitions ansi_func_defs = option_sense;
342 ansi-prototypes ansi_func_protos = option_sense;
343 backup backing_up_report = option_sense;
344 batch interactive = ! option_sense;
345 bison-bridge bison_bridge_lval = option_sense;
346 bison-locations { if((bison_bridge_lloc = option_sense))
347 bison_bridge_lval = true;
349 "c++" C_plus_plus = option_sense;
350 caseful|case-sensitive sf_set_case_ins(!option_sense);
351 caseless|case-insensitive sf_set_case_ins(option_sense);
352 debug ddebug = option_sense;
353 default spprdflt = ! option_sense;
354 ecs useecs = option_sense;
356 useecs = usemecs = false;
357 use_read = fullspd = true;
360 useecs = usemecs = false;
361 use_read = fulltbl = true;
363 input ACTION_IFDEF("YY_NO_INPUT", ! option_sense);
364 interactive interactive = option_sense;
365 lex-compat lex_compat = option_sense;
366 posix-compat posix_compat = option_sense;
368 ACTION_M4_IFDEF( "M4""_YY_MAIN", option_sense);
369 /* Override yywrap */
370 if( option_sense == true )
373 meta-ecs usemecs = option_sense;
375 ACTION_M4_IFDEF( "M4""_YY_NEVER_INTERACTIVE", option_sense );
376 interactive = !option_sense;
378 perf-report performance_report += option_sense ? 1 : -1;
379 pointer yytext_is_array = ! option_sense;
380 read use_read = option_sense;
381 reentrant reentrant = option_sense;
382 reject reject_really_used = option_sense;
383 stack ACTION_M4_IFDEF( "M4""_YY_STACK_USED", option_sense );
384 stdinit do_stdinit = option_sense;
385 stdout use_stdout = option_sense;
386 unistd ACTION_IFDEF("YY_NO_UNISTD_H", ! option_sense);
387 unput ACTION_M4_IFDEF("M4""_YY_NO_UNPUT", ! option_sense);
388 verbose printstats = option_sense;
389 warn nowarn = ! option_sense;
390 yylineno do_yylineno = option_sense; ACTION_M4_IFDEF("M4""_YY_USE_LINENO", option_sense);
391 yymore yymore_really_used = option_sense;
392 yywrap do_yywrap = option_sense;
394 yy_push_state ACTION_M4_IFDEF("M4""_YY_NO_PUSH_STATE", ! option_sense);
395 yy_pop_state ACTION_M4_IFDEF("M4""_YY_NO_POP_STATE", ! option_sense);
396 yy_top_state ACTION_M4_IFDEF("M4""_YY_NO_TOP_STATE", ! option_sense);
398 yy_scan_buffer ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BUFFER", ! option_sense);
399 yy_scan_bytes ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BYTES", ! option_sense);
400 yy_scan_string ACTION_M4_IFDEF("M4""_YY_NO_SCAN_STRING", ! option_sense);
402 yyalloc ACTION_M4_IFDEF("M4""_YY_NO_FLEX_ALLOC", ! option_sense);
403 yyrealloc ACTION_M4_IFDEF("M4""_YY_NO_FLEX_REALLOC", ! option_sense);
404 yyfree ACTION_M4_IFDEF("M4""_YY_NO_FLEX_FREE", ! option_sense);
406 yyget_debug ACTION_M4_IFDEF("M4""_YY_NO_GET_DEBUG", ! option_sense);
407 yyset_debug ACTION_M4_IFDEF("M4""_YY_NO_SET_DEBUG", ! option_sense);
408 yyget_extra ACTION_M4_IFDEF("M4""_YY_NO_GET_EXTRA", ! option_sense);
409 yyset_extra ACTION_M4_IFDEF("M4""_YY_NO_SET_EXTRA", ! option_sense);
410 yyget_leng ACTION_M4_IFDEF("M4""_YY_NO_GET_LENG", ! option_sense);
411 yyget_text ACTION_M4_IFDEF("M4""_YY_NO_GET_TEXT", ! option_sense);
412 yyget_lineno ACTION_M4_IFDEF("M4""_YY_NO_GET_LINENO", ! option_sense);
413 yyset_lineno ACTION_M4_IFDEF("M4""_YY_NO_SET_LINENO", ! option_sense);
414 yyget_in ACTION_M4_IFDEF("M4""_YY_NO_GET_IN", ! option_sense);
415 yyset_in ACTION_M4_IFDEF("M4""_YY_NO_SET_IN", ! option_sense);
416 yyget_out ACTION_M4_IFDEF("M4""_YY_NO_GET_OUT", ! option_sense);
417 yyset_out ACTION_M4_IFDEF("M4""_YY_NO_SET_OUT", ! option_sense);
418 yyget_lval ACTION_M4_IFDEF("M4""_YY_NO_GET_LVAL", ! option_sense);
419 yyset_lval ACTION_M4_IFDEF("M4""_YY_NO_SET_LVAL", ! option_sense);
420 yyget_lloc ACTION_M4_IFDEF("M4""_YY_NO_GET_LLOC", ! option_sense);
421 yyset_lloc ACTION_M4_IFDEF("M4""_YY_NO_SET_LLOC", ! option_sense);
423 extra-type return OPT_EXTRA_TYPE;
424 outfile return OPT_OUTFILE;
425 prefix return OPT_PREFIX;
426 yyclass return OPT_YYCLASS;
427 header(-file)? return OPT_HEADER;
428 tables-file return OPT_TABLES;
430 tablesverify = option_sense;
431 if(!tablesext && option_sense)
437 if(yyleng-1 < MAXLINE)
439 strcpy( nmstr, yytext + 1 );
443 synerr( _("Option line too long\n"));
444 FLEX_EXIT(EXIT_FAILURE);
446 nmstr[strlen( nmstr ) - 1] = '\0';
450 (([a-mo-z]|n[a-np-z])[[:alpha:]\-+]*)|. {
451 format_synerr( _( "unrecognized %%option: %s" ),
457 <RECOVER>.*{NL} ++linenum; BEGIN(INITIAL);
461 ^"%{".* ++bracelevel; yyless( 2 ); /* eat only %{ */
462 ^"%}".* --bracelevel; yyless( 2 ); /* eat only %} */
464 ^{WS}.* ACTION_ECHO; /* indented code in prolog */
466 ^{NOT_WS}.* { /* non-indented code */
467 if ( bracelevel <= 0 )
468 { /* not in %{ ... %} */
469 yyless( 0 ); /* put it all back */
479 {NL} ++linenum; ACTION_ECHO;
484 yyterminate(); /* to stop the parser */
489 ^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */
492 indented_code = false;
493 doing_codeblock = true;
495 BEGIN(PERCENT_BRACE_ACTION);
499 /* Allow "<" to appear in (?x) patterns. */
504 ^{OPTWS}"^" return '^';
505 \" BEGIN(QUOTE); return '"';
508 if ( lex_compat || posix_compat )
509 return BEGIN_REPEAT_POSIX;
511 return BEGIN_REPEAT_FLEX;
513 "$"/([[:blank:]]|{NL}) return '$';
517 BEGIN(PERCENT_BRACE_ACTION);
521 doing_rule_action = true;
528 /* We're in the middle of a (?x: ) pattern. */
529 /* Push back everything starting at the "|" */
531 amt = strchr (yytext, '|') - yytext;
535 continued_action = true;
544 /* We're in the middle of a (?x: ) pattern. */
545 yy_push_state(COMMENT_DISCARD);
548 yyless( yyleng - 2 ); /* put back '/', '*' */
550 continued_action = false;
555 ^{WS} /* allow indented rules */ ;
559 /* We're in the middle of a (?x: ) pattern. */
562 /* This rule is separate from the one below because
563 * otherwise we get variable trailing context, so
564 * we can't build the scanner using -{f,F}.
567 continued_action = false;
572 doing_rule_action = true;
581 /* We're in the middle of a (?x: ) pattern. */
586 continued_action = false;
588 unput( '\n' ); /* so <ACTION> sees it */
592 doing_rule_action = true;
600 "<<EOF>>" return EOF_OP;
605 outn("/* Begin user sect3 */");
606 yyterminate(); /* to stop the parser */
609 "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* {
614 strcpy( nmstr, yytext );
618 synerr( _("Input line too long\n"));
619 FLEX_EXIT(EXIT_FAILURE);
622 /* Check to see if we've already encountered this
625 if (0 /* <--- This "0" effectively disables the reuse of a
626 * character class (purely based on its source text).
627 * The reason it was disabled is so yacc/bison can parse
628 * ccl operations, such as ccl difference and union.
630 && (cclval = ccllookup( (Char *) nmstr )) != 0 )
632 if ( input() != ']' )
633 synerr( _( "bad character class" ) );
641 /* We fudge a bit. We know that this ccl will
642 * soon be numbered as lastccl + 1 by cclinit.
644 cclinstal( (Char *) nmstr, lastccl + 1 );
646 /* Push back everything but the leading bracket
647 * so the ccl can be rescanned.
655 "{-}" return CCL_OP_DIFF;
656 "{+}" return CCL_OP_UNION;
659 /* Check for :space: at the end of the rule so we don't
660 * wrap the expanded regex in '(' ')' -- breaking trailing
663 "{"{NAME}"}"[[:space:]]? {
664 register Char *nmdefptr;
665 int end_is_ws, end_ch;
667 end_ch = yytext[yyleng-1];
668 end_is_ws = end_ch != '}' ? 1 : 0;
670 if(yyleng-1 < MAXLINE)
672 strcpy( nmstr, yytext + 1 );
676 synerr( _("Input line too long\n"));
677 FLEX_EXIT(EXIT_FAILURE);
679 nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
681 if ( (nmdefptr = ndlookup( nmstr )) == 0 )
683 _( "undefined definition {%s}" ),
687 { /* push back name surrounded by ()'s */
688 int len = strlen( (char *) nmdefptr );
692 if ( lex_compat || nmdefptr[0] == '^' ||
693 (len > 0 && nmdefptr[len - 1] == '$')
694 || (end_is_ws && trlcontxt && !sf_skip_ws()))
695 { /* don't use ()'s after all */
696 PUT_BACK_STRING((char *) nmdefptr, 0);
698 if ( nmdefptr[0] == '^' )
705 PUT_BACK_STRING((char *) nmdefptr, 0);
713 yy_push_state(COMMENT_DISCARD);
715 /* Push back the "*" and return "/" as usual. */
722 if (lex_compat || posix_compat){
723 /* Push back the "?#" and treat it like a normal parens. */
729 yy_push_state(EXTENDED_COMMENT);
733 if (lex_compat || posix_compat)
734 /* Push back the "?" and treat it like a normal parens. */
737 BEGIN(GROUP_WITH_PARAMS);
740 "(" sf_push(); return '(';
741 ")" sf_pop(); return ')';
743 [/|*+?.(){}] return (unsigned char) yytext[0];
749 {OPTWS}{NL}{OPTWS} ++linenum; /* Allow blank lines & continuations */
750 [,*] return (unsigned char) yytext[0];
751 ">" BEGIN(SECT2); return '>';
752 ">"/^ BEGIN(CARETISBOL); return '>';
755 format_synerr( _( "bad <start condition>: %s" ),
760 <CARETISBOL>"^" BEGIN(SECT2); return '^';
765 \" BEGIN(SECT2); return '"';
768 synerr( _( "missing quote" ) );
777 "-" BEGIN(GROUP_MINUS_PARAMS);
778 i sf_set_case_ins(1);
782 <GROUP_MINUS_PARAMS>{
784 i sf_set_case_ins(0);
790 "^"/[^-\]\n] BEGIN(CCL); return '^';
791 "^"/("-"|"]") return '^';
792 . BEGIN(CCL); RETURNCHAR;
796 -/[^\]\n] return '-';
798 "]" BEGIN(SECT2); return ']';
800 synerr( _( "bad character class" ) );
807 "[:alnum:]" BEGIN(CCL); return CCE_ALNUM;
808 "[:alpha:]" BEGIN(CCL); return CCE_ALPHA;
809 "[:blank:]" BEGIN(CCL); return CCE_BLANK;
810 "[:cntrl:]" BEGIN(CCL); return CCE_CNTRL;
811 "[:digit:]" BEGIN(CCL); return CCE_DIGIT;
812 "[:graph:]" BEGIN(CCL); return CCE_GRAPH;
813 "[:lower:]" BEGIN(CCL); return CCE_LOWER;
814 "[:print:]" BEGIN(CCL); return CCE_PRINT;
815 "[:punct:]" BEGIN(CCL); return CCE_PUNCT;
816 "[:space:]" BEGIN(CCL); return CCE_SPACE;
817 "[:upper:]" BEGIN(CCL); return CCE_UPPER;
818 "[:xdigit:]" BEGIN(CCL); return CCE_XDIGIT;
820 "[:^alnum:]" BEGIN(CCL); return CCE_NEG_ALNUM;
821 "[:^alpha:]" BEGIN(CCL); return CCE_NEG_ALPHA;
822 "[:^blank:]" BEGIN(CCL); return CCE_NEG_BLANK;
823 "[:^cntrl:]" BEGIN(CCL); return CCE_NEG_CNTRL;
824 "[:^digit:]" BEGIN(CCL); return CCE_NEG_DIGIT;
825 "[:^graph:]" BEGIN(CCL); return CCE_NEG_GRAPH;
826 "[:^lower:]" BEGIN(CCL); return CCE_NEG_LOWER;
827 "[:^print:]" BEGIN(CCL); return CCE_NEG_PRINT;
828 "[:^punct:]" BEGIN(CCL); return CCE_NEG_PUNCT;
829 "[:^space:]" BEGIN(CCL); return CCE_NEG_SPACE;
830 "[:^upper:]" BEGIN(CCL); return CCE_NEG_UPPER;
831 "[:^xdigit:]" BEGIN(CCL); return CCE_NEG_XDIGIT;
834 _( "bad character class expression: %s" ),
836 BEGIN(CCL); return CCE_ALNUM;
842 yylval = myctoi( yytext );
849 if ( lex_compat || posix_compat )
850 return END_REPEAT_POSIX;
852 return END_REPEAT_FLEX;
856 synerr( _( "bad character inside {}'s" ) );
862 synerr( _( "missing }" ) );
870 <PERCENT_BRACE_ACTION>{
871 {OPTWS}"%}".* bracelevel = 0;
873 <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT );
878 CHECK_REJECT(yytext);
882 CHECK_YYMORE(yytext);
886 {M4QSTART} ACTION_ECHO_QSTART;
887 {M4QEND} ACTION_ECHO_QEND;
892 if ( bracelevel == 0 ||
893 (doing_codeblock && indented_code) )
895 if ( doing_rule_action )
896 add_action( "\tYY_BREAK\n" );
898 doing_rule_action = doing_codeblock = false;
905 /* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */
907 "{" ACTION_ECHO; ++bracelevel;
908 "}" ACTION_ECHO; --bracelevel;
909 {M4QSTART} ACTION_ECHO_QSTART;
910 {M4QEND} ACTION_ECHO_QEND;
911 [^[:alpha:]_{}"'/\n\[\]]+ ACTION_ECHO;
914 "'"([^'\\\n]|\\.)*"'" ACTION_ECHO; /* character constant */
915 \" ACTION_ECHO; BEGIN(ACTION_STRING);
919 if ( bracelevel == 0 )
921 if ( doing_rule_action )
922 add_action( "\tYY_BREAK\n" );
924 doing_rule_action = false;
932 [^"\\\n]+ ACTION_ECHO;
934 {NL} ++linenum; ACTION_ECHO; BEGIN(ACTION);
935 \" ACTION_ECHO; BEGIN(ACTION);
939 <COMMENT,COMMENT_DISCARD,ACTION,ACTION_STRING><<EOF>> {
940 synerr( _( "EOF encountered inside an action" ) );
944 <EXTENDED_COMMENT,GROUP_WITH_PARAMS,GROUP_MINUS_PARAMS><<EOF>> {
945 synerr( _( "EOF encountered inside pattern" ) );
949 <SECT2,QUOTE,FIRSTCCL,CCL>{ESCSEQ} {
950 yylval = myesc( (Char *) yytext );
952 if ( YY_START == FIRSTCCL )
960 {M4QSTART} fwrite (escaped_qstart, 1, strlen(escaped_qstart), yyout);
961 {M4QEND} fwrite (escaped_qend, 1, strlen(escaped_qend), yyout);
962 [^\[\]\n]*(\n?) ECHO;
964 <<EOF>> sectnum = 0; yyterminate();
967 <*>.|\n format_synerr( _( "bad character: %s" ), yytext );
974 if ( --num_input_files > 0 )
976 set_input_file( *++input_files );
985 /* set_input_file - open the given file (if NULL, stdin) for scanning */
987 void set_input_file( file )
990 if ( file && strcmp( file, "-" ) )
992 infilename = copy_string( file );
993 yyin = fopen( infilename, "r" );
996 lerrsf( _( "can't open %s" ), file );
1002 infilename = copy_string( "<stdin>" );
1009 /* Wrapper routines for accessing the scanner's malloc routines. */
1011 void *flex_alloc( size )
1014 return (void *) malloc( size );
1017 void *flex_realloc( ptr, size )
1021 return (void *) realloc( ptr, size );
1024 void flex_free( ptr )