1 Based on the C grammar for arithmetic expressions
2 =================================================
4 number_digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
6 number_exponent = 'e'|'E'
8 basic_number = basic_number number_digit | number_digit
13 basic_number number_exponent basic_number |
14 basic_number number_exponent '-' basic_number |
15 basic_number number_exponent '+' basic_number |
17 '.' basic_number number_exponent basic_number |
18 '.' basic_number number_exponent '-' basic_number |
19 '.' basic_number number_exponent '+' basic_number |
21 basic_number '.' number_exponent basic_number |
22 basic_number '.' number_exponent '-' basic_number |
23 basic_number '.' number_exponent '+' basic_number |
25 basic_number '.' basic_number number_exponent basic_number |
26 basic_number '.' basic_number number_exponent '-' basic_number |
27 basic_number '.' basic_number number_exponent '+' basic_number
30 identifier = '$'|'pi'|'e'|'X'|'Y'|'Width'|'Height'
39 unary_function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log'
40 binary_function = 'min'|'max'
46 unary_function '(' additive_expression ')' |
47 binary_function '(' additive_expression ',' additive_expression ')' |
48 '(' additive_expression ')'
50 unary_expression = '-' basic_expression
52 multiplicative_expression =
54 multiplicative_expression '*' basic_expression |
55 multiplicative_expression '/' basic_expression
58 multiplicative_expression |
59 additive_expression '+' multiplicative_expression |
60 additive_expression '-' multiplicative_expression