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 with or without
15 * modification are permitted provided that: (1) source distributions retain
16 * this entire copyright notice and comment, and (2) distributions including
17 * binaries display the following acknowledgement: ``This product includes
18 * software developed by the University of California, Berkeley and its
19 * contributors'' in the documentation or other materials provided with the
20 * distribution and in all advertising materials mentioning features or use
21 * of this software. Neither the name of the University nor the names of
22 * its contributors may be used to endorse or promote products derived from
23 * this software without 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.
36 /* yylex - scan for a regular expression token */
41 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" ),