mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 10:43:02 +00:00
tests: de-duplicate
* tests/conflicts.at (AT_YYLEX_PROTOTYPE): Don't define it, leave that task to AT_DATA_GRAMMAR. But be honest: tell AT_BISON_OPTION_PUSHDEFS all the options we use.
This commit is contained in:
@@ -402,11 +402,7 @@ m4_pushdef([AT_CONSISTENT_ERRORS_CHECK], [
|
|||||||
|
|
||||||
AT_SETUP([[parse.error=verbose and consistent errors: ]$1])
|
AT_SETUP([[parse.error=verbose and consistent errors: ]$1])
|
||||||
|
|
||||||
AT_BISON_OPTION_PUSHDEFS([$1])
|
AT_BISON_OPTION_PUSHDEFS([$1 AT_CXX_IF([[%defines]], [[%define api.pure]])])
|
||||||
|
|
||||||
m4_pushdef([AT_YYLEX_PROTOTYPE],
|
|
||||||
[AT_CXX_IF([[int yylex (yy::parser::semantic_type *lvalp)]],
|
|
||||||
[[int yylex (YYSTYPE *lvalp)]])])
|
|
||||||
|
|
||||||
AT_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
|
AT_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
|
||||||
[AT_JAVA_IF([[
|
[AT_JAVA_IF([[
|
||||||
@@ -415,12 +411,10 @@ AT_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
}]], [[
|
}]], [[
|
||||||
|
|
||||||
%code {]AT_CXX_IF([[
|
%code {
|
||||||
#include <string>]], [[
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
]AT_YYERROR_DECLARE[
|
||||||
]AT_YYERROR_DECLARE])[
|
]AT_YYLEX_DECLARE[
|
||||||
]AT_YYLEX_PROTOTYPE[;
|
|
||||||
#define USE(Var)
|
#define USE(Var)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,37 +436,34 @@ AT_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
|
|||||||
|
|
||||||
]$2[
|
]$2[
|
||||||
|
|
||||||
]AT_JAVA_IF([[%code lexer {]], [[%%]])[
|
]AT_JAVA_IF([[%code lexer {
|
||||||
|
|
||||||
/*--------.
|
/*--------.
|
||||||
| yylex. |
|
| yylex. |
|
||||||
`--------*/]AT_JAVA_IF([[
|
`--------*/
|
||||||
|
|
||||||
public String input = "]$3[";
|
public String input = "]$3[";
|
||||||
public int index = 0;
|
public int index = 0;
|
||||||
public int yylex ()
|
public int yylex ()
|
||||||
{
|
{
|
||||||
if (index < input.length ())
|
if (index < input.length ())
|
||||||
return input.charAt (index++);
|
return input.charAt (index++);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
public Object getLVal ()
|
public Object getLVal ()
|
||||||
{
|
{
|
||||||
return new Integer(1);
|
return new Integer(1);
|
||||||
}]], [[
|
}
|
||||||
|
|
||||||
]AT_YYLEX_PROTOTYPE[
|
|
||||||
{
|
|
||||||
static char const *input = "]$3[";
|
|
||||||
*lvalp = 1;
|
|
||||||
return *input++;
|
|
||||||
}]])[
|
|
||||||
]AT_YYERROR_DEFINE[
|
]AT_YYERROR_DEFINE[
|
||||||
]AT_JAVA_IF([[
|
|
||||||
};
|
};
|
||||||
|
%%
|
||||||
%%]])[
|
]], [[
|
||||||
|
%%
|
||||||
|
]AT_YYLEX_DEFINE(["$3"], [[*lvalp = 1]])[
|
||||||
|
]AT_YYERROR_DEFINE[
|
||||||
|
]])[
|
||||||
|
|
||||||
/*-------.
|
/*-------.
|
||||||
| main. |
|
| main. |
|
||||||
@@ -493,7 +484,6 @@ AT_JAVA_IF([AT_JAVA_PARSER_CHECK([[input]], [[0]]],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
m4_popdef([AT_EXPECTING])
|
m4_popdef([AT_EXPECTING])
|
||||||
m4_popdef([AT_YYLEX_PROTOTYPE])
|
|
||||||
AT_BISON_OPTION_POPDEFS
|
AT_BISON_OPTION_POPDEFS
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|||||||
Reference in New Issue
Block a user