[il-antlr-interest: 34450] Re: [antlr-interest] Beginner needing help with rewrite rules

2011-10-19 Thread Yves Weißig
Hi! Thanks for the answers! That was a good rough guess Jim... I finally came up with this: group : (OPEN children+=space* ( children+=group children+=space* |

[il-antlr-interest: 34453] [antlr-interest] How viable is the Csharp3 target?

2011-10-19 Thread Voelkel, Andy
Hi, I wrote a post yesterday about the trouble I'm having getting started with ANTLR. Overnight, I thought about it some more, and I'm becoming convinced that the latest problems I'm having are either problems with the Csharp target or backwards compatibility problems between ANTRL example

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

2011-10-19 Thread pragmaik
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

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

2011-10-19 Thread Sam Harwell
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

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

2011-10-19 Thread 李志鹏
which version c# runtime do you use? 3.4 or 3.3? download from official website? i am newbie, want to build simple project could run an example, but two weeks passed, i failed… 在 2011-10-19 下午10:36,pragmaik cont...@maik-schmidt.de编写: Hi Andy! I am using ANTLR's C# target for a couple of weeks

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

2011-10-19 Thread Kevin Cherry
I kind of got turned off when CSharp3 target was first introduced and the code template had bugs in it. For example, at the end it would print out a single line comment with the keyword namespace and the name of the namespace (i.e. // namespace foo). The problem was somebody put a newline after

[il-antlr-interest: 34458] Re: [antlr-interest] This learning curve is getting me down (error messages using examples) NEWBIE NEEDS HELP

2011-10-19 Thread Norman Dunbar
Afternoon Andy, On 19/10/11 08:39, Norman Dunbar wrote: ... Talking of which, is CSharp a good place to start as a beginner? Sigh! Wish I could read. When you wrote using the treeparser example code for target Csharp2 I missed the word target and thought that you were playing with a

[il-antlr-interest: 34459] Re: [antlr-interest] Rewriting a list of tokens to a list of custom tokens

2011-10-19 Thread Jim Idle
t1+='void' (t2+='*')* - ^(LIST TYPE[$t1]+ TYPE[$t2]+) By interpolating from your question. At least, that should get you on the right track. Jim -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- boun...@antlr.org] On Behalf Of Christian Sent:

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

2011-10-19 Thread Jim Idle
I can confirm that the Csharp3 target is very viable and works perfectly well. I think that your problems are more to do with being new to ANTLR and then trying to use the CSharp target as your first try. If you used the Java target purely inside ANTLRWorks just until you get going, then you will

[il-antlr-interest: 34461] [antlr-interest] Matching an arbitrary string until the next whitespace occurrence

2011-10-19 Thread Patrick Nick
Hi all, I just started using antlr and was able to construct a nice grammar that fulfills my application's needs. There is one thing which I haven't been able to get to work though. My grammar is parsing program arguments which the user supplied when starting the program, and some of that input

[il-antlr-interest: 34462] Re: [antlr-interest] Matching an arbitrary string until the next whitespace occurrence

2011-10-19 Thread Jim Idle
I suggest that you want to use getargs, and not try to parse things like this with ANTLR as the specification is too vague. The lexer is not context driven, so placing a rule like that in lexer will match everything that is whitespace to the detriment of any other rule at all. Jim

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

2011-10-19 Thread Justin Murray
Try using Console.WriteLine() instead of System.out.println(). What is inside of the curly braces is directly injected into the C# code being generated, and therefore needs to be C# syntax, not Java. - Justin On 10/19/2011 2:25 PM, Voelkel, Andy wrote: Hi, First, thanks for the

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

2011-10-19 Thread Jim Idle
System.out.println(invoke +$ID.text);} Is Java code, which is why I encourage you to just use ANTLRWorks with Java to get your head around ANTLR, then you will be able to see the woods from the trees switching to C#. Jim -Original Message- From: antlr-interest-boun...@antlr.org

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

2011-10-19 Thread Kevin Carroll
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

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

2011-10-19 Thread Voelkel, Andy
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.

[il-antlr-interest: 34468] [antlr-interest] Fwd: How viable is the Csharp3 target? (more specific questions)

2011-10-19 Thread Eric
-- Forwarded message -- From: Eric researcher0...@gmail.com Date: Wed, Oct 19, 2011 at 3:25 PM Subject: Re: [antlr-interest] How viable is the Csharp3 target? (more specific questions) To: Voelkel, Andy andy.voel...@plantronics.com On Wed, Oct 19, 2011 at 3:16 PM, Voelkel, Andy

[il-antlr-interest: 34469] Re: [antlr-interest] Rewriting a list of tokens to a list of custom tokens

2011-10-19 Thread Christian
No, your solution still generates invalid java code for me. Did you test your solution? The TYPE token does not accept a list as parameter. It is a simple token defined within the token block at the top of the grammar. It seems that the construction of an implicit list is only possible for rules

[il-antlr-interest: 34470] Re: [antlr-interest] Rewriting a list of tokens to a list of custom tokens

2011-10-19 Thread Jim Idle
Sorry, I did not see that list thing, but I was trying to get you on the right track. First, don't use literals Put the tokens in subrules Change the token type in subrule (I usually just set the type field in the token, but that is a bit of a cheat) I don't have time to test every code snippet