Each element of a KAST expression can have zero or more conditions.
Each condition is a boolean expression and must be surrounded by square brackets. A path element is matched with an AST node if all the corresponding conditions are met.
Expressions can be of one of the following types:
- TREE (AST nodes)
- SEMA (semantic information associated with AST nodes)
BOOL, INT and DOUBLE values can be converted into each other; TREE and SEMA values can be converted to the BOOL type.
The following types of expressions are supported:
Path expression: Starts with a child qualifier: [Expr::ExprBinary/Expr1::ExprConst]
Or expression: Expression1 | Expression2
Not expression: not Expression
Function expression: Func(Expr1, Expr2, ...)
You can use both built-in functions and custom functions.
Dot expression: Expression.Func(...)
The right part of such expression must be a function call. The expression in the left part of the dot expression is treated as the first argument of the function in the right part: a.b(c) is equivalent to b(a, c).
Attribute expression: @attribute_name
Arithmetic expression: Expression1 [+, -, /, *] Expression2
Relational expression: Expression1 [>, <, >=, <=, =, !=] Expression2
Bracket expression: (Expression)
Constant expression: 'abc' , 2.0
There are a number of literal representations for integer constants representing operation types, class specifiers, etc.
Variable expression: $variable
The operations below are ordered by priority, with the highest priority at the top.
(), . not +, - >, >=, <, <= =, != |