/* Bison Grammar Scanner -*- C -*-
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
- Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
%x SC_STRING SC_CHARACTER
letter [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-id {letter}({letter}|[0-9])*
-directive %{letter}({letter}|[0-9]|-)*
+id {letter}({letter}|[0-9]|-)*
+directive %{id}
int [0-9]+
/* POSIX says that a tag must be both an id and a C union member, but
/*----------------------------.
| Scanning Bison directives. |
`----------------------------*/
+
+ /* For directives that are also command line options, the regex must be
+ "%..."
+ after "[-_]"s are removed, and the directive must match the --long
+ option name, with a single string argument. Otherwise, add exceptions
+ to ../build-aux/cross-options.pl. */
+
<INITIAL>
{
"%binary" return PERCENT_NONASSOC;
unexpected_eof (token_start, "'");
STRING_FINISH;
loc->start = token_start;
- if (strlen(last_string) > 1)
+ if (strlen (last_string) > 1)
val->character = last_string[1];
else
val->character = last_string[0];