bel_parser 1.0.0.alpha.38-java → 1.0.0.alpha.39-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bel_parser/ast_filter.rb +6 -2
- data/lib/bel_parser/parsers/ast/node.rb +113 -58
- data/lib/bel_parser/parsers/bel_script/define_annotation.rb +4175 -3097
- data/lib/bel_parser/parsers/bel_script/define_annotation.rl +142 -49
- data/lib/bel_parser/parsers/bel_script/define_namespace.rb +980 -461
- data/lib/bel_parser/parsers/bel_script/define_namespace.rl +79 -39
- data/lib/bel_parser/parsers/bel_script/set.rb +4878 -2743
- data/lib/bel_parser/parsers/bel_script/set.rl +114 -32
- data/lib/bel_parser/parsers/bel_script/set_document.rb +5839 -5292
- data/lib/bel_parser/parsers/bel_script/set_document.rl +130 -27
- data/lib/bel_parser/parsers/bel_script/unset.rb +321 -234
- data/lib/bel_parser/parsers/bel_script/unset.rl +49 -21
- data/lib/bel_parser/parsers/common/blank_line.rb +12 -11
- data/lib/bel_parser/parsers/common/blank_line.rl +12 -12
- data/lib/bel_parser/parsers/common/comment_line.rb +65 -40
- data/lib/bel_parser/parsers/common/comment_line.rl +26 -26
- data/lib/bel_parser/parsers/common/common.rl +60 -0
- data/lib/bel_parser/parsers/common/function.rb +319 -0
- data/lib/bel_parser/parsers/common/function.rl +149 -0
- data/lib/bel_parser/parsers/common/identifier.rb +72 -68
- data/lib/bel_parser/parsers/common/identifier.rl +73 -29
- data/lib/bel_parser/parsers/common/list.rb +1617 -1243
- data/lib/bel_parser/parsers/common/list.rl +120 -60
- data/lib/bel_parser/parsers/common/string.rb +114 -41
- data/lib/bel_parser/parsers/common/string.rl +91 -28
- data/lib/bel_parser/parsers/common.rb +1 -0
- data/lib/bel_parser/parsers/expression/comment.rb +70 -38
- data/lib/bel_parser/parsers/expression/comment.rl +37 -20
- data/lib/bel_parser/parsers/expression/nested_statement.rb +63116 -13958
- data/lib/bel_parser/parsers/expression/nested_statement.rl +53 -23
- data/lib/bel_parser/parsers/expression/observed_term.rb +32497 -5188
- data/lib/bel_parser/parsers/expression/observed_term.rl +25 -20
- data/lib/bel_parser/parsers/expression/parameter.rb +2861 -847
- data/lib/bel_parser/parsers/expression/parameter.rl +178 -21
- data/lib/bel_parser/parsers/expression/relationship.rb +73 -55
- data/lib/bel_parser/parsers/expression/relationship.rl +41 -23
- data/lib/bel_parser/parsers/expression/simple_statement.rb +42895 -7846
- data/lib/bel_parser/parsers/expression/simple_statement.rl +41 -24
- data/lib/bel_parser/parsers/expression/term.rb +16498 -2602
- data/lib/bel_parser/parsers/expression/term.rl +52 -35
- data/lib/bel_parser/parsers/line_parser.rb +1 -0
- data/lib/bel_parser/parsers/mixin/buffer.rb +4 -0
- data/lib/bel_parser/parsers/tracer.rb +19 -0
- data/lib/bel_parser/script/state/namespace_definition.rb +1 -0
- metadata +10 -7
@@ -8,19 +8,21 @@
|
|
8
8
|
|
9
9
|
action yield_observed_term {
|
10
10
|
@buffers[:comment] ||= comment(nil)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
comment = @buffers[:comment]
|
12
|
+
term = @buffers[:term_stack][-1]
|
13
|
+
subject_term = subject(term)
|
14
|
+
rel = relationship(nil)
|
15
|
+
obj = object(nil)
|
16
|
+
stmt = observed_term(statement(subject_term, rel, obj, comment))
|
17
|
+
stmt.complete = true
|
18
|
+
yield stmt
|
17
19
|
}
|
18
20
|
|
19
21
|
observed_term :=
|
20
|
-
outer_term
|
22
|
+
outer_term
|
21
23
|
SP*
|
22
|
-
|
23
|
-
NL
|
24
|
+
comment? %yield_observed_term
|
25
|
+
NL?;
|
24
26
|
}%%
|
25
27
|
=end
|
26
28
|
# end: ragel
|
@@ -28,6 +30,7 @@
|
|
28
30
|
require_relative '../ast/node'
|
29
31
|
require_relative '../mixin/buffer'
|
30
32
|
require_relative '../nonblocking_io_wrapper'
|
33
|
+
require_relative '../tracer'
|
31
34
|
|
32
35
|
module BELParser
|
33
36
|
module Parsers
|
@@ -53,26 +56,28 @@ module BELParser
|
|
53
56
|
include Enumerable
|
54
57
|
include BELParser::Parsers::Buffer
|
55
58
|
include BELParser::Parsers::AST::Sexp
|
59
|
+
include BELParser::Parsers::Tracer
|
56
60
|
|
57
61
|
def initialize(content)
|
58
62
|
@content = content
|
59
|
-
# begin: ragel
|
63
|
+
# begin: ragel
|
60
64
|
%% write data;
|
61
|
-
# end: ragel
|
65
|
+
# end: ragel
|
62
66
|
end
|
63
67
|
|
64
68
|
def each
|
65
|
-
@buffers
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
@buffers = {}
|
70
|
+
@incomplete = {}
|
71
|
+
stack = []
|
72
|
+
data = @content.unpack('C*')
|
73
|
+
p = 0
|
74
|
+
pe = data.length
|
75
|
+
eof = data.length
|
76
|
+
|
77
|
+
# begin: ragel
|
73
78
|
%% write init;
|
74
79
|
%% write exec;
|
75
|
-
# end: ragel
|
80
|
+
# end: ragel
|
76
81
|
end
|
77
82
|
end
|
78
83
|
end
|