Commit b05a7eb2 authored by POTTIER Francois's avatar POTTIER Francois

About done cleaning up [Trie].

parent beeea948
......@@ -248,9 +248,12 @@ end = struct
Production.foldnt nt accu insert
) (Lr1.transitions s) (fresh s)
(* [nontrivial t] tests whether the trie [t] has any branches, i.e.,
contains at least one sub-trie whose [productions] field is nonempty. *)
let nontrivial t =
not (t.productions = [] && SymbolMap.is_empty t.transitions)
(* Redefine [star] to include a [nontrivial] test. *)
let star s =
let t = star s in
if nontrivial t then
......@@ -258,6 +261,8 @@ end = struct
else
None
(* Accessors. *)
let source t =
t.source
......
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