Hi Simon,

I assume you're using the grammar from this project:
http://code.google.com/p/phpparser/

If so, you'll need to modify the grammar to work with any target other than
the Java target. In the @header and @members blocks at the top, the
contained code is written in Java and will need to be ported to C#. As a
start, the @header blocks should be:

@lexer::namespace{Kuruvila.Php.Parser}
@parser::namespace{Kuruvila.Php.Parser}

You'll also need to port the embedded action in the HereDocContents lexer
rule to C#.

Thanks,
Sam

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Simon
Sent: Monday, February 14, 2011 11:22 PM
To: [email protected]
Subject: [antlr-interest] Compile errors with CSharp2 Target

Hello all,

I'm trying to get the CSharp2 target to work.   I followed the
instructions here:

http://www.antlr.org/wiki/pages/viewpage.action?pageId=557075

except that I generated using the command line rather than using Antlrworks:

java -classpath antlr-3.1.3.jar org.antlr.Tool -o . Test.g

The test example worked just fine and produced valid CSharp code, but when I
tried a PHP grammar (which works fine when generating to Java
code) it produced a build error:

C:\Temp\PHPParser\PhpLexer.cs(132,22): error CS0722:
'Antlr.Runtime.Token': static types cannot be used as return types

I tried using various different .NET targets (2.0, 3.0, 3.5), but it didn't
help.

Can anyone give me some hints about what might be wrong here?

Cheers & Thanks!

Simon

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


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

-- 
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.

Reply via email to