[il-antlr-interest: 28563] Re: [antlr-interest] Ambiguity caused by recursion (I think)

2010-04-08 Thread John B. Brodie
Greetings! On Thu, 2010-04-08 at 20:29 -0400, Cameron Ross wrote: > Hi, > > I have a grammar that calls a rule from two different "levels". This leads > to an ambiguity being reported from the two different calls to the rule. > Oddly, the ambiguity points to the same place, so I'm not sure why

[il-antlr-interest: 28562] Re: [antlr-interest] Processing/traversing a rule -- dealing with conditionals

2010-04-08 Thread Tyler Distad
John, Yes, I'm trying to deal with the conditional aspects of my grammar, but not quite in the sense you suggest. My processor is not interpreting the grammar, it's emitting assembly code for later compilation by gcc. So, I want to process all of the expressions regardless of the truth value of t

[il-antlr-interest: 28561] Re: [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Cliff Hudson
I think you might just have to pop up one level to think about how to express this - no magic needed. The way that grammar is written, your file is composed of one or more cltexts, which themselves may be composed either of a module or any number of phrases (including none at all). It seems to me

[il-antlr-interest: 28560] [antlr-interest] Ambiguity caused by recursion (I think)

2010-04-08 Thread Cameron Ross
Hi, I have a grammar that calls a rule from two different "levels". This leads to an ambiguity being reported from the two different calls to the rule. Oddly, the ambiguity points to the same place, so I'm not sure why its "ambiguous". The pertinent parts of the grammar are shown below and I've

[il-antlr-interest: %d] Re: [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Cameron Ross
I guess I'm not clear on why ANTLR is seeing OPEN and EOF as an ambiguity. On Thu, Apr 8, 2010 at 4:07 PM, Jim Idle wrote: > Your text rule can be empty, you need to rejig your use of + and * or you > end up with the empty match in more than one place. > > > > Jim > > > > From: Cameron Ross [ma

[il-antlr-interest: %d] Re: [antlr-interest] antlr-3.2 grammar

2010-04-08 Thread Jim Idle
The current ANTLR 3.2 uses StringTemplate for code generation and whether the ANTLR parser is written in v2 or v3 affects neither code generation nor the writing of a language target runtime. We are writing ANTLR v4 and this is written in v3. V4 is intended to be backward compatible grammaticall

[il-antlr-interest: %d] [antlr-interest] antlr-3.2 grammar

2010-04-08 Thread Alan Condit
I am interested in working with Ian Mitchell on the Objective-C target. From what I have been reading it seems like one of the current hang-ups to effective code generation is that antlr-3.2 is still written using v2 and lack of a string-template grammar for antlr-3.2. One, is this correct? Two

[il-antlr-interest: %d] Re: [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Cameron Ross
Yes, this is the way I have it implemented in my production version. However, I have to conform to a language specification which allows text to have zero or more phrases. Is there some ANLTR magic that I can use to support this? On Thu, Apr 8, 2010 at 4:07 PM, Jim Idle wrote: > Your text rul

[il-antlr-interest: %d] Re: [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Jim Idle
Your text rule can be empty, you need to rejig your use of + and * or you end up with the empty match in more than one place. Jim From: Cameron Ross [mailto:cr...@kojeware.com] Sent: Thursday, April 08, 2010 1:05 PM To: Jim Idle Subject: Re: [antlr-interest] OPEN, EOF ambiguity These

[il-antlr-interest: %d] Re: [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Cameron Ross
These rules show the top level of the grammar... start_rule : clif_file EOF ; clif_file : cltext+ ; cltext : (OPEN CL_MODULE) => module -> ^(CLTEXT module) | text -> ^(CLTEXT text) ; module : OPEN CL_MODULE interpretablename exclusion_set? cltext CLOSE -> ^(MODULE ^(MODULE_IDENTIFIER interpretab

[il-antlr-interest: 28554] Re: [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Jim Idle
You probably need to send the grammar rather than that graphic. It is likely something more fundamental and we cannot see what you predicates are doing from the graphic. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Beh

[il-antlr-interest: 28553] [antlr-interest] OPEN, EOF ambiguity

2010-04-08 Thread Cameron Ross
Hi, I have a grammar with an ambiguity that I just can't resolve. When I check the grammar using AntlrWorks I get the following: "Decision can match input such as "{EOF, OPEN}" using multiple alternatives: 1, 2". I've attached a screen grab of the syntax diagram generated by AntrlWorks. I don't

[il-antlr-interest: 28552] [antlr-interest] Hugo Leeney wants to stay in touch on LinkedIn

2010-04-08 Thread Hugo Leeney
LinkedIn Hugo Leeney requested to add you as a connection on LinkedIn: -- Ian, I'd like to add you to my professional network on LinkedIn. - Hugo Leeney Accept invitation from Hugo Leeney http://www.linkedin.com/e/XJ_Jh42eHeYQ_eJ2S5_J_0Ueq9jQF

[il-antlr-interest: 28551] [antlr-interest] C++ exceptions escape from libantlr3c

2010-04-08 Thread Christopher L Conway
We have had a problem with our application crashing when a parser exception is thrown. We override the default error handler as follows: /* init code... */ pFooParser fooParser = NewFooParser(tokenStream); fooParser->pParser->rec->reportError = &reportError; where reportError is defined

[il-antlr-interest: 28550] [antlr-interest] New partial methods in the C# 3 generated code

2010-04-08 Thread Sam Harwell
I've made a few changes locally in the generated code for the CSharp3 target. Partial methods are new to C# 3, and were added so generated code can add extensibility points. The partial methods and all calls to them in generated code are *completely* removed by the compiler if there is no implement

[il-antlr-interest: 28548] Re: [antlr-interest] Processing/traversing a rule -- dealing with conditionals

2010-04-08 Thread Farr, John
Tyler, It appears that you're trying to deal with the conditional aspect of your IF and WHILE statements in the tree grammar actions. I haven't found a way to do this exclusively in actions because the conditions determine which parts of the tree to "evaluate" and which parts to "skip over". T

[il-antlr-interest: 28546] Re: [antlr-interest] StringTemplate for target Language

2010-04-08 Thread Mark Wright
On Wed, Apr 07, 2010 at 12:26:27AM +, Gouasmi Thouraya wrote: > Is it obligatory to download and to install Maven2 to create the > stringTemplate of a language target? Yes. > otherwise what tool use to write the stringTemplate and how? > please help me Its necessary to download the ANTR 3.

[il-antlr-interest: 28545] [antlr-interest] Processing/traversing a rule

2010-04-08 Thread Tyler Distad
I have a tree parser which is traversing the nodes of my AST. At points within the grammar, I use action blocks to call methods on my processing object, thus keeping large amounts of action code abstracted into a separate file. This has worked fine, but now I have the "if" and "while" statements v