[antlr-interest] Re: C# working version

Alex Sedow alexsedow at mail.ru
Sat Mar 6 00:34:20 PST 2004


> Oh - I had used TextPad, mostly because of using the java step to generate
> the lexer/parser, but also it is because it is easy to adjust the syntax
> highlighting for different sections. To work on the token classes and the
> antlr libs I used vs.net 2002 - I might have had to modify the project
files
> to be 2002 compatible (you can just modify the headers of the sln and proj
> files). The bat file I use to run it copies whatever updates were made to
> antlr into the working directory of the grammar.
>
> To get it to run in vc# (as you probably know), just start an empty
project,
> add the cs files, and the add a reference to antlr.runtime-2.7.2 dll. I
> didn't go as far as calling the java from vs.net, though it shouldn't be
too
> hard if you want that. The bat file I use (local dirs and all) looks like:
>
> REM ** run.bat **
> echo off
> cls
> java -cp G:\antlr-2.7.2 antlr.Tool csharp.g
> copy G:\antlr-2.7.2\lib\csharp\src\obj\Debug\antlr.runtime.dll
> F:\Mediator\CSharp\
> csc /out:CSharp.exe /warn:1 /nologo
/R:F:\Mediator\CSharp\antlr.runtime.dll
> *.cs
> CSharp.exe cs2.in
>
> I just set that to the F5 hotkey in TextPad... I've put up the syntax
> highlighting file for TextPad as well, in case anyone uses that too.
> http://www.debreuil.com/CSharp/CSgrammar.syn
>
> Cheers,
> Robin

1. You can add command line call to project.
Open project properties add to Common Properties/Build Events/Pre-build
Event Command Line command line ("java -cp G:\antlr-2.7.2 antlr.Tool
csharp.g" (without quotes)). This variant has one disadvantage -
lexer/parser/etc files fully regenerated every time before building the
project (this may take a lot of time).
2. Add antlr/C#-runtime project to solution. And create reference to this
project from C#Parser project.

Alex.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list