Closed yossigil closed 5 years ago
for example,
v("X"). //define variable X
times().
v("X").plus().v("Y") // X * X + Y
.times().begin(). // X* X + Y(
.n(12.3)
.plus().
.v("X").
end(); // X* X + Y(12.3+X)
;
try also
n(12).v("X") // 12 * X
.plus("Y") // 12*X+Y
.n(36) // 12*X + 36*Y
The second code example would probably over-complicate the grammar---I'll pass it for now.
Done. Language is called Arithmetic
.
e.g., by