1Based on the C grammar for arithmetic expressions
2=================================================
3
4number_digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
5
6number_exponent = 'e'|'E'
7
8basic_number = basic_number number_digit | number_digit
9
10number =
11	   basic_number |
12
13	   basic_number number_exponent basic_number |
14	   basic_number number_exponent '-' basic_number |
15	   basic_number number_exponent '+' basic_number |
16
17	   '.' basic_number number_exponent basic_number |
18	   '.' basic_number number_exponent '-' basic_number |
19	   '.' basic_number number_exponent '+' basic_number |
20
21	   basic_number '.' number_exponent basic_number |
22	   basic_number '.' number_exponent '-' basic_number |
23	   basic_number '.' number_exponent '+' basic_number |
24
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
28
29
30identifier = '$'|'pi'|'e'|'X'|'Y'|'Width'|'Height'
31              ^            ^   ^     ^       ^
32              |            |   |     |       |
33	 '$' in PPT            |   |     |       |
34			 '#ppt_x' in PPT   |     |       |
35			     '#ppt_y' in PPT     |       |
36				       '#ppt_w' in PPT       |
37                               '#ppt_h' in PPT
38
39unary_function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log'
40binary_function = 'min'|'max'
41
42
43basic_expression =
44				 number |
45				 identifier |
46				 unary_function '(' additive_expression ')' |
47				 binary_function '(' additive_expression ',' additive_expression ')' |
48				 '(' additive_expression ')'
49
50unary_expression = '-' basic_expression
51
52multiplicative_expression =
53						  basic_expression |
54						  multiplicative_expression '*' basic_expression |
55						  multiplicative_expression '/' basic_expression
56
57additive_expression =
58					multiplicative_expression |
59					additive_expression '+' multiplicative_expression |
60					additive_expression '-' multiplicative_expression
61
62