traces: show the stack after reading a token

Currently, if we have long rules and series of shift, we stack states
without showing stack.  Let's be more incremental, and do how the Java
skeleton does.

* data/skeletons/lalr1.cc, data/skeletons/lalr1.d,
* data/skeletons/yacc.c:
Here.
Adjust test cases.
* tests/torture.at (AT_DATA_STACK_TORTURE): Disable stack traces: this
test produces a very large stack, and showing the stack each time we
shift a token goes quadatric.
This commit is contained in:
Akim Demaille
2020-02-04 07:44:00 +01:00
parent bba2f0a3a0
commit 37aeda6fb3
9 changed files with 45 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ input:
line:
'\n'
| 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' 'a' { printf ("a\n"); }
| expr '\n' { printf ("%.10g\n", $1); }
| error '\n' { yyerrok; }
;