|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
at.dms.compiler.tools.antlr.extra.InputBuffer
public class InputBuffer
Handles the input of compiler source code to the scanner.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
InputBuffer(File file,
String encoding)
Constructs a new input buffer that uses the specified character encoding, or the default character encoding if the specified encoding is null. |
|
InputBuffer(String name,
File file,
String encoding)
Constructs a new input buffer that uses the specified character encoding, or the default character encoding if the specified encoding is null. |
Method Summary | |
---|---|
void |
close()
Closes the input buffer. |
InputBufferState |
getBufferState(Scanner scanner)
Exports the buffer state. |
String |
getFile()
Returns the name of the file being read. |
int |
getLine()
Returns the current line number in the source code. |
void |
incrementLine()
Sets the current line number in the source code. |
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array. |
void |
setFile(String file)
Sets the name of the file being read. |
void |
setLine(int line)
Sets the current line number in the source code. |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputBuffer(String name, File file, String encoding) throws IOException
name
- the name of the filefile
- the file to readencoding
- the name of a supported character encoding
IOException
- an I/O exception occurredpublic InputBuffer(File file, String encoding) throws IOException
file
- the file to readencoding
- the name of a supported character encoding
IOException
- an I/O exception occurredMethod Detail |
---|
public void close() throws IOException
close
in interface Closeable
close
in class Reader
IOException
public int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
cbuf
- destination bufferoff
- offset at which to start storing characterslen
- maximum number of characters to read
IOException
- - If an I/O error occurspublic void setFile(String file)
public String getFile()
public final int getLine()
public final void setLine(int line)
public final void incrementLine()
public InputBufferState getBufferState(Scanner scanner)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |