Property | Type | Description | |
---|---|---|---|
$DEFAULT_DELIMITER | string | The default delimiter. This is used, by default, in all new instances. | |
$PARSER_METHODS | array | A list of methods that are used in lexing the SQL query. | |
$delimiter | string | This may change during lexing. | |
$delimiterLen | integer | Because parseDelimiter can be called a lot, it would perform a lot of calls to strlen, which might affect performance when the delimiter is big. | |
$errors | Usually, the lexing does not stop once an error occurred because that error might be false positive or a partial result (even a bad one) might be needed. | ||
$last | integer | The index of the last parsed character. | |
$len | integer | By storing its length, a lot of time is saved, because parsing methods would call strlen everytime. | |
$list | Tokens extracted from given strings. | ||
$str | string | |
The string to be parsed. | |
$strict | boolean | Whether errors should throw exceptions or just be stored. |
Method | Description | |
---|---|---|
__construct ( string | |
Constructor. | |
error ( string $msg = '', string $str = '', integer $pos, integer $code ) : void | Creates a new error log. | |
getTokens ( string | |
Gets the tokens list parsed by a new instance of a lexer. | |
lex ( ) : void | Parses the string and extracts lexemes. | |
parseBool ( ) : |
Parses a boolean. | |
parseComment ( ) : |
Parses a comment. | |
parseDelimiter ( ) : |
Parses the delimiter of the query. | |
parseKeyword ( ) : |
Parses a keyword. | |
parseLabel ( ) : |
Parses a label. | |
parseNumber ( ) : |
Parses a number. | |
parseOperator ( ) : |
Parses an operator. | |
parseString ( string $quote = '' ) : |
Parses a string. | |
parseSymbol ( ) : |
Parses a symbol. | |
parseUnknown ( ) : |
Parses unknown parts of the query. | |
parseWhitespace ( ) : |
Parses a whitespace. | |
setDelimiter ( string $delimiter ) | Sets the delimiter. |
public parseDelimiter ( ) : |
||
return |
public parseString ( string $quote = '' ) : |
||
$quote | string | Additional starting symbol. |
return |
public parseUnknown ( ) : |
||
return |
public parseWhitespace ( ) : |
||
return |
public setDelimiter ( string $delimiter ) | ||
$delimiter | string | The new delimiter. |
public static string $DEFAULT_DELIMITER | ||
return | string |
public static array $PARSER_METHODS | ||
return | array |
public int $delimiterLen | ||
return | integer |
public LexerException[],SqlParser\Exceptions $errors | ||
return |
public int $len | ||
return | integer |
public TokensList,sqlparser $list | ||
return |
public string|UtfString,sqlparser $str | ||
return | string | |
public bool $strict | ||
return | boolean |