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 :
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('
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
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)
)
)*
;
//
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
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:
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
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
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
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:
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.
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
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
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:
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:
15 matches
Mail list logo