[antlr-interest] Regression? antlr-03-30-2007.14 -> antlr-04-10-2007.18

Terence Parr parrt at cs.usfca.edu
Tue Apr 17 17:06:06 PDT 2007


Ok, i changed my mind.  works for acyclic DFA lookahead:

             if ( ((LA41_0>=VAR && LA41_0<=CONST)) && (synpred3())) {
                 switch ( input.LA(2) ) {
                 case IDENT:
                     int LA41_36 = input.LA(3);

                     if ( (synpred3()) ) {
                         alt41=1;
                     }
                     else if ( (true) ) {
                         alt41=2;
                     }
                     else error;
                     break;
			...

The code does not advance the lookahead through the DFA simulation.   
Cyclic DFA will.  Checking now...

ok, can't push a build as I'm not done with AST rewrite stuff; almost  
sent you the patch, but it got complicated.  ALmost ready for a new  
build.  Probably thursday

Ter

On Apr 17, 2007, at 3:36 PM, Terence Parr wrote:

>
> On Apr 17, 2007, at 3:25 PM, Terence Parr wrote:
>> Yeah, i had to make synpreds always evaluate but they do so now on  
>> every DFA transition...
>>
>> Ok, DFA looks correct but the synpred mechanism might not be  
>> working properly...I'll try to make some more examples.
>
> Crap.  synpreds with k>1 don't work.  synpreds need to eval from  
> start of decision not current point.  First one starts at position  
> 0 but next evaluation starts at position 1 (wrong).  Both must  
> start at 0.
>
> I'm on it.
>
> Ter



More information about the antlr-interest mailing list