Commit 1a941779 authored by Bruno Guillaume's avatar Bruno Guillaume

add activate command in syntax (not in effect)

parent c0994a10
......@@ -94,6 +94,7 @@ module Ast = struct
| Merge_node of (c_ident*c_ident)
| New_neighbour of (c_ident * c_ident * string)
| Del_node of c_ident
| Activate of c_ident
| Del_feat of (c_ident * feature_name)
| Update_feat of (c_ident * feature_name) * concat_item list
......
......@@ -81,6 +81,7 @@ module Ast : sig
| Merge_node of (c_ident*c_ident)
| New_neighbour of (c_ident * c_ident * string)
| Del_node of c_ident
| Activate of c_ident
| Del_feat of (c_ident * feature_name)
| Update_feat of (c_ident * feature_name) * concat_item list
......
......@@ -121,6 +121,8 @@ module Command = struct
(fst ancestor)
(Loc.to_string loc)
end
| (Ast.Activate n, loc) -> failwith "Not implemented"
| (Ast.Del_node n, loc) ->
check_c_ident loc n kci;
......
......@@ -46,6 +46,7 @@ module Html_doc = struct
| Ast.Shift_edge (n1,n2) -> bprintf buff "shift %s ==> %s" (Ast.c_ident_to_string n1) (Ast.c_ident_to_string n2)
| Ast.Merge_node (n1,n2) -> bprintf buff "merge %s ==> %s" (Ast.c_ident_to_string n1) (Ast.c_ident_to_string n2)
| Ast.New_neighbour (n1,n2,label) -> bprintf buff "add_node %s: <-[%s]- %s" (Ast.c_ident_to_string n1) label (Ast.c_ident_to_string n2)
| Ast.Activate n -> bprintf buff "activate %s" (Ast.c_ident_to_string n)
| Ast.Del_node n -> bprintf buff "del_node %s" (Ast.c_ident_to_string n)
| Ast.Update_feat ((n,fn),item_list) ->
bprintf buff "%s.%s = %s" (Ast.c_ident_to_string n) fn (List_.to_string string_of_concat_item " + " item_list)
......
......@@ -74,7 +74,7 @@ module Rule = struct
| Cst_out of Pid.t * P_edge.t
| Cst_in of Pid.t * P_edge.t
| Feature_eq of Pid.t * string * Pid.t * string
| Filter of Pid.t * P_fs.t (* used when a without impose a fs on a node defined by the match pattern *)
| Feature_diseq of Pid.t * string * Pid.t * string
| Feature_ineq of Ast.ineq * Pid.t * string * Pid.t * string
| Filter of Pid.t * P_fs.t (* used when a without impose a fs on a node defined by the match pattern *)
......
......@@ -52,7 +52,8 @@ let localize t = (t,get_loc ())
%token FEATURE /* feature */
%token FILE /* file */
%token LABELS /* labels */
%token NEW_NODES /* labels */
%token NEW_NODES /* new_nodes */
%token ACTIVATE /* activate */
%token MATCH /* match */
%token WITHOUT /* without */
%token COMMANDS /* commands */
......@@ -521,6 +522,9 @@ cident:
| i=IDENT { (i, None) }
| ei=EXT_IDENT { ei }
eident:
| ei=EXT_IDENT { ei }
command:
(* del_edge e *)
| DEL_EDGE n = IDENT
......@@ -558,6 +562,10 @@ command:
| ADD_NODE n1 = cident DDOT label = delimited(RTL_EDGE_LEFT,IDENT,RTL_EDGE_RIGHT) n2 = cident
{ localize (Ast.New_neighbour (n1,n2,label)) }
(* activate n#a *)
| ACTIVATE n = eident
{ localize (Ast.Activate n) }
(* del_feat m.cat *)
| DEL_FEAT qfn = EXT_QFN
{ localize (Ast.Del_feat qfn) }
......
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