Convert v3 grammar to v4?

317 prikaza
Preskoči na prvu nepročitanu poruku

Otis Gospodnetic

nepročitano,
5. ožu 2014. 10:03:2805. 03. 2014.
u antlr-di...@googlegroups.com
Hi,

I have a grammar that was written for ANTLR 3.  I saw https://theantlrguy.atlassian.net/wiki/pages/viewpage.action?pageId=1900596 (about ANTLR 4) and am wondering the following:
* is it possible to use v3 grammar with ANTLR 4?
* is it possible to give ANTLR 4 the v3 grammar and have ANTLR 4 output the v4 version of the same grammar?

Thanks,
Otis
--
Performance Monitoring * Log Analytics * Search Analytics
Solr & Elasticsearch Support * http://sematext.com/


Terence Parr

nepročitano,
5. ožu 2014. 12:59:1905. 03. 2014.
u antlr-di...@googlegroups.com
Hi v3 grammars are easy to convert; just remove syntactic predicates
and it'll be close. I can look for you. ptr to grammar?
T
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Otis Gospodnetic

nepročitano,
5. ožu 2014. 16:15:4905. 03. 2014.
u antlr-di...@googlegroups.com
Otis
--
Performance Monitoring * Log Analytics * Search Analytics
Solr & Elasticsearch Support * http://sematext.com/


--
You received this message because you are subscribed to a topic in the Google Groups "antlr-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/antlr-discussion/KqANyZqXvTo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to antlr-discussi...@googlegroups.com.

Terence Parr

nepročitano,
5. ožu 2014. 19:16:3905. 03. 2014.
u antlr-di...@googlegroups.com
Hi. well now we create parse trees automagically not AST so all -> would have to go.  Also there is a LOT of raw code in there. might take some tweaks to preserve meaning. 

All in all, doesn't look too scary. have you tried it? ;)
T

Sam Harwell

nepročitano,
6. ožu 2014. 00:42:2906. 03. 2014.
u antlr-di...@googlegroups.com

Hi Otis,

 

I’m taking a look at this.

 

Sam

Sam Harwell

nepročitano,
6. ožu 2014. 15:38:4706. 03. 2014.
u antlr-di...@googlegroups.com

Hi Otis,

 

I sent a pull request that shows all the steps I went through to convert your project from ANTLR 3 to ANTLR 4.

https://github.com/senseidb/sensei/pull/23

 

As described in the pull request, it’s not 100% done, primarily because I didn’t duplicate the error messaging you put in place for ANTLR 3. However, it should provide you with a reasonable starting place for the transition.

 

Thanks,

Sam

Otis Gospodnetic

nepročitano,
6. ožu 2014. 16:11:3006. 03. 2014.
u antlr-di...@googlegroups.com
Wow, thank you Sam! :)

I'll ping Sensei devs to see if they want to accept this quickly.

Otis
--
Performance Monitoring * Log Analytics * Search Analytics
Solr & Elasticsearch Support * http://sematext.com/


Odgovori svima
Odgovori autoru
Proslijedi
0 novih poruka