Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcaml-grew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
grew
libcaml-grew
Commits
dced74c7
Commit
dced74c7
authored
Jan 09, 2018
by
Bruno Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add conll_fields in lexer/parser
parent
57c1d264
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
src/grew_lexer.mll
src/grew_lexer.mll
+1
-0
src/grew_parser.mly
src/grew_parser.mly
+10
-1
No files found.
src/grew_lexer.mll
View file @
dced74c7
...
...
@@ -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
}
...
...
src/grew_parser.mly
View file @
dced74c7
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment