Commit 33b4eb78 authored by POTTIER Francois's avatar POTTIER Francois

Create the table [nullable]. Not yet exploited.

parent c50ccbcd
......@@ -47,5 +47,11 @@ module type TABLES = sig
val lr0_incoming: PackedIntArray.t
(* A table that tells which non-terminal symbols are nullable. *)
val nullable: string
(* Like the [error] bitmap, this is the second component
of a packed int array of bit width 1. *)
end
......@@ -902,6 +902,23 @@ let lr0_items () =
(* ------------------------------------------------------------------------ *)
(* A table that tells which nonterminal symbols are nullable.
(For simplicity, this table includes the start symbols.) *)
let nullable () =
assert Settings.inspection;
let nullable : int list =
Nonterminal.map (fun nt ->
if Analysis.nullable nt then 1 else 0
)
in
define_and_measure (
"nullable",
marshal11_list nullable
)
(* ------------------------------------------------------------------------ *)
(* Let's put everything together. *)
open UnparameterizedSyntax
......@@ -1015,6 +1032,7 @@ let program =
rhs() ::
lr0_core() ::
lr0_items() ::
nullable() ::
[]
) ::
[]
......
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