Class: Packrat::ResultProducer
- Inherits:
-
Object
- Object
- Packrat::ResultProducer
- Defined in:
- lib/packrat/grammar.rb
Overview
The last element of a prod can be a result producer that produces the result to be returned by the prod in case of a successfull parse.
Direct Known Subclasses
Instance Method Summary collapse
- #finalize_result(res) ⇒ Object
-
#new_result ⇒ Object
A ResultProducer returns a result which it then updates.
-
#production=(prod) ⇒ Object
Before any results are produced we need to know the prod we are in.
- #update_result(res, subres, elem, index) ⇒ Object
Instance Method Details
#finalize_result(res) ⇒ Object
250 |
# File 'lib/packrat/grammar.rb', line 250 def finalize_result(res); res; end |
#new_result ⇒ Object
A ResultProducer returns a result which it then updates. This is needed since multiple results can be in production at the same time.
248 |
# File 'lib/packrat/grammar.rb', line 248 def new_result; end |
#production=(prod) ⇒ Object
Before any results are produced we need to know the prod we are in
244 |
# File 'lib/packrat/grammar.rb', line 244 def production=(prod); @prod = prod; end |
#update_result(res, subres, elem, index) ⇒ Object
249 |
# File 'lib/packrat/grammar.rb', line 249 def update_result(res, subres, elem, index); end |