Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
b85051b1
Commit
b85051b1
authored
Mar 23, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include the start nonterminal symbol in the information produced by [entry_points].
parent
a9879267
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
src/cmly_api.ml
src/cmly_api.ml
+3
-3
src/cmly_format.ml
src/cmly_format.ml
+1
-1
src/cmly_write.ml
src/cmly_write.ml
+3
-3
No files found.
src/cmly_api.ml
View file @
b85051b1
...
...
@@ -47,11 +47,11 @@ module type GRAMMAR = sig
end
module
Grammar
:
sig
val
basename
:
string
val
preludes
:
string
list
val
postludes
:
string
list
val
basename
:
string
val
parameters
:
string
list
(* %parameter declarations *)
val
entry_points
:
(
production
*
lr1
)
list
val
parameters
:
string
list
val
entry_points
:
(
nonterminal
*
production
*
lr1
)
list
val
attributes
:
Attribute
.
t
list
end
...
...
src/cmly_format.ml
View file @
b85051b1
...
...
@@ -93,7 +93,7 @@ type grammar = {
g_productions
:
production_def
array
;
g_lr0_states
:
lr0_state_def
array
;
g_lr1_states
:
lr1_state_def
array
;
g_entry_points
:
(
production
*
lr1
)
list
;
g_entry_points
:
(
nonterminal
*
production
*
lr1
)
list
;
g_attributes
:
attributes
;
g_parameters
:
string
list
;
}
src/cmly_write.ml
View file @
b85051b1
...
...
@@ -130,8 +130,8 @@ let lr1_state (node : Lr1.node) : lr1_state_def =
TerminalMap
.
fold_rev
add
(
Lr1
.
reductions
node
)
[]
}
let
entry_point
prod
node
xs
:
(
production
*
lr1
)
list
=
(
Production
.
p2i
prod
,
Lr1
.
number
node
)
::
xs
let
entry_point
prod
node
nt
_typ
accu
:
(
nonterminal
*
production
*
lr1
)
list
=
(
Nonterminal
.
n2i
nt
,
Production
.
p2i
prod
,
Lr1
.
number
node
)
::
accu
let
encode
()
:
grammar
=
{
...
...
@@ -143,7 +143,7 @@ let encode () : grammar =
g_productions
=
Production
.
init
production
;
g_lr0_states
=
Array
.
init
Lr0
.
n
lr0_state
;
g_lr1_states
=
Array
.
of_list
(
Lr1
.
map
lr1_state
);
g_entry_points
=
ProductionMap
.
fold
entry_point
Lr1
.
entry
[]
;
g_entry_points
=
Lr1
.
fold_entry
entry_point
[]
;
g_attributes
=
attributes
Analysis
.
attributes
;
g_parameters
=
List
.
map
raw_content
Front
.
grammar
.
parameters
;
}
...
...
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