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
dcc89cc9
Commit
dcc89cc9
authored
Oct 16, 2015
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose the function [number] in the incremental API.
parent
942ce961
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
1 deletion
+23
-1
CHANGES
CHANGES
+1
-0
TODO
TODO
+1
-1
doc/main.tex
doc/main.tex
+8
-0
src/IncrementalEngine.ml
src/IncrementalEngine.ml
+4
-0
src/engineTypes.ml
src/engineTypes.ml
+4
-0
src/referenceInterpreter.ml
src/referenceInterpreter.ml
+3
-0
src/tableInterpreter.ml
src/tableInterpreter.ml
+2
-0
No files found.
CHANGES
View file @
dcc89cc9
...
@@ -4,6 +4,7 @@ A [supplier] is a function that produces tokens on demand.
...
@@ -4,6 +4,7 @@ A [supplier] is a function that produces tokens on demand.
[lexer_lexbuf_to_supplier] turns a lexer and a lexbuf into a supplier.
[lexer_lexbuf_to_supplier] turns a lexer and a lexbuf into a supplier.
[loop] is a ready-made made main parsing loop.
[loop] is a ready-made made main parsing loop.
[loop_handle] is a variant of [loop] that lets the user do her own error handling.
[loop_handle] is a variant of [loop] that lets the user do her own error handling.
[number] maps a state of the LR(1) automaton to its number.
2015/10/16:
2015/10/16:
Incompatible change of the incremental API: renamed the type ['a result]
Incompatible change of the incremental API: renamed the type ['a result]
...
...
TODO
View file @
dcc89cc9
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
* Suite des patchs de Frédéric Bour.
* Suite des patchs de Frédéric Bour.
API d'inspection complète.
API d'inspection complète.
Exposer le nombre d'états (pour la mémoisation)
et une conversion état -> entier
.
Exposer le nombre d'états (pour la mémoisation).
Idem pour les productions.
Idem pour les productions.
Fonctions d'affichage pour les types terminal, nonterminal, etc.?
Fonctions d'affichage pour les types terminal, nonterminal, etc.?
Fonctions d'isomorphisme entre token et 'a terminal * 'a?
Fonctions d'isomorphisme entre token et 'a terminal * 'a?
...
...
doc/main.tex
View file @
dcc89cc9
...
@@ -2149,6 +2149,14 @@ The index \verb+'a+ is the type of the semantic values associated with $A$.
...
@@ -2149,6 +2149,14 @@ The index \verb+'a+ is the type of the semantic values associated with $A$.
The role played by
\verb
+
'a
+
is clarified in the definition of the
The role played by
\verb
+
'a
+
is clarified in the definition of the
type
\verb
+
element
+
, which follows.
type
\verb
+
element
+
, which follows.
%% val number
\begin{verbatim}
val number:
_
lr1state -> int
\end{verbatim}
The states of the LR(1) automaton are numbered (from 0 and up).
%% type element
%% type element
\begin{verbatim}
\begin{verbatim}
...
...
src/IncrementalEngine.ml
View file @
dcc89cc9
...
@@ -113,6 +113,10 @@ module type INCREMENTAL_ENGINE = sig
...
@@ -113,6 +113,10 @@ module type INCREMENTAL_ENGINE = sig
type
'
a
lr1state
type
'
a
lr1state
(* The states of the LR(1) automaton are numbered (from 0 and up). *)
val
number
:
_
lr1state
->
int
(* An element is a pair of a non-initial state [s] and a semantic value [v]
(* An element is a pair of a non-initial state [s] and a semantic value [v]
associated with the incoming symbol of this state. The idea is, the value
associated with the incoming symbol of this state. The idea is, the value
[v] was pushed onto the stack just before the state [s] was entered. Thus,
[v] was pushed onto the stack just before the state [s] was entered. Thus,
...
...
src/engineTypes.ml
View file @
dcc89cc9
...
@@ -84,6 +84,10 @@ module type TABLE = sig
...
@@ -84,6 +84,10 @@ module type TABLE = sig
type
state
type
state
(* States are numbered. *)
val
number
:
state
->
int
(* The type of tokens. These can be thought of as real tokens, that is,
(* The type of tokens. These can be thought of as real tokens, that is,
tokens returned by the lexer. They carry a semantic value. This type
tokens returned by the lexer. They carry a semantic value. This type
does not include the [error] pseudo-token. *)
does not include the [error] pseudo-token. *)
...
...
src/referenceInterpreter.ml
View file @
dcc89cc9
...
@@ -9,6 +9,9 @@ module T = struct
...
@@ -9,6 +9,9 @@ module T = struct
type
state
=
type
state
=
Lr1
.
node
Lr1
.
node
let
number
=
Lr1
.
number
type
token
=
type
token
=
Terminal
.
t
Terminal
.
t
...
...
src/tableInterpreter.ml
View file @
dcc89cc9
...
@@ -5,6 +5,8 @@ module Make (T : TableFormat.TABLES)
...
@@ -5,6 +5,8 @@ module Make (T : TableFormat.TABLES)
type
state
=
type
state
=
int
int
let
number
s
=
s
type
token
=
type
token
=
T
.
token
T
.
token
...
...
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