[antlr-interest] Non-disjoint tokens

Steve Bennett stevagewp at gmail.com
Sun Nov 25 04:52:29 PST 2007


On 11/25/07, Harald Mueller <harald_m_mueller at gmx.de> wrote:
> What does help are semantic predicates (essentially, "arbitrary conditions"):
<snip>

> (and I'm not sure what happends at the end of the input with the above condition: say the end of the file is ...<HT> - would the access to input.LA(6) crash? - I think not, but I did not try it...).

Just tried this: it works magnificently. It correctly parsed the following text:
<HTML> HTML <HTML FOO <HTMFOO <HT <HTM

(and no, it didn't crash at the end :))

Thank you very much for this solution, I can now keep making progress.

Steve


More information about the antlr-interest mailing list