Posted 20 years ago
by Greg Shaffer
- Boulder
Hi,
I use a TokenStream in my PostParse function of my semantic parser. I'm doing a forward parse by calling TokenStream.Read().
In certain situations, I call TokenStream.PeekReverse() and TokenStream.ReadReverse(). I expect those two functions to return the previous token, but instead they return the current token.
What is interesting is that the TokenStream's position changes, but the token that is returned is not what I expect. In order to get the previous token via TokenStream, I need to call ReadReverse twice.
Is this how it is supposed to work, or is this a bug?
Thanks,
Greg
I use a TokenStream in my PostParse function of my semantic parser. I'm doing a forward parse by calling TokenStream.Read().
In certain situations, I call TokenStream.PeekReverse() and TokenStream.ReadReverse(). I expect those two functions to return the previous token, but instead they return the current token.
What is interesting is that the TokenStream's position changes, but the token that is returned is not what I expect. In order to get the previous token via TokenStream, I need to call ReadReverse twice.
Is this how it is supposed to work, or is this a bug?
Thanks,
Greg