org.ablaf.lexer
Interface ILexerSource

All Known Implementing Classes:
AbstractLexerSource

public interface ILexerSource

ILexerSource provides a very simple interface to a lexable source. For wxample a lexable source could be a file or a string.

Version:
$Revision: 1.3 $
Author:
jpetersen

Method Summary
 char getLastRead()
           
 int getLine()
           
 int getOffset()
          Return the count of read characters.
 java.lang.String getSourceName()
          Return the name of the source.
 char read()
          Returns the next char.
 void unread()
          Unread the last read char.
 

Method Detail

read

public char read()
Returns the next char.

Returns:
the next char.

unread

public void unread()
Unread the last read char.


getOffset

public int getOffset()
Return the count of read characters.

Returns:
the count of read characters.

getSourceName

public java.lang.String getSourceName()
Return the name of the source. For example this method can return the name of the file from which is readed.

Returns:
the name of the source.

getLastRead

public char getLastRead()
Returns:
the last char returned by read()

getLine

public int getLine()
Returns:
the current line number


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.