mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
tests: dispatch per lang on the definition of yylex
* tests/local.at (AT_YYLEX_DEFINE): Dispatch on the language. (AT_YYLEX_DEFINE(java)): New. * tests/conflicts.at, tests/java.at: Use it.
This commit is contained in:
@@ -437,26 +437,8 @@ AT_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
|
||||
]$2[
|
||||
|
||||
]AT_JAVA_IF([[%code lexer {
|
||||
|
||||
/*--------.
|
||||
| yylex. |
|
||||
`--------*/
|
||||
|
||||
public String input = "]$3[";
|
||||
public int index = 0;
|
||||
public int yylex ()
|
||||
{
|
||||
if (index < input.length ())
|
||||
return input.charAt (index++);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
public Object getLVal ()
|
||||
{
|
||||
return new Integer(1);
|
||||
}
|
||||
|
||||
]AT_YYERROR_DEFINE[
|
||||
]AT_YYLEX_DEFINE([$3], [[return new Integer(1)]])[
|
||||
]AT_YYERROR_DEFINE[
|
||||
};
|
||||
%%
|
||||
]], [[
|
||||
|
||||
Reference in New Issue
Block a user