bel_parser 1.0.0.alpha.44 → 1.0.0.alpha.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemspec +1 -1
- data/VERSION +1 -1
- data/bin/bel2_validator +68 -12
- data/bin/bel_script_reader +56 -25
- data/lib/bel/translator/plugins/bel_script/reader.rb +2 -1
- data/lib/bel_parser/expression/validator.rb +7 -8
- data/lib/bel_parser/language/apply_namespace_encoding.rb +20 -23
- data/lib/bel_parser/language/expression_validator.rb +2 -2
- data/lib/bel_parser/parsers/ast/node.rb +35 -0
- data/lib/bel_parser/parsers/bel_script/define_annotation.rb +964 -808
- data/lib/bel_parser/parsers/bel_script/define_annotation.rl +24 -4
- data/lib/bel_parser/parsers/bel_script/define_namespace.rb +336 -300
- data/lib/bel_parser/parsers/bel_script/define_namespace.rl +15 -3
- data/lib/bel_parser/parsers/common/common.rl +1 -0
- data/lib/bel_parser/resource/resource_url_reader.rb +2 -2
- data/lib/bel_parser/resource.rb +50 -3
- data/lib/bel_parser/script/apply_resource_uri.rb +30 -0
- data/lib/bel_parser/script/nanopub_mapper.rb +9 -5
- data/lib/bel_parser/script/state/annotation_definition.rb +24 -9
- data/lib/bel_parser/script/state/namespace_definition.rb +22 -8
- data/lib/bel_parser/script/syntax/expression_validation.rb +6 -5
- data/lib/bel_parser/script/syntax/undefined_annotation_value.rb +14 -9
- data/lib/bel_parser/script/syntax/unresolvable_namespace.rb +14 -7
- metadata +3 -2
@@ -17,10 +17,15 @@
|
|
17
17
|
action add_string_value {
|
18
18
|
trace('DEFINE_ANNOTATION add_string_value')
|
19
19
|
string_node = @buffers.delete(:string)
|
20
|
-
|
20
|
+
|
21
|
+
case
|
22
|
+
when @uri_domain
|
23
|
+
leaf = domain(uri(string_node))
|
24
|
+
leaf.complete = string_node.complete
|
25
|
+
when @url_domain
|
21
26
|
leaf = domain(url(string_node))
|
22
27
|
leaf.complete = string_node.complete
|
23
|
-
|
28
|
+
when @pattern_domain
|
24
29
|
leaf = domain(pattern(string_node))
|
25
30
|
leaf.complete = string_node.complete
|
26
31
|
else
|
@@ -54,6 +59,11 @@
|
|
54
59
|
@list_domain = true
|
55
60
|
}
|
56
61
|
|
62
|
+
action add_uri_domain {
|
63
|
+
trace('DEFINE_ANNOTATION add_uri_domain')
|
64
|
+
@uri_domain = true
|
65
|
+
}
|
66
|
+
|
57
67
|
action add_url_domain {
|
58
68
|
trace('DEFINE_ANNOTATION add_url_domain')
|
59
69
|
@url_domain = true
|
@@ -87,9 +97,13 @@
|
|
87
97
|
action define_annotation_node_eof {
|
88
98
|
trace('DEFINE_ANNOTATION define_annotation_node_eof')
|
89
99
|
annotation_definition_node = annotation_definition()
|
90
|
-
|
100
|
+
|
101
|
+
case
|
102
|
+
when @uri_domain
|
103
|
+
domain_node = domain(uri())
|
104
|
+
when @url_domain
|
91
105
|
domain_node = domain(url())
|
92
|
-
|
106
|
+
when @pattern_domain
|
93
107
|
domain_node = domain(pattern())
|
94
108
|
else
|
95
109
|
domain_node = domain()
|
@@ -131,6 +145,11 @@
|
|
131
145
|
%add_list_domain
|
132
146
|
;
|
133
147
|
|
148
|
+
uri_domain =
|
149
|
+
KW_URI
|
150
|
+
%add_uri_domain
|
151
|
+
;
|
152
|
+
|
134
153
|
url_domain =
|
135
154
|
KW_URL
|
136
155
|
%add_url_domain
|
@@ -143,6 +162,7 @@
|
|
143
162
|
|
144
163
|
domain =
|
145
164
|
list_domain |
|
165
|
+
uri_domain |
|
146
166
|
url_domain |
|
147
167
|
pattern_domain
|
148
168
|
;
|