mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
* src/scan-gram.l, src/reader.h (scanner_last_string_free):
Restore. * src/scan-gram.l (last_string): Is global to the file, not to yylex. * src/parse-gram.y (input): Don't append the epilogue here, (epilogue.opt): do it here, and free the scanner's obstack. * src/reader.c (epilogue_set): Rename as... (epilogue_augment): this. * data/c.m4 (b4_epilogue): Defaults to empty.
This commit is contained in:
@@ -142,6 +142,10 @@ extend_location (location_t *loc, char const *token, int size)
|
||||
|
||||
static struct obstack string_obstack;
|
||||
|
||||
/* A string representing the most recently saved token. */
|
||||
static char *last_string;
|
||||
|
||||
|
||||
#define YY_OBS_GROW \
|
||||
obstack_grow (&string_obstack, yytext, yyleng)
|
||||
|
||||
@@ -154,6 +158,11 @@ static struct obstack string_obstack;
|
||||
#define YY_OBS_FREE \
|
||||
obstack_free (&string_obstack, last_string)
|
||||
|
||||
void
|
||||
scanner_last_string_free (void)
|
||||
{
|
||||
YY_OBS_FREE;
|
||||
}
|
||||
|
||||
/* Within well-formed rules, RULE_LENGTH is the number of values in
|
||||
the current rule so far, which says where to find `$0' with respect
|
||||
@@ -199,9 +208,6 @@ splice (\\[ \f\t\v]*\n)*
|
||||
/* Scanner context when scanning C code. */
|
||||
int c_context IF_LINT (= 0);
|
||||
|
||||
/* A string representing the most recently saved token. */
|
||||
char *last_string;
|
||||
|
||||
/* At each yylex invocation, mark the current position as the
|
||||
start of the next token. */
|
||||
YY_STEP;
|
||||
|
||||
Reference in New Issue
Block a user