public final class CSSCharStream extends Object implements CharStream
CharStream, where the stream is
assumed to contain only ASCII characters (with java-like unicode escape
processing).| Constructor and Description |
|---|
CSSCharStream(Reader aReader) |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustBeginLineColumn(int nNewLine,
int newCol)
Method to adjust line and column numbers for the start of a token.
|
void |
backup(int nAmount)
Retreat.
|
char |
BeginToken()
Returns the next character that marks the beginning of the next token.
|
void |
Done()
Set buffers back to null when finished.
|
int |
getBeginColumn()
Returns the column number of the first character for current token (being
matched after the last call to BeginTOken).
|
int |
getBeginLine()
Returns the line number of the first character for current token (being
matched after the last call to BeginTOken).
|
int |
getEndColumn()
Returns the column number of the last character for current token (being
matched after the last call to BeginTOken).
|
int |
getEndLine()
Returns the line number of the last character for current token (being
matched after the last call to BeginTOken).
|
String |
GetImage()
Returns a string made up of characters from the marked token beginning
to the current buffer position.
|
char[] |
GetSuffix(int len)
Returns an array of characters that make up the suffix of length 'len' for
the currently matched token.
|
int |
getTabSize() |
boolean |
getTrackLineColumn() |
char |
readChar()
Read a character.
|
void |
setTabSize(int i)
Set the tab size to use.
|
void |
setTrackLineColumn(boolean tlc)
Enable or disable line number and column number tracking.
|
public void setTabSize(int i)
CharStreamsetTabSize in interface CharStreami - spaces per tabpublic int getTabSize()
getTabSize in interface CharStreampublic char BeginToken()
throws IOException
CharStreamBeginToken in interface CharStreamIOException - from readCharpublic char readChar()
throws IOException
readChar in interface CharStreamIOException - if an I/O error occurspublic int getEndColumn()
CharStreamgetEndColumn in interface CharStreampublic int getEndLine()
CharStreamgetEndLine in interface CharStreampublic int getBeginColumn()
CharStreamgetBeginColumn in interface CharStreampublic int getBeginLine()
CharStreamgetBeginLine in interface CharStreampublic void backup(int nAmount)
backup in interface CharStreampublic String GetImage()
CharStreamGetImage in interface CharStreampublic char[] GetSuffix(int len)
CharStreamGetSuffix in interface CharStreampublic void Done()
Done in interface CharStreampublic void adjustBeginLineColumn(int nNewLine,
int newCol)
nNewLine - line indexnewCol - column indexpublic boolean getTrackLineColumn()
getTrackLineColumn in interface CharStreamtrue if line number and column numbers should be tracked.public void setTrackLineColumn(boolean tlc)
CharStreamsetTrackLineColumn in interface CharStreamtlc - true to track it, false to not do it.Copyright © 2014–2018 Philip Helger. All rights reserved.