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 /* $Header: /home/daffy/u0/vern/flex/RCS/yylex.c,v 2.13 95/03/04 16:10:41 vern Exp $ */
30 /* $FreeBSD: src/usr.bin/lex/yylex.c,v 1.5 1999/10/27 07:56:48 obrien Exp $ */
31 /* $DragonFly: src/usr.bin/lex/yylex.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */
38 /* yylex - scan for a regular expression token */
43 static int beglin
= false;
51 if ( toktype
== EOF
|| toktype
== 0 )
57 synerr( _( "premature EOF" ) );
70 fprintf( stderr
, "%d\t", num_rules
+ 1 );
96 (void) putc( toktype
, stderr
);
100 (void) putc( '\n', stderr
);
108 fputs( "%s", stderr
);
112 fputs( "%x", stderr
);
116 fputs( "%%\n", stderr
);
118 /* We set beglin to be true so we'll start
119 * writing out numbers as we echo rules.
120 * flexscan() has already assigned sectnum.
128 fprintf( stderr
, "'%s'", nmstr
);
154 fprintf( stderr
, "\\%c",
159 if ( ! isascii( yylval
) ||
160 ! isprint( yylval
) )
163 (unsigned int) yylval
);
173 fprintf( stderr
, "%d", yylval
);
177 fprintf( stderr
, "[%d]", yylval
);
181 fprintf( stderr
, "<<EOF>>" );
185 fprintf( stderr
, "%s ", yytext
);
202 fprintf( stderr
, "%s", yytext
);
206 fprintf( stderr
, _( "End Marker\n" ) );
211 _( "*Something Weird* - tok: %d val: %d\n" ),