I completed the JackTokenizer but cannot figure out how to implement the CompilationEngine. To get a clue where to start, I am asking what I did not understand in the textbook (written in Japanese).
In the section regarding the parser output of Chapter 10, it says the parser outputs <xxx> terminal <xxx> when encountering the terminals. Is the CompilationEngine module supposed to output so in the first place? For example, when calling the compileClass method, does it write <keyword> terminal </keyword> for 'class' and then replace 'terminal' with 'class' referring to the Tokenizer input?
An easy way to check this for yourself is to open the test file, that the tool will compare against your output. You can see that the projects/10/Square/Main.xml file indeed contains
I totally misunderstood the steps I am going to build the Parser. I thought I had to convert each token to <terminal> or <non-termianl>, but that is unnecessary.