3 ms·
Wouldn't storing and editing source code as an AST make a lot of syntax errors impossible?
by ksrm 12y ago
Wouldn't storing and editing source code as an AST make a lot of syntax errors impossible?
- __david__ 12y agoUser-created syntax errors, possibly. But it can't completely eliminate them: 5 ↤ "hello" Now you could argue that the editor might detect that and not allow it, but if your abstract syntax tree data structure can support it, then you will be handed it at some point and so you should detect it. But more importantly, the abstract tree itself has to be stored. Whatever the format (binary or otherwise), that has to be checked, too (unless you want buffer overflows or code execution exploits in your compiler/editor). All in all, it sounds like the same stuff compilers already have to deal with, so I don't think it wouldn't be a win there.