1: doctype public "-//IDN etl.sf.net//ETL//Grammar 0.2.1";
2: grammar calculator.CalculatorArith {
3: include "calculator-basic-0_2_1.g.etl";
4: namespace t = "http://etl.sf.net/samples/calculator";
5: namespace default a = "http://etl.sf.net/samples/calculator/arith";
6: context default Expressions {
7: op composite Identity(f) {
8: ^t:Identity {
9: % (;
10: @ value = expression;
11: % );
12: };
13: };
14: op UnaryMinus(fy, 200, -) {
15: @ value = right;
16: };
17: op UnaryPlus(fy, 200, +) {
18: @ value = right;
19: };
20: op Power(xfy, 300, **) {
21: @ first = left;
22: @ second = right;
23: };
24: op Multiply(yfx, 400, *) {
25: @ first = left;
26: @ second = right;
27: };
28: op Divide(yfx, 400, /) {
29: @ first = left;
30: @ second = right;
31: };
32: op Remainder(yfx, 400, %) {
33: @ first = left;
34: @ second = right;
35: };
36: op Plus(yfx, 500, +) {
37: @ first = left;
38: @ second = right;
39: };
40: op Minus(yfx, 500, -) {
41: @ first = left;
42: @ second = right;
43: };
44: };
45: };