Hi,
I implemented the compileclass method by the following. I prepared the attached simple XML file for a test.
MainT.xml1. 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.
MainMyreadlines.xmlCould you tell me how to write the line as it is by using the readlines? Or is there any better way to implement each compilation method?
Regards,
Ichiro