class Treetop::Compiler::GrammarCompiler

def ruby_source_from_string(s)

compile a string containing treetop source into ruby
def ruby_source_from_string(s)
  parser = MetagrammarParser.new
  result = parser.parse(s)
  unless result
    raise RuntimeError.new(parser.failure_reason)
  end
  result.compile
end