Expressions and Assignments:

 
<assignment>               ::= <variable> <replace> <expression>
                             | <left part> <assignment>

<replace>                  ::= =

<left part>                ::= <variable> ,

<expression>               ::= <logical factor>
                             | <expression> | <logical factor>

<logical factor>           ::= <logical secondary>
                             | <logical factor> & <logical secondary>

<logical secondary>        ::= <logical primary>
                             | ¬ <logical primary>

<logical primary>          ::= <string expression>
                             | <string expression> <relation> <string expression> 

<relation>                 ::= =
                             | <
                             | >
                             | ¬ =
                             | ¬ <
                             | ¬ >
                             | < =
          		     | > =

<string expression>        ::= <arithmetic expression>
			     | <string expression> ||  <arithmetic expression>

<arithmetic expression>    ::= <term>
                             | <arithmetic expression> + <term>
                             | <arithmetic expression> - <term>
                             | + <term>
                             | - <term>

<term>                     ::= <primary>
                             | <term> * <primary>
                             | <term> / <primary>
                             | <term> MOD <primary>

<primary>         ::= <constant>
                    | <variable>
                    | ( <expression> )

<variable>        ::= <identifier>
                    | <subscript head> <expression> )

<subscript head>  ::= <identifier> (
                    | <subscript head> <expression> ,
  
 
 
XPL Operator Precedence
PriorityOperatorInterpretation
7
(lowest)
|Logical OR of numeric values
6&Logical AND of numeric values
5¬Logical complement of conditional or numeric value
4=Condition TRUE if values are equal ¹
<Condition TRUE if first operand less than second
>Condition TRUE if first operand greater than second
¬ =Condition TRUE if values are NOT equal
¬ <Same as > =
¬ >Same as < =
< =Condition TRUE if first operand less than or equal to second
> =Condition TRUE if first operand greater than or equal to second
3||String concatenation
Non-string operands will be converted to strings.
2+32-bit signed two's-complement addition
+Unary +
-32-bit signed two's-complement subtraction
-Unary -; 32-bit two's-complement
1
(highest)
*Signed 32-bit multiplication
/Signed 32-bit division.
Divide by zero causes interrupt
mod32-bit remainder from division
¹ String comparisons are done first by length. If the lengths are equal the strings are then compared on a character basis.