Parser
in package
OASIS-CQL Parser
Provides Level 1 variant 2.b) conformance.
http://docs.oasis-open.org/search-ws/searchRetrieve/v1.0/os/part5-cql/searchRetrieve-v1.0-os-part5-cql.html
Tags
Table of Contents
Constants
- STATE_NOTERM = 1
- STATE_TERM = 2
- TOKEN_REGEX = '([()/<=>]|<=|>=|==)|([^"()/<=>\\s]+)|"([\\\\]"|[^"])*"'
Properties
- $allowedBoolOp : mixed
- $queryTree : Term
Methods
- __toString() : string
- asTsquery() : string
- parse() : mixed
- setAllowedBoolOp() : void
- checkQueryTree() : void
- parseLogical() : Term
- parseSimple() : Term
- parseTokens() : array<string|int, Token>
Constants
STATE_NOTERM
public
mixed
STATE_NOTERM
= 1
STATE_TERM
public
mixed
STATE_TERM
= 2
TOKEN_REGEX
public
mixed
TOKEN_REGEX
= '([()/<=>]|<=|>=|==)|([^"()/<=>\\s]+)|"([\\\\]"|[^"])*"'
Properties
$allowedBoolOp
private
mixed
$allowedBoolOp
= ['and', 'or', 'not', 'prox']
$queryTree
private
Term
$queryTree
Methods
__toString()
public
__toString() : string
Return values
stringasTsquery()
public
asTsquery() : string
Return values
stringparse()
public
parse(string $query) : mixed
Parameters
- $query : string
setAllowedBoolOp()
public
setAllowedBoolOp(array<string|int, string> $allowed) : void
Parameters
- $allowed : array<string|int, string>
checkQueryTree()
private
checkQueryTree(Term $term) : void
Parameters
- $term : Term
parseLogical()
private
parseLogical(array<string|int, Token> &$tokens) : Term
Parameters
- $tokens : array<string|int, Token>
Return values
TermparseSimple()
private
parseSimple(array<string|int, mixed> &$tokens) : Term
Parameters
- $tokens : array<string|int, mixed>
Return values
TermparseTokens()
private
parseTokens(string $query) : array<string|int, Token>
Parameters
- $query : string