问题
In response to a previous question, @Pablo Fernandez suggested I implement a simple interpreter using Treetop to embed in my RoR application. It looks like a good approach.
But I can't help but wonder: hasn't anyone written a toy interpreter to embed in a Ruby app? I don't need any I/O functions -- in fact, I specifically don't want any I/O functions. (If you're wondering why I want an interpreter inside of Ruby, please refer to the original post!)
Thanks.
回答1:
FWIW, I ended up tweaking a version of stickup to use as a embeddable interpreter. The process was fast and easy and serves my needs well. (And besides, I used to work for a Common Lisp company, so it was an excuse to re-live the joys of s-expressions.)
来源:https://stackoverflow.com/questions/6100616/ruby-looking-for-ruby-embeddable-interpreter-or-scripting-language