Commit e91ca0cf authored by bguillaum's avatar bguillaum

In gr format, the ‘.’ char is accepted in node identifiers

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@9062 7838e531-6607-4d57-9587-6c381814729c
parent 5f530c55
......@@ -52,6 +52,12 @@ module Ast = struct
let parse_pattern_label_ident s = check_special "label ident" [":"; "."; "*"] s; s
let dump_pattern_label_ident name = name
(* ---------------------------------------------------------------------- *)
(* node_ident: W0.5 *)
type node_ident = string
let parse_node_ident s = check_special "node ident" ["."] s; s
let dump_node_ident name = name
(* ---------------------------------------------------------------------- *)
(* feature_ident: V.cat *)
type feature_ident = Id.name * feature_name
......
......@@ -32,6 +32,12 @@ module Ast : sig
val parse_pattern_label_ident: string -> pattern_label_ident
val dump_pattern_label_ident: pattern_label_ident -> string
(* ---------------------------------------------------------------------- *)
(* node_ident: W0.5 *)
type node_ident = string
val parse_node_ident: string -> node_ident
val dump_node_ident: node_ident -> string
(* ---------------------------------------------------------------------- *)
(* feature_ident: V.cat *)
type feature_ident = Id.name * feature_name
......
......@@ -152,6 +152,12 @@ simple_id:
simple_id_with_loc:
| id=ID { localize (Ast.parse_simple_ident id) }
node_id:
| id=ID { Ast.parse_node_ident id }
node_id_with_loc:
| id=ID { localize (Ast.parse_node_ident id) }
feature_ident :
| id=ID { Ast.parse_feature_ident id }
......@@ -191,12 +197,12 @@ gr_item:
(* B (1) [phon="pense", lemma="penser", cat=v, mood=ind ] *)
(* B [phon="pense", lemma="penser", cat=v, mood=ind ] *)
| id_loc=simple_id_with_loc position=option(delimited(LPAREN, FLOAT ,RPAREN)) feats=delimited(LBRACKET,separated_list_final_opt(COMA,node_features),RBRACKET)
| id_loc=node_id_with_loc position=option(delimited(LPAREN, FLOAT ,RPAREN)) feats=delimited(LBRACKET,separated_list_final_opt(COMA,node_features),RBRACKET)
{ let (id,loc) = id_loc in
Graph_node ({Ast.node_id = id; position=position; fs=feats}, loc) }
(* A -[x]-> B *)
| n1_loc=simple_id_with_loc label=delimited(LTR_EDGE_LEFT,label_ident,LTR_EDGE_RIGHT) n2=simple_id
| n1_loc=node_id_with_loc label=delimited(LTR_EDGE_LEFT,label_ident,LTR_EDGE_RIGHT) n2=node_id
{ Graph_edge ({Ast.edge_id = None; src=fst n1_loc; edge_label_cst=Ast.Pos_list [label]; tar=n2}, snd n1_loc) }
/*=============================================================================================*/
......
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