[antlr-interest] C# target

forumer at smartmobili.com forumer at smartmobili.com
Sat Apr 7 09:37:25 PDT 2012


Hi,

I am trying to use a java parser from a c# project (targetting 4.0) and 
I have added references to the
antlr runtime found inside antlr-3.4\runtime\CSharp2\dist\bin\net-2.0.
By the way the DOT-NET-runtime-3.1.3.zip is not correct because when I 
try to unzip it with 7-zip or
from windows I get the following message : WOuld you like to replace 
the existing file Antlr3.Utility.xml.
If I examine the zip file I can see that the Antlr3.Utility.xml is 
duplicated :


$ unzip -l DOT-NET-runtime-3.1.3.zip
Archive:  DOT-NET-runtime-3.1.3.zip
   Length      Date    Time    Name
---------  ---------- -----   ----
         0  02-21-2009 22:51   bin/
         0  03-11-2009 23:25   bin/net-2.0/
      6144  03-11-2009 23:25   bin/net-2.0/Antlr3.Utility.dll
     75617  03-11-2009 23:25   bin/net-2.0/Antlr3.Runtime.dll.mdb
      2412  03-11-2009 23:25   bin/net-2.0/Antlr3.Utility.xml <<<<<<< 
DUPLICATE
    198080  03-11-2009 23:25   bin/net-2.0/Antlr3.Runtime.xml
    117760  03-11-2009 23:25   bin/net-2.0/Antlr3.Runtime.dll
      1110  03-11-2009 23:25   bin/net-2.0/Antlr3.Utility.dll.mdb
    114688  06-13-2008 13:17   bin/net-2.0/antlr.runtime.dll
    155648  03-11-2009 23:25   bin/net-2.0/StringTemplate.dll
      2525  08-11-2008 23:04   bin/net-2.0/Antlr3.Utility.XML <<<<<<< 
DUPLICATE
      1300  03-11-2009 23:19   README.TXT
---------                     -------
    675284                     12 files

As you can see file is duplicated.

I am also using antlrworks-1.4.3 and generated CSharp parser/lexer but 
when I try it I get
some missing GrammarRule attribute (I tried with CSharp2 and CSharp3 
but same error).
When I read 
http://www.antlr.org/wiki/display/ANTLR3/Antlr+3+CSharp+Target I can see 
the following instruction :
For recognizers created with ANTLR v3.1.x, you will need ANTLRWorks 
v1.2.x.
I find it weird to have to use an old version but ok let's try it, so I 
have generated my files again and now I get the
following error :

'skip' doesn't exist in current context but if I replace skip by Skip 
it seems to find the symbol.

So my question : Can I rely on c# target because it doesn't seem very 
stable...

Thanks





More information about the antlr-interest mailing list