[antlr-interest] problem with example

Jyotish-Software jyotisha at nord-com.net
Fri Dec 28 08:41:46 PST 2007


Hallo everyone,
I am new to the list and first of all I would like to thank Terence Parr 
and Jean Bovet for their wonderfull software.
I just bought the book 'The Definitive ANTLR Reference' Version 
2007-7-29 and copied the example in chapter 3, Expr.g. It works as 
written in the text, for example with '3+@'  or '(3'  that is, the error 
  is reported is exactly as in the book. But when I enter '(3+4)*5' the 
syntax tree in the interpreter shows a NoViableAltException and the 
debugger has the right result 35 but states: Line 1:4 no viable 
alternative at input ')'. The same happens when I run the Test.java 
which I do in Eclipse. From the syntax tree I see that another multExp 
is started which find no satisfying value for the atom. How can one stop 
  the parsing at this point or what is wrong?
Kind regards
Rolf




More information about the antlr-interest mailing list