* tests/local.at (AT_YYERROR_DEFINE): Don't add quotes, check their
presence to detect char/int types.
* tests/actions.at, tests/conflicts.at, tests/glr-regression.at,
* tests/push.at, tests/regression.at: Adjust.
-]AT_YYLEX_DEFINE(123456789)[
+]AT_YYLEX_DEFINE(["123456789"])[
-]AT_YYLEX_DEFINE([abcd], [[yylval = res]])[
+]AT_YYLEX_DEFINE(["abcd"], [[yylval = res]])[
-]AT_YYLEX_DEFINE([abcdef])[
+]AT_YYLEX_DEFINE(["abcdef"])[
-]AT_YYLEX_DEFINE([abd], [yylval = res])[
+]AT_YYLEX_DEFINE(["abd"], [yylval = res])[
+]AT_YYLEX_DEFINE(["a"])[
-]AT_YYLEX_DEFINE([aaa])[
+]AT_YYLEX_DEFINE(["aaa"])[
+]AT_YYLEX_DEFINE(["a"])[
+]AT_YYLEX_DEFINE(["a"])[
]AT_YYERROR_DEFINE[
int
main (void)
]AT_YYERROR_DEFINE[
int
main (void)
+]AT_YYLEX_DEFINE(["a"])[
+]AT_YYLEX_DEFINE(["a"])[
b: 'b';
d: /* nada. */;
%%
b: 'b';
d: /* nada. */;
%%
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
]AT_YYERROR_DEFINE[
int
main (void)
]AT_YYERROR_DEFINE[
int
main (void)
# AT_YYLEX_PROTOTYPE
# AT_YYLEX_DECLARE_EXTERN
# AT_YYLEX_DECLARE
# AT_YYLEX_PROTOTYPE
# AT_YYLEX_DECLARE_EXTERN
# AT_YYLEX_DECLARE
-# AT_YYLEX_DEFINE(INPUT-STRING, [ACTION])
-# ---------------------------------------
+# AT_YYLEX_DEFINE([INPUT], [ACTION])
+# ----------------------------------
+# INPUT can be empty, or in double quotes, or a list (in braces).
+# ACTION may compute yylval for instance, using "res" as token type,
+# and "toknum" as the number of calls to yylex (starting at 0).
m4_define([AT_YYLEX_PROTOTYPE],
[int AT_NAME_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl
])
m4_define([AT_YYLEX_PROTOTYPE],
[int AT_NAME_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl
])
static
]AT_YYLEX_PROTOTYPE[
{
static
]AT_YYLEX_PROTOTYPE[
{
- static char const input[] = "$1";
+ ]m4_bmatch([$1], [^\(".*"\)?$],
+ [[static char const input[] = ]m4_default([$1], [""])],
+ [[static int const input[] = ]$1])[;
static size_t toknum = 0;
int res;
]AT_USE_LEX_ARGS[;
static size_t toknum = 0;
int res;
]AT_USE_LEX_ARGS[;
-]m4_if([$1], [[both]], [AT_YYLEX_DEFINE([])])[
+]m4_if([$1], [[both]], [AT_YYLEX_DEFINE])[
/* Induce two syntax error messages (which requires full error
recovery by shifting 3 tokens) in order to detect any loss of the
reallocated buffer. */
/* Induce two syntax error messages (which requires full error
recovery by shifting 3 tokens) in order to detect any loss of the
reallocated buffer. */
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
]AT_YYERROR_DEFINE[
/* Induce two syntax error messages (which requires full error
recovery by shifting 3 tokens). */
]AT_YYERROR_DEFINE[
/* Induce two syntax error messages (which requires full error
recovery by shifting 3 tokens). */
-]AT_YYLEX_DEFINE([abc])[
+]AT_YYLEX_DEFINE(["abc"])[
+]AT_YYLEX_DEFINE(["$1"])[