I have a few things about the AST / Symbol Table relation that i don't understand.
I currently have a AST implemented in C# which has nodes for variable declarations (these contain informations about the name, type, source position, a possible constant value as expression node, etc).
Now i want to fill a symbol table (using the visitor pattern on my AST) but my question is: are the "symbols" new classes for example VariableSymbol or does the symbol table directly store the VariableDeclarationNode from the AST?
IF the symbols are new classes, then who would store the evaluated expression value for constant variables, the VariableDeclarationNode or the VariableSymbol or somewhere else?
(I have seen some interpreter examples and they store all variable values, including constants, in a additional hash table, but im working on a source-to-source compiler and not a interpreter, so im not sure where you store the evaluated constants in this case. Sorry i know these a kinda multiple questions)