Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
GeneralFilter Class Reference
+ Collaboration diagram for GeneralFilter:

Static Public Member Functions

static analyze ($source, $onlyToken=false)
 

Data Fields

const T_ESCAPE = "T_ESCAPE"
 
const T_QUOTE = "T_QUOTE"
 
const T_WHITESPACE = "T_WHITESPACE"
 
const T_STAR_BEGIN = "T_STAR_BEGIN"
 
const T_STAR_END = "T_STAR_END"
 
const T_OPEN_PARENTHESIS = "T_OPEN_PARENTHESIS"
 
const T_CLOSE_PARENTHESIS = "T_CLOSE_PARENTHESIS"
 
const T_OR = "T_OR"
 
const T_AND = "T_AND"
 
const T_WORD = "T_WORD"
 
const T_PUNCTUATION = "T_PUNCTUATION"
 
const MODE_STRING = "string"
 
const MODE_WORD = "word"
 
const MODE_OPEN_PARENTHESIS = "open_parenthesis"
 
const MODE_PARTIAL_BEGIN = "partial_begin"
 
const MODE_PARTIAL_END = "partial_end"
 
const MODE_PARTIAL_BOTH = "partial_both"
 
const MODE_CLOSE_PARENTHESIS = "close_parenthesis"
 
const MODE_OR = "or"
 
const MODE_AND = "and"
 

Static Protected Member Functions

static _match ($line, $offset)
 
static _convertToken ($tokens)
 

Static Protected Attributes

static $_terminals
 

Detailed Description

Definition at line 12 of file LexGeneralFilter.php.

Member Function Documentation

static _convertToken (   $tokens)
staticprotected

Convert the tokens in filter element

Parameters
$tokensarray of token
Returns
array array of filter elements

Definition at line 109 of file LexGeneralFilter.php.

static _match (   $line,
  $offset 
)
staticprotected

Analyze a fragment of source

Parameters
string$linecurrent line
int$offsetoffset of the line
Returns
array|bool current fragment or false

Definition at line 89 of file LexGeneralFilter.php.

static analyze (   $source,
  $onlyToken = false 
)
static

Analyze a general filter string

Parameters
string$sourcethe filter
bool$onlyTokenuse it if you only want the lexer token
Returns
array array of filter elements ("mode" => word, string, partial_begin, partial_end, partial_both, open_parenthesis, close_parenthesis, and, or, "word" => currentWord) or array of token elements ("token" => token type (see $_terminals), "match" => matched string)
Exceptions
LexException

Definition at line 64 of file LexGeneralFilter.php.

Field Documentation

$_terminals
staticprotected
Initial value:
= array(
'/^(\\\)/' => self::T_ESCAPE,
'/^(\")/' => self::T_QUOTE,
'/^(\s+)/' => self::T_WHITESPACE,
'/^(OR)/' => self::T_OR,
'/^(AND)/' => self::T_AND,
'/^(\()/' => self::T_OPEN_PARENTHESIS,
'/^(\))/' => self::T_CLOSE_PARENTHESIS,
'/^(\*(?=\s|\z))/' => self::T_STAR_END,
'/^(\*)/' => self::T_STAR_BEGIN,
'/^([\p{L}\']?[\p{L}\p{N}]+(?:-[\p{L}][\p{L}\p{N}]*)?)/u' => self::T_WORD,
'/^([\p{P}\p{S}])/u' => self::T_PUNCTUATION,
)

Definition at line 38 of file LexGeneralFilter.php.

const MODE_AND = "and"

Definition at line 33 of file LexGeneralFilter.php.

const MODE_CLOSE_PARENTHESIS = "close_parenthesis"

Definition at line 31 of file LexGeneralFilter.php.

const MODE_OPEN_PARENTHESIS = "open_parenthesis"

Definition at line 27 of file LexGeneralFilter.php.

const MODE_OR = "or"

Definition at line 32 of file LexGeneralFilter.php.

const MODE_PARTIAL_BEGIN = "partial_begin"

Definition at line 28 of file LexGeneralFilter.php.

const MODE_PARTIAL_BOTH = "partial_both"

Definition at line 30 of file LexGeneralFilter.php.

const MODE_PARTIAL_END = "partial_end"

Definition at line 29 of file LexGeneralFilter.php.

const MODE_STRING = "string"

Definition at line 25 of file LexGeneralFilter.php.

const MODE_WORD = "word"

Definition at line 26 of file LexGeneralFilter.php.

const T_AND = "T_AND"

Definition at line 22 of file LexGeneralFilter.php.

const T_CLOSE_PARENTHESIS = "T_CLOSE_PARENTHESIS"

Definition at line 20 of file LexGeneralFilter.php.

const T_ESCAPE = "T_ESCAPE"

Definition at line 14 of file LexGeneralFilter.php.

const T_OPEN_PARENTHESIS = "T_OPEN_PARENTHESIS"

Definition at line 19 of file LexGeneralFilter.php.

const T_OR = "T_OR"

Definition at line 21 of file LexGeneralFilter.php.

const T_PUNCTUATION = "T_PUNCTUATION"

Definition at line 24 of file LexGeneralFilter.php.

const T_QUOTE = "T_QUOTE"

Definition at line 15 of file LexGeneralFilter.php.

const T_STAR_BEGIN = "T_STAR_BEGIN"

Definition at line 17 of file LexGeneralFilter.php.

const T_STAR_END = "T_STAR_END"

Definition at line 18 of file LexGeneralFilter.php.

const T_WHITESPACE = "T_WHITESPACE"

Definition at line 16 of file LexGeneralFilter.php.

const T_WORD = "T_WORD"

Definition at line 23 of file LexGeneralFilter.php.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen