Commit 180b9fe3 authored by Bruno Guillaume's avatar Bruno Guillaume

remove local_labels

parent 292f1c9a
......@@ -338,7 +338,6 @@ module Ast = struct
type modul = {
module_id:Id.name;
local_labels: (string * string list) list;
rules: rule list;
deterministic: bool;
module_doc:string list;
......
......@@ -168,7 +168,6 @@ module Ast : sig
type modul = {
module_id:Id.name;
local_labels: (string * string list) list;
rules: rule list;
deterministic: bool;
module_doc:string list;
......
......@@ -172,7 +172,7 @@ module Command = struct
| H_SHIFT_OUT of (Gid.t * Gid.t)
let build ?domain ?param (kai, kei) table locals ast_command =
let build ?domain ?param (kai, kei) table ast_command =
(* kai stands for "known act ident", kei for "known edge ident" *)
let pid_of_act_id loc node_name =
......
......@@ -68,7 +68,6 @@ module Command : sig
?param: (string list * string list) ->
(Id.name list * string list) ->
Id.table ->
Label_domain.decl array ->
Ast.command ->
t * (Id.name list * string list)
end (* module Command *)
......@@ -48,7 +48,7 @@ module Label = struct
let style = get_style ?domain t in
Label_domain.to_dot ~deco style
let from_string ?loc ?domain ?(locals=[||]) str =
let from_string ?loc ?domain str =
match Domain.edge_id_from_string ?loc ?domain str with
| Some id -> id
| None ->
......
......@@ -29,7 +29,7 @@ module Label : sig
val to_dot: ?domain: Domain.t -> ?deco:bool -> t -> string
val from_string: ?loc:Loc.t -> ?domain: Domain.t -> ?locals:Label_domain.decl array -> string -> t
val from_string: ?loc:Loc.t -> ?domain: Domain.t -> string -> t
end (* module Label *)
......
......@@ -67,7 +67,7 @@ module P_graph = struct
(pid, fs)
(* -------------------------------------------------------------------------------- *)
let build ?domain ?pat_vars ?(locals=[||]) (full_node_list : Ast.node list) full_edge_list =
let build ?domain ?pat_vars (full_node_list : Ast.node list) full_edge_list =
(* NB: insert searches for a previous node with the Same name and uses unification rather than constraint *)
(* NB: insertion of new node at the end of the list: not efficient but graph building is not the hard part. *)
......@@ -122,7 +122,7 @@ module P_graph = struct
(* -------------------------------------------------------------------------------- *)
(* It may raise [P_fs.Fail_unif] in case of contradiction on constraints *)
let build_extension ?domain ?pat_vars ?(locals=[||]) pos_table full_node_list full_edge_list =
let build_extension ?domain ?pat_vars pos_table full_node_list full_edge_list =
let built_nodes = List.map (P_node.build ?domain ?pat_vars) full_node_list in
......@@ -332,7 +332,7 @@ module G_graph = struct
| None -> None
(* -------------------------------------------------------------------------------- *)
let build ?domain ?(grewpy=false) ?(locals=[||]) gr_ast =
let build ?domain ?(grewpy=false) gr_ast =
let full_node_list =
if grewpy
then List.sort (Ast.grewpy_compare) gr_ast.Ast.nodes
......
......@@ -62,7 +62,6 @@ module P_graph: sig
val build:
?domain:Domain.t ->
?pat_vars: string list ->
?locals: Label_domain.decl array ->
Ast.node list ->
Ast.edge list ->
(t * Id.table)
......@@ -71,7 +70,6 @@ module P_graph: sig
val build_extension:
?domain:Domain.t ->
?pat_vars: string list ->
?locals: Label_domain.decl array ->
Id.table ->
Ast.node list ->
Ast.edge list ->
......@@ -108,7 +106,7 @@ module G_graph: sig
(* Build functions *)
(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
val build: ?domain:Domain.t -> ?grewpy: bool -> ?locals: Label_domain.decl array -> Ast.gr -> t
val build: ?domain:Domain.t -> ?grewpy: bool -> Ast.gr -> t
val of_conll: ?domain:Domain.t -> Conll.t -> t
......
......@@ -148,7 +148,6 @@ end (* module Rewrite_history *)
module Modul = struct
type t = {
name: string;
local_labels: (string * string list) array;
rules: Rule.t list;
deterministic: bool;
loc: Loc.t;
......@@ -171,13 +170,10 @@ module Modul = struct
loop [] t.rules
let build ?domain ast_module =
let locals = Array.of_list ast_module.Ast.local_labels in
Array.sort compare locals;
let rules = List.map (Rule.build ?domain ~locals ast_module.Ast.mod_dir) ast_module.Ast.rules in
let rules = List.map (Rule.build ?domain ast_module.Ast.mod_dir) ast_module.Ast.rules in
let modul =
{
name = ast_module.Ast.module_id;
local_labels = locals;
rules;
deterministic = ast_module.Ast.deterministic;
loc = ast_module.Ast.mod_loc;
......
......@@ -69,7 +69,6 @@ end (* module Rewrite_history *)
module Modul: sig
type t = {
name: string;
local_labels: (string * string list) array;
rules: Rule.t list;
deterministic: bool;
loc: Loc.t;
......
......@@ -309,7 +309,6 @@ grew_module:
| doc=option(COMMENT) MODULE det=boption(DETERMINISTIC) id_loc=simple_id_with_loc LACC l=option(labels) r=rules RACC
{
{ Ast.module_id = fst id_loc;
local_labels = (match l with None -> [] | Some x -> x);
rules = r;
deterministic = det;
module_doc = (match doc with Some d -> d | None -> []);
......
......@@ -269,7 +269,7 @@ module Rule = struct
("constraints", `List (List.map (const_to_json ?domain) basic.constraints));
]
let build_pos_basic ?domain ?pat_vars ?(locals=[||]) basic_ast =
let build_pos_basic ?domain ?pat_vars basic_ast =
let (graph, pos_table) =
P_graph.build ?domain ?pat_vars basic_ast.Ast.pat_nodes basic_ast.Ast.pat_edges in
(
......@@ -345,7 +345,7 @@ module Rule = struct
Large_prec (pid_of_name loc id1, pid_of_name loc id2)
(* It may raise [P_fs.Fail_unif] in case of contradiction on constraints *)
let build_neg_basic ?domain ?pat_vars ?(locals=[||]) pos_table basic_ast =
let build_neg_basic ?domain ?pat_vars pos_table basic_ast =
let (extension, neg_table) =
P_graph.build_extension ?domain ?pat_vars pos_table basic_ast.Ast.pat_nodes basic_ast.Ast.pat_edges in
......@@ -458,7 +458,7 @@ module Rule = struct
Buffer.contents buff
(* ====================================================================== *)
let build_commands ?domain ?param ?(locals=[||]) pos pos_table ast_commands =
let build_commands ?domain ?param pos pos_table ast_commands =
let known_act_ids = Array.to_list pos_table in
let known_edge_ids = get_edge_ids pos in
......@@ -471,7 +471,6 @@ module Rule = struct
?param
(kai,kei)
pos_table
locals
ast_command in
command :: (loop (new_kai,new_kei) tail) in
loop (known_act_ids, known_edge_ids) ast_commands
......@@ -490,7 +489,7 @@ module Rule = struct
parse_pat_vars vars
(* ====================================================================== *)
let build ?domain ?(locals=[||]) dir rule_ast =
let build ?domain dir rule_ast =
let (param, pat_vars, cmd_vars) =
match rule_ast.Ast.param with
......
......@@ -82,7 +82,7 @@ module Rule : sig
(** [build domain ?local dir ast_rule] returns the Rule.t value corresponding to [ast_rule].
[dir] is used for localisation of lp files *)
val build: ?domain:Domain.t -> ?locals:Label_domain.decl array -> string -> Ast.rule -> t
val build: ?domain:Domain.t -> string -> Ast.rule -> t
(** [normalize domain module_name ?deterministic rule_list instance] returns a set of normal forms *)
(* raise Stop if some command fails to apply *)
......
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