operators.md

June 10, 2026 ยท View on GitHub

Documentation

Operators

ArithmeticLogicBitwiseUnary prefix
+ Addition== Equal& And++ Increment then use
- Subtraction!= Not equal| Or-- Decrement then use
* Multiplication< Less^ Xor~ Bitwise not
/ Division<= Less or equal<< Left shiftnot Logic not
% Modulus> Greater>> Right shift
>= Greater or equal
&& And
|| Or

Operator precedence

BIPLAN uses a layered recursive descent parser that naturally enforces standard mathematical hierarchy that perfectly mirrors standard C precedence:

  1. Factor: Parentheses, numbers, constants, variables, function calls and system functions
  2. Term: *, /, %
  3. Expression: +, -, &, |, ^, <<, >>
  4. Relation: ==, !=, <, >, <=, >=, &&, ||

For this reason this expression 2 + 3 * 4 evaluates to 14; multiplication has a higher precedence than addition.

Operator syntax

In BIPLAN the following program is incorrect:

if 1 == 1 || 0 == 0 print "OK" end

The correct form is:

if (1 == 1) || (0 == 0) print "OK" end

Parenthesis are required for the interpreter to detect a nested relation and compute it before the primary relation.