public interface CharStream
Modifier and Type | Method and Description |
---|---|
void |
backup(int amount)
Backs up the input stream by amount steps.
|
char |
beginToken() |
void |
done()
The lexer calls this function to indicate that it is done with the stream
and hence implementations can free any resources held by this class.
|
int |
getBeginColumn() |
int |
getBeginLine() |
int |
getEndColumn() |
int |
getEndLine() |
String |
getImage() |
char[] |
getSuffix(int len) |
int |
getTabSize() |
boolean |
isTrackLineColumn() |
char |
readChar()
Get the next character from the selected input.
|
void |
setTabSize(int i)
Set the tab size to use.
|
void |
setTrackLineColumn(boolean trackLineColumn)
Enable or disable line number and column number tracking.
|
char readChar() throws IOException
IOException
- on IO errorint getBeginColumn()
int getBeginLine()
int getEndColumn()
int getEndLine()
void backup(int amount)
amount
- Number of chars to back up.char beginToken() throws IOException
IOException
String getImage()
char[] getSuffix(int len)
{ String t = getImage(); return t.substring(t.length() - len, t.length()).toCharArray(); }
void done()
int getTabSize()
void setTabSize(int i)
i
- spaces per tabboolean isTrackLineColumn()
true
if line number and column numbers should be tracked.void setTrackLineColumn(boolean trackLineColumn)
trackLineColumn
- true
to track it, false
to not do it.Copyright © 2007–2023. All rights reserved.