Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
a2c403bc
Commit
a2c403bc
authored
Jan 01, 2015
by
POTTIER Francois
Browse files
Cleanup.
parent
339d6f81
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tableBackend.ml
View file @
a2c403bc
...
...
@@ -689,53 +689,58 @@ let application =
(* The client API invokes the interpreter with an appropriate start state. *)
let
api
:
IL
.
valdef
list
=
let
lexer
=
"lexer"
and
lexbuf
=
"lexbuf"
in
(* An entry point to the monolithic API. *)
Lr1
.
fold_entry
(
fun
_prod
state
nt
t
api
->
(* The entry point to the monolithic API. *)
define
(
Nonterminal
.
print
true
nt
,
EFun
(
[
PVar
lexer
;
PVar
lexbuf
]
,
EAnnot
(
EMagic
(
E
App
(
EVar
entry
,
[
EIntConst
(
Lr1
.
number
state
);
EVar
lexer
;
EVar
lex
buf
]
)
)
,
type2scheme
(
TypTextual
t
)
)
let
monolithic_entry_point
state
nt
t
=
define
(
Nonterminal
.
print
true
nt
,
let
lexer
=
"lexer"
and
lexbuf
=
"lexbuf"
in
EFun
(
[
PVar
lexer
;
PVar
lexbuf
]
,
EAnnot
(
E
Magic
(
EApp
(
EVar
entry
,
[
EIntConst
(
Lr1
.
number
state
)
;
EVar
lex
er
;
EVar
lexbuf
]
)
)
,
type2scheme
(
TypTextual
t
)
)
)
::
(* The entry point to the incremental API. *)
define
(
(* [false] is intentional; [incremental] performs normalization *)
incremental
(
Nonterminal
.
print
false
nt
)
,
(* In principle the abstraction [fun () -> ...] should not be
necessary, since [start] is a pure function. However, when
[--trace] is enabled, [start] will log messages to the
standard error channel. *)
EFun
(
[
PUnit
]
,
EAnnot
(
EMagic
(
EApp
(
EVar
start
,
[
EIntConst
(
Lr1
.
number
state
);
]
)
)
,
type2scheme
(
result
(
TypTextual
t
))
)
)
)
(* An entry point to the incremental API. *)
let
incremental_entry_point
state
nt
t
=
define
(
incremental
(
Nonterminal
.
print
true
nt
)
,
(* In principle the abstraction [fun () -> ...] should not be
necessary, since [start] is a pure function. However, when
[--trace] is enabled, [start] will log messages to the
standard error channel. *)
EFun
(
[
PUnit
]
,
EAnnot
(
EMagic
(
EApp
(
EVar
start
,
[
EIntConst
(
Lr1
.
number
state
);
]
)
)
,
type2scheme
(
result
(
TypTextual
t
))
)
)
::
)
)
let
api
:
IL
.
valdef
list
=
Lr1
.
fold_entry
(
fun
_prod
state
nt
t
api
->
monolithic_entry_point
state
nt
t
::
incremental_entry_point
state
nt
t
::
api
)
[]
...
...
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