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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/bel_parser/ast_filter.rb +6 -2
  4. data/lib/bel_parser/parsers/ast/node.rb +113 -58
  5. data/lib/bel_parser/parsers/bel_script/define_annotation.rb +4175 -3097
  6. data/lib/bel_parser/parsers/bel_script/define_annotation.rl +142 -49
  7. data/lib/bel_parser/parsers/bel_script/define_namespace.rb +980 -461
  8. data/lib/bel_parser/parsers/bel_script/define_namespace.rl +79 -39
  9. data/lib/bel_parser/parsers/bel_script/set.rb +4878 -2743
  10. data/lib/bel_parser/parsers/bel_script/set.rl +114 -32
  11. data/lib/bel_parser/parsers/bel_script/set_document.rb +5839 -5292
  12. data/lib/bel_parser/parsers/bel_script/set_document.rl +130 -27
  13. data/lib/bel_parser/parsers/bel_script/unset.rb +321 -234
  14. data/lib/bel_parser/parsers/bel_script/unset.rl +49 -21
  15. data/lib/bel_parser/parsers/common/blank_line.rb +12 -11
  16. data/lib/bel_parser/parsers/common/blank_line.rl +12 -12
  17. data/lib/bel_parser/parsers/common/comment_line.rb +65 -40
  18. data/lib/bel_parser/parsers/common/comment_line.rl +26 -26
  19. data/lib/bel_parser/parsers/common/common.rl +60 -0
  20. data/lib/bel_parser/parsers/common/function.rb +319 -0
  21. data/lib/bel_parser/parsers/common/function.rl +149 -0
  22. data/lib/bel_parser/parsers/common/identifier.rb +72 -68
  23. data/lib/bel_parser/parsers/common/identifier.rl +73 -29
  24. data/lib/bel_parser/parsers/common/list.rb +1617 -1243
  25. data/lib/bel_parser/parsers/common/list.rl +120 -60
  26. data/lib/bel_parser/parsers/common/string.rb +114 -41
  27. data/lib/bel_parser/parsers/common/string.rl +91 -28
  28. data/lib/bel_parser/parsers/common.rb +1 -0
  29. data/lib/bel_parser/parsers/expression/comment.rb +70 -38
  30. data/lib/bel_parser/parsers/expression/comment.rl +37 -20
  31. data/lib/bel_parser/parsers/expression/nested_statement.rb +63116 -13958
  32. data/lib/bel_parser/parsers/expression/nested_statement.rl +53 -23
  33. data/lib/bel_parser/parsers/expression/observed_term.rb +32497 -5188
  34. data/lib/bel_parser/parsers/expression/observed_term.rl +25 -20
  35. data/lib/bel_parser/parsers/expression/parameter.rb +2861 -847
  36. data/lib/bel_parser/parsers/expression/parameter.rl +178 -21
  37. data/lib/bel_parser/parsers/expression/relationship.rb +73 -55
  38. data/lib/bel_parser/parsers/expression/relationship.rl +41 -23
  39. data/lib/bel_parser/parsers/expression/simple_statement.rb +42895 -7846
  40. data/lib/bel_parser/parsers/expression/simple_statement.rl +41 -24
  41. data/lib/bel_parser/parsers/expression/term.rb +16498 -2602
  42. data/lib/bel_parser/parsers/expression/term.rl +52 -35
  43. data/lib/bel_parser/parsers/line_parser.rb +1 -0
  44. data/lib/bel_parser/parsers/mixin/buffer.rb +4 -0
  45. data/lib/bel_parser/parsers/tracer.rb +19 -0
  46. data/lib/bel_parser/script/state/namespace_definition.rb +1 -0
  47. metadata +10 -7
@@ -8,19 +8,21 @@
8
8
 
9
9
  action yield_observed_term {
10
10
  @buffers[:comment] ||= comment(nil)
11
- yield observed_term(
12
- statement(
13
- subject(@buffers[:term_stack][-1]),
14
- relationship(nil),
15
- object(nil),
16
- @buffers[:comment]))
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
- COMMENT? %yield_observed_term
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
- stack = []
67
- data = @content.unpack('C*')
68
- p = 0
69
- pe = data.length
70
- eof = data.length
71
-
72
- # begin: ragel
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