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:
Akim Demaille
2019-02-19 20:37:29 +01:00
parent 420e7b03ec
commit 7d6747cec9
3 changed files with 58 additions and 45 deletions

View File

@@ -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[
};
%%
]], [[