BNF определение Cocoa предикатов

Cocoa

NSPredicate

NSPredicate ::= NSComparisonPredicate | NSCompoundPredicate
    | "(" NSPredicate ")" | TRUEPREDICATE | FALSEPREDICATE 

NSCompoundPredicate

NSCompoundPredicate ::= NSPredicate "AND" NSPredicate
    | NSPredicate "OR" NSPredicate
    | "NOT" NSPredicate

NSComparisonPredicate

NSComparisonPredicate ::= expression operation expression
    | aggregate_qualifier NSComparisonPredicate

Операции

CONTAINS и IN служат как совокупность операторов и строковых операторов, в зависимости от типов своих аргументов.

operation ::= "=" | "!=" | "<" | ">" | "<=" | ">="
    | BETWEEN
    | aggregate_operations [ "[" string_options "]" ]

aggregate_operations ::= CONTAINS | IN | string_operations

string_operations ::= BEGINSWITH | ENDSWITH | LIKE | MATCHES

string_options ::= c | d | cd

Совокупные отборы

aggregate_qualifier ::= ANY | ALL | NONE | SOME

Выражения

expression ::= "(" expression ")"
    | binary_expression
    | function_expression
    | assignment_expression
    | index_expression
    | keypath_expression
    | value_expression

Значение выражения

value_expression ::= literal_value | literal_aggregate

Значение литерала

literal_value ::= string_value
    | numeric_value
    | predicate_argument
    | predicate_variable
    | NULL
    | TRUE
    | FALSE
    | SELF

Строковое значение

string_value ::= "text" | 'text'

Аргумент предиката

predicate_argument ::= "%" format_argument

Аргумент формата

format_argument ::= "@" | "%" | "K"
    printf style conversion character

Переменная предиката

predicate_variable ::= "$" identifier

Ключевое выражение

keypath_expression ::= identifier | "@" identifier
    | expression "." expression

Совокупные литералы

literal_aggregate ::= "{" [ expression [ "," expression ... ] ] "}"

Индекс выражения

index_expression ::= array_expression "[" integer_expression "]"

    | dictionary_expression   "[" expression "]"

    | aggregate_expression "[" FIRST "]" 

    | aggregate_expression "[" LAST "]" 

    | aggregate_expression "[" SIZE "]"

Агрегатное выражение

aggregate_expression ::= array_expression | dictionary_expression

Назначение выражения

assignment_expression ::= predicate_variable ":=" expression

Бинарные выражения

binary_expression ::= expression binary_operator expression

    | "-" expression

Бинарные операторы

binary_operator ::= "+" | "-" | "*" | "/" | "**"

Функция выражения

function_expression ::= function_name "(" [ expression [ "," expression ... ] ] ")"

Имя функции

function_name ::= "sum" | "count" | "min" | "max"

    | "average" | "median" | "mode" | "stddev"

    | "sqrt" | "log" | "ln" | "exp"

    | "floor" | "ceiling" | "abs" | "trunc"

    | "random" | "randomn" | "now"

Массив выражений

array_expression ::= any expression that evaluates to an NSArray object

Словарь выражений

dictionary_expression ::= any expression that evaluates to an NSDictionary object

Целые выражения

integer_expression ::= any expression that evaluates to an integral value

Числовые значения

numeric_value ::= C style numeric constant

Идентификатор

identifier ::= C style identifier | "#" reserved_word
 
 
homeЗаметили ошибкукарта сайта 
   Made on a Mac