On 5/1/05, Glenn Smith <glenn.ruby / gmail.com> wrote:
> Always something I've wanted to write - an interpreter of my own.  Now
> I'm not likely to produce the next 'Ruby', but the recent announcement
> of Fu's 'TAO', and other languages, make me wonder if I could write
> something similar.  Just for me, so to speak.  A bit of fun.
> 
> I did look at the possibility of going down the traditional route of
> [F]Lex/Yacc[Bison] and 'C', but it would be nice to write it in Ruby.
> Alright, it would be one interpreted language interpreting another,
> but as I said, 'a bit of fun'.  That's if two small children and a
> scary wife allow me the time of course!!
> 
> I see there are ruby-lex and ruby-yacc modules on RAA - anybody used
> these in anger and are they complete/good-enough?
> 
> Has anybody done this kind of thing before?  Not being a) a genius, b)
> Matz, or c) the owner of a fine beard, can anybody recommend any good
> URL's/tutorials/perhaps even books?

Brian Wisti just announced a new release of PageTemplate, you might
want to take a look at it.

I used an earlier version as a guide while building a mini language in
another (non Ruby) language.  His code was easy to read, and it
covered the basics (looping, branching, etc.)  I probably could have
built my own mini language without it, but his code definitely sped up
the process.

It's not using lex or yacc (or at least the old version wasn't), so it
may be too simplified for your needs, but that could also make it
easier to learn from.

  * http://rubyforge.org/projects/pagetemplate/
  * http://coolnamehere.com/products/pagetemplate/
 
> I could grow a beard of course...

Yeah, they're mutually exclusive, as building a language/parser is
likely to cause you to want to tear some hair out :)

> --
> 
> All the best
> Glenn
> Aylesbury, UK
> 
> 


-- 
Bill Guindon (aka aGorilla)