public final class CssCharStream extends Object implements org.htmlunit.cssparser.parser.javacc.CharStream
| Modifier and Type | Field and Description |
|---|---|
int |
bufpos
Position in buffer.
|
static boolean |
staticFlag
Whether parser is static.
|
| Constructor and Description |
|---|
CssCharStream(Reader dstream,
int startline,
int startcolumn)
Constructor.
|
CssCharStream(Reader dstream,
int startline,
int startcolumn,
int buffersize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustBeginLineColumn(int newLine,
int newCol)
Method to adjust line and column numbers for the start of a token.
|
void |
backup(int amount)
Backs up the input stream by amount steps.
|
char |
beginToken()
Start.
|
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()
Get token beginning column number.
|
int |
getBeginLine()
Get token beginning line number.
|
int |
getEndColumn()
Get token end column number.
|
int |
getEndLine()
Get token end line number.
|
String |
getImage()
Get token literal value.
|
char[] |
getSuffix(int len)
Get the suffix.
|
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 tlc)
Enable or disable line number and column number tracking.
|
public static final boolean staticFlag
public int bufpos
public CssCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
dstream - the stream to read fromstartline - startlinestartcolumn - startcolumnbuffersize - buffersizepublic CssCharStream(Reader dstream, int startline, int startcolumn)
dstream - the stream to read fromstartline - startlinestartcolumn - startcolumnpublic final char beginToken()
throws IOException
beginToken in interface org.htmlunit.cssparser.parser.javacc.CharStreamIOExceptionpublic final char readChar()
throws IOException
readChar in interface org.htmlunit.cssparser.parser.javacc.CharStreamIOException - on IO errorpublic final int getEndColumn()
getEndColumn in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic final int getEndLine()
getEndLine in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic final int getBeginColumn()
getBeginColumn in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic final int getBeginLine()
getBeginLine in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic final void backup(int amount)
backup in interface org.htmlunit.cssparser.parser.javacc.CharStreamamount - Number of chars to back up.public final String getImage()
getImage in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic final char[] getSuffix(int len)
getSuffix in interface org.htmlunit.cssparser.parser.javacc.CharStream
{
String t = getImage();
return t.substring(t.length() - len, t.length()).toCharArray();
}
public void done()
done in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic void adjustBeginLineColumn(int newLine,
int newCol)
newLine - the new linenewCol - the new columnpublic void setTabSize(int i)
setTabSize in interface org.htmlunit.cssparser.parser.javacc.CharStreami - spaces per tabpublic int getTabSize()
getTabSize in interface org.htmlunit.cssparser.parser.javacc.CharStreampublic boolean isTrackLineColumn()
isTrackLineColumn in interface org.htmlunit.cssparser.parser.javacc.CharStreamtrue if line number and column numbers should be tracked.public void setTrackLineColumn(boolean tlc)
setTrackLineColumn in interface org.htmlunit.cssparser.parser.javacc.CharStreamtlc - true to track it, false to not do it.Copyright © 2025 HtmlUnit. All rights reserved.