public class LineToParse extends PrimitiveLookAhead
Modifier and Type | Field and Description |
---|---|
int |
lineno
lineno is the line number of the string, toParse
|
java.util.LinkedList<java.lang.String> |
parseList
parseList is a linkedList of tokens (strings) that capture the essence of
a parse
|
java.lang.String |
token
most recently parsed token (some are skipped)
|
java.lang.String |
toParse
toParse is the unparsed segment/string
|
Constructor and Description |
---|
LineToParse(java.lang.String lineContents,
int lineNumber)
parse lineContents that has lineNumber
|
Modifier and Type | Method and Description |
---|---|
void |
add2ParseList(java.lang.String s)
used rarely (Barrier/Nothing) to add indicators to the parseList
|
void |
AssertNotAtEnd(Token t)
is there more to parse to parse? If not, throw ParseException
|
boolean |
atEnd() |
char |
charAt(int i) |
int |
getLineNo() |
void |
parseSave(Token t)
consume expected token t and add parsed token to the parseList
|
void |
parseSaveQualified(Token t)
assuming canParse() == true, consume token t and add parsed token to the parseList
|
void |
parseSkip(Token t)
consume expected token t and ignore its existence
|
void |
parseSkipQualified(Token t)
assuming canParse() == true, consume token t and ignore its existence
|
char |
peek() |
boolean |
returnSave(int i)
advance toParse by the length i of a parsed "token" and set token to the
length i string that has been removed; this is the "result" of parsing.
|
boolean |
returnSaveTrim(int i) |
boolean |
returnSkip(int i)
advance toParse by the length i of a parsed "token"; no token is
returned; return true.
|
boolean |
startsWith(java.lang.String s) |
allButRBracketOrBarrier, isCard, isCardinality, isColumnNameChar, isDigit, isDot, isLetter, isLetterOrDigit, isLetterOrDigitOrUnderScore, isLowercaseLetter, isNegative, isNumber, isQuote, isRole, isUnderScore
public java.lang.String toParse
public java.lang.String token
public java.util.LinkedList<java.lang.String> parseList
public int lineno
public LineToParse(java.lang.String lineContents, int lineNumber)
lineContents
- -- contents of line to parselineNumber
- -- number of line in file (-1 otherwise)public int getLineNo()
public char peek()
public boolean startsWith(java.lang.String s)
s
- -- string look-aheadpublic char charAt(int i)
i
- index of character lookahead in unparsed segment of linepublic boolean atEnd()
public void AssertNotAtEnd(Token t)
t
- -- token that was expected to be readpublic boolean returnSave(int i)
i
- -- length of parsed "token" stringpublic boolean returnSaveTrim(int i)
public boolean returnSkip(int i)
i
- -- length of parsed tokenpublic void parseSaveQualified(Token t)
t
- -- token to consumepublic void parseSave(Token t)
t
- -- token to consumepublic void parseSkipQualified(Token t)
t
- -- token to consumepublic void parseSkip(Token t)
t
- -- token to consumepublic void add2ParseList(java.lang.String s)
s
- -- string to add