peterxu422 wrote
Why is there no startClass() method specified in the API for the SymbolTable class? Doesn't a new classScope need to be created each time a new class is created so that it can keep track of its own fields and statics?
In the book recommended design, a new CompilationEngine is constructed for each file processed. One of the objects in the CompilationEngine is a SymbolTable, so each file starts with an empty SymbolTable. Since the Jack language spec says there can be only one class per file, the SymbolTable never needs to change to a different class scope.
--Mark