rley 0.6.00 → 0.6.01

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -1
  3. data/CHANGELOG.md +3 -0
  4. data/Gemfile +1 -1
  5. data/examples/NLP/benchmark_pico_en.rb +6 -10
  6. data/examples/NLP/nano_eng/nano_en_demo.rb +2 -2
  7. data/examples/NLP/nano_eng/nano_grammar.rb +1 -2
  8. data/examples/data_formats/JSON/json_ast_builder.rb +8 -8
  9. data/examples/general/SRL/lib/ast_builder.rb +74 -72
  10. data/examples/general/SRL/lib/grammar.rb +2 -2
  11. data/examples/general/SRL/lib/regex/abstract_method.rb +28 -28
  12. data/examples/general/SRL/lib/regex/alternation.rb +21 -25
  13. data/examples/general/SRL/lib/regex/anchor.rb +6 -9
  14. data/examples/general/SRL/lib/regex/atomic_expression.rb +10 -15
  15. data/examples/general/SRL/lib/regex/capturing_group.rb +15 -14
  16. data/examples/general/SRL/lib/regex/char_class.rb +10 -13
  17. data/examples/general/SRL/lib/regex/char_range.rb +45 -46
  18. data/examples/general/SRL/lib/regex/char_shorthand.rb +8 -9
  19. data/examples/general/SRL/lib/regex/character.rb +196 -191
  20. data/examples/general/SRL/lib/regex/compound_expression.rb +47 -50
  21. data/examples/general/SRL/lib/regex/concatenation.rb +23 -27
  22. data/examples/general/SRL/lib/regex/expression.rb +53 -56
  23. data/examples/general/SRL/lib/regex/lookaround.rb +23 -20
  24. data/examples/general/SRL/lib/regex/match_option.rb +26 -28
  25. data/examples/general/SRL/lib/regex/monadic_expression.rb +20 -23
  26. data/examples/general/SRL/lib/regex/multiplicity.rb +17 -20
  27. data/examples/general/SRL/lib/regex/non_capturing_group.rb +9 -12
  28. data/examples/general/SRL/lib/regex/polyadic_expression.rb +51 -55
  29. data/examples/general/SRL/lib/regex/quantifiable.rb +14 -20
  30. data/examples/general/SRL/lib/regex/repetition.rb +20 -23
  31. data/examples/general/SRL/lib/regex/wildcard.rb +15 -19
  32. data/examples/general/SRL/lib/regex_repr.rb +1 -1
  33. data/examples/general/SRL/lib/tokenizer.rb +2 -2
  34. data/examples/general/SRL/spec/integration_spec.rb +17 -12
  35. data/examples/general/SRL/spec/regex/character_spec.rb +160 -153
  36. data/examples/general/SRL/spec/regex/multiplicity_spec.rb +27 -31
  37. data/examples/general/SRL/spec/spec_helper.rb +1 -1
  38. data/examples/general/SRL/spec/tokenizer_spec.rb +25 -27
  39. data/examples/general/calc_iter1/calc_ast_builder.rb +10 -10
  40. data/examples/general/calc_iter2/calc_ast_builder.rb +7 -9
  41. data/examples/general/calc_iter2/calc_ast_nodes.rb +5 -6
  42. data/examples/general/calc_iter2/calc_lexer.rb +3 -5
  43. data/examples/general/calc_iter2/spec/calculator_spec.rb +16 -14
  44. data/examples/general/left.rb +8 -8
  45. data/examples/general/right.rb +8 -8
  46. data/lib/rley/constants.rb +1 -1
  47. data/lib/rley/engine.rb +16 -20
  48. data/lib/rley/formatter/json.rb +1 -1
  49. data/lib/rley/gfg/grm_flow_graph.rb +1 -1
  50. data/lib/rley/gfg/item_vertex.rb +6 -5
  51. data/lib/rley/gfg/vertex.rb +3 -3
  52. data/lib/rley/lexical/token.rb +4 -3
  53. data/lib/rley/parse_rep/ast_base_builder.rb +4 -3
  54. data/lib/rley/parse_rep/parse_rep_creator.rb +1 -1
  55. data/lib/rley/parse_rep/parse_tree_builder.rb +3 -2
  56. data/lib/rley/parser/error_reason.rb +1 -1
  57. data/lib/rley/parser/gfg_chart.rb +6 -6
  58. data/lib/rley/parser/gfg_parsing.rb +19 -19
  59. data/lib/rley/parser/parse_entry.rb +3 -3
  60. data/lib/rley/parser/parse_entry_set.rb +1 -1
  61. data/lib/rley/parser/parse_walker_factory.rb +15 -15
  62. data/lib/rley/syntax/grammar.rb +1 -1
  63. data/lib/rley/syntax/grammar_builder.rb +2 -2
  64. data/lib/rley/syntax/production.rb +4 -3
  65. data/lib/rley/syntax/symbol_seq.rb +2 -2
  66. data/spec/rley/base/grm_items_builder_spec.rb +1 -1
  67. data/spec/rley/engine_spec.rb +3 -6
  68. data/spec/rley/formatter/asciitree_spec.rb +0 -1
  69. data/spec/rley/formatter/bracket_notation_spec.rb +0 -1
  70. data/spec/rley/formatter/debug_spec.rb +2 -3
  71. data/spec/rley/gfg/grm_flow_graph_spec.rb +19 -19
  72. data/spec/rley/parse_rep/ast_builder_spec.rb +12 -12
  73. data/spec/rley/parser/gfg_earley_parser_spec.rb +1 -1
  74. data/spec/rley/parser/parse_entry_set_spec.rb +5 -5
  75. data/spec/rley/parser/parse_state_spec.rb +8 -3
  76. data/spec/rley/parser/parse_tracer_spec.rb +3 -1
  77. data/spec/rley/parser/parse_walker_factory_spec.rb +1 -1
  78. data/spec/rley/ptree/parse_tree_node_spec.rb +1 -1
  79. data/spec/rley/syntax/grammar_builder_spec.rb +1 -1
  80. data/spec/rley/syntax/grammar_spec.rb +1 -1
  81. metadata +2 -3
  82. data/spec/rley/support/ast_builder.rb +0 -403
@@ -8,8 +8,8 @@ builder = Rley::Syntax::GrammarBuilder.new do
8
8
  add_terminals('DOT')
9
9
 
10
10
  # Grammar with left recursive rule.
11
- rule 'l_dots' => []
12
- rule 'l_dots' => %w[l_dots DOT]
11
+ rule 'l_dots' => []
12
+ rule 'l_dots' => %w[l_dots DOT]
13
13
  end
14
14
 
15
15
  # And now, let's build the grammar...
@@ -17,12 +17,12 @@ grammar = builder.grammar
17
17
 
18
18
  # Highly simplified tokenizer implementation.
19
19
  def tokenizer(aText, aGrammar)
20
- tokens = aText.scan(/\./).map do |dot|
21
- terminal = aGrammar.name2symbol['DOT']
22
- Rley::Lexical::Token.new(dot, terminal)
23
- end
20
+ tokens = aText.scan(/\./).map do |dot|
21
+ terminal = aGrammar.name2symbol['DOT']
22
+ Rley::Lexical::Token.new(dot, terminal)
23
+ end
24
24
 
25
- return tokens
25
+ return tokens
26
26
  end
27
27
 
28
28
  input_to_parse = '.' * 500 # Input = 500 consecutive dots
@@ -35,4 +35,4 @@ puts "Parsing successful? #{result.success?}"
35
35
  unless result.success?
36
36
  puts result.failure_reason.message
37
37
  exit(1)
38
- end
38
+ end
@@ -8,8 +8,8 @@ builder = Rley::Syntax::GrammarBuilder.new do
8
8
  add_terminals('DOT')
9
9
 
10
10
  # Grammar with right recursive rule.
11
- rule 'r_dots' => []
12
- rule 'r_dots' => %w[DOT r_dots]
11
+ rule 'r_dots' => []
12
+ rule 'r_dots' => %w[DOT r_dots]
13
13
  end
14
14
 
15
15
  # And now, let's build the grammar...
@@ -17,12 +17,12 @@ grammar = builder.grammar
17
17
 
18
18
  # Highly simplified tokenizer implementation.
19
19
  def tokenizer(aText, aGrammar)
20
- tokens = aText.scan(/\./).map do |dot|
21
- terminal = aGrammar.name2symbol['DOT']
22
- Rley::Lexical::Token.new(dot, terminal)
23
- end
20
+ tokens = aText.scan(/\./).map do |dot|
21
+ terminal = aGrammar.name2symbol['DOT']
22
+ Rley::Lexical::Token.new(dot, terminal)
23
+ end
24
24
 
25
- return tokens
25
+ return tokens
26
26
  end
27
27
 
28
28
  input_to_parse = '.' * 500 # Input = 500 consecutive dots
@@ -35,4 +35,4 @@ puts "Parsing successful? #{result.success?}"
35
35
  unless result.success?
36
36
  puts result.failure_reason.message
37
37
  exit(1)
38
- end
38
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Rley # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.6.00'.freeze
6
+ Version = '0.6.01'.freeze
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = "Ruby implementation of the Earley's parsing algorithm".freeze
@@ -22,11 +22,9 @@ module Rley # This module is used as a namespace
22
22
  attr_reader :grammar
23
23
 
24
24
  # Constructor.
25
- # @param &aBlock [Proc, Lambda] Code block for setting the configuration.
26
- def initialize(&aConfigBlock)
25
+ def initialize()
27
26
  @configuration = EngineConfig.new
28
-
29
- yield configuration if block_given?
27
+ yield configuration if block_given?
30
28
  end
31
29
 
32
30
  # Factory method.
@@ -48,12 +46,11 @@ module Rley # This module is used as a namespace
48
46
  def parse(aTokenizer)
49
47
  tokens = []
50
48
  aTokenizer.each do |a_token|
51
- if a_token
52
- term_name = a_token.terminal
53
- term_symb = grammar.name2symbol[term_name]
54
- a_token.instance_variable_set(:@terminal, term_symb)
55
- tokens << a_token
56
- end
49
+ next unless a_token
50
+ term_name = a_token.terminal
51
+ term_symb = grammar.name2symbol[term_name]
52
+ a_token.instance_variable_set(:@terminal, term_symb)
53
+ tokens << a_token
57
54
  end
58
55
  parser = build_parser(grammar)
59
56
  return parser.parse(tokens)
@@ -89,14 +86,14 @@ module Rley # This module is used as a namespace
89
86
  # Convert raw parse result into a parse forest representation
90
87
  # @param aRawParse [Parser::GFGParsing]
91
88
  # def to_pforest(aRawParse)
92
- # factory = ParseRep::ParseForestFactory.new(aRawParse)
93
- # if configuration.repr_builder == :default
94
- # result = factory.create(nil)
95
- # else
96
- # result = factory.create(configuration.repr_builder)
97
- # end
98
-
99
- # return result
89
+ # factory = ParseRep::ParseForestFactory.new(aRawParse)
90
+ # if configuration.repr_builder == :default
91
+ # result = factory.create(nil)
92
+ # else
93
+ # result = factory.create(configuration.repr_builder)
94
+ # end
95
+
96
+ # return result
100
97
  # end
101
98
 
102
99
  # Build a visitor for the given parse tree
@@ -109,7 +106,7 @@ module Rley # This module is used as a namespace
109
106
  # @param aPTree[SPPF::ParseForest]
110
107
  # @return [ParseForestVisitor]
111
108
  # def pforest_visitor(aPForest)
112
- # return Rley::ParseForestVisitor.new(aPForest)
109
+ # return Rley::ParseForestVisitor.new(aPForest)
113
110
  # end
114
111
 
115
112
  protected
@@ -119,4 +116,3 @@ module Rley # This module is used as a namespace
119
116
  end
120
117
  end # class
121
118
  end # module
122
-
@@ -19,7 +19,7 @@ module Rley # This module is used as a namespace
19
19
  def initialize(anIO)
20
20
  super(anIO)
21
21
  @indentation = 0
22
- @sibling_flags = [ false ]
22
+ @sibling_flags = [false]
23
23
  end
24
24
 
25
25
  # Method called by a ParseTreeVisitor to which the formatter subscribed.
@@ -63,7 +63,7 @@ module Rley # This module is used as a namespace
63
63
  # production.
64
64
  # @return [String]
65
65
  def inspect()
66
- result = "#<#{self.class.name}:#{self.object_id}"
66
+ result = "#<#{self.class.name}:#{object_id}"
67
67
  result << ' @vertices=['
68
68
  list = vertices.map { |v| "#<#{v.selfie}>" }
69
69
  result << list.join(', ')
@@ -4,13 +4,13 @@ require_relative 'vertex'
4
4
 
5
5
  module Rley # This module is used as a namespace
6
6
  module GFG # This module is used as a namespace
7
- # Specialization of Vertex class. Represents a
7
+ # Specialization of Vertex class. Represents a
8
8
  # vertex in a grammar flow graph associated to a given dotted item.
9
9
  # Responsibilities (in addition to inherited ones):
10
10
  # - Know its related non-terminal symbol
11
11
  class ItemVertex < Vertex
12
12
  # Link to the dotted item object
13
- # @return [DottedItem] The corresponding dotted item
13
+ # @return [DottedItem] The corresponding dotted item
14
14
  attr_reader :dotted_item
15
15
 
16
16
  # Optional link to a "shortcut" edge.
@@ -65,16 +65,17 @@ module Rley # This module is used as a namespace
65
65
  end
66
66
 
67
67
  # Return the symbol after the dot.
68
- # @return [Syntax::GrmSymbol, NilClass] Next grammar symbol otherwise nil.
68
+ # @return [Syntax::GrmSymbol, NilClass] Next grammar symbol otherwise nil.
69
69
  def next_symbol()
70
70
  return dotted_item.next_symbol
71
71
  end
72
72
 
73
73
  # Return the non-terminal symbol at the left-hand side of the production
74
- # @return [Syntax::GrmSymbol] The non-terminal symbol at left side of production.
74
+ # @return [Syntax::GrmSymbol]
75
+ # The non-terminal symbol at left side of production.
75
76
  def lhs()
76
77
  return dotted_item.lhs
77
- end
78
+ end
78
79
  end # class
79
80
  end # module
80
81
  end # module
@@ -35,7 +35,7 @@ module Rley # This module is used as a namespace
35
35
  result = '#<'
36
36
  result << selfie
37
37
  edges.each { |e| result << e.inspect }
38
- result << specific_inspect()
38
+ result << specific_inspect
39
39
  result << '>'
40
40
 
41
41
  return result
@@ -45,8 +45,8 @@ module Rley # This module is used as a namespace
45
45
  # vertex without the edges.
46
46
  # @return [String]
47
47
  def selfie()
48
- result = "#{self.class.name}:#{self.object_id}"
49
- result << %Q[ label="#{self.label}"]
48
+ result = "#{self.class.name}:#{object_id}"
49
+ result << %Q( label="#{label}")
50
50
  return result
51
51
  end
52
52
 
@@ -7,20 +7,21 @@ module Rley # This module is used as a namespace
7
7
  # Say, that in a particular language, the lexeme 'foo' is an occurrence
8
8
  # of the terminal symbol IDENTIFIER. Then the lexer will return a Token
9
9
  # object that states the fact that 'foo' is indeed an IDENTIFIER. Basically,
10
- # a Token is a pair (lexeme, terminal): it asserts that a given lexeme
10
+ # a Token is a pair (lexeme, terminal): it asserts that a given lexeme
11
11
  # is an instance of given terminal symbol.
12
12
  class Token
13
13
  # The sequence of character(s) from the input stream that is an occurrence
14
14
  # of the related terminal symbol.
15
15
  # @return [String] Input substring that is an instance of the terminal.
16
16
  attr_reader(:lexeme)
17
-
17
+
18
18
  # @return [Syntax::Terminal] Terminal symbol corresponding to the lexeme.
19
19
  attr_reader(:terminal)
20
20
 
21
21
  # Constructor.
22
22
  # @param theLexeme [String] the lexeme (= piece of text from input)
23
- # @param aTerminal [Syntax::Terminal] The terminal symbol corresponding to the lexeme.
23
+ # @param aTerminal [Syntax::Terminal]
24
+ # The terminal symbol corresponding to the lexeme.
24
25
  def initialize(theLexeme, aTerminal)
25
26
  raise 'Internal error: nil terminal symbol detected' if aTerminal.nil?
26
27
  @lexeme = theLexeme
@@ -85,7 +85,7 @@ module Rley # This module is used as a namespace
85
85
  # Factory method for creating a node object for the given
86
86
  # input token.
87
87
  # @param aTerminal [Syntax::Production] Relevant production rule
88
- # @param aTerminal [Syntax::Terminal] Terminal symbol associated with the token
88
+ # @param aTerminal [Syntax::Terminal] Terminal associated with the token
89
89
  # @param aTokenPosition [Integer] Position of token in the input stream
90
90
  # @param aToken [Lexical::Token] The input token
91
91
  def new_leaf_node(aProduction, aTerminal, aTokenPosition, aToken)
@@ -107,7 +107,7 @@ module Rley # This module is used as a namespace
107
107
  # @param theChildren [Array] Children nodes (one per rhs symbol)
108
108
  def new_parent_node(aProduction, aRange, theTokens, theChildren)
109
109
  mth_name = method_name(aProduction.name)
110
- if self.respond_to?(mth_name, true)
110
+ if respond_to?(mth_name, true)
111
111
  node = send(mth_name, aProduction, aRange, theTokens, theChildren)
112
112
  else
113
113
  # Default action...
@@ -117,7 +117,8 @@ module Rley # This module is used as a namespace
117
117
  when 1
118
118
  return_first_child(aRange, theTokens, theChildren)
119
119
  else
120
- raise StandardError, "Don't know production '#{aProduction.name}'"
120
+ msg = "Don't know production '#{aProduction.name}'"
121
+ raise StandardError, msg
121
122
  end
122
123
  end
123
124
  return node
@@ -26,7 +26,7 @@ module Rley # This module is used as a namespace
26
26
  # puts "EVENT #{event[0]} #{event[1]}"
27
27
  a_builder.receive_event(*event)
28
28
  end
29
- rescue StopIteration
29
+ rescue StopIteration => exc
30
30
  # Do nothing
31
31
  end
32
32
 
@@ -100,7 +100,7 @@ module Rley # This module is used as a namespace
100
100
  non_terminal = entry2nonterm(anEntry)
101
101
  # Create raw node and push onto stack
102
102
  push_raw_node(range, non_terminal)
103
- #when :revisit
103
+ # when :revisit
104
104
  # # TODO: design specification
105
105
  else
106
106
  raise NotImplementedError, "Cannot handle event #{anEvent}"
@@ -135,7 +135,8 @@ module Rley # This module is used as a namespace
135
135
  process_middle_entry(anEntry, anIndex)
136
136
  end
137
137
  else
138
- $stderr.puts "Internal Errore '#{anEvent}', entry: #{anEntry}, index: #{anIndex}"
138
+ msg_prefix = "Internal Error '#{anEvent}', "
139
+ $stderr.puts msg_prefix + "entry: #{anEntry}, index: #{anIndex}"
139
140
  raise NotImplementedError
140
141
  end
141
142
  end
@@ -16,7 +16,7 @@ module Rley # Module used as a namespace
16
16
 
17
17
  # Returns the result of invoking reason.to_s.
18
18
  def message()
19
- return self.to_s
19
+ return to_s
20
20
  end
21
21
 
22
22
  # Return this reason's class name and message
@@ -13,7 +13,7 @@ module Rley # This module is used as a namespace
13
13
  attr_reader(:sets)
14
14
 
15
15
  # @param tokenCount [Integer] The number of lexemes in the input to parse.
16
- # @param aGFGraph [GFG::GrmFlowGraph] The GFG for the grammar in use.
16
+ # @param aGFGraph [GFG::GrmFlowGraph] The GFG for the grammar in use.
17
17
  def initialize(tokenCount, aGFGraph)
18
18
  @sets = Array.new(tokenCount + 1) { |_| ParseEntrySet.new }
19
19
  push_entry(aGFGraph.start_vertex, 0, 0, :start_rule)
@@ -74,11 +74,11 @@ module Rley # This module is used as a namespace
74
74
  # Retrieve all the end entries (i.e. of the form
75
75
  last_entries = sets[last_index].entries.select(&:end_entry?)
76
76
  # last_entries.each_with_index do |entry, index|
77
- # if entry.nil?
78
- # puts "Nil entry at index #{index}"
79
- # else
80
- # puts entry
81
- # end
77
+ # if entry.nil?
78
+ # puts "Nil entry at index #{index}"
79
+ # else
80
+ # puts entry
81
+ # end
82
82
  # end
83
83
 
84
84
  # ... now find the end vertex for start symbol and with origin at zero.
@@ -9,11 +9,11 @@ module Rley # This module is used as a namespace
9
9
  module Parser # This module is used as a namespace
10
10
  class GFGParsing
11
11
  # The link to the grammar flow graph
12
- # @return [GFG::GrmFlowGraph] The GFG that drives the parsing
12
+ # @return [GFG::GrmFlowGraph] The GFG that drives the parsing
13
13
  attr_reader(:gf_graph)
14
14
 
15
15
  # The link to the chart object
16
- # @return [GFGChart]
16
+ # @return [GFGChart]
17
17
  attr_reader(:chart)
18
18
 
19
19
  # The sequence of input token to parse
@@ -54,16 +54,16 @@ module Rley # This module is used as a namespace
54
54
  pos = aPosition
55
55
  size_before = chart[pos].size
56
56
  apply_rule(anEntry, start_vertex, pos, pos, :call_rule)
57
-
57
+
58
58
  if next_symbol.nullable? && anEntry.dotted_entry?
59
59
  size_after = chart[pos].size
60
60
  # ...apply the Nullable rule
61
61
  nullable_rule(anEntry, aPosition) if size_after == size_before
62
- end
62
+ end
63
63
  end
64
-
64
+
65
65
  # Let the current sigma set be the ith parse entry set.
66
- # This method is invoked when a dotted entry is added
66
+ # This method is invoked when a dotted entry is added
67
67
  # to the parse entry set of the from [A => alpha . B beta, k]
68
68
  # and B is nullable
69
69
  # Then the entry [A => alpha B . beta, k] is added to the current
@@ -78,8 +78,8 @@ module Rley # This module is used as a namespace
78
78
 
79
79
  # first pos == origin
80
80
  # second pos == position
81
- apply_rule(end_entry, next_vertex, anEntry.origin, pos, :nullable_rule)
82
- end
81
+ apply_rule(end_entry, next_vertex, anEntry.origin, pos, :nullable_rule)
82
+ end
83
83
 
84
84
  # Let the current sigma set be the ith parse entry set.
85
85
  # This method is invoked when an entry is added to a parse entry set
@@ -156,7 +156,7 @@ module Rley # This module is used as a namespace
156
156
  apply_rule(ntry, vertex_after_terminal, origin, pos, :scan_rule)
157
157
  end
158
158
  end
159
-
159
+
160
160
  return true
161
161
  end
162
162
 
@@ -165,7 +165,7 @@ module Rley # This module is used as a namespace
165
165
  def success?()
166
166
  return false if @failure_reason
167
167
  return chart.accepting_entry ? true : false
168
- end
168
+ end
169
169
 
170
170
  # Return true if there are more than one complete state
171
171
  # for the same lhs and same origin in any state set.
@@ -179,28 +179,28 @@ module Rley # This module is used as a namespace
179
179
  def parse_forest()
180
180
  msg = <<-END_MSG
181
181
  Method Rley::Parser::GFGParsing.parse_forest is deprecated, call
182
- Rley::Engine::to_pforest. It will be removed April 1st
183
- or version 0.6.1 (whichever is first)
182
+ Rley::Engine::to_pforest. It will be removed April 1st
183
+ or version 0.6.1 (whichever is first)
184
184
  END_MSG
185
- # $stderr.puts(msg)
185
+ # warn(msg)
186
186
  factory = ParseRep::ParseForestFactory.new(self)
187
187
 
188
188
  return factory.create
189
189
  end
190
-
190
+
191
191
  # Factory method. Builds a ParseTree from the parse result.
192
192
  # @return [ParseTree]
193
193
  def parse_tree(aBuilder = nil)
194
194
  msg = <<-END_MSG
195
195
  Method Rley::Parser::GFGParsing.parse_tree is deprecated, call
196
- Rley::Engine::to_ptree. It will be removed April 1st
197
- or version 0.6.1 (whichever is first)
196
+ Rley::Engine::to_ptree. It will be removed April 1st
197
+ or version 0.6.1 (whichever is first)
198
198
  END_MSG
199
- $stderr.puts(msg)
199
+ warn(msg)
200
200
  factory = ParseRep::ParseTreeFactory.new(self)
201
201
 
202
202
  return factory.create(aBuilder)
203
- end
203
+ end
204
204
 
205
205
  # Retrieve the very first parse entry added to the chart.
206
206
  # This entry corresponds to the start vertex of the GF graph
@@ -225,7 +225,7 @@ END_MSG
225
225
  # A notification that the parsing reached an end
226
226
  def done()
227
227
  # Parse not successful and no reason identified
228
- # Assuming that parse failed because of a premature end
228
+ # Assuming that parse failed because of a premature end
229
229
  premature_end unless success? || failure_reason
230
230
  end
231
231