Commit dced74c7 authored by Bruno Guillaume's avatar Bruno Guillaume

add conll_fields in lexer/parser

parent 57c1d264
......@@ -154,6 +154,7 @@ and standard target = parse
| "import" { IMPORT }
| "domain" { DOMAIN }
| "features" { FEATURES }
| "conll_fields" { CONLL_FIELDS }
| "feature" { FEATURE }
| "file" { FILE }
| "labels" { Global.label_flag := true; LABELS }
......
......@@ -73,6 +73,7 @@ let localize t = (t,get_loc ())
%token INCL /* include */
%token IMPORT /* import */
%token FEATURES /* features */
%token CONLL_FIELDS /* conll_fields */
%token FEATURE /* feature */
%token FILE /* file */
%token LABELS /* labels */
......@@ -220,13 +221,20 @@ gr_item:
| 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) }
/*=============================================================================================*/
/* CONLL FIELD DEFINITION */
/*=============================================================================================*/
conll_fields:
| CONLL_FIELDS LACC x=separated_nonempty_list_final_opt(SEMIC,simple_id) RACC { x }
/*=============================================================================================*/
/* DOMAIN DEFINITION */
/*=============================================================================================*/
domain:
| f=features_group g=labels
| c=option(conll_fields) f=features_group g=labels EOF
{
{ Ast.feature_domain = f;
conll_fields = c;
label_domain = g;
}
}
......@@ -726,6 +734,7 @@ new_grs:
| decls = list(decl) EOF { decls }
decl:
| c=conll_fields { New_ast.Conll_fields c }
| f=features_group { New_ast.Features f }
| l=labels { New_ast.Labels l }
| r=rule { New_ast.Rule r }
......
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