From: James Coglan Date: 2009-03-27T02:06:31+09:00 Subject: Re: Writing a language converter in Ruby ? --0016e6de17c8d6e83a046608aeb5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/3/26 Alex Gutteridge > On 26 Mar 2009, at 16:51, Albert Schlef wrote: > > Brian Candler wrote: >> >>> Albert Schlef wrote: >>> >>>> That's interesting. I see that their DSL looks like: >>>> >>>> rule additive >>>> multitive '+' additive / multitive >>>> end >>>> >>>> Do you notice? There's "end" there but no "do"! How is it possible? >>>> >>> >>> Because it's not Ruby. >>> [snip] >>> Presumably, TXL's language *requires* a rule body followed by end. >>> >> >> But I was not talking about TXL. I was talking about Treetop >> (http://treetop.rubyforge.org/). >> >> -- Posted via http://www.ruby-forum.com/. >> > > > Treetop grammers aren't written in Ruby (or TXL) they're their own custom > language. Though, worth noting that the language bears a very close relationship to Ruby modules, since Treetop grammars can be mixed into each other so languages can be composed from smaller languages. When you compile a Treetop grammar, you get a Ruby module that can be mixed into any other class to make that class a parser for the grammar. -- James Coglan http://github.com/jcoglan --0016e6de17c8d6e83a046608aeb5--