Hello, I was trying to convert a ANTLR4 grammar specification to SmaCC. After many unsuccessful tries that made me question my sanity I wondered: maybe someone has a solution. Grammar conversion is something that can be automated. My question is if anyone has done something to convert an ANTLR4 grammar to a SmaCC grammar? Thanks and farewell, - Henrique -- View this message in context: http://forum.world.st/ANTLR4-to-SmaCC-tp4948738.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi Henrique, I have never tried to do this. But this is a very valuable effort. There are many grammars in ANTLR, it would be fantastic to reuse them. Keep us posted about your efforts. Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On May 31, 2017, at 11:03 AM, Henrique Rocha <henrique.rocha@gmail.com> wrote:
Hello,
I was trying to convert a ANTLR4 grammar specification to SmaCC. After many unsuccessful tries that made me question my sanity I wondered: maybe someone has a solution. Grammar conversion is something that can be automated.
My question is if anyone has done something to convert an ANTLR4 grammar to a SmaCC grammar?
Thanks and farewell,
- Henrique
-- View this message in context: http://forum.world.st/ANTLR4-to-SmaCC-tp4948738.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi Henrique, Le 31/05/2017 à 17:03, Henrique Rocha a écrit :
Hello,
I was trying to convert a ANTLR4 grammar specification to SmaCC. After many unsuccessful tries that made me question my sanity I wondered: maybe someone has a solution. Grammar conversion is something that can be automated.
Sort of. LL(*) brings itself to entirely different hacks to play with the tokens and lexical analysis that LR() grammars, and most of the hard work on parsers is in that area. I haven't looked if the reversed recursion in ANTLR is hard to convert. The use of the + * ? [ ] symbols is nice because it hides effectively on which side the recursion happens (left recursion in LR, right recursion in ANTLR)
My question is if anyone has done something to convert an ANTLR4 grammar to a SmaCC grammar?
Write a ANTLRv4 grammar syntax grammar in SmaCC would do the trick. Apart from semantic actions of course. Regards, Thierry
Thanks and farewell,
- Henrique
-- View this message in context: http://forum.world.st/ANTLR4-to-SmaCC-tp4948738.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Thierry Goubier wrote
LL(*) brings itself to entirely different hacks to play with the tokens and lexical analysis that LR() grammars, and most of the hard work on parsers is in that area.
I haven't looked if the reversed recursion in ANTLR is hard to convert.
I agree. But I have seem some tricks and tips to convert one kind to the other. It seems like a lot of the work can be automated. Thierry Goubier wrote
Write a ANTLRv4 grammar syntax grammar in SmaCC would do the trick.
Unfortunately, I dont have the skills or the knowledge in SmaCC to write this in SmaCC. I tried and failed (so many times) to convert a specific language to SmaCC and I got nowhere (I cant even imagine to do a more generic syntax grammar such as ANTLR). That is why I am asking for help if anyone else has done something like that. Thanks and best regards, - Henrique -- View this message in context: http://forum.world.st/ANTLR4-to-SmaCC-tp4948738p4948771.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (3)
-
Alexandre Bergel -
Henrique Rocha -
Thierry Goubier