public class InputParser extends Object
Modifier and Type | Field and Description |
---|---|
String |
file
File reference.
|
String |
input
Input to be parsed.
|
int |
length
Query length.
|
int |
mark
Marked input position.
|
int |
pos
Current input position.
|
Constructor and Description |
---|
InputParser(String input)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
char |
consume()
Consumes the next character.
|
boolean |
consume(int ch)
Peeks forward and consumes the character if it equals the specified one.
|
boolean |
consume(String str)
Peeks forward and consumes the string if it equals the specified one.
|
char |
curr()
Returns the current character.
|
boolean |
curr(int ch)
Checks if the current character equals the specified one.
|
protected byte[] |
found()
Returns a "found" string, containing the current character.
|
InputInfo |
info()
Creates input information.
|
protected void |
mark()
Remembers the current position.
|
boolean |
more()
Checks if more characters are found.
|
protected char |
next()
Returns the next character.
|
protected static boolean |
quote(int ch)
Checks if the specified character is a quote.
|
protected String |
rest()
Returns the remaining, unscanned query substring.
|
public final String input
public final int length
public String file
public int pos
public int mark
public InputParser(String input)
input
- inputpublic final boolean more()
public final char curr()
public final boolean curr(int ch)
ch
- character to be checkedprotected final void mark()
protected final char next()
0
if string is exhaustedpublic final char consume()
0
if string is exhaustedpublic final boolean consume(int ch)
ch
- character to consumeprotected static boolean quote(int ch)
ch
- character to be checkedpublic final boolean consume(String str)
str
- string to consumeprotected final byte[] found()
protected final String rest()
public final InputInfo info()
Copyright © 2005–2015 BaseX Team. All rights reserved.