Class: Packrat::SexprProducer
- Inherits:
-
ResultProducer
- Object
- ResultProducer
- Packrat::SexprProducer
- Defined in:
- lib/packrat/grammar.rb
Overview
Create a Sexpr based on the name of the matched production and the result-array.
Instance Method Summary collapse
-
#initialize(name) ⇒ SexprProducer
constructor
A new instance of SexprProducer.
- #new_result ⇒ Object
- #update_result(res, subres, elem, index, nhi) ⇒ Object
Methods inherited from ResultProducer
#finalize_result, #production=
Constructor Details
#initialize(name) ⇒ SexprProducer
Returns a new instance of SexprProducer.
256 257 258 |
# File 'lib/packrat/grammar.rb', line 256 def initialize(name) @name = name end |
Instance Method Details
#new_result ⇒ Object
259 |
# File 'lib/packrat/grammar.rb', line 259 def new_result; [@name]; end |
#update_result(res, subres, elem, index, nhi) ⇒ Object
260 |
# File 'lib/packrat/grammar.rb', line 260 def update_result(res, subres, elem, index, nhi); res << subres; end |