[antlr-interest] Accessing HIDDEN tokens in the C target.

Robin Green rgreen at google.com
Thu Aug 28 17:39:47 PDT 2008


On Thu, Aug 28, 2008 at 5:07 PM, Jim Idle <jimi at temporal-wave.com> wrote:

> Yes but get returns a pointer to a TOKEN, which has a super pointer to the
> common token (off the top of my head), if it is returning a
> pANTLR3_COMMON_TOKEN already (it might be) then you don't need the super.
>
>
get() in antlr3tokenstream.c returns a pANTLR3_COMMON_TOKEN.

My problem is that I'm walking through this stream and I never see a token
that's not "channel=0". My iinput source has plenty of inline comments and
whitespace, so I'm starting to suspect that I'm calling the wrong "get()"
here.

#define    INPUT PARSER->tstream
#define ISTREAM INPUT->istream

Since I use "ANTLR3_INT32 max_size = INPUT->istream->cachedSize;" to get the
number of tokens in the stream, should I be using ISTREAM or INPUT in
my for my get() call?
What's the difference?

- Robin Green
  Googoe, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080828/7e928113/attachment.html 


More information about the antlr-interest mailing list