Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 5.43 KB

operators.md

File metadata and controls

44 lines (37 loc) · 5.43 KB

Documentation

Operators

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

Operator precedence

BIPLAN implements a recursive descent parser for this reason there is no operator precedence and calculations are executed in the order specified by the user.

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.