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 $ */
37 /* yylex - scan for a regular expression token */
42 static int beglin = false;
50 if ( toktype == EOF || toktype == 0 )
56 synerr( _( "premature EOF" ) );
69 fprintf( stderr, "%d\t", num_rules + 1 );
95 (void) putc( toktype, stderr );
99 (void) putc( '\n', stderr );
107 fputs( "%s", stderr );
111 fputs( "%x", stderr );
115 fputs( "%%\n", stderr );
117 /* We set beglin to be true so we'll start
118 * writing out numbers as we echo rules.
119 * flexscan() has already assigned sectnum.
127 fprintf( stderr, "'%s'", nmstr );
153 fprintf( stderr, "\\%c",
158 if ( ! isascii( yylval ) ||
159 ! isprint( yylval ) )
162 (unsigned int) yylval );
172 fprintf( stderr, "%d", yylval );
176 fprintf( stderr, "[%d]", yylval );
180 fprintf( stderr, "<<EOF>>" );
184 fprintf( stderr, "%s ", yytext );
201 fprintf( stderr, "%s", yytext );
205 fprintf( stderr, _( "End Marker\n" ) );
210 _( "*Something Weird* - tok: %d val: %d\n" ),