Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
2bd96cd5
Commit
2bd96cd5
authored
Sep 12, 2019
by
POTTIER Francois
Browse files
New function [Lr0.outgoing_edges].
parent
f6ef5a8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lr0.ml
View file @
2bd96cd5
...
...
@@ -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
)
...
...
src/lr0.mli
View file @
2bd96cd5
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment