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
7642c33b
Commit
7642c33b
authored
Jan 07, 2015
by
POTTIER Francois
Browse files
Include the start productions in [production_defs].
It is not useful, but should not cost much, and is more regular.
parent
cb955491
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tableBackend.ml
View file @
7642c33b
...
...
@@ -862,18 +862,15 @@ let incoming_symbol_def () =
(* ------------------------------------------------------------------------ *)
(* A table that maps a production (i.e., an integer index) to its definition
(i.e., its right-hand side).
This table concerns ordinary productions only,
as opposed to the start productions, whose existence
is not exposed to the
user. We deal with the start productions by considering they have an empty
right-hand sid
e. *)
(i.e., its right-hand side).
In principle, we use this table only for
ordinary productions,
as opposed to the start productions, whose existence
is not exposed to the user. However, it is simpler (and not costly) to
include all productions in this tabl
e. *)
let
production_def
prod
=
elist
(
if
Production
.
is_start
prod
then
[]
else
(* The production's right-hand side. This is a list of symbols. *)
List
.
map
xsymbol
(
Array
.
to_list
(
Production
.
rhs
prod
))
(* The production's right-hand side. This is a list of symbols. *)
List
.
map
xsymbol
(
Array
.
to_list
(
Production
.
rhs
prod
))
)
let
production_defs
()
=
...
...
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