[antlr-interest] minor 3.0b4 bug?

Terence Parr parrt at cs.usfca.edu
Sat Oct 7 09:38:20 PDT 2006


Hi. :)  The error is valid.  Two paths can reach the RPAREN.  One is  
via the alt in the loop and the other is the exit branch.  ANTLR is  
asking: upon ')', should I re-enter loop or exit. :)

Ter
On Oct 7, 2006, at 3:35 AM, Robert Hill wrote:

>
> service	:  LParen  RParen	;
> paramList	: 	;
>
> and
>
> service	:  LParen  paramList RParen	;
> paramList	: 	;
>
> compile ok, but if you add a kleene star to the paramlist
>
> service	:  LParen paramList* RParen ;
> paramList
> 	:
> 	;
> I get the following error :
>
> ANTLR Parser Generator   Early Access Version 3.0b4 (??, 2006)   
> 1989-2006
> D:\ActiveProjects\IdeaProjects\Jtest1\src\SGenParser.g:86:12:  
> Decision can
> match input such as "RParen" using multiple alternatives: 1, 2
> As a result, alternative(s) 2 were disabled for that input
> D:\ActiveProjects\IdeaProjects\Jtest1\src\SGenParser.g:86:12: The  
> following
> alternatives are unreachable: 2
>
> Where is Alt 2?
>
> Ok, I know that having an empty rule is a bit daft, but I was half way
> through writing it, and the old habit of save/build every 10  
> seconds is
> still alive and kicking.. at least it stops me typing too much guff  
> in and
> not knowing where the errors are coming from LOL..
>
> Cheers,
> Rob
>
>
>
>



More information about the antlr-interest mailing list