[antlr-interest] Skipping anything not parseable
mail at martin-probst.com
Tue Mar 22 05:19:02 PST 2005
what about making a rule for "unrecognized paragraphs"? You could write
something like this:
> para: knownPara | unknownPara;
> knownPara: (( KEYWORD1 ... ) | ( KEYWORD2 ... ) | ... ) LINEBREAK;
> unknownPara: (WORDS)* LINEBREAK;
By writing "unknownPara!:" you can also suppress automatic AST
generation for that rule so you won't see these paragraphs in the AST.
Am Dienstag, den 22.03.2005, 03:18 -0800 schrieb togol machillan:
> No, not important because I am selecting paragraphs of interest by defining keywords which occur as the first word on the line. So any paragraph which starts with a keyword not in the defined keyword list, should be skipped over. How can parser skip over unknown paragraphs without saying that its expecting the EOF token.
> ----- Original Message -----
> From: "Michiel Vermandel" <MVerma at ferranti.be>
> To: "togol machillan" <togolmach2 at lycos.com>, antlr-interest at antlr.org
> Subject: RE: [antlr-interest] Skipping anything not parseable
> Date: Tue, 22 Mar 2005 11:52:34 +0100
> > I guess you still want to know about these occurrences, right?
> > -----Original Message-----
> > From: antlr-interest-bounces at antlr.org
> > [mailto:antlr-interest-bounces at antlr.org] On Behalf Of togol machillan
> > Sent: dinsdag 22 maart 2005 11:50
> > To: antlr-interest at antlr.org
> > Subject: [antlr-interest] Skipping anything not parseable
> > Hi,
> > Is there any way to skip token on input for which no rule has been
> > defined in the parser? When the parser sees some structure which it does
> > not recognize, it stops saying that it was expecting something else. I
> > want the parser to continue and just skip over structures or tokens it
> > cannot handle.
> > Regards,
> > Awais
> > --
> > _______________________________________________
> > NEW! Lycos Dating Search. The only place to search multiple dating sites
> > at once.
> > http://datingsearch.lycos.com
More information about the antlr-interest