]> git.saurik.com Git - bison.git/commitdiff
* tests/regression.at (Conflicts): Rename as...
authorAkim Demaille <akim@epita.fr>
Mon, 12 Nov 2001 09:33:04 +0000 (09:33 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 12 Nov 2001 09:33:04 +0000 (09:33 +0000)
(Unresolved SR Conflicts): this.
(Solved SR Conflicts): New.

ChangeLog
tests/regression.at

index af61a73df09b8062f46d4e58d1417aaced1f20a3..bda485afe9bc0c434fbc0e45c59edaa2362833a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-12  Akim Demaille  <akim@epita.fr>
+
+       * tests/regression.at (Conflicts): Rename as...
+       (Unresolved SR Conflicts): this.
+       (Solved SR Conflicts): New.
+
 2001-11-12  Akim Demaille  <akim@epita.fr>
 
        * src/reduce.c (print_results): Rename as...
index 2a60d27ced97f5efe06a308c2b83ce810305d575..14ce95ac0e7893d1f647c18db20ffbadcc88cede 100644 (file)
@@ -43,11 +43,11 @@ AT_CHECK([bison -v duplicate.y -o duplicate.c], 0, ignore, ignore)
 AT_CLEANUP([duplicate.*])
 
 
-## ----------- ##
-## Conflicts.  ##
-## ----------- ##
+## ------------------------- ##
+## Unresolved SR Conflicts.  ##
+## ------------------------- ##
 
-AT_SETUP([Conflicts])
+AT_SETUP([Unresolved SR Conflicts])
 
 AT_DATA([input.y],
 [[%token NUM OP
@@ -134,6 +134,103 @@ state 5
 
 
 
+state 6
+
+    $default   accept
+]])
+
+AT_CLEANUP(input.c input.output)
+
+
+## --------------------- ##
+## Solved SR Conflicts.  ##
+## --------------------- ##
+
+AT_SETUP([Solved SR Conflicts])
+
+AT_DATA([input.y],
+[[%token NUM OP
+%right OP
+%%
+exp: exp OP exp | NUM;
+]])
+
+AT_CHECK([bison input.y -o input.c -v], 0, [], [])
+
+# Check the contents of the report.
+AT_CHECK([cat input.output], [],
+[[Conflict in state 4 between rule 1 and token OP resolved as shift.
+
+Grammar
+
+rule 1    exp -> exp OP exp
+rule 2    exp -> NUM
+
+Terminals, with rules where they appear
+
+$ (-1)
+error (256)
+NUM (257) 2
+OP (258) 1
+
+Nonterminals, with rules where they appear
+
+exp (5)
+    on left: 1 2, on right: 1
+
+
+state 0
+
+    NUM        shift, and go to state 1
+
+    exp        go to state 2
+
+
+
+state 1
+
+    exp  ->  NUM .   (rule 2)
+
+    $default   reduce using rule 2 (exp)
+
+
+
+state 2
+
+    exp  ->  exp . OP exp   (rule 1)
+
+    $          go to state 5
+    OP         shift, and go to state 3
+
+
+
+state 3
+
+    exp  ->  exp OP . exp   (rule 1)
+
+    NUM        shift, and go to state 1
+
+    exp        go to state 4
+
+
+
+state 4
+
+    exp  ->  exp . OP exp   (rule 1)
+    exp  ->  exp OP exp .   (rule 1)
+
+    OP         shift, and go to state 3
+
+    $default   reduce using rule 1 (exp)
+
+
+
+state 5
+
+    $          go to state 6
+
+
+
 state 6
 
     $default   accept