Class: Packrat::ResultProducer

Inherits:
Object
  • Object
show all
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

ASTBuilder, LiftOneResultProducer, SexprProducer

Instance Method Summary collapse

Instance Method Details

#finalize_result(res) ⇒ Object



250
# File 'lib/packrat/grammar.rb', line 250

def finalize_result(res); res; end

#new_resultObject

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