fr.umlv.tatoo.runtime.lexer
Class Scanner<R,B extends LexerBuffer>
java.lang.Object
fr.umlv.tatoo.runtime.lexer.Tokenizer<R,B>
fr.umlv.tatoo.runtime.lexer.Scanner<R,B>
- Type Parameters:
R
- type of rules.B
- type of buffer.
- All Implemented Interfaces:
- Iterable<R>, Iterator<R>
public class Scanner<R,B extends LexerBuffer>
- extends Tokenizer<R,B>
- implements Iterator<R>, Iterable<R>
Provide a simple scanner that implements Iterator
and Iterable
The buffer must support the read
operation.
If you don't have an activator
because
you don't use the parser
provided by Tatoo, you can use a Tokenizer
instead.
- Author:
- Remi Forax
- See Also:
Tokenizer
Methods inherited from class fr.umlv.tatoo.runtime.lexer.Tokenizer |
createTokenizer, createTokenizer, eof, getBuffer, getLexerTable, getNext, hasNext, hasNext, next, next, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<R>
next
public R next()
- Specified by:
next
in interface Iterator<R>
iterator
public Iterator<R> iterator()
-
This implementation always returns
this
.
- Specified by:
iterator
in interface Iterable<R>
remove
public void remove()
- Specified by:
remove
in interface Iterator<R>
createScanner
public static <R,B extends LexerBuffer> Scanner<R,B> createScanner(LexerTable<R> lexerTable,
B buffer,
RuleActivator<? extends R> activator)