[antlr-interest] Ignore "Mismatched input" and "No viable alternative"

Nilo Roberto C Paim nilopaim at gmail.com
Thu Jun 30 13:33:39 PDT 2011


Hi all,

I'm trying to parse a text file created by an application. There are lines
in this text file that I know perfectly their contents and format, and these
lines are correctly parsed.

Otherwise, there are lines that can be recognized by any syntax I can think
about. 

When I parse the file with my syntax, I'm getting several occurrences of
"Mismatched input" and "No viable alternative" on the lines that I can't
recognize.

What I want is simply throw away these invalid lines, as if them would be
absent from the text file. For my purposes, these lines are "invisibles".

How can I do that, ignoring the lexer/parser errors?

TIA

Nilo - Brasil



More information about the antlr-interest mailing list