XFA Specification
Chapter 23, FormCalc Specification
Grammar and Syntax
815
An AdditiveExpressio
n
76
operands are null. If not both null, the operands are promoted to numeric values, and a numeric operation
is performed.
The AdditiveOperator '+', is the addition operator; it returns the sum of its operands.
The AdditiveOperator '-', is the subtraction operator; it returns the difference of its operands.
Multiplicative Expressions
78 MultiplicativeExpression ::= UnaryExpression |
MultiplicativeExpression MultiplicativeOperator UnaryExpression
79 MultiplicativeOperator ::= '*' | '/'
A MultiplicativeExpression
78
operands are null. If not both null, the operands are promoted to numeric values, and a numeric operation
is performed.
The MultiplicativeOperator '*', is the multiplication operator; it returns the product of its operands.
The MultiplicativeOperator '/', is the division operator; it returns the quotient of its operands.
Unary Expressions
80 UnaryExpression ::= PrimaryExpression | UnaryOperator UnaryExpression
81 UnaryOperator ::= '-' | '+' | 'not'
A UnaryExpression
80
The UnaryOperator '-' denotes the unary minus operator; it returns the arithmetic negation of its operand,
or null if its operand is null. If its operand is not null, it is promoted to a numeric value, and the unary minus
operation is performed.
The UnaryOperator '+' denotes the unary plus operator; it returns the arithmetic value of its operand, or
null if its operand is null. If its operand is not null, it is promoted to a numeric value, and the unary plus
operation is performed.
The UnaryOperator 'not' denotes the logical negation operator. it returns the logical negation of its
operand. Its operand is promoted to a boolean value, and the logical operation is performed.
The logical negation operation returns the boolean result true, represented by the numeric value 1,
whenever its operand is 0, and returns the boolean result false, represented by the numeric value 0,
otherwise.
Note:
The arithmetic negation of a null operand yields the result null, whereas the logical negation of a
null operand yields the boolean result true. This is justified by the common sense statement: If null
means nothing then "not nothing" should be something.
Primary Expressions
82 PrimaryExpression ::=
Literal | Accessor | MethodCall | '(' SimpleExpression ')'
A PrimaryExpression
82
accessors, function calls, and parenthesized simple expressions.