Output "terminal" and "non-terminal"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Output "terminal" and "non-terminal"

Ichiro
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?

Thanks,
Ichiro
Reply | Threaded
Open this post in threaded view
|

Re: Output "terminal" and "non-terminal"

ivant
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
<keyword> class </keyword>
.
Reply | Threaded
Open this post in threaded view
|

Re: Output "terminal" and "non-terminal"

Ichiro
Thanks for your reply.

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.

Regards,
Ichiro