You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
*/
%option debug nodefault nounput noyywrap never-interactive
%option prefix="gram_" outfile="lex.yy.c"
%{
+/* Work around a bug in flex 2.5.31. See Debian bug 333231
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
+#undef gram_wrap
+#define gram_wrap() 1
+
#include "system.h"
#include <mbswidth.h>
#include "files.h"
#include "getargs.h"
#include "gram.h"
+#include "quotearg.h"
#include "reader.h"
#include "uniqstr.h"
} \
while (0)
+/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
+int gram_get_lineno (void);
+FILE *gram_get_in (void);
+FILE *gram_get_out (void);
+int gram_get_leng (void);
+char *gram_get_text (void);
+void gram_set_lineno (int);
+void gram_set_in (FILE *);
+void gram_set_out (FILE *);
+int gram_get_debug (void);
+void gram_set_debug (int);
+int gram_lex_destroy (void);
+
/* Location of scanner cursor. */
boundary scanner_cursor;
"%prec" rule_length--; return PERCENT_PREC;
"%printer" token_type = PERCENT_PRINTER; BEGIN SC_PRE_CODE;
"%pure"[-_]"parser" return PERCENT_PURE_PARSER;
+ "%require" return PERCENT_REQUIRE;
"%right" return PERCENT_RIGHT;
"%skeleton" return PERCENT_SKELETON;
"%start" return PERCENT_START;
"'" STRING_GROW; token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER;
/* Strings. */
- "\"" STRING_GROW; token_start = loc->start; BEGIN SC_ESCAPED_STRING;
+ "\"" token_start = loc->start; BEGIN SC_ESCAPED_STRING;
/* Prologue. */
"%{" code_start = loc->start; BEGIN SC_PROLOGUE;
<SC_ESCAPED_STRING>
{
"\"" {
- STRING_GROW;
STRING_FINISH;
loc->start = token_start;
val->chars = last_string;
STRING_GROW;
STRING_FINISH;
loc->start = token_start;
- val->symbol = symbol_get (last_string, *loc);
+ val->symbol = symbol_get (quotearg_style (escape_quoting_style,
+ last_string),
+ *loc);
symbol_class_set (val->symbol, token_sym, *loc);
last_string_1 = last_string[1];
symbol_user_token_number_set (val->symbol, last_string_1, *loc);
}
else
{
- complain_at (*loc, _("missing `{' in `%s'"),
+ complain_at (*loc, _("missing `{' in %s"),
token_name (token_type));
obstack_sgrow (&obstack_for_string, "{}");
STRING_FINISH;
"$"("<"{tag}">")?(-?[0-9]+|"$") handle_dollar (token_type, yytext, *loc);
"@"(-?[0-9]+|"$") handle_at (token_type, yytext, *loc);
+ "$" {
+ warn_at (*loc, _("stray `$'"));
+ obstack_sgrow (&obstack_for_string, "$][");
+ }
+ "@" {
+ warn_at (*loc, _("stray `@'"));
+ obstack_sgrow (&obstack_for_string, "@@");
+ }
+
<<EOF>> unexpected_eof (code_start, "}"); BEGIN INITIAL;
}