1 /* yylex - scanner front-end for flex */
4 * Copyright (c) 1990 The Regents of the University of California.
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 * Redistribution and use in source and binary forms are permitted provided
15 * that: (1) source distributions retain this entire copyright notice and
16 * comment, and (2) distributions including binaries display the following
17 * acknowledgement: ``This product includes software developed by the
18 * University of California, Berkeley and its contributors'' in the
19 * documentation or other materials provided with the distribution and in
20 * all advertising materials mentioning features or use of this software.
21 * Neither the name of the University nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 /* $NetBSD: yylex.c,v 1.8 1998/01/05 05:16:00 perry Exp $ */
36 /* yylex - scan for a regular expression token */
42 static int beglin
= false;
49 if ( toktype
== EOF
|| toktype
== 0 )
55 synerr( _( "premature EOF" ) );
68 fprintf( stderr
, "%d\t", num_rules
+ 1 );
94 (void) putc( toktype
, stderr
);
98 (void) putc( '\n', stderr
);
106 fputs( "%s", stderr
);
110 fputs( "%x", stderr
);
114 fputs( "%%\n", stderr
);
116 /* We set beglin to be true so we'll start
117 * writing out numbers as we echo rules.
118 * flexscan() has already assigned sectnum.
126 fprintf( stderr
, "'%s'", nmstr
);
152 fprintf( stderr
, "\\%c",
157 if ( ! isascii( yylval
) ||
158 ! isprint( yylval
) )
161 (unsigned int) yylval
);
171 fprintf( stderr
, "%d", yylval
);
175 fprintf( stderr
, "[%d]", yylval
);
179 fprintf( stderr
, "<<EOF>>" );
183 fprintf( stderr
, "%s ", yytext
);
200 fprintf( stderr
, "%s", yytext
);
204 fprintf( stderr
, _( "End Marker\n" ) );
209 _( "*Something Weird* - tok: %d val: %d\n" ),