Le 02/08/2012 02:10, Walter Bright a écrit :
6. A single "Lexer" instance should be able to serially accept input ranges, sharing and updating one identifier table
I see the lexer as a function that take an range of char as input and give back a range of token. Does it make sense to make an instance of a lexer ?
7. It should accept a callback delegate for errors. That delegate should decide whether to: 1. ignore the error (and "Lexer" will try to recover and continue) 2. print an error message (and "Lexer" will try to recover and continue) 3. throw an exception, "Lexer" is done with that input range
Off topic, but it look like the condition proposal from H.S. Teoh and myself.
Basically, I don't want anyone to be motivated to do a separate one after seeing this one.
That would be awesome !