Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
61697906
Commit
61697906
authored
Apr 06, 2017
by
POTTIER Francois
Browse files
Removed [Lr1.fold_reduced].
parent
4c65eb03
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/codeBackend.ml
View file @
61697906
...
...
@@ -439,10 +439,10 @@ let (shiftreduce : Production.index -> bool), shiftreducecount =
(* Check that all call sites push a stack cell and have a
default reduction. *)
Lr1
.
fold_reduce
d
(
fun
s
accu
->
Lr1
.
NodeSet
.
fol
d
(
fun
s
accu
->
accu
&&
(
match
Default
.
has_default_reduction
s
with
None
->
false
|
Some
_
->
true
)
&&
(
runpushes
s
)
)
prod
true
)
(
Lr1
.
production_where
prod
)
true
)
...
...
src/lr1.ml
View file @
61697906
...
...
@@ -938,8 +938,8 @@ let () =
(* For each production, compute where (that is, in which states) this
production can be reduced. This computation is done AFTER default conflict
resolution (see below). It is an error to call the accessor
functions
[may_reduce], [ever_reduced], [fold_reduced] before
conflict resolution. *)
resolution (see below). It is an error to call
any of
the accessor
functions before default
conflict resolution
has taken place
. *)
let
production_where
:
NodeSet
.
t
ProductionMap
.
t
option
ref
=
ref
None
...
...
@@ -981,9 +981,6 @@ let may_reduce node prod =
let
ever_reduced
prod
=
not
(
NodeSet
.
is_empty
(
production_where
prod
))
let
fold_reduced
f
prod
accu
=
NodeSet
.
fold
f
(
production_where
prod
)
accu
(* ------------------------------------------------------------------------ *)
(* When requested by the code generator, apply default conflict
resolution to ensure that the automaton is deterministic. *)
...
...
src/lr1.mli
View file @
61697906
...
...
@@ -193,8 +193,3 @@ val may_reduce: node -> Production.index -> bool
(* [ever_reduced prod] tells whether production [prod] is ever reduced. *)
val
ever_reduced
:
Production
.
index
->
bool
(* [fold_reduced prod] folds over all states that can reduce
production [prod]. *)
val
fold_reduced
:
(
node
->
'
a
->
'
a
)
->
Production
.
index
->
'
a
->
'
a
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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