/* Bison Grammar Scanner -*- C -*-
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
#include "gram.h"
#include "quotearg.h"
#include "reader.h"
-#include "verify.h"
#include "uniqstr.h"
#define YY_USER_INIT \
static struct obstack obstack_for_string;
/* A string representing the most recently saved token. */
-static char *last_string;
+char *last_string;
+/* The location of the most recently saved token, if it was a
+ BRACED_CODE token; otherwise, this has an unspecified value. */
+location last_braced_code_loc;
#define STRING_GROW \
obstack_grow (&obstack_for_string, yytext, yyleng)
/* Code in between braces. */
"{" {
+ if (current_rule->action)
+ grammar_midrule_action ();
STRING_GROW;
token_type = BRACED_CODE;
braces_level = 0;
val->symbol = symbol_get (quotearg_style (escape_quoting_style,
last_string),
*loc);
- symbol_class_set (val->symbol, token_sym, *loc);
+ symbol_class_set (val->symbol, token_sym, *loc, false);
last_string_1 = last_string[1];
symbol_user_token_number_set (val->symbol, last_string_1, *loc);
STRING_FREE;
loc->start = code_start;
val->chars = last_string;
increment_rule_length (*loc);
+ last_braced_code_loc = *loc;
BEGIN INITIAL;
return token_type;
}
break;
case '\t':
- {
- column = add_column_width (column, p0, p - p0);
- column = add_column_width (column, NULL, 8 - ((column - 1) & 7));
- p0 = p + 1;
- break;
- }
+ column = add_column_width (column, p0, p - p0);
+ column = add_column_width (column, NULL, 8 - ((column - 1) & 7));
+ p0 = p + 1;
+ break;
+
+ default:
+ break;
}
scanner_cursor.line = line;