[antlr-interest] Accessing lexer characters programmatically?
Jim Idle
jimi at temporal-wave.com
Mon Apr 28 09:23:30 PDT 2008
You could, I think, use a pre-initialized bitmap for all the code points (or some other structure), then knock out the used ones. This will tell you which characters were and which were not encountered.
Jim
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Susan Jolly
> Sent: Monday, April 28, 2008 7:27 AM
> To: Gavin Lambert; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Accessing lexer characters
> programmatically?
>
> Thanks Gavin.
>
> Yes, you are correct from a practical point of view and I appreciate
> your
> clear understanding the situation. I'd thought of doing it the way you
> suggested since, even though it is a bit inelegant, ANTLR scanning is
> so
> fast it probably doesn't matter.
>
> However, as you pointed out, "if you need to report mismatches for
> characters not actually in the input stream then it won't be
> sufficient."
>
> The standard use case is that the user would supply the same table when
> processing a set of documents over time, possibly in a batch mode. It
> could
> be that the table would be adequate for some documents and not for
> others.
> So it would be nice if I could certify to the user that the table is
> adequate in general. (And, of course, I'd like to be able to do this
> for
> the table I use for testing.)
>
>
More information about the antlr-interest
mailing list