|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.util.InputParser
public class InputParser
Abstract class for parsing various inputs, such as database commands or queries.
Field Summary | |
---|---|
java.lang.String |
file
File reference. |
java.lang.String |
input
Input to be parsed. |
int |
length
Query length. |
int |
mark
Marked input position. |
int |
pos
Current input position. |
Constructor Summary | |
---|---|
InputParser(java.lang.String in)
Constructor. |
Method Summary | |
---|---|
char |
consume()
Returns next character. |
boolean |
consume(int ch)
Peeks forward and consumes the character if it equals the specified one. |
boolean |
consume(java.lang.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 void |
file(IO f,
Context c)
Sets a file reference. |
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 java.lang.String |
rest()
Returns the remaining, unscanned query substring. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String input
public final int length
public java.lang.String file
public int pos
public int mark
Constructor Detail |
---|
public InputParser(java.lang.String in)
in
- inputMethod Detail |
---|
protected void file(IO f, Context c)
f
- filec
- database contextpublic final boolean more()
public final char curr()
public final boolean curr(int ch)
ch
- character to be checked
protected final void mark()
protected final char next()
public final char consume()
public final boolean consume(int ch)
ch
- character to consume
protected static final boolean quote(int ch)
ch
- character to be checked
public final boolean consume(java.lang.String str)
str
- string to consume
protected final byte[] found()
protected final java.lang.String rest()
public final InputInfo info()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |