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:
Expression1 | Expression2
Func(Expr1, Expr2, ...)
You can use both built-in functions and custom functions.
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).
Expression1 [+, -, /, *] Expression2
Expression1 [>, <, >=, <=, =, !=] Expression2
'abc' , 2.0
There are a number of literal representations for integer constants representing operation types, class specifiers, etc.
The operations below are ordered by priority, with the highest priority at the top.
(), . not +, - >, >=, <, <= =, != |