\PHPSQLLexer

This class splits the SQL string into little parts, which the parser can use to build the result array.

Summary

Methods
Properties
Constants
__construct()
split()
No public properties found
No constants found
endsWith()
concatUserDefinedVariables()
concatComments()
isBacktick()
balanceBackticks()
balanceCharacter()
concatColReferences()
concatEscapeSequences()
balanceParenthesis()
$splitters
N/A
No private methods found
No private properties found
N/A

Properties

$splitters

$splitters : 

Type

Methods

__construct()

__construct() 

Constructor.

It initializes some fields.

split()

split(  $sql) 

Parameters

$sql

endsWith()

endsWith(string  $haystack, string  $needle) : boolean

Ends the given string $haystack with the string $needle?

Parameters

string $haystack
string $needle

Returns

boolean —

true, if the parameter $haystack ends with the character sequences $needle, false otherwise

concatUserDefinedVariables()

concatUserDefinedVariables(  $tokens) 

Parameters

$tokens

concatComments()

concatComments(  $tokens) 

Parameters

$tokens

isBacktick()

isBacktick(  $token) 

Parameters

$token

balanceBackticks()

balanceBackticks(  $tokens) 

Parameters

$tokens

balanceCharacter()

balanceCharacter(  $tokens,   $idx,   $char) 

Parameters

$tokens
$idx
$char

concatColReferences()

concatColReferences(  $tokens) 

This function concats some tokens to a column reference.

There are two different cases:

  1. If the current token ends with a dot, we will add the next token
  2. If the next token starts with a dot, we will add it to the previous token

Parameters

$tokens

concatEscapeSequences()

concatEscapeSequences(  $tokens) 

Parameters

$tokens

balanceParenthesis()

balanceParenthesis(  $tokens) 

Parameters

$tokens