org.codehaus.groovy.syntax.lexer
Interface CharStream

All Known Implementing Classes:
AbstractCharStream, FileCharStream

public interface CharStream

Conduit of characters to a lexer.

Version:
$Id: CharStream.java,v 1.3 2003/10/05 23:49:18 bob Exp $
Author:
bob mcwhirter
See Also:
Lexer, AbstractCharStream

Field Summary
static char EOS
          End-of-stream value.
 
Method Summary
 void close()
           
 char consume()
          Consume the next character.
 String getDescription()
           
 char la()
          Look-ahead to the next character.
 char la(int k)
          Look-ahead to the kth character.
 

Field Detail

EOS

public static final char EOS
End-of-stream value.

See Also:
Constant Field Values
Method Detail

getDescription

public String getDescription()

la

public char la()
        throws IOException
Look-ahead to the next character.

This method is equivalent to la(1).

Returns:
The next character or -1 if no more characters available.
Throws:
IOException - If an error occurs attempting to lookahead a character.
See Also:
la(int)

la

public char la(int k)
        throws IOException
Look-ahead to the kth character.

Parameters:
k - Number of characters to look ahead.
Returns:
the kth 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
Consume the next character.

Returns:
The consumed character or -1 if no more characters available.
Throws:
IOException - If an error occurs attempting to consume a character.

close

public void close()
           throws IOException
IOException


Copyright © 2003 The Codehaus. All Rights Reserved.