Date: Wed, 14 Sep 1994 11:39:08 -0700 (PDT) From: Gordon Hogenson Subject: Re: User defined functions To: Duncan Sands Cc: djgpp AT sun DOT soe DOT clarkson DOT edu On Tue, 13 Sep 1994, Duncan Sands wrote: > Can anyone help me: > I am writing a program ( using DJ's gcc - which is great by the way! ) > which needs to evaluate a user specified mathematical function of several > variables like sin(x*y) fairly rapidly for many x and y values. I appreciate > that the best way to do this might be to link in object code defining > the function but this is not feasible for me: the people specifying the > function may not even know what a compiler is. This seems > to leave me the task of parsing the user's input into some sort of > tree structure and then using this to evaluate the function. > You could try the gnuplot source code -- it contains routines for parsing functions. Gnuplot is available at prep.ai.mit.edu and other GNU mirrors (even a DOS version). Gordon