when do I need to write .jjt file and when do I ONLY need to write .jj file

StackOverflow https://stackoverflow.com/questions/17005359

  •  31-05-2022
  •  | 
  •  

Pergunta

I find that ,to generate a calculator ,I only need to write .jj file.

The calculator is the only example I studied,So hopefully if you can provide me some simple examples of JJTree..Thank you :)

Is it right that jjtree provide the container-class for the result of .jj?

Foi útil?

Solução

Use a JJTree file if you want to build a tree structure during parsing and you accept JJTree's way of doing that. A JJTree file will generally be much less cluttered with semantic actions than a JavaCC file. The price you pay is that you have less control over the form of the tree nodes.

I'd suggest looking at some of the JJTree tutorials that are out there. Google "JJTree tutorial".

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top