Commit 4b199254 authored by POTTIER Francois's avatar POTTIER Francois

Document [current_state_number].

parent db51d2ce
...@@ -2548,6 +2548,20 @@ than or equal to the number of elements in the stack, \verb+None+ is returned. ...@@ -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 \verb+get+ is implemented using \verb+pop_many+ and \verb+top+: its time
complexity is $O(i)$. 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 %% val equal
\begin{verbatim} \begin{verbatim}
......
...@@ -282,10 +282,10 @@ module type INCREMENTAL_ENGINE = sig ...@@ -282,10 +282,10 @@ module type INCREMENTAL_ENGINE = sig
val get: int -> 'a env -> element option val get: int -> 'a env -> element option
(* [current_state_number env] returns (the integer number of) the automaton's (* [current_state_number env] is (the integer number of) the automaton's
current state. This works even if the automaton's stack is empty, in which current state. This works even if the automaton's stack is empty, in
case the current state is an initial state. This number can be used as an which case the current state is an initial state. This number can be
argument to a [message] function that was generated by [menhir passed as an argument to a [message] function generated by [menhir
--compile-errors]. *) --compile-errors]. *)
val current_state_number: 'a env -> int val current_state_number: 'a env -> int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment