[antlr-interest] ANTLR v2,v3

Jim Idle jimi at temporal-wave.com
Thu Aug 7 10:12:51 PDT 2008


On Thu, 2008-08-07 at 14:08 +0200, Johannes Luber wrote:

> Anders Karlsson schrieb:
> > Hi
> > 
> > Is there a detailed list with grammar changes from v2 to v3. I have one big 140K v2 grammar to convert and I am really struggling so it would help with such a list. I have the book ANTLR3 ref however there seems to be no helpful summary with the changes. e.g. in v2 you can write a:'t' to get an alias for 't' in v3 you have to write a='t' (if even true).
> 
> Does <http://www.antlr.org/wiki/pages/viewpage.action?pageId=719> help?
> > 
> > I am not so familiar with the v2 grammar and was hoping not having to learn that dialect first when converting.
> > 
> > Running the v2v3 just doesn't do it. The original grammar contains lots of sprinkled in C++ code and generates its own AST tree.  
> > 
> > I have also noticed that the ANTRLWorks1.1.7 crashes when the grammar is big, it suddenly stops updating the screen. Is this a known problem? It happens when I do "Generate code".
> 
> I noticed this behaviour myself, but Jean couldn't reproduce it, I 
> believe. Send him a bug report with the grammar and generate the grammar 
> on the command line.


I think that this happens when the grammar is so far away from being a
good one that the parsers are giving up all the time. Also, turn off the
syntax autoupdate until the grammar is more like a v3 one.

BTW - there are plenty of people that will convert your grammar for a
fee, including me. If you are converting a C++ grammar, then all the
actions (which should really be doing minimum work in actions and
calling external code) will need to be changed. If you know neither the
original C++ model in 2.7, nor the 3.1 C/C++ model, then you will be
doing this conversion for a long time I suspect.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080807/a2072d52/attachment.html 


More information about the antlr-interest mailing list