org.codehaus.groovy.syntax.lexer
Class AbstractCharStream
java.lang.Object
|
+--org.codehaus.groovy.syntax.lexer.AbstractCharStream
- All Implemented Interfaces:
- CharStream
- Direct Known Subclasses:
- InputStreamCharStream, ReaderCharStream, StringCharStream
- public abstract class AbstractCharStream
- extends Object
- implements CharStream
Fields inherited from interface org.codehaus.groovy.syntax.lexer.CharStream |
EOS |
Method Summary |
char |
consume()
Consume the next character. |
String |
getDescription()
|
char |
la()
Look-ahead to the next character. |
char |
la(int k)
Look-ahead to the k th character. |
protected abstract char |
nextChar()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.codehaus.groovy.syntax.lexer.CharStream |
close |
AbstractCharStream
public AbstractCharStream()
AbstractCharStream
public AbstractCharStream(String description)
getDescription
public String getDescription()
- Specified by:
getDescription
in interface CharStream
nextChar
protected abstract char nextChar()
throws IOException
IOException
la
public char la()
throws IOException
- Description copied from interface:
CharStream
- Look-ahead to the next character.
This method is equivalent to la(1)
.
- Specified by:
la
in interface CharStream
- Returns:
- The next character or -1 if no more characters
available.
- Throws:
IOException
- If an error occurs attempting to lookahead
a character.- See Also:
CharStream.la(int)
la
public char la(int k)
throws IOException
- Description copied from interface:
CharStream
- Look-ahead to the
k
th character.
- Specified by:
la
in interface CharStream
- Parameters:
k
- Number of characters to look ahead.
- Returns:
- the
k
th character or -1 if no
more characters available.
- Throws:
IOException
- If an error occurs attempting to lookahead
a character.
consume
public char consume()
throws IOException
- Description copied from interface:
CharStream
- Consume the next character.
- Specified by:
consume
in interface CharStream
- Returns:
- The consumed character or -1 if no more characters
available.
- Throws:
IOException
- If an error occurs attempting to consume
a character.
Copyright © 2003 The Codehaus. All Rights Reserved.