I have two orthogonal questions related to symbol tables:
Should I build the symbol table and perform type checking as I parse the code? Parsing first and then traversing the AST to build the symbol table looks cleaner to me. However, I like the idea of having an immutable AST (similar to Clang), and I can't have that in a two-step process (as I would need to insert extra type conversion nodes in the type checking phase).
Should the symbol table be responsible for doing type checking? I read multiple articles in which symbol tables are used for this purpose. Is that a recommended practice? It looks rather awkward to me.
Note: I am using a top-down recursive descent parser.