Commit 1542f265 authored by POTTIER Francois's avatar POTTIER Francois

Renamings in [Action].

parent ab8b48b3
......@@ -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
......
......@@ -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
......
......@@ -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
......
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