[antlr-interest] ANTLR v2,v3

Anders Karlsson anders at globe-trotter.us
Thu Aug 7 18:04:49 PDT 2008




>  --------------------
>  TO: Johannes Luber <jaluber at gmx.de>
>  DATE: Thu, 07 Aug 2008 10:12:51 -0700
>  SUBJECT: Re: [antlr-interest] ANTLR v2,v3
>  
>  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 <[LINK:
>  http://www.antlr.org/wiki/pages/viewpage.action?pageId=719]
>  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

Hi thanks for the update, I will try and turn off the auto-update. Unfortunately I cannot give out the grammar for troubleshooting due to company policy.

Thanks for your offer but I think this is something I myself need to do since it is part of my job. I don't currently have any firm requirement to convert to v3 but it will come next year so I was just investigating how much work it would be by some hands-on research. 

Do you have any tips in how to approach the problem of converting a grammar, would be grateful for any pointers there. e.g. starting with this then doing that :)

Best regards
Anders


More information about the antlr-interest mailing list