|
From: | Hans Aberg |
Subject: | Re: how to parse linear equations |
Date: | Sat, 16 Jan 2010 16:02:03 +0100 |
On 16 Jan 2010, at 15:52, Michael Chen wrote:
Exactly, I would like to first process the linear expression, which are coefficients and a constant; how can I do it over my ast tree recursively? + * * 2 + 3 - x y z x
Just make a data structure that can hold a polynomial - linear in your case, with operators + - *. Then just build it as in the calculator case, only that it operates on this polynomial data.
Hans
[Prev in Thread] | Current Thread | [Next in Thread] |