Commit 29da64b1 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Remove [past].

parent 0df691c9
......@@ -100,30 +100,6 @@ module P =
let print_element = Some (fun s -> print (print_element s))
(* The past of an LR(0) item is the first part of the right-hand side,
up to the point. We represent it as a reversed list, right to left.
Thus, the past corresponds to a prefix of the stack. *)
let past (prod, index) =
let rhs = rhs prod in
List.rev (MenhirLib.General.take index rhs)
(* The LR(0) items that form the core of an LR(1) state have compatible
pasts. If we pick the one with the longest past, we obtain the past
of this state, i.e., the longest statically known prefix of the stack
in this state. *)
let past items =
let (max_index, max_past) =
List.fold_left (fun ((max_index, max_past) as accu) ((_, index) as item) ->
if max_index < index then
index, past item
) (0, []) items
let items_current env =
(* Get the current state. *)
match Lazy.force (stack env) with
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