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
4b199254
Commit
4b199254
authored
Apr 10, 2017
by
POTTIER Francois
Browse files
Document [current_state_number].
parent
db51d2ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
doc/main.tex
View file @
4b199254
...
...
@@ -2548,6 +2548,20 @@ than or equal to the number of elements in the stack, \verb+None+ is returned.
\verb
+
get
+
is implemented using
\verb
+
pop_many
+
and
\verb
+
top
+
: its time
complexity is
$
O
(
i
)
$
.
%% val current_state_number
\begin{verbatim}
val current
_
state
_
number: 'a env -> int
\end{verbatim}
\verb
+
current_state_number env
+
is the integer number of the automaton's
current state. Although this number might conceivably be obtained via the
functions~
\verb
+
top
+
and
\verb
+
number
+
, using
\verb
+
current_state_number
+
is
preferable, because this method works even when the automaton's stack is empty
(in which case the current state is an initial state, and
\verb
+
top
+
returns
\verb
+
None
+
). This number can be passed as an argument to a
\verb
+
message
+
function generated by
\verb
+
menhir --compile-errors
+
.
%% val equal
\begin{verbatim}
...
...
src/IncrementalEngine.ml
View file @
4b199254
...
...
@@ -282,10 +282,10 @@ module type INCREMENTAL_ENGINE = sig
val
get
:
int
->
'
a
env
->
element
option
(* [current_state_number env]
return
s (the integer number of) the automaton's
current state. This works even if the automaton's stack is empty, in
which
case the current state is an initial state. This number can be
used as an
argument to a [message] function
that was
generated by [menhir
(* [current_state_number env]
i
s (the integer number of) the automaton's
current state. This works even if the automaton's stack is empty, in
which
case the current state is an initial state. This number can be
passed as an
argument to a [message] function generated by [menhir
--compile-errors]. *)
val
current_state_number
:
'
a
env
->
int
...
...
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