Colorizer Part II.V
December 19, 2007 on 12:55 am | In .NET Coding | No CommentsA friend of mine pointed out to me one possible way of finding syntax errors, and resuming parsing after one successfully. The key is to split the input text on some known divider. It’s possible that your grammar won’t have one, but in the case of, say… C#, you can split all the statements on ‘}’ and ‘;’ . Then you can store each as an independently parsed string (even store it’s parse tree in a linked list or array or something) and then flag each with an error or not. This is a great trick, provided that you have some identifiable block/line terminator to split on. For line based grammars this is exceptionally easy.. just split on newlines… for not line based grammars, you might split on block terminators only, like ‘end’ in ‘Simple.’ At least then you have some smaller unit of ‘parse’ to work with and you can track state of parsing across a document with some degree of efficiency. That also means you can trigger the ‘re-parsing’ of small segments when new text is added or pasted. Very interesting. I’m right now trying to think of a case that there wouldn’t be a way to do this… perhaps some functional languages would be eternally nesting… but as far as I’m concerned that’s a corner case ![]()
SuperDeluxe.Com - Stop the MAdnesS
December 1, 2007 on 2:27 am | In Uncategorized | No CommentsOk I’ve had it with SuperDeluxe It’s too much funny, smartness in one place. I can’t take it. It’s sucking my humorous response enegry reserves to the dregs. If they put out one more episode of [(Layers)] or the Maria Bamford Show, I may never write another line of productive code again.
I actually don’t go there or any video sites, or even watch anything on TV that often, but when I do go there, it’s like I get stuck. I can’t hit the stop button.
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
