2.4.3.1. What is an expression in ScriptBasic

[<<<] [>>>]

Altough the syntax defintion in script basic is table driven and can easily be modified expressions are not. The syntax of an expression is somewhat fix. Here we formally define what the program thinks to be an expression. This restriction should not cause problem in the usage of this module because this is the usual syntax of an expression. Any altering to this would result in an expression syntax which is unusual, and therefore difficult to use for the common users. The operators and functions along with therir precedence values are defined in tables anyway, so you have flexibility.

The formal description of an expression syntax:

 tag ::= UNOP tag
         NUMBER
         STRING
         '(' expression ')'
         VARIABLE { '[' expression_list ']' }
         VARIABLE '{' expression_list '}'
         FUNC '(' expression_list ')'
         .

expression_list ::= expression [ ',' expression_list ] .

expression_i(1) ::= tag .

expression_i(i) := expression_i(i-1) [ OP(i) expression_i(i) ] .

expression ::= expression_i(MAX_PREC) .

left_value ::= variable { '[' expression_list ']' } variable '{' expression_list '}' .


[<<<] [>>>]