From: Chiyuan Zhang Date: 2008-02-04T12:16:34+09:00 Subject: Re: Treetop: Can the parser be put inside a module? Yes! That's exactly what I'm looking for! Thanks! 2008/2/4, Clifford Heath : > Chiyuan Zhang wrote: > > I'm wondering if Treetop can provide (or is it already have?) a > > mechanize like this: > > > > module MyModule > > Treetop.load("my") > > end > > so that I'll get a MyModule::MyParser instead of a top-level MyParser. > > The Treetop meta-grammar allows you to define your grammar inside a > module, even more than one level. The parser will be emitted inside > a module of the same name. > > module MyModule > grammar MyLang > rule top > ... > end > end > end > > Clifford Heath > >