3.3.0 Operator Expressions
Note
This section is incomplete at this time. Planned pages:
- [RD-VBAL §3.3.1 Unary Operators]
- [RD-VBAL §3.3.2 Arithmetic Operators]
- [RD-VBAL §3.3.3 Logical (Bitwise) Operators]
- [RD-VBAL §3.3.4 Relational (Comparison) Operators]
An operator consists of a bound expression node that yields a deterministic result given one or more operand inputs.
- An operator that accepts a single input is a unary operator;
- An operator that accepts two inputs is a binary operator;
- An operator that accepts three inputs is a ternary operator.
Note
🧩 RD-VBA does not currently define any ternary operators.
- All unary operators are prefix, with the operator token appearing before its operand;
- All binary operators are infix, with a left and a right operand and the operator token between them;
- ternary operators are undefined in RD-VBA and should never be introduced in the language core.
All operators ultimately inherit BoundNode, which represents any type of AST node:
Each layer of this inheritance hierarchy refines its members with more specialized signatures in templated methods, usually sealing overrides to leave only one or two methods to implement at the leaves. For example a BoundExpression has a general-purpose inputs array of values, but an operator expression exposes them as indexed operands, and a unary operator only sees one while a binary operator gets Left and Right operands.
Tip
This is also the case for all semantics, both static and runtime.
⏮️ RD-VBAL §3.2 Literals | ⏭️ RD-VBAL §4.0 Program Structure