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
1542f265
Commit
1542f265
authored
Nov 04, 2015
by
POTTIER Francois
Browse files
Renamings in [Action].
parent
ab8b48b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/action.ml
View file @
1542f265
...
...
@@ -59,7 +59,7 @@ type sw =
type
keyword_renaming
=
string
*
sw
*
sw
let
rename_position_keyword
let
rename_position_keyword
_outer
((
psym
,
first_prod
,
last_prod
)
:
keyword_renaming
)
(
subject
,
where
)
:
sw
=
match
subject
,
where
with
...
...
@@ -70,7 +70,7 @@ let rename_position_keyword
|
WhereStart
->
first_prod
|
WhereEnd
->
last_prod
let
rename_position_keyword_
2
let
rename_position_keyword_
inner
((
psym
,
first_prod
,
last_prod
)
:
keyword_renaming
)
(
subject
,
where
)
:
sw
=
match
subject
,
where
with
...
...
@@ -148,11 +148,11 @@ let rename f renaming phi a =
keywords
=
keywords
;
}
let
rename_
inlined_psym
=
rename
rename_position_keyword
let
rename_
outer
=
rename
rename_position_keyword
_outer
let
rename
=
rename
rename_position_keyword_
2
let
rename
_inner
=
rename
rename_position_keyword_
inner
let
to_il_expr
action
=
action
.
expr
...
...
src/action.mli
View file @
1542f265
...
...
@@ -13,18 +13,18 @@ type sw =
type
keyword_renaming
=
string
*
sw
*
sw
(** [rename keyword_renaming phi a] builds the action
(** [rename
_inner
keyword_renaming phi a] builds the action
[let x1 = x1' and ... xn = xn' in a] if [phi] is [(x1, x1') ... (xn, xn')].
Moreover, [renaming_env] is used to correctly replace $startpos/$endpos
present in the semantic action. *)
val
rename
:
val
rename
_inner
:
keyword_renaming
->
(
string
*
string
)
list
->
t
->
t
(** [rename_
inlined_psym
keyword_renaming phi a] updates the occurrences of the
(** [rename_
outer
keyword_renaming phi a] updates the occurrences of the
inlined non terminal in the action [a].
*)
val
rename_
inlined_psym
:
val
rename_
outer
:
keyword_renaming
->
(
string
*
string
)
list
->
t
->
t
...
...
src/nonTerminalDefinitionInlining.ml
View file @
1542f265
...
...
@@ -138,10 +138,10 @@ let inline grammar =
the first producer of the inlined branch if it is not empty or
the preceding producer found in the prefix. *)
let
outer_action
=
Action
.
rename_
inlined_psym
renaming_env
[]
b
.
action
Action
.
rename_
outer
renaming_env
[]
b
.
action
in
let
action'
=
Action
.
rename
renaming_env
phi
pb
.
action
Action
.
rename
_inner
renaming_env
phi
pb
.
action
in
{
b
with
...
...
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