[il-antlr-interest: 27286] Re: [antlr-interest] simple lexical analysis question

2009-12-16 Thread Jean-Claude Durand
Thanks for your answers, I now understand the stategy of lexers. The left factoring you propose does not work better: because of the 'F' letter of the identifier following the minus sign, the problem remains the same in the example '-FOO -FIN-' ! ~/Soft/Antlr/LexJava: java Main test line 1:2

[il-antlr-interest: 27287] [antlr-interest] action for import

2009-12-16 Thread Bujji
Hi all how to implement import statement (like in python: import sys) using antlr grammar i have got syntax recognition in examples but how the action should be performed. how the language is able to find that that file is there or not in the library any clues ? help me Thanks in advance Siva

[il-antlr-interest: 27288] [antlr-interest] Successful parser return is always null

2009-12-16 Thread Andrey Pohilko
Hello! I have a Bpp.g that successfully processed by antlrworks antlrworks-1.3.1.jar, I can see parse tree. When I use generated parser and lexer classes, my call to parser g.specification() always returns null, but examples in internet show that there must be an object. My test code and Bpp.g

[il-antlr-interest: 27289] [antlr-interest] Réf. : Re: Strange code too large error since *very simple* gat ed semantic predicates

2009-12-16 Thread loic . lefevre
Hello Jimi, First thanks for your reply. As you said, yes I'm really trying to enforce parsing paths. What I've tried so far: - Use int comparison instead or String comparison = KO - Replaced {...}?= (gated semantic predicates) by {...}? (disambiguating semantic predicates) = OK the switch has

[il-antlr-interest: 27290] [antlr-interest] Réf. : Re: Maven problems with ANTLR 3.2

2009-12-16 Thread loic . lefevre
Please read: http://jira.codehaus.org/browse/MOJO-1014 That in mind, I've added the following lines in the antlr-3.2/pom.xml at line 35: scm developerConnectionscm:svn:http://fisheye2.cenqua.com/browse/antlr/developerConnection /scm Now it works (at least, the tests are currently

[il-antlr-interest: 27291] Re: [antlr-interest] Tree construction

2009-12-16 Thread Marcin Rzeźnicki
On Tue, Dec 15, 2009 at 10:36 PM, Jim Idle j...@temporal-wave.com wrote: You will need to bring the EQUALS up in to the rule and rewrite accordingly: expression   :   ce=conditionalExpression     (          EQUALS e1=expression  - ^(STORE $ce $e1)        | ao=assignmentOperator

[il-antlr-interest: 27292] [antlr-interest] Specifying string template file location with GUnit

2009-12-16 Thread Cameron Ross
Hi, I'm using GUnit to test an ANLTR tree walker and it works very well. However, the only way I've found to tell GUnit where my template file resides is set the template library from within @init for the grammar rule being tested. This has the obvious drawback of placing test code within

[il-antlr-interest: 27293] Re: [antlr-interest] simple lexical analysis question

2009-12-16 Thread John B. Brodie
Moins : '-' ( ('FIN-')='FIN-' { $type = FIN; } )?; On Wed, 2009-12-16 at 11:39 +0100, Jean-Claude Durand wrote: Thanks for your answers, I now understand the stategy of lexers. The left factoring you propose does not work better: because of the 'F' letter of the identifier following the

[il-antlr-interest: 27299] Re: [antlr-interest] Réf . : Re: Maven problems with ANTLR 3.2

2009-12-16 Thread Jim Idle
Cool - thanks for that Loïc - I will update the build with this once I have read the article. Jim From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of loic.lefe...@bnpparibas.com Sent: Wednesday, December 16, 2009 5:40 AM To: wclod...@los-alamos.net

[il-antlr-interest: 27302] [antlr-interest] Réf. : Re: Pass parameters to DFAs for semantic predicate (or Ant LR 3.3 wish list? :o) )

2009-12-16 Thread loic . lefevre
Yes SWIFT parsing by hand is very easy (at least I've almost finished it in 30 minutes). But here come my problems with ambiguities to treat. For example, we can have a tag named 53B; its format is [/1!a][/34x]#[35x] which means: - optionally (absolutely 1 upper case letter preceded by a /) -

[il-antlr-interest: 27305] Re: [antlr-interest] Bug (difference) in ANTLR 3.2 tree matching.

2009-12-16 Thread Michael Matera
Hi Jim, I am not constructing tree nodes myself. The test case I provided contains a complete grammar that shows the problem. I'll reattach it to this message. Also here's the relevant parts of my grammar: Lexer/Parser: tokens { BLOCK; } file : trycatch+ EOF ; trycatch : 'try'

[il-antlr-interest: 27307] Re: [antlr-interest] MismatchedTokenException

2009-12-16 Thread Jim Idle
I think that the problem is you are trying to use the gated predicate to continue consuming. Instead just use action code and then the gated predicate will just select the rule. Here is a working example: grammar T; aaa : rule+ EOF ; rule : classtok | ident ; classtok : CLASS;

[il-antlr-interest: 27308] Re: [antlr-interest] Bug (difference) in ANTLR 3.2 tree matching.

2009-12-16 Thread Terence Parr
Thanks Michael. added bug report with all info you sent. http://www.antlr.org/jira/browse/ANTLR-418 Ter 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

[il-antlr-interest: 27309] [antlr-interest] Abandoning continuous build system

2009-12-16 Thread Jim Idle
After days of headaches I have come to the conclusion that running bunches of war apps on tomcat servers just isn't worth the hassle - in fact I am not sure that they really work without someone to reboot the thing every day. Hudson just runs out of memory, the plugins hang and it brings the

[il-antlr-interest: 27310] Re: [antlr-interest] MismatchedTokenException

2009-12-16 Thread David-Sarah Hopwood
Marcin Rzeźnicki wrote: 2009/12/14 Marcin Rzeźnicki marcin.rzezni...@gmail.com: 2009/12/13 Jim Idle j...@temporal-wave.com: This usually means that your lexer token numbers are out of sync with your parser tokens. Regen in correct order and make sure all tokens have been declared. Umm, what

[il-antlr-interest: 27311] Re: [antlr-interest] Réf . : Re: Maven problems with ANTLR 3.2

2009-12-16 Thread William B. Clodius
Loïc: Thanks for the suggestion. It did fix the immediate problem, and, after being reminded by subsequent failure that I need to sudo to override the default Mac protections in /usr/local, I was able to get the process to run to completion. As a minor point, with my aging eyes I had trouble

[il-antlr-interest: 27312] Re: [antlr-interest] Fwd: Reporting a bug in C Target

2009-12-16 Thread Gokulakannan Somasundaram
The include dependency should be protected because they are all #ifdef’ed, but perhaps I broke something in this incarnation. The basic problem is when a file includes B.h in the A-B-C chain. In the middle of it B.h includes A.h. When A.h again tried to include B.h, #ifdef has protected it. But

[il-antlr-interest: 27314] Re: [antlr-interest] Fwd: Reporting a bug in C Target

2009-12-16 Thread Jim Idle
Yes. I think that the include series has got out of sync with recent changes. I appreciate the constructive feedback more than you know - it seems to be rare lately :) Jim On Dec 16, 2009, at 20:57, Gokulakannan Somasundaram gokul...@gmail.com wrote: The include dependency should be

[il-antlr-interest: 27315] Re: [antlr-interest] action for import

2009-12-16 Thread William B. Clodius
There are a large number of ways to implement what you want and the devil is in the details. I will assume that you will be dealing with a file system similar to that on Window's/Linux/Mac and not an embedded system, or an old style mainframe with an unusual file system. Your implementation