peterxu422 wrote
One way I could think of accomplishing this is to create a new class called SymbolTableValues and just have the value in the hashtable be one of these objects with the appropriate data stored in them. But I thought I should avoid creating an extra class since it wasn't suggested in the book. I'm thinking there's another way to achieve this and was wondering if anyone had any suggestions.
I look at this as an implementation detail that would be up to the programmer, not a part of the recommended architecture.
Using a class to contain the values, as you are thinking, is the classic way to do this sort of thing if your programming language supports it.
[You could avoid creating the SymbolTableValues object by having the hash table values be arrays, but that's just plain ugly and very error prone!]
--Mark