[antlr-interest] Update C# VS2005 integration instructions

Brian Todoroff brian at todoroff.com
Thu Nov 29 12:20:46 PST 2007


Looks like a bug in the C# code generator and has nothing to do with
the integration.  BTW you want to put the -message-format vs2005
option back in to your java command so that error messages generated
by antlr.Tool work correctly in the error box in VS:
<Exec Command="java org.antlr.Tool -debug -message-format vs2005
@(Antlr3)" Outputs="%(Antlr3.OutputFiles)" />

Don't use the debugger, so I could be off here, but I believe the work
around should be to change the offending line to a member declaration
only:
     protected ITreeAdaptor adaptor;
and add the initialization to both constructors for the class:
     adaptor = new DebugTreeAdaptor(dbg, new CommonTreeAdaptor());

Ugly since you'll need to do it by hand each time you generate, but it
should keep you moving forward until the generator can get fixed - far
out of my depth on that one...

Brian


On Nov 28, 2007 6:05 PM, Lucas Ontivero <lucasontivero at hotmail.com> wrote:
>
> Hi All,
>
>  I tried this integration and is ok but after, I put the -debug option:
>        <Exec Command="Tool\Antlr3.Tool.exe -debug @(Antlr3)"
> Outputs="%(Antlr3.OutputFiles)"/>
>
> The code is generated but when I compile it, VS2005 show me 4 errors:
>  "An object reference is required for the nonstatic field, method, or
> property 'Antlr.Runtime.Debug.DebugParser.dbg' C:\Documents and
> Settings\Administrador.ROOT\Escritorio\Compiler\Source\Buba\BubaParser.cs
> 227 59 Buba"
>
>  I'm just reporting this.
>  Bye
>
>
>  ________________________________
>
>  > Date: Tue, 27 Nov 2007 17:33:20 -0800
> > From: brian at todoroff.com
> > To: antlr-interest at antlr.org
> > Subject: [antlr-interest] Update C# VS2005 integration instructions
>
>
> >
> > For those of you working with ANTLR and C# in Visual Studio, I've
> > updated the integration instructions on the wiki to correctly setup
> > the output .cs files as dependencies of your .g files. Also made the
> > minor edit to use the vs2005 message format included in v3.
> >
> >
> http://www.antlr.org/wiki/display/ANTLR3/Integration+with+development+environments
> >
> > Tested with the latest .jar and VS2005. Let me know if you experience
> > any problems.
> >
> > Brian
>
>
> ________________________________
> Express yourself instantly with MSN Messenger! MSN Messenger
>


More information about the antlr-interest mailing list