Ken Williams wrote:
> 
> 
> On 6/4/10 2:53 PM, "Jim Idle" <[email protected]> wrote:
> 
>> You need to use a collection that gives out the entries in the order they 
>> were
>> added:
>>
>> http://java.sun.com/docs/books/tutorial/collections/interfaces/queue.html
> 
> I don't think that's the issue here, there's only ever 1 element in the
> queue.  It's not getting mixed up with other elements in the queue, it's
> getting mixed up with the token held by the superclass.
> 
> 

The way nextToken() is overriden, it first returns the token matched by
the rule, and subsequently any additional queued token before matching a
new token in the input stream.

Lexer.emit(x) sets x as the token matched by the rule.

That's why the token emitted with Lexer.emit(Token) is returned before
any queued token(s).



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to