LL(k) grammar for an interesting *subset* of Ruby ?

  • Thread starter Jean-Christophe Le Lann
  • Start date
J

Jean-Christophe Le Lann

Hello

Are you aware of any kind of LL(k) grammar for an interesting *subset*
of Ruby ?

Or maybe ruby basic constructs do not fit LL(k) principles ?

Anyone tried that with Citrus or Treetop ?

Thanks
JCLL
 
C

Clifford Heath


Four years old (so no 1.9 syntax), a 0.1 version number, written in Lisp,
and claims *not* to parse Ruby correctly. Good luck with that! (really)

Nathan Sobo (author of Treetop, which I now maintain) intended to, but got
side-tracked into adding incremental parser facilities into Treetop so that
he could implement a syntax-directed editor for Ruby... I don't think the
actual Ruby grammar ever got properly started.

It's definitely possible, and now, there's a Ruby test suite to use as well.

The advantage of using a PEG is that PEG grammars are composable, so you
could incorporate grammar rule definition into the core language, allowing
Ruby to extend itself into any language. I hoped this might eventuate, but
now, I think that Javascript and V8 is the right implementation target.

Clifford Heath.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top