[antlr-interest] help requested for selective whitespace

Scott Amort jsamort at sympatico.ca
Tue Jan 31 18:54:09 PST 2006


On Sun, 2006-01-29 at 20:44 -0500, Scott Amort wrote:
> So, what I am hoping is that there is a method to
> selectively test for whitespace in certain cases, while ignoring all
> other instances.

Hi Again,

I read a recent post concerning 'Syntactic predicates' with some
interest, as it appears to be another way of looking at my problem.  The
author seemed to be wanting all whitespace separated values to be fully
evaluated as a token, not smaller segments (i.e. A of A12345 would match
as a token, instead of the entire unit being considered invalid).  This
is very similar to my wanting something like:

a b c

to be valid, but not:

abc

Anyways, I am still searching for a good means of only selectively
including whitespace.  I have read the field guide and its entry on
whitespace (http://www.antlr.org/article/whitespace/), and seem to
recall coming across a similar page that described the use of a hidden
token stream, but one that actually used the keyword 'hidden' as a token
in the parser, instead of requiring tree walker as in the example.  Does
this sound at all familiar to anyone?  I can't for the life of me find
that page again.

Thanks from a beginner just trying to figure things out!

Best,
Scott



More information about the antlr-interest mailing list