Expression Grammar
The FdoExpression::Parse() method supports the following expression grammar:
<Expression> ::= '(' Expression ')'
| <UnaryExpression>
| <BinaryExpression>
| <Function>
| <Identifier>
| <ValueExpression>
<BinaryExpression> ::=
<Expression> '+' <Expression>
| <Expression> '-' <Expression>
| <Expression> '*' <Expression>
| <Expression> '/' <Expression>
<DataValue> ::=
TRUE
| FALSE
| DATETIME
| DOUBLE
| INTEGER
| STRING
| BLOB
| CLOB
| NULL
<Function> ::= <Identifier> '(' <ExpressionCollection> ')'
<ExpressionCollection> ::=
| <Expression>
| <ExpressionCollection> ',' <Expression>
<GeometryValue> ::= GEOMFROMTEXT '(' STRING ')'
<Identifier> ::= IDENTIFIER
<ValueExpression> ::= <LiteralValue> | <Parameter>;
<LiteralValue> ::= <GeometryValue> | <DataValue>
<Parameter> ::= PARAMETER | ':'STRING
<UnaryExpression> ::= '-' <Expression>
Expression Operator Precedence
The precedence is shown in YACC notation, that is, the highest precedence operators are at the bottom.
%left Add Subtract
%left Multiply Divide
%left Negate