There's a new tutorial on creating a small interpreter at http://dhaka.rubyforge.org/chittagong.html (note: this won't make any sense if you don't read the other, easier, examples). This has now become part of the test suite. I hope it addresses some of the questions that people that have had. Although the interpreter features its own exception mechanism (that has nothing to do with Ruby's exceptions), it still 'leaks' Ruby in several places. Plugging all these leaks was not the goal. Remember, it's just a sketch, to illustrate a broad swathe of functionality. And you can already write some pretty bad programs with it! This release contains several small changes, some of which are unfortunately backwards-incompatible. Things just make more sense this way. * Deprecated ParseSuccessResult#syntax_tree. Use ParseSuccessResult#parse_tree from now on (it's the proper name for it). * Tokenizer#accumulator eliminated. * Added a Tokenizer#create_token factory method. Use this to create tokens from now on. * Tokenizer#tokenize now returns either a TokenizerSuccessResult or TokenizerErrorResult, does not throw an exception on encountering unexpected characters. ('unexpected' characters are actually quite expected.) * Token now contains an attribute input_position, the index of the source input that it was created from. * ParseErrorResult now contains the unexpected_token itself, not the unexpected_token_index. * Tokenizer returns the end symbol token for empty input. Pretty much all of these were justified by the need for more meta-data to allow for proper error reporting. This functionality has been greatly improved. I've tried to incorporate Gregory Brown's suggestions into the newest RDoc by including some sample usages for the most important classes. Ok, I'm going to stop making backwards-incompatible changes now. http://dhaka.rubyforge.org Mushfeq.
on 2007-01-21 09:09
on 2007-01-21 10:06
On 1/21/07, Mushfeq Khan <firstname.lastname@example.org> wrote: > I've tried to incorporate Gregory Brown's suggestions into the newest RDoc > by including some sample usages for the most important classes. Looks good! Thanks Musfeq.