Commit 1091e03c authored by POTTIER Francois's avatar POTTIER Francois

Removed the construction of the backward reference graph, which was

no longer used.
parent 462b069d
......@@ -709,29 +709,19 @@ module ProductionMap = struct
end
(* ------------------------------------------------------------------------ *)
(* Build the grammar's forward and backward reference graphs.
In the backward reference graph, edges relate each nonterminal [nt]
to each of the nonterminals whose definition mentions [nt]. The
reverse reference graph is used in the computation of the nullable,
nonempty, and FIRST sets.
The forward reference graph is unused but can be printed on demand. *)
(* Build the grammar's forward reference graph. This graph is unused, but
can be printed on demand. *)
let forward : NonterminalSet.t array =
Array.make Nonterminal.n NonterminalSet.empty
let backward : NonterminalSet.t array =
Array.make Nonterminal.n NonterminalSet.empty
let () =
Array.iter (fun (nt1, rhs) ->
Array.iter (function
| Symbol.T _ ->
()
| Symbol.N nt2 ->
forward.(nt1) <- NonterminalSet.add nt2 forward.(nt1);
backward.(nt2) <- NonterminalSet.add nt1 backward.(nt2)
forward.(nt1) <- NonterminalSet.add nt2 forward.(nt1)
) rhs
) Production.table
......
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