Hi Jean-Baptiste,
Q1: SableCC 3 or 4?From a 2019 answer found here, I plan to start with SableCC 3.7 rather than SableCC 4 which is qualified as non stable by the community.Is it the right choice of should I start with SableCC 4 ?
I recommend using SableCC 3. It is stable and complete.
I've let students use SableCC 4 beta. In that context, its many limitations (no lexers states, no *+? operators, no tree transformations, etc.) weren't a problem. Their feedback and my own experience with SableCC4 was quite useful to identify the good and the bad of various proposals. I really like the simplified syntax, but the benefits of the more complex lexers and parser engines and their collateral impacts weren't convincing. So, the project is going through a redesign to better achieve my objectives without adding uncesseray complexity.
Q2. Doc.Where can I find the grammar doc for SableCC 3?Same question with a doc on states and how to use it.I'm struggling to get back with what I was able to do 10 years ago.I'm using exemples provided with SableCC 3 distribution, but I find this approach quite hard.On SableCC.org the thesis is stated to be the definitive guide, is it true for SableCC 3 ?
Yes, my old thesis remains the definitive guide for SableCC 3.
SableCC 3 is completely syntax-compatible with the previous
SableCC 2. Its main feature is the addition of tree
transformations. These tree transformations are internally used by
SableCC 3 to automatically resolve grammar conflicts. Many users
benefit from this without even being aware of it. SableCC 3 also
supports explicit tree transformations directives, but few users
take advantage of that. There's a link on the documentation page a
CST->AST tutorial.
Cheers,
Etienne
Etienne Gagnon, Ph.D. http://sablecc.org