Hi Kevin,


That's the ticket (change HIDDEN to Hidden)! But doesn't that make the grammar 
non-portable, and aren't portable grammars a goal of ANTLR?



Also, it verifies my suspicion that the example code I got (for Csharp) was 
wrong. All the examples I downloaded are wrong, I just checked. So I went back 
and tried to retrace where I got them from, but found the same examples on the 
Antlr site with the same folder organization, but without the errors. 
Frustrating. I sure haven't figured my way around the ANTLR site properly yet, 
I guess! And there are stale examples out there, since I got them only 
yesterday!



Anyhow, I think I'm unstuck for the moment. Thanks to all of you!



Now I can go see if I can figure out how to use AntlrWorks, since everyone 
seems to rave about it, even though it seems that I need to use grammars that 
are a little different (unfortunately), because it's all Java



-          Andy





-----Original Message-----
From: Kevin Carroll [mailto:kcarr...@signmgmt.com]
Sent: Wednesday, October 19, 2011 11:35 AM
To: Voelkel, Andy; antlr-interest@antlr.org
Subject: RE: [antlr-interest] How viable is the Csharp3 target? (more specific 
questions)



Andy,



In addition to the other's suggestions, change HIDDEN to Hidden.  The C# target 
attempts to use standard C# conventions when possible. It can be frustrating 
when working from the books and Java-focused documentation, but once you get 
past the few differences and gain some momentum, you should not have too many 
other compatibility issues.



Kevin Carroll



-----Original Message-----

From: antlr-interest-boun...@antlr.org<mailto:antlr-interest-boun...@antlr.org> 
[mailto:antlr-interest-boun...@antlr.org]<mailto:[mailto:antlr-interest-boun...@antlr.org]>
 On Behalf Of Voelkel, Andy

Sent: Wednesday, October 19, 2011 1:26 PM

To: Sam Harwell; 'pragmaik'; 
antlr-interest@antlr.org<mailto:antlr-interest@antlr.org>

Subject: Re: [antlr-interest] How viable is the Csharp3 target? (more specific 
questions)



Hi,







First, thanks for the encouragement. Knowing there are active users out there 
makes all the difference.







I've now taken the first example from "the definitive ANTLR reference" and 
tried to get it to work, first using the Visual Studio Extensions and 
templates, and then also manually running the ANTLR3.exe file at the command 
line, just to verify that my problems are in the generated code and are not 
errors generated during the generation of code (since the Visual Studio 
Extensions and associated instructions seem to produce projects that both 
generate code and then build it).







So my grammar is this simple:







grammar Lexer1;







options {



    language=CSharp3;



}







/** Match things like "call foo;" */



r : 'call' ID ';' {System.out.println("invoke "+$ID.text);} ;



ID: 'a'..'z'+ ;



WS: (' '|'\n'|'\r')+   {$channel=HIDDEN;} ; // ignore whitespace







When I compile the code generated by ANTLR3, I get these errors:





K:\Plantronics\Development 
Sandbox\AntlrTest\AntlrTest\obj\x86\Debug\Lexer1Parser.cs(28,2): warning 
CS3021: 'Lexer1Parser' does not need a CLSCompliant attribute because the 
assembly does not have a CLSCompliant attribute K:\Plantronics\Development 
Sandbox\AntlrTest\AntlrTest\obj\x86\Debug\Lexer1Parser.cs(86,11): error CS1041: 
Identifier expected; 'out' is a keyword K:\Plantronics\Development 
Sandbox\AntlrTest\AntlrTest\obj\x86\Debug\Lexer1Parser.cs(86,11): error CS1525: 
Invalid expression term 'out'

K:\Plantronics\Development 
Sandbox\AntlrTest\AntlrTest\obj\x86\Debug\Lexer1Lexer.cs(28,2): warning CS3021: 
'Lexer1Lexer' does not need a CLSCompliant attribute because the assembly does 
not have a CLSCompliant attribute K:\Plantronics\Development 
Sandbox\AntlrTest\AntlrTest\obj\x86\Debug\Lexer1Lexer.cs(276,13): error CS0103: 
The name 'HIDDEN' does not exist in the current context







The errors regarding "System.out" make sense, that seems like a call to a Java 
function that does not exist in C#. However the error with HIDDEN is confusing 
to me, and it is the result of sub a basic construct ({$channel=HIDDEN:};). I 
can't imagine what I am doing wrong to cause this, and since it is the first 
example pulled out of the book, you would think it would work!







Can someone help me here? I'm gaining confidence, but I'm having trouble even 
walking before I can run!







Oh, also: What are the files Antlr3.Targets.CSharp2.dll and 
Antlr3.Targets.CSharp3.dll for?







-          Andy











-----Original Message-----

From: antlr-interest-boun...@antlr.org<mailto:antlr-interest-boun...@antlr.org> 
[mailto:antlr-interest-boun...@antlr.org]<mailto:[mailto:antlr-interest-boun...@antlr.org]>
 On Behalf Of Sam Harwell

Sent: Wednesday, October 19, 2011 7:59 AM

To: 'pragmaik'; antlr-interest@antlr.org<mailto:antlr-interest@antlr.org>

Subject: Re: [antlr-interest] How viable is the Csharp3 target?







Hi Andy & Maik,







I agree that the C# target documentation is lacking in many ways. I try to keep 
enough documentation at the following page to get you started on the right path:



http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases







I've been using the CSharp3 target in a commercial product for 3 years now.



At this point, most of the remaining the issues I have with it are 
basic/technical limitations of ANTLR 3 that will hopefully be resolved in later 
versions.







Sam







-----Original Message-----



From: 
antlr-interest-boun...@antlr.org<mailto:antlr-interest-boun...@antlr.org<mailto:antlr-interest-boun...@antlr.org%3cmailto:antlr-interest-boun...@antlr.org>>



[mailto:antlr-interest-boun...@antlr.org]<mailto:[mailto:antlr-interest-boun...@antlr.org]><mailto:[mailto:antlr-interest-boun...@antlr.org]>
 On Behalf Of pragmaik



Sent: Wednesday, October 19, 2011 9:36 AM



To: 
antlr-interest@antlr.org<mailto:antlr-interest@antlr.org<mailto:antlr-interest@antlr.org%3cmailto:antlr-interest@antlr.org>>



Subject: Re: [antlr-interest] How viable is the Csharp3 target?







Hi Andy!







I am using ANTLR's C# target for a couple of weeks now to create a domain 
specific language that is a subset of the C programming language.







My experience is similar to yours, but I can assure you that the C# target 
works and that it is actively maintained. It differs from the Java target in a 
few places, but it works.







The biggest problem is finding documentation. I've both of Terence Parr's books 
on my desk and the folks on this mailing list are very friendly and competent.







Cheers,



Maik











--



View this message in context:



http://antlr.1301665.n2.nabble.com/How-viable-is-the-Csharp3-target-tp690889



0p6908949.html



Sent from the ANTLR mailing list archive at Nabble.com.







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







________________________________



CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files or 
previous e-mail messages attached to it, may contain information that is 
confidential and/or legally privileged. If you are not the intended recipient, 
or a person responsible for delivering it to the intended recipient, please DO 
NOT disclose the contents to another person, store or copy the information in 
any medium, or use any of the information contained in or attached to this 
transmission for any purpose. If you have received this transmission in error, 
please immediately notify the sender by reply email or at 
priv...@plantronics.com<mailto:priv...@plantronics.com>, and destroy the 
original transmission and its attachments without reading or saving in any 
manner.



For further information about Plantronics - the Company, its products, brands, 
partners, please visit our website 
www.plantronics.com<http://www.plantronics.com>.



List: http://www.antlr.org/mailman/listinfo/antlr-interest

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



________________________________

CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files or 
previous e-mail messages attached to it, may contain information that is 
confidential and/or legally privileged. If you are not the intended recipient, 
or a person responsible for delivering it to the intended recipient, please DO 
NOT disclose the contents to another person, store or copy the information in 
any medium, or use any of the information contained in or attached to this 
transmission for any purpose. If you have received this transmission in error, 
please immediately notify the sender by reply email or at 
priv...@plantronics.com, and destroy the original transmission and its 
attachments without reading or saving in any manner.

For further information about Plantronics - the Company, its products, brands, 
partners, please visit our website www.plantronics.com.

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 il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to