Commit a8de2811 authored by POTTIER Francois's avatar POTTIER Francois

New test grammar, joe_parser2.

This grammar currently has an unexplainable conflict which in fact
should be explainable. Investigation shows that this is due to an
incorrect assumption about the function [TerminalSet.add]. This will
be fixed in the next commit.
parent 043a4aaa
File "joe_parser2.mly", line 16, characters 7-9:
Warning: the token A1 is unused.
File "joe_parser2.mly", line 16, characters 10-12:
Warning: the token A2 is unused.
File "joe_parser2.mly", line 16, characters 13-15:
Warning: the token A3 is unused.
File "joe_parser2.mly", line 16, characters 16-18:
Warning: the token A5 is unused.
File "joe_parser2.mly", line 16, characters 19-21:
Warning: the token A6 is unused.
File "joe_parser2.mly", line 16, characters 22-24:
Warning: the token A7 is unused.
File "joe_parser2.mly", line 16, characters 25-27:
Warning: the token A8 is unused.
File "joe_parser2.mly", line 16, characters 28-30:
Warning: the token A9 is unused.
File "joe_parser2.mly", line 13, characters 31-34:
Warning: the token AAA is unused.
File "joe_parser2.mly", line 16, characters 31-33:
Warning: the token B1 is unused.
File "joe_parser2.mly", line 16, characters 34-36:
Warning: the token B2 is unused.
File "joe_parser2.mly", line 16, characters 37-39:
Warning: the token B3 is unused.
File "joe_parser2.mly", line 16, characters 40-42:
Warning: the token B4 is unused.
File "joe_parser2.mly", line 16, characters 43-45:
Warning: the token B5 is unused.
File "joe_parser2.mly", line 17, characters 7-9:
Warning: the token B6 is unused.
File "joe_parser2.mly", line 17, characters 10-12:
Warning: the token B7 is unused.
File "joe_parser2.mly", line 17, characters 13-15:
Warning: the token B8 is unused.
File "joe_parser2.mly", line 17, characters 16-18:
Warning: the token B9 is unused.
File "joe_parser2.mly", line 13, characters 27-30:
Warning: the token BBB is unused.
File "joe_parser2.mly", line 17, characters 19-21:
Warning: the token C1 is unused.
File "joe_parser2.mly", line 17, characters 22-24:
Warning: the token C2 is unused.
File "joe_parser2.mly", line 17, characters 25-27:
Warning: the token C3 is unused.
File "joe_parser2.mly", line 17, characters 28-30:
Warning: the token C4 is unused.
File "joe_parser2.mly", line 17, characters 31-33:
Warning: the token C5 is unused.
File "joe_parser2.mly", line 17, characters 34-36:
Warning: the token C6 is unused.
File "joe_parser2.mly", line 17, characters 37-39:
Warning: the token C7 is unused.
File "joe_parser2.mly", line 17, characters 40-42:
Warning: the token C8 is unused.
File "joe_parser2.mly", line 17, characters 43-45:
Warning: the token C9 is unused.
File "joe_parser2.mly", line 13, characters 23-26:
Warning: the token CCC is unused.
File "joe_parser2.mly", line 18, characters 7-9:
Warning: the token D1 is unused.
File "joe_parser2.mly", line 18, characters 10-12:
Warning: the token D2 is unused.
File "joe_parser2.mly", line 18, characters 13-15:
Warning: the token D3 is unused.
File "joe_parser2.mly", line 18, characters 16-18:
Warning: the token D4 is unused.
File "joe_parser2.mly", line 18, characters 19-21:
Warning: the token D5 is unused.
File "joe_parser2.mly", line 18, characters 22-24:
Warning: the token D6 is unused.
File "joe_parser2.mly", line 18, characters 25-27:
Warning: the token D7 is unused.
File "joe_parser2.mly", line 18, characters 28-30:
Warning: the token D8 is unused.
File "joe_parser2.mly", line 18, characters 31-33:
Warning: the token D9 is unused.
File "joe_parser2.mly", line 13, characters 19-22:
Warning: the token DDD is unused.
File "joe_parser2.mly", line 19, characters 7-9:
Warning: the token E1 is unused.
File "joe_parser2.mly", line 13, characters 15-18:
Warning: the token EEE is unused.
File "joe_parser2.mly", line 13, characters 11-14:
Warning: the token FFF is unused.
File "joe_parser2.mly", line 13, characters 7-10:
Warning: the token GGG is unused.
File "joe_parser2.mly", line 14, characters 39-42:
Warning: the token HHH is unused.
File "joe_parser2.mly", line 14, characters 35-38:
Warning: the token III is unused.
File "joe_parser2.mly", line 14, characters 31-34:
Warning: the token JJJ is unused.
File "joe_parser2.mly", line 14, characters 27-30:
Warning: the token KKK is unused.
File "joe_parser2.mly", line 14, characters 23-26:
Warning: the token LLL is unused.
File "joe_parser2.mly", line 14, characters 19-22:
Warning: the token MMM is unused.
File "joe_parser2.mly", line 14, characters 15-18:
Warning: the token NNN is unused.
File "joe_parser2.mly", line 14, characters 11-14:
Warning: the token OOO is unused.
File "joe_parser2.mly", line 14, characters 7-10:
Warning: the token PPP is unused.
File "joe_parser2.mly", line 15, characters 7-10:
Warning: the token RRR is unused.
File "joe_parser2.mly", line 15, characters 11-14:
Warning: the token SSS is unused.
File "joe_parser2.mly", line 15, characters 15-18:
Warning: the token TTT is unused.
File "joe_parser2.mly", line 15, characters 19-22:
Warning: the token UUU is unused.
File "joe_parser2.mly", line 15, characters 23-26:
Warning: the token VVV is unused.
File "joe_parser2.mly", line 15, characters 27-30:
Warning: the token WWW is unused.
File "joe_parser2.mly", line 15, characters 31-34:
Warning: the token XXX is unused.
File "joe_parser2.mly", line 15, characters 35-38:
Warning: the token YYY is unused.
File "joe_parser2.mly", line 15, characters 39-42:
Warning: the token ZZZ is unused.
Grammar has 1 nonterminal symbols, among which 1 start symbols.
Grammar has 62 terminal symbols.
Grammar has 2 productions.
nullable(look_for_trouble) = false
first(look_for_trouble) = COOL_TOKEN
minimal(look_for_trouble) = (* 1 *) COOL_TOKEN
follow(look_for_trouble) = #
Built an LR(0) automaton with 3 states.
The grammar is not SLR(1) -- 1 states have a conflict.
The construction mode is pager.
Built an LR(1) automaton with 3 states.
Warning: one state has reduce/reduce conflicts.
1 conflict could not be explained.
Warning: one reduce/reduce conflict was arbitrarily resolved.
File "joe_parser2.mly", line 27, characters 4-14:
Warning: production look_for_trouble -> COOL_TOKEN is never reduced.
Warning: in total, 1 production is never reduced.
2 out of 3 states have a default reduction.
0 out of 3 states are represented.
0 out of 66 symbols keep track of their start position.
0 out of 66 symbols keep track of their end position.
3 out of 3 productions exploit shiftreduce optimization.
0 out of 3 states can peek at an error.
15 functions before inlining, 1 functions after inlining.
/* Sent by Joe on 2020/05/26. This grammar has an "unexplainable conflict".
If one removes any of the (apparently unused!) tokens, then the problem
disappears. The conflict token is '#'. There is a reduce/reduce conflict. */
/* All of the unused tokens below are actually necessary to reproduce the
problem. It turns out that there are 62 tokens, plus error and #, and
this causes TerminalSet to be implemented as a DWordBitSet. The bug
was caused by the fact that [DWordBitSet.add] did not preserve physical
equality when the element was already present in the set. */
%token COOL_TOKEN
%token GGG FFF EEE DDD CCC BBB AAA
%token PPP OOO NNN MMM LLL KKK JJJ III HHH
%token RRR SSS TTT UUU VVV WWW XXX YYY ZZZ
%token A1 A2 A3 A5 A6 A7 A8 A9 B1 B2 B3 B4 B5
%token B6 B7 B8 B9 C1 C2 C3 C4 C5 C6 C7 C8 C9
%token D1 D2 D3 D4 D5 D6 D7 D8 D9
%token E1
%start <int> look_for_trouble
%%
look_for_trouble:
| COOL_TOKEN { }
| COOL_TOKEN { }
;
File "joe_parser2.mly", line 16, characters 7-9:
Warning: the token A1 is unused.
File "joe_parser2.mly", line 16, characters 10-12:
Warning: the token A2 is unused.
File "joe_parser2.mly", line 16, characters 13-15:
Warning: the token A3 is unused.
File "joe_parser2.mly", line 16, characters 16-18:
Warning: the token A5 is unused.
File "joe_parser2.mly", line 16, characters 19-21:
Warning: the token A6 is unused.
File "joe_parser2.mly", line 16, characters 22-24:
Warning: the token A7 is unused.
File "joe_parser2.mly", line 16, characters 25-27:
Warning: the token A8 is unused.
File "joe_parser2.mly", line 16, characters 28-30:
Warning: the token A9 is unused.
File "joe_parser2.mly", line 13, characters 31-34:
Warning: the token AAA is unused.
File "joe_parser2.mly", line 16, characters 31-33:
Warning: the token B1 is unused.
File "joe_parser2.mly", line 16, characters 34-36:
Warning: the token B2 is unused.
File "joe_parser2.mly", line 16, characters 37-39:
Warning: the token B3 is unused.
File "joe_parser2.mly", line 16, characters 40-42:
Warning: the token B4 is unused.
File "joe_parser2.mly", line 16, characters 43-45:
Warning: the token B5 is unused.
File "joe_parser2.mly", line 17, characters 7-9:
Warning: the token B6 is unused.
File "joe_parser2.mly", line 17, characters 10-12:
Warning: the token B7 is unused.
File "joe_parser2.mly", line 17, characters 13-15:
Warning: the token B8 is unused.
File "joe_parser2.mly", line 17, characters 16-18:
Warning: the token B9 is unused.
File "joe_parser2.mly", line 13, characters 27-30:
Warning: the token BBB is unused.
File "joe_parser2.mly", line 17, characters 19-21:
Warning: the token C1 is unused.
File "joe_parser2.mly", line 17, characters 22-24:
Warning: the token C2 is unused.
File "joe_parser2.mly", line 17, characters 25-27:
Warning: the token C3 is unused.
File "joe_parser2.mly", line 17, characters 28-30:
Warning: the token C4 is unused.
File "joe_parser2.mly", line 17, characters 31-33:
Warning: the token C5 is unused.
File "joe_parser2.mly", line 17, characters 34-36:
Warning: the token C6 is unused.
File "joe_parser2.mly", line 17, characters 37-39:
Warning: the token C7 is unused.
File "joe_parser2.mly", line 17, characters 40-42:
Warning: the token C8 is unused.
File "joe_parser2.mly", line 17, characters 43-45:
Warning: the token C9 is unused.
File "joe_parser2.mly", line 13, characters 23-26:
Warning: the token CCC is unused.
File "joe_parser2.mly", line 18, characters 7-9:
Warning: the token D1 is unused.
File "joe_parser2.mly", line 18, characters 10-12:
Warning: the token D2 is unused.
File "joe_parser2.mly", line 18, characters 13-15:
Warning: the token D3 is unused.
File "joe_parser2.mly", line 18, characters 16-18:
Warning: the token D4 is unused.
File "joe_parser2.mly", line 18, characters 19-21:
Warning: the token D5 is unused.
File "joe_parser2.mly", line 18, characters 22-24:
Warning: the token D6 is unused.
File "joe_parser2.mly", line 18, characters 25-27:
Warning: the token D7 is unused.
File "joe_parser2.mly", line 18, characters 28-30:
Warning: the token D8 is unused.
File "joe_parser2.mly", line 18, characters 31-33:
Warning: the token D9 is unused.
File "joe_parser2.mly", line 13, characters 19-22:
Warning: the token DDD is unused.
File "joe_parser2.mly", line 19, characters 7-9:
Warning: the token E1 is unused.
File "joe_parser2.mly", line 13, characters 15-18:
Warning: the token EEE is unused.
File "joe_parser2.mly", line 13, characters 11-14:
Warning: the token FFF is unused.
File "joe_parser2.mly", line 13, characters 7-10:
Warning: the token GGG is unused.
File "joe_parser2.mly", line 14, characters 39-42:
Warning: the token HHH is unused.
File "joe_parser2.mly", line 14, characters 35-38:
Warning: the token III is unused.
File "joe_parser2.mly", line 14, characters 31-34:
Warning: the token JJJ is unused.
File "joe_parser2.mly", line 14, characters 27-30:
Warning: the token KKK is unused.
File "joe_parser2.mly", line 14, characters 23-26:
Warning: the token LLL is unused.
File "joe_parser2.mly", line 14, characters 19-22:
Warning: the token MMM is unused.
File "joe_parser2.mly", line 14, characters 15-18:
Warning: the token NNN is unused.
File "joe_parser2.mly", line 14, characters 11-14:
Warning: the token OOO is unused.
File "joe_parser2.mly", line 14, characters 7-10:
Warning: the token PPP is unused.
File "joe_parser2.mly", line 15, characters 7-10:
Warning: the token RRR is unused.
File "joe_parser2.mly", line 15, characters 11-14:
Warning: the token SSS is unused.
File "joe_parser2.mly", line 15, characters 15-18:
Warning: the token TTT is unused.
File "joe_parser2.mly", line 15, characters 19-22:
Warning: the token UUU is unused.
File "joe_parser2.mly", line 15, characters 23-26:
Warning: the token VVV is unused.
File "joe_parser2.mly", line 15, characters 27-30:
Warning: the token WWW is unused.
File "joe_parser2.mly", line 15, characters 31-34:
Warning: the token XXX is unused.
File "joe_parser2.mly", line 15, characters 35-38:
Warning: the token YYY is unused.
File "joe_parser2.mly", line 15, characters 39-42:
Warning: the token ZZZ is unused.
%start look_for_trouble
%token A1
%token A2
%token A3
%token A5
%token A6
%token A7
%token A8
%token A9
%token AAA
%token B1
%token B2
%token B3
%token B4
%token B5
%token B6
%token B7
%token B8
%token B9
%token BBB
%token C1
%token C2
%token C3
%token C4
%token C5
%token C6
%token C7
%token C8
%token C9
%token CCC
%token COOL_TOKEN
%token D1
%token D2
%token D3
%token D4
%token D5
%token D6
%token D7
%token D8
%token D9
%token DDD
%token E1
%token EEE
%token FFF
%token GGG
%token HHH
%token III
%token JJJ
%token KKK
%token LLL
%token MMM
%token NNN
%token OOO
%token PPP
%token RRR
%token SSS
%token TTT
%token UUU
%token VVV
%token WWW
%token XXX
%token YYY
%token ZZZ
%type <int> look_for_trouble
%%
look_for_trouble:
_1 = COOL_TOKEN
{ ( )}
| _1 = COOL_TOKEN
{ ( )}
%%
......@@ -3772,6 +3772,27 @@
(rule (alias jocaml-new-parser)
(action (diff ../good/jocaml-new-parser.exp jocaml-new-parser.out)))
(rule (target joe_parser2.opp.out) (deps ../good/joe_parser2.mly)
(action
(with-outputs-to joe_parser2.opp.out
(chdir ../good
(system
"timeout 60 %{bin:menhir} --only-preprocess %{deps} || echo 'TIMEOUT after 60 seconds.'")))))
(rule (alias joe_parser2)
(action (diff ../good/joe_parser2.opp.exp joe_parser2.opp.out)))
(rule (targets joe_parser2.out joe_parser2.out.timings)
(deps ../good/joe_parser2.mly)
(action
(with-outputs-to joe_parser2.out
(chdir ../good
(system
"timeout 60 %{bin:menhir} --explain -lg 2 -la 2 -lc 2 --timings-to ../src/joe_parser2.out.timings %{deps} || echo 'TIMEOUT after 60 seconds.'")))))
(rule (alias joe_parser2)
(action (diff ../good/joe_parser2.exp joe_parser2.out)))
(rule (target jparser.opp.out) (deps ../good/jparser.mly)
(action
(with-outputs-to jparser.opp.out
......@@ -9723,6 +9744,7 @@
(alias jocaml)
(alias jocaml-ambients)
(alias jocaml-new-parser)
(alias joe_parser2)
(alias join-param-1)
(alias jparser)
(alias js_of_ocaml.3.2.0-js_parser)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment