diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2021-08-07 12:49:33 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2021-08-07 12:53:19 +0200 |
commit | 7f1e9249d05c779b821a2e8ec4d97f89782d09f5 (patch) | |
tree | 8074871c26dedeb597d9402788d53fa08a84fbd5 /tests | |
parent | 6d86d26b3359b6e97b997537a8268d4d6583cdbf (diff) | |
download | bison-7f1e9249d05c779b821a2e8ec4d97f89782d09f5.tar.gz |
d: prepare to be able to run LAC tests
Unfortunately it seems to be quite difficult to have "LAC: Exploratory
stack" run for D.
* data/skeletons/lalr1.d: We need File when traces are enabled.
* tests/local.at (AT_YYLEX_DEFINE(d)): New.
* tests/regression.at: Prepare for D, but don't run it, it does not
work.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/local.at | 20 | ||||
-rw-r--r-- | tests/regression.at | 10 |
2 files changed, 29 insertions, 1 deletions
diff --git a/tests/local.at b/tests/local.at index e24c419d..01cf5845 100644 --- a/tests/local.at +++ b/tests/local.at @@ -953,6 +953,26 @@ public void reportSyntaxError(]AT_API_PREFIX[Parser.Context ctx) ]])[]]) +# FIXME: this does not work. It is a stub copied blindly from Java. +m4_define([AT_YYLEX_DEFINE(d)], +[[ + /*--------. + | yylex. | + `--------*/ + + public string input = ]$1[; + public int index = 0; + public int yylex() { + if (index < input.length()) + return input.charAt(index++); + else + return 0; + } + public Object getLVal() { + ]m4_ifval([$2], [$2], [return null])[; + } +]]) + m4_define([AT_MAIN_DEFINE(d)], [[int main () { diff --git a/tests/regression.at b/tests/regression.at index 52ef5e15..73d9268a 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -1337,7 +1337,10 @@ m4_pushdef([AT_LAC_CHECK], [ AT_BISON_OPTION_PUSHDEFS([%debug $1]) AT_DATA_GRAMMAR([input.y], -[AT_JAVA_IF([[%code imports { +[AT_LANG_CASE( +[d], [[%define api.symbol.prefix {SYM_} +]], +[java], [[%code imports { import java.io.IOException; } @@ -1419,6 +1422,11 @@ AT_LAC_CHECK([[%define api.push-pull both %define api.pure]]) # C++. AT_LAC_CHECK([[%skeleton "lalr1.cc"]]) +# D. +# FIXME: does not work. lalr1.d cannot work with literal chars, +# and AT_YYLEX_DEFINE(d) is incorrect. +# AT_LAC_CHECK([[%skeleton "lalr1.d"]]) + # Java. AT_LAC_CHECK([[%skeleton "lalr1.java"]]) |