Expression syntax

This topic describes syntax for expressions used in form fields.

The expression syntax is similar to the C language expressions. The main difference is that the expressions operate with Boolean type, so there is no need to distinguish Boolean and bitwise operators (&& and &, || and |, and so forth). There are also no assignment operations. The operations priority is the same as in C language.

Complete formal syntax definitions follow:


    selector_expression ::-
    logic_expression ? first_expression : second_expression
    logic_expression
    logic_expression ::-
    logic_expression | logic_expression_and
    logic_expression_and
    logic_expression_and ::-
    logic_expression_and & logic_expression_cmp
    logic_expression_cmp
    logic_expression_cmp ::-
    logic_expression_cmp operation_cmp math_expression
    math_expression
    math_expression ::-
    math_expression operation_add math_expression_mul
    math_expression_mul
    math_expression_mul ::-
    math_expression_mul operation_mul unary_expression
    unary_expression
    unary_expression ::-
    unary_operator unary_expression
    (expression)
    constant
    identifier
    operation_cmp ::-
    =
    ==
    !=
    >
    <
    >=
    <=
    operation_add ::-
    +
    -
    operation_mul ::-
    *
    /
    unary_operation ::-
    +
    -
    !
    constant ::-
    integer_constant  // regular_expression: [0123456789]+
    string_constant   // regular_expression:".*"
    boolean_constant  // case_insensitive:TRUE, FALSE, ON, OFF
                       // case_insensitive:YES, NO, OFF
    identifier ::- [a-zA-Z_][0-9a-zA-Z_]*