Top Level Namespace
Defined Under Namespace
Modules: Pegex
Instance Method Summary collapse
Instance Method Details
#pegex(grammar, receiver = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/pegex.rb', line 6 def pegex grammar, receiver=nil if not receiver require 'pegex/tree/wrap' receiver = Pegex::Tree::Wrap.new end receiver = receiver.new if receiver.class == Class return Pegex::Parser.new do |p| p.grammar = Pegex::Grammar.new {|g| g.text = grammar} p.receiver = receiver end end |