|
|
|
|
|
by joeroot
4878 days ago
|
|
I came across this issue when looking to build a stripped down Ruby interpreter in JS last summer. A few attempts have been made at defining its grammar, though with each new version the task becomes more and more challenging. If anyone's interested, this definition of Ruby 1.4 is pretty good:
http://www.cse.buffalo.edu/~regan/cse305/RubyBNF.pdf |
|
The question is whether what it defines corresponds to Ruby. It's easy enough to define an unambiguous subset of the language and declare you're done, but it's irrelevant if the grammar does not match what the language actually is.