ConditionsEach 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:
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] Note: When a path expression constitutes the whole KAST pattern, it starts with '//' followed by a node type name. This means that corresponding subtrees are matched anywhere in the AST. On the other hand, when a path expression is one of the conditions or a part of a condition in a KAST expression, it starts with a child name or any other axis qualifier instead. This means that the path must start from the node this expression is related to.
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 See Variables. Supported operations The operations below are ordered by priority, with the highest priority at the top. (), . not +, - >, >=, <, <= =, != | |