Commit f3b9933b by POTTIER Francois

Documented [get].

parent d5dd4089
......@@ -2536,6 +2536,18 @@ is done via \verb+i+ successive invocations of \verb+pop+. Thus,
\verb+pop_many 1+ is \verb+pop+. The index \verb+i+ must be nonnegative. The
time complexity is $O(i)$.
%% val get
\begin{verbatim}
val get: int -> 'a env -> element option
\end{verbatim}
\verb+get i env+ returns the parser's \verb+i+-th stack element. The index
\verb+i+ is 0-based: thus, \verb+get 0+ is \verb+top+. If \verb+i+ is greater
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 positions
\begin{verbatim}
......
......@@ -275,7 +275,7 @@ module type INCREMENTAL_ENGINE = sig
val pop_many: int -> 'a env -> 'a env option
(* [get i env] returns the parser's [i]-th stack cell. The index [i] is
(* [get i env] returns the parser's [i]-th stack element. The index [i] is
0-based: thus, [get 0] is [top]. If [i] is greater than or equal to the
number of elements in the stack, [None] is returned. The time complexity
is O(i). *)
......
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