[il-antlr-interest: 31713] [SPAM] [antlr-interest] [SPAM] Syntax ambiguity?

2011-03-04 Thread Olivier Lefevre
Sorry, the subject is not very informational but I cannot get the hang of the problem, so I cannot devise a better subject. I have this small grammar: grammar Gr3; options { output=AST; } stat : fun1 | fun2 ; fun1 : 'fun1(' ID1 ')' ; fun2 : 'fun2(' ID2 ')' ; fragment DIGIT :

[il-antlr-interest: 31714] Re: [antlr-interest] [SPAM] [SPAM] Syntax ambiguity?

2011-03-04 Thread Kevin J. Cummings
On 03/04/2011 03:02 AM, Olivier Lefevre wrote: Sorry, the subject is not very informational but I cannot get the hang of the problem, so I cannot devise a better subject. I have this small grammar: grammar Gr3; options { output=AST; } stat : fun1 | fun2 ; fun1 : 'fun1('

[il-antlr-interest: 31716] [antlr-interest] Template rewriting: processing lists of things (possible bug?)

2011-03-04 Thread Conrad Hughes
Dear all, I'm using ANTLR 3.3. In a template rewriting grammar, structures like rule: l+=otherRule+ create a list of nulls in $l if otherRule isn't a template rewrite. This seems undesirable behaviour since I'd've thought that unrewritten rules should just appear in $l as their original

[il-antlr-interest: 31719] [antlr-interest] Tree grammar for expression subrules?

2011-03-04 Thread g...@novadsp.com
Is there a pattern to follow for creating tree grammars for subrules? // parser rule. this works. expression : (a=term - $a) ( ( '|' b=term - ^(OR $expression $b) | '|'- ^(OR $expression EPSILON) ) )* ; //

[il-antlr-interest: 31720] Re: [antlr-interest] How to get the complete syntax tree

2011-03-04 Thread Juan Manuel Cámara
Thank you Bart, your post at stackoverflow.com was exactly what I was looking for. The explanation is very clear. Thanks! El 3 de marzo de 2011 19:22, Bart Kiers bki...@gmail.com escribió: Hi, 2011/3/3 Juan Manuel Cámara juanm...@gmail.com ... The Parser works fine, but its return is a

[il-antlr-interest: 31721] Re: [antlr-interest] Template rewriting: processing lists of things (possible bug?)

2011-03-04 Thread Terence Parr
hi. Rules do not return templates by default; you have to set them. any that does not returns a null, hence, the list of nulls you get :) Ter On Mar 4, 2011, at 3:28 AM, Conrad Hughes wrote: Dear all, I'm using ANTLR 3.3. In a template rewriting grammar, structures like rule:

[il-antlr-interest: 31722] Re: [antlr-interest] Tree grammar for expression subrules?

2011-03-04 Thread Bart Kiers
On Fri, Mar 4, 2011 at 6:53 PM, g...@novadsp.com g...@novadsp.com wrote: Is there a pattern to follow for creating tree grammars for subrules? // parser rule. this works. expression : (a=term - $a) ( ( '|' b=term - ^(OR $expression $b) | '|'- ^(OR

[il-antlr-interest: 31723] [SPAM] [antlr-interest] [SPAM] Re: [SPAM] [SPAM] Syntax ambiguity?

2011-03-04 Thread Olivier Lefevre
First, a correction. I wrote: So, how can I force ANTLR to consider ID1 in this position? I meant ID2, of course. On 3/4/2011 9:33 AM, Kevin J. Cummings wrote: fun2 : 'fun2(' (id1=ID1 { id1.setType(ID2); } | ID2 ) ')' ; This is a perfectly good solution, thanks! It's a pity the ANTLR book

[il-antlr-interest: 31724] Re: [antlr-interest] [SPAM] [SPAM] Re: [SPAM] [SPAM] Syntax ambiguity?

2011-03-04 Thread Kevin J. Cummings
On 03/04/2011 03:28 PM, Olivier Lefevre wrote: Just for my understanding of ANTLR, though, I wonder if there isn't a solution at the lexer level: some way to tell the lexer that if it sees a 'fun2(' then it *must* look for an ID2 next. That would involve the lexer knowing something about the

[il-antlr-interest: 31725] [antlr-interest] Updated CSharp2 Runtime in main?

2011-03-04 Thread Felix Natter
hello, Is there a development version with updated CSharp2 runtime? I cannot get it to work at all :-/ I found the snapshots: http://www.antlr.org/depot/antlr3//main/target/antlr-master-3.3.1-SNAPSHOT-src.jar but they do not contain the runtimes other than the java one. Another question:

[il-antlr-interest: 31726] Re: [antlr-interest] Tree grammar for expression subrules?

2011-03-04 Thread g...@novadsp.com
On 04/03/2011 19:13, Bart Kiers wrote: I'd expect that to become the tree-grammar rule: expression : term | ^(OR expression term) | ^(OR expression EPSILON) ; Hello Bart Once again, extremely useful input. Thanks. My question though still stands.

[il-antlr-interest: 31727] [SPAM] [antlr-interest] [SPAM] Re: [SPAM] [SPAM] Re: [SPAM] [SPAM] Syntax ambiguity?

2011-03-04 Thread Olivier Lefevre
On 3/4/2011 9:32 PM, Kevin J. Cummings wrote: That would involve the lexer knowing something about the parsing context, which it doesn't. Your entire character stream gets tokenized before the parser even gets run I see. I thought cases like this might be an argument for a combined

[il-antlr-interest: 31728] Re: [antlr-interest] Updated CSharp2 Runtime in main?

2011-03-04 Thread g...@novadsp.com
Felix Is there a development version with updated CSharp2 runtime? I've been able to use the CSharp2 run-time with the following changes, the original code was pulled as a tarball from Atlassian: * Atlassian CSharp2 running is missing the IASTRuleReturnScope file. Implemented as namespace

[il-antlr-interest: 31729] [SPAM] [antlr-interest] [SPAM] Re: Syntax ambiguity?

2011-03-04 Thread Olivier Lefevre
I see. I thought cases like this might be an argument for a combined lexer-parser but I have since found the notes where TP argues it: against it, I meant. List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe:

[il-antlr-interest: 31730] [SPAM] [antlr-interest] [SPAM] Re: C# Target: Problems with Mono

2011-03-04 Thread Olivier Lefevre
On 3/1/2011 10:00 PM, Felix Natter wrote: I am trying to generate C# code from my grammar for use with Mono2 (v1.9). ** (Antlr3.exe:4230): WARNING **: Missing method System.Reflection.Emit.DynamicMethod::.ctor(string,Type,Type[]) 1) The Mono team is quite candid about what is missing: