summaryrefslogtreecommitdiffstats
path: root/usr.bin/lex/yylex.c
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1996-06-19 20:48:06 +0000
committernate <nate@FreeBSD.org>1996-06-19 20:48:06 +0000
commitd4f014461bc07fca54b2cd433609b621fc41de13 (patch)
treeae643c558fdb5902ac3cf1acf047d18715e1846d /usr.bin/lex/yylex.c
parent5ef1dc8eacedf7cc26d0872db31307f1bcc25fae (diff)
downloadFreeBSD-src-d4f014461bc07fca54b2cd433609b621fc41de13.zip
FreeBSD-src-d4f014461bc07fca54b2cd433609b621fc41de13.tar.gz
Finish the import and merge in FreeBSD specific changes.
Add a 'bootstrap' target which *must* be run before building the new version, since the new scanner relies on the current version of flex to build itself otherwise.
Diffstat (limited to 'usr.bin/lex/yylex.c')
-rw-r--r--usr.bin/lex/yylex.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/usr.bin/lex/yylex.c b/usr.bin/lex/yylex.c
index 6edb130..918d468 100644
--- a/usr.bin/lex/yylex.c
+++ b/usr.bin/lex/yylex.c
@@ -6,7 +6,7 @@
*
* This code is derived from software contributed to Berkeley by
* Vern Paxson.
- *
+ *
* The United States Government has rights in this work pursuant
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /home/ncvs/src/usr.bin/lex/yylex.c,v 1.1.1.1 1994/08/24 13:10:34 csgr Exp $ */
+/* $Header: /home/ncvs/src/usr.bin/lex/yylex.c,v 1.1.1.2 1996/06/19 20:26:46 nate Exp $ */
#include <ctype.h>
#include "flexdef.h"
@@ -39,6 +39,7 @@ int yylex()
{
int toktype;
static int beglin = false;
+ extern char *yytext;
if ( eofseen )
toktype = EOF;
@@ -51,7 +52,7 @@ int yylex()
if ( sectnum == 1 )
{
- synerr( "premature EOF" );
+ synerr( _( "premature EOF" ) );
sectnum = 2;
toktype = SECTEND;
}
@@ -109,10 +110,6 @@ int yylex()
fputs( "%x", stderr );
break;
- case WHITESPACE:
- (void) putc( ' ', stderr );
- break;
-
case SECTEND:
fputs( "%%\n", stderr );
@@ -120,9 +117,8 @@ int yylex()
* writing out numbers as we echo rules.
* flexscan() has already assigned sectnum.
*/
-
if ( sectnum == 2 )
- beglin = 1;
+ beglin = 1;
break;
@@ -183,13 +179,34 @@ int yylex()
fprintf( stderr, "<<EOF>>" );
break;
+ case OPTION_OP:
+ fprintf( stderr, "%s ", yytext );
+ break;
+
+ case OPT_OUTFILE:
+ case OPT_PREFIX:
+ case CCE_ALNUM:
+ case CCE_ALPHA:
+ case CCE_BLANK:
+ case CCE_CNTRL:
+ case CCE_DIGIT:
+ case CCE_GRAPH:
+ case CCE_LOWER:
+ case CCE_PRINT:
+ case CCE_PUNCT:
+ case CCE_SPACE:
+ case CCE_UPPER:
+ case CCE_XDIGIT:
+ fprintf( stderr, "%s", yytext );
+ break;
+
case 0:
- fprintf( stderr, "End Marker" );
+ fprintf( stderr, _( "End Marker\n" ) );
break;
default:
fprintf( stderr,
- "*Something Weird* - tok: %d val: %d\n",
+ _( "*Something Weird* - tok: %d val: %d\n" ),
toktype, yylval );
break;
}
OpenPOWER on IntegriCloud