Commit 9c293f61 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Remove [Lr0.compare], which was unused except in one place where it could be easily replaced.

parent 57732594
......@@ -46,10 +46,7 @@ module P = struct
module S = struct
include Set.Make(struct
type t = lr1state
let compare = Lr0.compare
end)
include Set.Make(Lr0.Lr1StateAsOrderedType)
(* [map] is part of the output of [Set.Make] since 4.04 only, so we have
to define it by hand. *)
......
......@@ -413,20 +413,6 @@ let equal ((k1, toksr1) as state1) ((k2, toksr2) as state2) =
in
loop (Array.length toksr1)
(* A total order on states. *)
let compare ((k1, toksr1) as state1) ((k2, toksr2) as state2) =
assert (k1 = k2 && well_formed state1 && well_formed state2);
let rec loop i =
if i = 0 then
0
else
let i = i - 1 in
let c = TerminalSet.compare toksr1.(i) toksr2.(i) in
if c <> 0 then c else loop i
in
loop (Array.length toksr1)
(* Subsumption between states. *)
let subsume ((k1, toksr1) as state1) ((k2, toksr2) as state2) =
......
......@@ -109,12 +109,6 @@ val reductions: lr1state -> (TerminalSet.t * Production.index) list
val equal: lr1state -> lr1state -> bool
(* A total order on states. The two states must have the same core.
This is an arbitrary total order; it has nothing to do with set
inclusion, which is a partial order; see [subsume] below. *)
val compare: lr1state -> lr1state -> int
(* Subsumption between states. The two states must have the same
core. Then, one subsumes the other if and only if their lookahead
sets are (pointwise) in the subset relation. *)
......
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