Sean Mountcastle
3/1/2006 8:31:00 PM
Gary and Tom,
Thanks for the pointers, I've read the AW AWK Programming Language and
O'Reilly lex & yacc books. From the presentations I've seen on Ruby
DSLs, it doesn't seem like folks are writing parsers -- it seems more
like Lisp macros where the program is being written as its being
interpreted.
In the same way that Ruby's attr_accessor creates getter/setter
methods for the specified symbols (instance variables), DSL 'gurus'
have created similar constructs which implement the 'mini language'
without the drugery of writing a parser/compiler.
It looks like there are no "How to write DSLs in Ruby" books currently
available or planned.
Regards,
Sean
On 3/1/06, Tom Copeland <tom@infoether.com> wrote:
> >
> > You might want to read chapter 6 of The AWK Programming
> > Language (Aho, Kernighan, Weinberger). The title of that
> > chapter is 'little
> > languages'.
> > The chapter includes the following examples (in AWK of course):
> >
> > assembler and interpreter
> > drawing graphs
> > a sort generator
> > a reverse-polish calculator
> > an infix calculator
> > recursive-descent parsing
>
> Along the same lines, the O'Reilly Lex and Yacc book (by John Levine and
> several others) has some little DSL examples - a menu generation system
> and whatnot.
>
> Yours,
>
> Tom
>
>
>