public class Scanner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
blankCharacters
The characters to skip to create the string which represents the
current token.
|
protected char[] |
buffer
The recording buffer.
|
protected int |
current
The current char.
|
protected int |
end
The end offset of the last lexical unit.
|
protected int |
position
The current position in the buffer.
|
protected NormalizingReader |
reader
The reader.
|
protected int |
start
The start offset of the last lexical unit.
|
protected int |
type
The type of the current lexical unit.
|
Constructor and Description |
---|
Scanner(java.io.InputStream is,
java.lang.String enc)
Creates a new Scanner object.
|
Scanner(java.io.Reader r)
Creates a new Scanner object.
|
Scanner(java.lang.String s)
Creates a new Scanner object.
|
Modifier and Type | Method and Description |
---|---|
void |
clearBuffer()
Clears the buffer.
|
void |
close()
Closes the underlying stream used by the scanner.
|
protected int |
dotNumber()
Scans the decimal part of a number.
|
protected int |
endGap()
Returns the end gap of the current lexical unit.
|
protected void |
escape()
Scans an escape sequence, if one.
|
char[] |
getBuffer()
Returns the buffer used to store the chars.
|
int |
getColumn()
Returns the current column.
|
int |
getEnd()
Returns the end offset of the last lexical unit.
|
int |
getLine()
Returns the current line.
|
int |
getStart()
Returns the start offset of the last lexical unit.
|
java.lang.String |
getStringValue()
Returns the string representation of the current lexical unit.
|
int |
getType()
The current lexical unit type like defined in LexicalUnits.
|
protected static boolean |
isEqualIgnoreCase(int i,
char c)
Compares the given int with the given character, ignoring case.
|
int |
next()
Returns the next token.
|
protected int |
nextChar()
Sets the value of the current char to the next character or -1 if the
end of stream has been reached.
|
protected void |
nextToken()
Returns the next token.
|
protected int |
number()
Scans a number.
|
protected int |
numberUnit(boolean integer)
Scans the unit of a number.
|
void |
scanAtRule()
Scans a @rule value.
|
protected int |
string1()
Scans a single quoted string.
|
protected int |
string2()
Scans a double quoted string.
|
protected NormalizingReader reader
protected int current
protected char[] buffer
protected int position
protected int type
protected int start
protected int end
protected int blankCharacters
public Scanner(java.io.Reader r) throws ParseException
r
- The reader to scan.ParseException
public Scanner(java.io.InputStream is, java.lang.String enc) throws ParseException
is
- The input stream to scan.enc
- The encoding to use to decode the input stream, or null.ParseException
public Scanner(java.lang.String s) throws ParseException
s
- The string to scan.ParseException
public int getLine()
public int getColumn()
public char[] getBuffer()
public int getStart()
public int getEnd()
public void clearBuffer()
public int getType()
public java.lang.String getStringValue()
public void scanAtRule() throws ParseException
ParseException
public int next() throws ParseException
ParseException
public void close()
protected int endGap()
protected void nextToken() throws ParseException
ParseException
protected int string1() throws java.io.IOException
java.io.IOException
protected int string2() throws java.io.IOException
java.io.IOException
protected int number() throws java.io.IOException
java.io.IOException
protected int dotNumber() throws java.io.IOException
java.io.IOException
protected int numberUnit(boolean integer) throws java.io.IOException
java.io.IOException
protected void escape() throws java.io.IOException
java.io.IOException
protected static boolean isEqualIgnoreCase(int i, char c)
protected int nextChar() throws java.io.IOException
java.io.IOException
Copyright © 2022 Apache Software Foundation. All Rights Reserved.