[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Grammatica-users] C# help
From: |
Per Cederberg |
Subject: |
Re: [Grammatica-users] C# help |
Date: |
Wed, 19 Nov 2003 10:39:11 +0100 |
Forgot to cc: the list. /Per
-----Forwarded Message-----
From: Per Cederberg <address@hidden>
To: Sebastien Le Calvez D. <address@hidden>
Subject: Re: [Grammatica-users] C# help
Date: Wed, 19 Nov 2003 10:37:21 +0100
On Tue, 2003-11-18 at 21:32, Sebastien Le Calvez D. wrote:
> I need help on compiling the c# version of grammatical. I know that in
> order to compile (with ms csc) I have to do something like csc
> /lib:lib /reference:grammatica-1.4.dll, but I don’t know what to put
> after that. Is there some kind of manual for the c#. What file do I
> have to compile??
Do you mean to compile Grammatica proper or to compile
your own code using Grammatica? The steps one normally
takes for the latter are:
1. Run Grammatica on you .grammar file:
java -jar grammatica-1.4.jar hello.grammar --csoutput .
There are more options if you like something a bit
less "vanilla".
2. Compile your code with the Grammatica library
(plus the newly created parser code). With Mono
this would be:
mcs -lib:lib -reference:grammatica-1.4.dll -out:hello.exe
-main:MainClass -target:exe *.cs
I suspect you can just replace "mcs" with "csc" to
have it work with the MS stuff.
3. Run your code. With Mono (again) this step is:
mono hello.exe
In Windows I think you can run the hello.exe
directly but I wouldn't know (not having Windows
here to test on).
The above example assumes that the grammatica-1.4.dll
lives in the same directory as everything else. It is
normally a bad idea to put everything in a single
directory, but it made this example so much easier!
Hope this helps!
> I’m doing a T-SQL instruction parser. I have my BNF grammar. Thanks
> for the help….
Cool! I will start publishing Grammatica grammars on
the web site soon, so if you'd like to contribute
you'd be very welcome!
Cheers,
/Per