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
52d6ebf3
Commit
52d6ebf3
authored
Aug 29, 2015
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed old Printers.{ml,mli} in demos/calc-incremental/.
This module is now in src/.
parent
25855060
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
132 deletions
+0
-132
demos/calc-incremental/Printers.ml
demos/calc-incremental/Printers.ml
+0
-94
demos/calc-incremental/Printers.mli
demos/calc-incremental/Printers.mli
+0
-38
No files found.
demos/calc-incremental/Printers.ml
deleted
100644 → 0
View file @
25855060
module
Make
(
I
:
MenhirLib
.
IncrementalEngine
.
EVERYTHING
)
(
User
:
sig
val
arrow
:
string
(* should include space on both sides *)
val
dot
:
string
val
space
:
string
val
print_symbol
:
I
.
xsymbol
->
string
end
)
=
struct
open
User
(* Buffer and string utilities. *)
let
out
=
Buffer
.
add_string
let
with_buffer
f
x
=
let
b
=
Buffer
.
create
128
in
f
b
x
;
Buffer
.
contents
b
let
into_buffer
f
b
x
=
out
b
(
f
x
)
(* Printing a list of symbols. An optional dot is printed at offset
[i] into the list [symbols], if this offset lies between [0] and
the length of the list (included). *)
let
rec
buffer_symbols
b
i
symbols
=
if
i
=
0
then
begin
out
b
dot
;
out
b
space
;
buffer_symbols
b
(
-
1
)
symbols
end
else
begin
match
symbols
with
|
[]
->
()
|
symbol
::
symbols
->
out
b
(
print_symbol
symbol
);
out
b
space
;
buffer_symbols
b
(
i
-
1
)
symbols
end
(* Printing an item. *)
let
buffer_item
b
(
prod
,
i
)
=
out
b
(
print_symbol
(
I
.
lhs
prod
));
out
b
arrow
;
buffer_symbols
b
i
(
I
.
rhs
prod
)
(* Printing a production (without a dot). *)
let
buffer_production
b
prod
=
buffer_item
b
(
prod
,
-
1
)
let
print_item
=
with_buffer
buffer_item
let
print_production
=
with_buffer
buffer_production
(* Printing an element as a symbol. *)
let
print_element_as_symbol
element
=
match
element
with
|
I
.
Element
(
s
,
_
,
_
,
_
)
->
print_symbol
(
I
.
X
(
I
.
incoming_symbol
s
))
let
buffer_element_as_symbol
=
into_buffer
print_element_as_symbol
(* Printing a stack or an environment. These functions are parameterized
over an element printer. [print_element_as_symbol] can be used for
this purpose; but the user can define other printers if desired. *)
let
buffer_stack
buffer_element
b
stack
=
I
.
foldr
(
fun
element
()
->
buffer_element
b
element
;
out
b
space
)
stack
()
let
buffer_env
buffer_element
b
env
=
buffer_stack
buffer_element
b
(
I
.
view
env
)
let
print_stack
print_element
stack
=
with_buffer
(
buffer_stack
(
into_buffer
print_element
))
stack
let
print_env
print_element
env
=
with_buffer
(
buffer_env
(
into_buffer
print_element
))
env
end
demos/calc-incremental/Printers.mli
deleted
100644 → 0
View file @
25855060
module
Make
(
I
:
MenhirLib
.
IncrementalEngine
.
EVERYTHING
)
(
User
:
sig
val
arrow
:
string
(* should include space on both sides *)
val
dot
:
string
val
space
:
string
val
print_symbol
:
I
.
xsymbol
->
string
end
)
:
sig
(* Printing an element as a symbol. This prints just the symbol
that this element represents; nothing more. *)
val
buffer_element_as_symbol
:
Buffer
.
t
->
I
.
element
->
unit
val
print_element_as_symbol
:
I
.
element
->
string
(* Printing a stack or an environment. These functions are parameterized
over an element printer. [print_element_as_symbol] can be used for
this purpose; but the user can define other printers if desired. *)
val
buffer_stack
:
(
Buffer
.
t
->
I
.
element
->
unit
)
->
Buffer
.
t
->
I
.
element
I
.
stream
->
unit
val
print_stack
:
(
I
.
element
->
string
)
->
I
.
element
I
.
stream
->
string
val
buffer_env
:
(
Buffer
.
t
->
I
.
element
->
unit
)
->
Buffer
.
t
->
I
.
env
->
unit
val
print_env
:
(
I
.
element
->
string
)
->
I
.
env
->
string
(* Printing an item. *)
val
buffer_item
:
Buffer
.
t
->
I
.
item
->
unit
val
print_item
:
I
.
item
->
string
(* Printing a production. *)
val
buffer_production
:
Buffer
.
t
->
I
.
production
->
unit
val
print_production
:
I
.
production
->
string
end
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