Commit bf09998f authored by POTTIER Francois's avatar POTTIER Francois

Removed the left-hand side of the [production_defs] table, which

was no longer needed.
parent e3ba88ea
......@@ -862,23 +862,18 @@ let incoming_symbol_def () =
(* ------------------------------------------------------------------------ *)
(* A table that maps a production (i.e., an integer index) to its definition
(i.e., its left-hand and right-hand sides). This table concerns ordinary
productions only, as opposed to the start productions, whose existence is
not exposed to the user. *)
(i.e., its right-hand side). This table concerns ordinary productions only,
as opposed to the start productions, whose existence is not exposed to the
user. *)
let production_def prod =
if Production.is_start prod then
enone
else
esome (ETuple [
(* The production's left-hand side. This is always a nonterminal symbol,
of course. For simplicity, we encode it at type [xsymbol], even though
we could in principle use an existentially-quantified type of
nonterminal symbols. *)
xsymbol (Symbol.N (Production.nt prod));
esome (
(* The production's right-hand side. This is a list of symbols. *)
elist (List.map xsymbol (Array.to_list (Production.rhs prod)))
])
)
let production_defs () =
assert Settings.inspection;
......
......@@ -139,7 +139,7 @@ module type INSPECTION_TABLES = sig
(* The definition (i.e. left-hand side and right-hand side) of every
(non-start) production. *)
val production_defs: (xsymbol * xsymbol list) option array
val production_defs: (xsymbol list) option array
(* A mapping of every (non-initial) state to its LR(0) core. *)
......
......@@ -188,8 +188,7 @@ module MakeInspection (T : TableFormat.INSPECTION_TABLES) = struct
T.nonterminal nt
let rhs prod =
let _, rhs = production_def prod in
rhs
production_def prod
(* This is a copy of [Item.export]. *)
......
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