1 /* yylex - scanner front-end for flex */
3 /* Copyright (c) 1990 The Regents of the University of California. */
4 /* All rights reserved. */
6 /* This code is derived from software contributed to Berkeley by */
9 /* The United States Government has rights in this work pursuant */
10 /* to contract no. DE-AC03-76SF00098 between the United States */
11 /* Department of Energy and the University of California. */
13 /* This file is part of flex. */
15 /* Redistribution and use in source and binary forms, with or without */
16 /* modification, are permitted provided that the following conditions */
19 /* 1. Redistributions of source code must retain the above copyright */
20 /* notice, this list of conditions and the following disclaimer. */
21 /* 2. Redistributions in binary form must reproduce the above copyright */
22 /* notice, this list of conditions and the following disclaimer in the */
23 /* documentation and/or other materials provided with the distribution. */
25 /* Neither the name of the University nor the names of its contributors */
26 /* may be used to endorse or promote products derived from this software */
27 /* without specific prior written permission. */
29 /* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
30 /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
31 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
39 /* yylex - scan for a regular expression token */
44 static int beglin
= false;
50 toktype
= flexscan ();
52 if (toktype
== EOF
|| toktype
== 0) {
56 synerr (_("premature EOF"));
67 fprintf (stderr
, "%d\t", num_rules
+ 1);
92 (void) putc (toktype
, stderr
);
96 (void) putc ('\n', stderr
);
104 fputs ("%s", stderr
);
108 fputs ("%x", stderr
);
112 fputs ("%%\n", stderr
);
114 /* We set beglin to be true so we'll start
115 * writing out numbers as we echo rules.
116 * flexscan() has already assigned sectnum.
124 fprintf (stderr
, "'%s'", nmstr
);
149 fprintf (stderr
, "\\%c", yylval
);
153 if (!isascii (yylval
) || !isprint (yylval
))
156 (unsigned int) yylval
);
158 (void) putc (yylval
, stderr
);
165 fprintf (stderr
, "%d", yylval
);
169 fprintf (stderr
, "[%d]", yylval
);
173 fprintf (stderr
, "<<EOF>>");
177 fprintf (stderr
, "%s ", yytext
);
194 fprintf (stderr
, "%s", yytext
);
198 fprintf (stderr
, _("End Marker\n"));
204 ("*Something Weird* - tok: %d val: %d\n"),