org.eclipse.xtext.parser.antlr
Class TokenAcceptor

java.lang.Object
  extended by org.eclipse.xtext.parser.antlr.TokenAcceptor
All Implemented Interfaces:
java.util.Iterator<org.antlr.runtime.Token>, ITokenAcceptor

public class TokenAcceptor
extends java.lang.Object
implements ITokenAcceptor, java.util.Iterator<org.antlr.runtime.Token>

Simple implementation of an ITokenAcceptor based on the assumption that the calls to accept and next will be alternating with only a few exceptions.

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
TokenAcceptor()
           
 
Method Summary
 void accept(org.antlr.runtime.Token token)
           
 boolean hasNext()
           
 org.antlr.runtime.Token next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenAcceptor

public TokenAcceptor()
Method Detail

accept

public void accept(org.antlr.runtime.Token token)
Specified by:
accept in interface ITokenAcceptor

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<org.antlr.runtime.Token>

next

public org.antlr.runtime.Token next()
Specified by:
next in interface java.util.Iterator<org.antlr.runtime.Token>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<org.antlr.runtime.Token>