help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Iterate a function over an array


From: Nicholas Crosbie
Subject: Iterate a function over an array
Date: Tue, 25 Jul 2006 12:15:44 +1000


I'm new to the world of parsers.  I want to pass an expression to
Bison and have that expression return code which is then executed
on each member of an array.

So with an array like such:

        [x(1), x(2), x(3)...........x(n-1)]

         x(i)' = FUNCTION(x(i))

My aims is to supply a FUNCTION string to Bison, have it produce
the correct code and then apply that code to each element of my array.

Can this be done?  What strategy can I use.   A user should be able
to vary the function (enter any string - within limits - which is then
supplied to Bison for parsing);  however since once that has been done,
the expression ('FUNCTION') does not change.
I don't want to have to repeatedly visit the parser as I apply the function to
each array element.

Perhaps there are example(s) demonstrating this behavior?

thanks,

NDC








reply via email to

[Prev in Thread] Current Thread [Next in Thread]