doctype public "-//IDN etl.sf.net//ETL//Grammar 0.2.1";
grammar calculator.CalculatorArith {
include "calculator-basic-0_2_1.g.etl";
namespace t = "http://etl.sf.net/samples/calculator";
namespace default a = "http://etl.sf.net/samples/calculator/arith";
context default Expressions {
op composite Identity(f) {
^t:Identity {
% (;
@ value = expression;
% );
};
};
op UnaryMinus(fy, 200, -) {
@ value = right;
};
op UnaryPlus(fy, 200, +) {
@ value = right;
};
op Power(xfy, 300, **) {
@ first = left;
@ second = right;
};
op Multiply(yfx, 400, *) {
@ first = left;
@ second = right;
};
op Divide(yfx, 400, /) {
@ first = left;
@ second = right;
};
op Remainder(yfx, 400, %) {
@ first = left;
@ second = right;
};
op Plus(yfx, 500, +) {
@ first = left;
@ second = right;
};
op Minus(yfx, 500, -) {
@ first = left;
@ second = right;
};
};
};