[il-antlr-interest: 24427] Re: [antlr-interest] Check for end of token stream when parser finishes.
OF token to match the whole input > test: exp EOF; > -shibin > > > On Tue, Jun 30, 2009 at 5:29 AM, Gyanit Singh wrote: > >> Hi all, >> >> I have a simple grammar >> -- >> grammar test; >> test : exp; >> exp: ONE (
[il-antlr-interest: 24425] [antlr-interest] Check for end of token stream when parser finishes.
Hi all, I have a simple grammar -- grammar test; test : exp; exp: ONE ('+' ONE)* ; ONE: '1'; --- if you try to parse "1+11" the parser matches test and expr to "1+1" and ignores the last "1". Is there a way to throw an exception when this happen