mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* src/reduce.c (reduce_output): Formatting changes.
* src/print.c (print_results, print_grammar): Likewise. * tests/regression.at (Rule Line Numbers) (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
This commit is contained in:
@@ -44,10 +44,12 @@ AT_DATA([[input.y]],
|
||||
exp: useful;
|
||||
]])
|
||||
|
||||
AT_CHECK([[bison input.y]])
|
||||
AT_CHECK([[bison input.y]], 0, [],
|
||||
[[input.y contains 9 useless nonterminals
|
||||
]])
|
||||
|
||||
AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' input.output]], 0,
|
||||
[[Terminals which are not used:
|
||||
[[Useless nonterminals:
|
||||
useless1
|
||||
useless2
|
||||
useless3
|
||||
|
||||
@@ -63,12 +63,14 @@ AT_CHECK([bison input.y -o input.c -v], 0, [],
|
||||
AT_CHECK([cat input.output], [],
|
||||
[[State 4 contains 1 shift/reduce conflict.
|
||||
|
||||
|
||||
Grammar
|
||||
|
||||
Number, Line, Rule
|
||||
1 3 exp -> exp OP exp
|
||||
2 3 exp -> NUM
|
||||
|
||||
|
||||
Terminals, with rules where they appear
|
||||
|
||||
$ (-1)
|
||||
@@ -76,6 +78,7 @@ error (256)
|
||||
NUM (257) 2
|
||||
OP (258) 1
|
||||
|
||||
|
||||
Nonterminals, with rules where they appear
|
||||
|
||||
exp (5)
|
||||
@@ -138,6 +141,8 @@ state 5
|
||||
state 6
|
||||
|
||||
$default accept
|
||||
|
||||
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
@@ -162,12 +167,14 @@ AT_CHECK([bison input.y -o input.c -v], 0, [], [])
|
||||
AT_CHECK([cat input.output], [],
|
||||
[[Conflict in state 4 between rule 1 and token OP resolved as shift.
|
||||
|
||||
|
||||
Grammar
|
||||
|
||||
Number, Line, Rule
|
||||
1 4 exp -> exp OP exp
|
||||
2 4 exp -> NUM
|
||||
|
||||
|
||||
Terminals, with rules where they appear
|
||||
|
||||
$ (-1)
|
||||
@@ -175,6 +182,7 @@ error (256)
|
||||
NUM (257) 2
|
||||
OP (258) 1
|
||||
|
||||
|
||||
Nonterminals, with rules where they appear
|
||||
|
||||
exp (5)
|
||||
@@ -236,6 +244,8 @@ state 5
|
||||
state 6
|
||||
|
||||
$default accept
|
||||
|
||||
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
@@ -283,8 +293,7 @@ AT_CHECK([bison input.y -o input.c -v], 0, [], [])
|
||||
|
||||
# Check the contents of the report.
|
||||
AT_CHECK([cat input.output], [],
|
||||
[[
|
||||
Grammar
|
||||
[[Grammar
|
||||
|
||||
Number, Line, Rule
|
||||
1 2 @1 -> /* empty */
|
||||
@@ -292,6 +301,7 @@ Grammar
|
||||
3 15 @2 -> /* empty */
|
||||
4 15 expr -> @2 'c'
|
||||
|
||||
|
||||
Terminals, with rules where they appear
|
||||
|
||||
$ (-1)
|
||||
@@ -300,6 +310,7 @@ $ (-1)
|
||||
'c' (99) 4
|
||||
error (256)
|
||||
|
||||
|
||||
Nonterminals, with rules where they appear
|
||||
|
||||
expr (6)
|
||||
@@ -378,6 +389,8 @@ state 7
|
||||
state 8
|
||||
|
||||
$default accept
|
||||
|
||||
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user