Commit 43233fce authored by Bruno Guillaume's avatar Bruno Guillaume

remove old syntax for new nodes

parent 9fca1eb5
......@@ -255,7 +255,6 @@ module Ast = struct
| Shift_out of (Id.name * Id.name * edge_label_cst)
| Shift_edge of (Id.name * Id.name * edge_label_cst)
| New_neighbour of (Id.name * Id.name * edge_label)
| New_node of Id.name
| New_before of (Id.name * Id.name)
| New_after of (Id.name * Id.name)
......@@ -303,7 +302,6 @@ module Ast = struct
| Shift_edge (n1,n2,Regexp re) ->
sprintf "shift %s =[re\"%s\"]=> %s" n1 re n2
| New_neighbour (n1,n2,label) -> sprintf "add_node %s: <-[%s]- %s" n1 label n2
| New_node (n) -> sprintf "add_node %s" n
| New_before (n1,n2) -> sprintf "add_node %s :< %s" n1 n2
| New_after (n1,n2) -> sprintf "add_node %s :> %s" n1 n2
......@@ -313,12 +311,6 @@ module Ast = struct
| Del_feat (act_id, feat_name) ->
sprintf "del_feat %s.%s" act_id feat_name
let rec replace_new_neighbour = function
| [] -> []
| (New_neighbour (new_name, old_name, edge),loc) :: tail ->
(New_after (new_name, old_name),loc) :: (Add_edge (old_name, new_name, edge),loc) :: (replace_new_neighbour tail)
| head :: tail -> head :: (replace_new_neighbour tail)
(* the [rule] type is used for 3 kinds of module items:
- rule { param=None; ... }
- lex_rule
......
......@@ -143,8 +143,6 @@ module Ast : sig
| Shift_out of (Id.name * Id.name * edge_label_cst)
| Shift_edge of (Id.name * Id.name * edge_label_cst)
| New_neighbour of (Id.name * Id.name * edge_label)
| New_node of Id.name
| New_before of (Id.name * Id.name)
| New_after of (Id.name * Id.name)
......@@ -156,10 +154,6 @@ module Ast : sig
val string_of_u_command: u_command -> string
type command = u_command * Loc.t
val replace_new_neighbour: command list -> command list
type rule = {
rule_id:Id.name;
pattern: pattern;
......
......@@ -283,6 +283,4 @@ module Command = struct
| _ -> Error.build ~loc "[Update_feat] Only open features can be modified with the concat operator '+' but \"%s\" is not declared as an open feature" feat_name);
((UPDATE_FEAT (pid_of_act_id loc act_id, feat_name, items), loc), (kai, kei))
| (Ast.New_neighbour _, _) -> Error.bug "New_neighbour command must be replaced"
end (* module Command *)
......@@ -528,9 +528,6 @@ module G_graph = struct
| (None, None) -> map_wo_node in
{ graph with map = new_map }
(* -------------------------------------------------------------------------------- *)
let add_neighbour loc ?domain graph node_id label = failwith "no more add_neighbour"
(* -------------------------------------------------------------------------------- *)
let insert ?domain id1 id2 graph =
let node1 = Gid_map.find id1 graph.map in
......
......@@ -139,8 +139,6 @@ module G_graph: sig
[graph] is unchanged if the node is not in it. *)
val del_node: t -> Gid.t -> t
val add_neighbour: Loc.t -> ?domain:Domain.t -> t -> Gid.t -> G_edge.t -> (Gid.t * t)
val add_before: Loc.t -> ?domain:Domain.t -> Gid.t -> t -> (Gid.t * t)
val add_after: Loc.t -> ?domain:Domain.t -> Gid.t -> t -> (Gid.t * t)
......
......@@ -111,9 +111,9 @@ module G_node = struct
let rm_out_edges t = {t with next = Massoc_gid.empty}
let build_neighbour t = { empty with position = (get_position t) +. 0.01 }
(* let build_neighbour t = { empty with position = (get_position t) +. 0.01 }
let build_new t = { empty with position = (get_position t) +. 0.01 }
let build_new t = { empty with position = (get_position t) +. 0.01 } *)
let position_comp n1 n2 = Pervasives.compare n1.position n2.position
......
......@@ -73,8 +73,8 @@ module G_node: sig
raise an [Build] exception if there is more than one such feature. *)
val get_annot_info: t -> string option
val build_neighbour: t -> t
val build_new: t -> t
(* val build_neighbour: t -> t
val build_new: t -> t *)
val rename: (Gid.t * Gid.t) list -> t -> t
end
......
......@@ -332,7 +332,7 @@ rule:
{
{ Ast.rule_id = fst id_loc;
pattern = Ast.complete_pattern { Ast.pat_pos = p; Ast.pat_negs = n };
commands = Ast.replace_new_neighbour cmds;
commands = cmds;
param = None;
lex_par = None;
rule_doc = begin match doc with Some d -> d | None -> [] end;
......@@ -343,7 +343,7 @@ rule:
{
{ Ast.rule_id = fst id_loc;
pattern = Ast.complete_pattern { Ast.pat_pos = p; Ast.pat_negs = n };
commands = Ast.replace_new_neighbour cmds;
commands = cmds;
param = Some param;
lex_par = lex_par;
rule_doc = begin match doc with Some d -> d | None -> [] end;
......@@ -673,12 +673,6 @@ command:
| com_fead_id_loc= feature_ident_with_loc EQUAL items=separated_nonempty_list (PLUS, concat_item)
{ let (com_fead_id,loc) = com_fead_id_loc in (Ast.Update_feat (com_fead_id, items), loc) }
/* OBSOLETE SYNTAX */
/* add_node n: <-[x]- m */
| ADD_NODE new_ci_loc=simple_id_with_loc DDOT label=delimited(RTL_EDGE_LEFT,label_ident,RTL_EDGE_RIGHT) anc_ci=simple_id
{ let (new_ci,loc) = new_ci_loc in (Ast.New_neighbour (new_ci, anc_ci,label), loc) }
concat_item:
| gi=ID { if Ast.is_simple_ident gi then Ast.String_item gi else Ast.Qfn_item (Ast.parse_feature_ident gi) }
| s=STRING { Ast.String_item s }
......
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