edu.umd.cs.findbugs
Class Tokenizer
java.lang.Object
edu.umd.cs.findbugs.Tokenizer
public class Tokenizer
- extends java.lang.Object
A simple tokenizer for Java source text.
This is not intended to be a compliant lexer;
instead, it is for quick and dirty scanning.
- Author:
- David Hovemeyer
- See Also:
Token
Field Summary |
private java.io.PushbackReader |
reader
|
private static java.util.BitSet |
single
|
private static java.util.BitSet |
whiteSpace
|
Constructor Summary |
Tokenizer(java.io.Reader reader)
Constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
whiteSpace
private static final java.util.BitSet whiteSpace
single
private static final java.util.BitSet single
reader
private java.io.PushbackReader reader
Tokenizer
public Tokenizer(java.io.Reader reader)
- Constructor.
- Parameters:
reader
- the Reader for the Java source text
next
public Token next()
throws java.io.IOException
- Get the next Token in the stream.
- Returns:
- the Token
- Throws:
java.io.IOException
skipWhitespace
private void skipWhitespace()
throws java.io.IOException
- Throws:
java.io.IOException
munchString
private Token munchString(int delimiter)
throws java.io.IOException
- Throws:
java.io.IOException
maybeComment
private Token maybeComment()
throws java.io.IOException
- Throws:
java.io.IOException
parseWord
private Token parseWord()
throws java.io.IOException
- Throws:
java.io.IOException