public class Lexer extends Object
Modifier and Type | Field and Description |
---|---|
protected CharacterIterator |
ci |
Constructor and Description |
---|
Lexer(String input,
String paramPrefixes,
boolean parseEscapedChars)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
Accessor for the current index in the input string.
|
String |
getInput()
Accessor for the input string.
|
boolean |
nextIsDot()
Utility to return if the next character is a dot.
|
boolean |
nextIsSingleQuote()
Utility to return if the next non-whitespace character is a single quote.
|
Boolean |
parseBooleanLiteral()
Parse a boolean from the current position.
|
Boolean |
parseBooleanLiteralIgnoreCase()
Parse a boolean from the current position (case insensitive).
|
String |
parseCast()
Parse a cast in the query from the current position, returning the name of the class that is being cast
to.
|
boolean |
parseChar(char c)
Check if char
c is found |
boolean |
parseChar(char c,
char unlessFollowedBy)
Check if char
c is found |
Character |
parseCharacterLiteral()
Parse a Character literal
|
boolean |
parseEOS()
Check if END OF TEXT is reached.
|
BigDecimal |
parseFloatingPointLiteral()
Parse a floating point number from the current position.
|
String |
parseIdentifier()
Parse a java identifier from the current position.
|
BigInteger |
parseIntegerLiteral()
Parse an integer number from the current position.
|
String |
parseMethod()
Checks if a java Method is found
|
String |
parseName()
Parses the text string (up to the next space) and returns it.
|
boolean |
parseNullLiteral()
Checks if null literal is parsed
|
boolean |
parseNullLiteralIgnoreCase()
Checks if null literal is parsed (case insensitive).
|
boolean |
parseString(String s)
Check if String
s is found |
boolean |
parseStringIgnoreCase(String s)
Check if String
s is found ignoring the case |
String |
parseStringLiteral()
Parse a String literal
|
boolean |
peekString(String s)
Check if String "s" is found and not moving the cursor position.
|
boolean |
peekStringIgnoreCase(String s)
Check if String "s" is found ignoring the case, and not moving the cursor position.
|
String |
remaining()
Method to return the remaining part of the string not yet processed.
|
int |
skipWS()
Skip over any whitespace from the current position.
|
String |
toString() |
protected final CharacterIterator ci
public String getInput()
public int getIndex()
public int skipWS()
public boolean parseEOS()
public boolean parseChar(char c)
c
is foundc
- the Character to findc
is foundpublic boolean parseChar(char c, char unlessFollowedBy)
c
is foundc
- the Character to findunlessFollowedBy
- the character to validate it does not follow c
c
is found and not followed by unlessFollowedBy
public boolean parseString(String s)
s
is founds
- the String to finds
is foundpublic boolean parseStringIgnoreCase(String s)
s
is found ignoring the cases
- the String to finds
is foundpublic boolean peekString(String s)
s
- the String to findpublic boolean peekStringIgnoreCase(String s)
s
- the String to findpublic String parseIdentifier()
public String parseMethod()
public String parseName()
public String parseCast()
public BigInteger parseIntegerLiteral()
public BigDecimal parseFloatingPointLiteral()
public Boolean parseBooleanLiteral()
public Boolean parseBooleanLiteralIgnoreCase()
public boolean nextIsSingleQuote()
public boolean nextIsDot()
public Character parseCharacterLiteral()
NucleusUserException
- if an invalid character is found or the CharacterIterator is finishedpublic String parseStringLiteral()
NucleusUserException
- if an invalid character is found or the CharacterIterator is finishedpublic boolean parseNullLiteral()
public boolean parseNullLiteralIgnoreCase()
public String remaining()
Copyright © 2019. All rights reserved.