summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2013-05-01 00:04:29 +0000
committerjkim <jkim@FreeBSD.org>2013-05-01 00:04:29 +0000
commit7f23afbdaf075afb54aa66d256e6f7d89dd780e7 (patch)
tree98b19a7f2ffae67b9296fd2524f03760292116ab
parent40a2cd1f368539b5141ecbb03e0264ad37c3c403 (diff)
downloadFreeBSD-src-7f23afbdaf075afb54aa66d256e6f7d89dd780e7.zip
FreeBSD-src-7f23afbdaf075afb54aa66d256e6f7d89dd780e7.tar.gz
Merge some important post-2.5.37 changes from upstream.
http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=c53fd2db8c78fef5afd284c3e64da51bc71cf6c3 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=899b2163bbde1a70b3be8b91cbbabd8007341205 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=7642bd98aebb62260df923f57b794138dab6f1e7 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=11b7c6cea340c2fca9b49ec635a45bd34361afe9 http://flex.git.sourceforge.net/git/gitweb.cgi?p=flex/flex;a=commit;h=ec2fdb85e0bac6e8aeca405094506e4cf8bfc0b6
-rw-r--r--flex.skl13
-rw-r--r--flexdef.h3
-rw-r--r--gen.c4
-rw-r--r--main.c7
4 files changed, 17 insertions, 10 deletions
diff --git a/flex.skl b/flex.skl
index 01d8204..aebf2ae 100644
--- a/flex.skl
+++ b/flex.skl
@@ -727,6 +727,11 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
%% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
+m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
+[[
+%% [1.5] DFA
+]])
+
%if-c-only Standard (non-C++) definition
m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
@@ -1272,8 +1277,6 @@ m4_ifdef( [[M4_YY_NOT_REENTRANT]],
]])
]])
-%% [7.0] user's declarations go here
-
m4_ifdef( [[M4_YY_BISON_LVAL]],
[[
yylval = yylval_param;
@@ -1329,6 +1332,9 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
}
+ {
+%% [7.0] user's declarations go here
+
while ( 1 ) /* loops until end-of-file is reached */
{
%% [8.0] yymore()-related code goes here
@@ -1486,6 +1492,7 @@ do_action: /* This label is used only to access EOF actions. */
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
+ } /* end of user's declarations */
} /* end of yylex */
%ok-for-header
@@ -2360,7 +2367,7 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yyb
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- int i;
+ yy_size_t i;
m4_dnl M4_YY_DECL_GUTS_VAR();
/* Get memory for full buffer, including space for trailing EOB's. */
diff --git a/flexdef.h b/flexdef.h
index 0e81410..046dd9a 100644
--- a/flexdef.h
+++ b/flexdef.h
@@ -908,6 +908,9 @@ extern void lerrif PROTO ((const char *, int));
/* Report an error message formatted with one string argument. */
extern void lerrsf PROTO ((const char *, const char *));
+/* Like lerrsf, but also exit after displaying message. */
+extern void lerrsf_fatal PROTO ((const char *, const char *));
+
/* Spit out a "#line" statement. */
extern void line_directive_out PROTO ((FILE *, int));
diff --git a/gen.c b/gen.c
index 5a5daef..8261951 100644
--- a/gen.c
+++ b/gen.c
@@ -874,7 +874,7 @@ void gen_next_state (worry_about_NULs)
else
strcpy (char_map, useecs ?
- "yy_ec[YY_SC_TO_UI(*yy_cp)]" :
+ "yy_ec[YY_SC_TO_UI(*yy_cp)] " :
"YY_SC_TO_UI(*yy_cp)");
if (worry_about_NULs && nultrans) {
@@ -1972,7 +1972,7 @@ void make_tables ()
("if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )");
indent_up ();
indent_puts ("{");
- indent_puts ("int yyl;");
+ indent_puts ("yy_size_t yyl;");
do_indent ();
out_str ("for ( yyl = %s; yyl < yyleng; ++yyl )\n",
yymore_used ? (yytext_is_array ? "YY_G(yy_prev_more_offset)" :
diff --git a/main.c b/main.c
index 31833c4..069b7b2 100644
--- a/main.c
+++ b/main.c
@@ -182,6 +182,8 @@ int flex_main (argc, argv)
readin ();
+ skelout ();
+ /* %% [1.5] DFA */
ntod ();
for (i = 1; i <= num_rules; ++i)
@@ -240,11 +242,6 @@ void check_options ()
flexerror (_
("Can't use --reentrant or --bison-bridge with -l option"));
- /* Don't rely on detecting use of yymore() and REJECT,
- * just assume they'll be used.
- */
- yymore_really_used = reject_really_used = true;
-
yytext_is_array = true;
do_yylineno = true;
use_read = false;
OpenPOWER on IntegriCloud