mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -960,10 +960,12 @@ AT_PARSER_CHECK([input --debug], 1,
|
||||
]],
|
||||
[[Starting parse
|
||||
Entering state 0
|
||||
Stack now 0
|
||||
Reducing stack by rule 1 (line 20):
|
||||
-> $$ = nterm start ()
|
||||
Stack now 0
|
||||
Entering state 1
|
||||
Stack now 0 1
|
||||
Reading a token
|
||||
Next token is token 'a' (PRINTER)
|
||||
syntax error, unexpected 'a', expecting $end
|
||||
@@ -1441,6 +1443,7 @@ AT_LAC_CHECK([])
|
||||
AT_PARSER_CHECK([[input --debug]], [[2]], [],
|
||||
[[Starting parse
|
||||
Entering state 0
|
||||
Stack now 0
|
||||
Reading a token
|
||||
Now at end of input.
|
||||
LAC: initial context established for $end
|
||||
@@ -1456,6 +1459,7 @@ AT_LAC_CHECK([z], [[0]])
|
||||
AT_PARSER_CHECK([[input --debug]], [[2]], [],
|
||||
[[Starting parse
|
||||
Entering state 0
|
||||
Stack now 0
|
||||
Reading a token
|
||||
Next token is token $undefined ()
|
||||
LAC: initial context established for $undefined
|
||||
|
||||
Reference in New Issue
Block a user