Commit 2bd96cd5 authored by POTTIER Francois's avatar POTTIER Francois

New function [Lr0.outgoing_edges].

parent f6ef5a8d
......@@ -236,6 +236,14 @@ let items node : Item.Set.t =
let incoming_symbol node : Symbol.t option =
InfiniteArray.get incoming node
let outgoing_edges node : node SymbolMap.t =
SymbolMap.map
(fun (target, _) -> target)
(InfiniteArray.get _transitions node)
let outgoing_symbols node : Symbol.t list =
SymbolMap.domain (InfiniteArray.get _transitions node)
(* ------------------------------------------------------------------------ *)
(* Help for building the LR(1) automaton. *)
......@@ -331,12 +339,6 @@ let transitions
((k, Array.map (interpret state) sr) : lr1state)
) (InfiniteArray.get _transitions k)
let outgoing_symbols
(k : node)
: Symbol.t list =
SymbolMap.domain (InfiniteArray.get _transitions k)
let transition
symbol
((k, _) as state : lr1state)
......
......@@ -44,6 +44,11 @@ val items: node -> Item.Set.t
val incoming_symbol: node -> Symbol.t option
(* The outgoing edges of a node. *)
val outgoing_edges: node -> node SymbolMap.t
val outgoing_symbols: node -> Symbol.t list
(* ------------------------------------------------------------------------ *)
(* Help for building the LR(1) automaton. *)
......@@ -77,7 +82,6 @@ val start: node -> lr1state
(* Information about the transitions and reductions at a state. *)
val transitions: lr1state -> lr1state SymbolMap.t
val outgoing_symbols: node -> Symbol.t list
val transition: Symbol.t -> lr1state -> lr1state
val reductions: lr1state -> (TerminalSet.t * Production.index) list
......
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