|
This is a matter of design. Each "module" has a particular task:
Tokenizer: break Jack code into tokens
Symbol Table: keep track of class names, function names, variable names, etc.
Parser: transform tokens into a tree
VM Writer: transform the tree (the program) into VM instructions (push, pop, etc)
Keep in mind that you certainly can depart from the suggested design in your own implementation. (That said, this architecture, in general, is one you will see in the real world.)
|