1. write <class> 2. read the first 3 lines of codes from the Tokenizer excluding <tokens> 3. Because the next token is 'field', call the compileClassVarDec
I used the 'readlines' function to read the Tokenizer. In the 2nd step, I specified a line of the Tokenizer by an index and write it on the new XML file. The output in the command prompt is the same as the Tokenizer.xml. However, the output in the new XML file excluded the type of the terminal such as <keyword> or <identifier>. Please refer to the attached file below.
Re: How to extract xml codes of the Tokenizer in each Compilexxx methods?
While you could use the XML from the tokenizer as the input to your compiler, that is not the intent. The idea is that having it produce the token list is the first step, but once that is working, you have it instead output the compiled code.