Add the following in your .csproj:

 

  <PropertyGroup>

    <UseHostCompilerIfAvailable>False</UseHostCompilerIfAvailable>

  </PropertyGroup>

 

Sam

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Ed Key
Sent: Sunday, January 18, 2009 9:58 AM
To: [email protected]
Subject: [antlr-interest] ANTLR build step problem (using MS Visual
Studio2008, C#)

 

Hi All,

I've just finished integrating an ANTLR step into my C# project and
everything is very nice and neat except for one thing: When I build, the
lexer/parser generation seems to be one step behind the build, even
though it is being done before the C# code is compiled.

For example, starting with a working .G file, I introduce a deliberate
error, in the @members section, e.g. just putting the word "typo" 

I then hit F6 and build - everything succeeds.

I then hit build again - I now get the expected error: "Member modifier
'public' must precede the member type and name"


Below are the (hopefully) relevent bits of the vcproj file:

The generated C# lexer/parser files:

    <Compile Include="UI\WuweiUILexer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>WuweiUI.g</DependentUpon>
    </Compile>
    <Compile Include="UI\WuweiUIParser.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>WuweiUI.g</DependentUpon>
    </Compile>

The grammar file:

  <ItemGroup>
    <Antlr3 Include="UI\WuweiUI.g">
      <OutputFiles>WuweiUILexer.cs;WuweiUIParser.cs</OutputFiles>
    </Antlr3>
  </ItemGroup>

The pre-build step:

  <PropertyGroup>
    <PreBuildEvent>java -classpath
"$(ProjectDir)..\..\antlr\antlrworks-1.2.2.jar" org.antlr.Tool
-message-format vs2005 "$(ProjectDir)@(Antlr3)"</PreBuildEvent>
  </PropertyGroup>


I've tried various tweaks to the vcproj file but with no success. The
pre-build step was previously set up as in
http://www.antlr.org/wiki/display/ANTLR3/Integration+with+Development+En
vironments, but this did not work with spaces in $(ProjectDir). (There
may be a solution to this sub-problem but it's outside of my limited XML
knowledge....)

Thanks in advance for any help or information!

Ed


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to