Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
11
Issues
11
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
f3b9933b
Commit
f3b9933b
authored
Apr 07, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented [get].
parent
d5dd4089
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
doc/main.tex
doc/main.tex
+12
-0
src/IncrementalEngine.ml
src/IncrementalEngine.ml
+1
-1
No files found.
doc/main.tex
View file @
f3b9933b
...
...
@@ -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}
...
...
src/IncrementalEngine.ml
View file @
f3b9933b
...
...
@@ -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). *)
...
...
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