Commit 64e01756 authored by POTTIER Francois's avatar POTTIER Francois

Temporary state where the two definitions of [nullable_first_prod]

are checked to produce the same results.
parent 6d4c8892
......@@ -993,8 +993,7 @@ let () =
TerminalSet.compare original updated <> 0
)
let first', _first_prod', _first_symbol' =
let module FIRST =
module FIRST =
GenericAnalysis
(TerminalSet)
(struct
......@@ -1013,9 +1012,14 @@ let first', _first_prod', _first_symbol' =
(* The FIRST set of the empty sequence is empty. *)
let epsilon = TerminalSet.empty
end)
in
let first', _first_prod', _first_symbol' =
FIRST.nonterminal, FIRST.production, FIRST.symbol
let nullable_first_prod' prod i =
NULLABLE.production prod i,
FIRST.production prod i
(* TEMPORARY sanity check *)
let () =
for nt = Nonterminal.start to Nonterminal.n - 1 do
......@@ -1272,7 +1276,10 @@ module Analysis = struct
let nullable_first_prod prod i =
let rhs = Production.rhs prod in
nullable_first_rhs rhs i
let n, f = nullable_first_rhs rhs i in
let n', f' = nullable_first_prod' prod i in
assert (n = n' && TerminalSet.equal f f');
n, f
let explain_first_rhs (tok : Terminal.t) (rhs : Symbol.t array) (i : int) =
convert (explain tok rhs i)
......
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