diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2021-01-01 19:07:12 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2021-01-02 07:37:00 +0100 |
commit | 1283dc72434ccd632a2b08266e6f2cffdfd34955 (patch) | |
tree | d8e94bdc845a005e22aef72509f52ab0a1597e77 /NEWS | |
parent | e3d4b42f58d21710eb2b026add2b595d9f927028 (diff) | |
download | bison-1283dc72434ccd632a2b08266e6f2cffdfd34955.tar.gz |
glr.c: log the execution of deferred actions
Currently deferred reductions are not "verbose" at all: only immediate
reductions are displayed in the YYDEBUG traces. I don't understand
why. Besides it seems actually simpler the install the reduction
traces right around the user action inside yyuserAction rather that
around calls to yyuserAction.
This only trouble is that yyuserAction does not know the stack number
it works on, so we have to pass it. And pass -1 when we are actually
running on a temporary stack.
The glr example, on "T(x) + y;" as input, adds these logs, which
allow to see when the `<cast>` is built:
Stack 0 Entering state 26
Reduced stack 0 by rule 7 (line 108); action deferred. Now in state 7.
Stack 0 Entering state 7
Reading a token
Next token is token '+' (1.6: )
Stack 1 Entering state 27
Reduced stack 1 by rule 13 (line 123); action deferred. Now in state 12.
Stack 1 Entering state 12
Next token is token '+' (1.6: )
Stack 1 dies.
Removing dead stacks.
On stack 0, shifting token '+' (1.6: )
Stack 0 now in state #14
+Reducing stack -1 by rule 6 (line 107):
+ $1 = token identifier (1.3: x)
+-> $$ = nterm expr (1.3: x)
+Reducing stack -1 by rule 7 (line 108):
+ $1 = token typename (1.0: T)
+ $2 = token '(' (1.2: )
+ $3 = nterm expr (1.3: x)
+ $4 = token ')' (1.4: )
+-> $$ = nterm expr (1.0-3: <cast>(x,T))
Returning to deterministic operation.
* data/skeletons/glr.c (yyuserAction): Take yyk as a new argument.
Rename argument yyn as yyrule for clarity.
Log before and after the user action.
Adjust callers to not call YY_REDUCE_PRINT and YY_SYMBOL_PRINT.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -9,6 +9,11 @@ GNU Bison NEWS Prefer value_type to semantic_type to denote the semantic value type, specified by the `api.value.type` %define variable. +*** GLR traces + + There were not debug traces for deferred calls to user actions. They are + logged now. + ** New features *** Option -H, --header and directive %header |