At 22:43 15/01/2010, Arne Schröder wrote:
 >file    : section1 section2?
 >        ;
[...]
 >If I now try to parse "Section1 bla()) 
Section2" something similar
 >happens:
 >It parses up to the second ")" and then decides 
to skip the rest.
 >And I definitely do not want the second ")" to 
be there i.e. want
 >it to throw a recognition-error and recover itself.

Try adding EOF to the end of your top-level 
rule.  Without that, ANTLR assumes that it is not 
required to parse all the input, so if it 
successfully parses a section1 it will just 
decide that the section2 has been omitted (since it's optional).


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.


Reply via email to