phpcr-utils/src/PHPCR/Util/QOM/Sql2Scanner.php
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
\PHPCR\Util\QOM\Sql2Scanner
Allows lookup and fetching of tokens.
Properties
Methods
__construct(string $sql2) : void
Construct a scanner with the given SQL2 statement
Name | Type | Description |
---|---|---|
$sql2 | string |
expectToken(string $token, boolean $case_insensitive = true) : void
Expect the next token to be the given one and throw an exception if it's not the case.
The equality test is done case sensitively/insensitively depending on the second parameter.
Name | Type | Description |
---|---|---|
$token | string | The expected token |
$case_insensitive | boolean |
expectTokens(array $tokens, boolean $case_insensitive = true) : void
Expect the next tokens to be the one given in the array of tokens and throws an exception if it's not the case.
Name | Type | Description |
---|---|---|
$tokens | array | |
$case_insensitive | boolean |
- See
- \PHPCR\Util\QOM\expectToken
fetchNextToken() : string
Get the next token and remove it from the queue.
Return an empty string when there are no more tokens.
Type | Description |
---|---|
string |
lookupNextToken(int $offset = 0) : string
Get the next token without removing it from the queue.
Return an empty string when there are no more tokens.
Name | Type | Description |
---|---|---|
$offset | int | number of tokens to look ahead - defaults to 0, the current token |
Type | Description |
---|---|
string |
scan(string $sql2) : array
Scan a SQL2 string a extract the tokens
Name | Type | Description |
---|---|---|
$sql2 | string |
Type | Description |
---|---|
array |
tokenIs(string $token, string $value, boolean $case_insensitive = true) : boolean
Test the equality of two tokens
Name | Type | Description |
---|---|---|
$token | string | |
$value | string | |
$case_insensitive | boolean |
Type | Description |
---|---|
boolean |