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




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to