2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 Based on the C grammar for arithmetic expressions
20 =================================================
22 number_digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
24 number_exponent = 'e'|'E'
26 basic_number = basic_number number_digit | number_digit
31 basic_number number_exponent basic_number |
32 basic_number number_exponent '-' basic_number |
33 basic_number number_exponent '+' basic_number |
35 '.' basic_number number_exponent basic_number |
36 '.' basic_number number_exponent '-' basic_number |
37 '.' basic_number number_exponent '+' basic_number |
39 basic_number '.' number_exponent basic_number |
40 basic_number '.' number_exponent '-' basic_number |
41 basic_number '.' number_exponent '+' basic_number |
43 basic_number '.' basic_number number_exponent basic_number |
44 basic_number '.' basic_number number_exponent '-' basic_number |
45 basic_number '.' basic_number number_exponent '+' basic_number
48 identifier = '$'|'pi'|'e'|'X'|'Y'|'Width'|'Height'
57 unary_function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan'|'acos'|'asin'|'exp'|'log'
58 binary_function = 'min'|'max'
64 unary_function '(' additive_expression ')' |
65 binary_function '(' additive_expression ',' additive_expression ')' |
66 '(' additive_expression ')'
68 unary_expression = '-' basic_expression
70 multiplicative_expression =
72 multiplicative_expression '*' basic_expression |
73 multiplicative_expression '/' basic_expression
76 multiplicative_expression |
77 additive_expression '+' multiplicative_expression |
78 additive_expression '-' multiplicative_expression