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 Michael On Sat, Jan 16, 2010 at 8:44 AM, Hans Aberg <hab...@math.su.se> wrote: > On 16 Jan 2010, at 15:21, Michael Chen wrote: > >> My goal is to get to the matrix form Ax =b by collecting and combining >> linear terms while I am parsing the ast tree. Once I get a clean >> matrix form Ax=b, it is straightforward to call my other routines to >> solve it. > > It may be easier to first parse polynomial expressions, which is, since it > is linear, the coefficients plus the constant. When the equality "=" > appears, you can combine the two sides. WHen you have collected all > equalities, build the matrix. This method then generalizes to polynomial > equations, if you would like to do so later. > > Hans > > > -- Best regards, Michael Chen Google Voice Phone.: 847-448-0647 _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison