[antlr-interest] A rule ANTLR 3 doesn't like [Re: ANTLR 3 diagnostics]

Terence Parr parrt at cs.usfca.edu
Fri Dec 28 10:30:45 PST 2007


Hi Chap, can you pass me the latest version of your grammar?  I should  
look at it.
Ter
On Dec 28, 2007, at 10:20 AM, J Chapman Flack wrote:

>
> J Chapman Flack wrote:
>> That sounds more promising, though I seem to recall trying it  
>> yesterday
>> and still blowing the stack. I'll try with the newer build.
>
> A new grammar containing only this rule in isolation compiles
> without error (and generates believable code). In the original
> grammar, the stack still overflows in the DFA builder while
> working on this rule.  I suppose I can start copying other
> rules over from the original until it blows up again; something
> involving callers of the rule, I suppose.
>
> Is there any other technique (after adding -Xwatchconversion)
> that might shed some more light?  I'll try -Xdbgconversion
> and see what I can make sense of.
>
> What does -Xm do?  Might the converter invoke rules repeatedly?
> (Ok, I'll order the book, it probably has more of that information
> than I'm finding on the wiki).  Could that pose a problem for
> rules where choices depend on parameters and sempreds?
>
> -Chap
>
>> numeric_aggregate[int n, int tt]
>>                 @init {
>>                   boolean limit = ( 0 != n );
>>                 }
>>                 : NUMBER
>>                   ( options { greedy = true; } :
>>                     { (!limit || (--n > 0)) && LA(1) == tt }?  
>> ~( SEMI )
>>                     NUMBER
>>                   )*
>>                   { !limit || 0 == n }?
>>                 ;
>



More information about the antlr-interest mailing list