Condition Grammar
-
Basic conditional judgment unit, which defines the primitive of comparison
e.g.
Condition Expression
Expression using “and/or/not” to connect condition primitive
e.g.
-
Variable that is defined by Condition Expression
e.g.
Advanced Condition Expression
Expression using “and/or/not” to connect condition primitive and condition variable
In advanced condition expression, condition variable is identified by “$” prefix
-
$news_host && req_method_in("GET") # match condition variable and HTTP method is "GET"
- Basic conditional judgment unit, format is shown as follows:
FuncName( params )
- Condition primitive like function definition: FuncName is name of condition primitive; params are input parameters
- Note: All builtin condition primitives
Condition Expression grammar is defined as follows:
Priority and combination rule of “&&/||/!” is same as them in C language
Expression description
Advanced Condition Expression grammar is defined as follows:
Expression description
Advanced Condition Expression(ACE) ->
| ACE || ACE
| ( ACE)
| Condition Variable