< Previous
Next >

: The abstract syntax tree construction code is about to start working, I think. Programming in C or C++ is like building a watch with a million little gears. You build all these components and then you try to get all the gears to mesh together. I get sick of this very quickly. I'd much rather be building things with Legos. Metaphorical Legos, I mean. Or real Legos, for that matter.

I keep moving responsibility for the symbol table between the scanner and the parser. It was in the scanner, then I moved it to the parser, then I decided I could do it in the scanner after all, then I decided that I couldn't. I'm still fairly sure that I couldn't, because the parser doesn't know whether an identifier is part of, eg., a declaration (in which case it goes in the symbol table) or a statement (in which case it's an error if it's not already in the symbol table).


[Main] [Edit]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.