Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by Henrique Rocha
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. > > |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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. 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 |
Free forum by Nabble | Edit this page |