|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.pbemengine.engine.ng.tools.LineParser
public class LineParser
Takes a line contained in a String, and gives the ability to parse that string to see if it matches a sequence of tokens. The first word of the string is extracted, and treated separately.
| Constructor Summary | |
|---|---|
LineParser(java.lang.String line)
Creates a new instance of LineParser, identifying the first word as the so-called command, and matching the rest by a given set of Tokens |
|
| Method Summary | |
|---|---|
char |
getNextChar()
Returns the first character of the remaining string and increases the search index |
java.lang.Object[] |
getResults()
Retrieve the results created by the last parsing rounds. |
boolean |
hasMoreChars()
Determines whether or not we've reached the end of the parseable string |
boolean |
match(Token[] tokens)
Match the given sequence of tokens to an array of Tokens |
boolean |
match(TokenSequence seq)
Match the given sequence of tokens to a TokenSequence |
char |
peekNextChar()
Returns the first character of the remaining string without increasing the search index |
void |
skipWhiteSpaces()
Skips any whitespaces in the line until a non-whitespace char is encountered |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LineParser(java.lang.String line)
line - The line to parse| Method Detail |
|---|
public char getNextChar()
public char peekNextChar()
public boolean hasMoreChars()
true if there are still chars remaining in the string,
false otherwise.public void skipWhiteSpaces()
public boolean match(Token[] tokens)
tokens - The array of tokens to match
true if the sequence of Tokens matches this string
false otherwisepublic boolean match(TokenSequence seq)
seq - The TokenSequence to match this line to
true if the sequence of Tokens matches this string
false otherwisepublic java.lang.Object[] getResults()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||