Mail Archives: djgpp/1999/07/07/01:14:20
Denis Lamarche wrote:
> what is my_foo? what if I wanted to access the varables declared at the
> beggining of my c code from inside
> the script language. like: status=12 Whitch is the VAR '=' exp. so
> how do I tell my program
> that I wan to put 12 in the previously declares status variable?
Are you saying you have a variable declared in your bison code like:
And when you parse the input file and find a line reading something like:
status = 12
you want to assign 12 to the status variable inside the parser?
If so, there is no trivial way to do it, the easiest way I can think of is
to make an array of structs containing strings and int pointers. Each time you
find a VAR = exp, compare the string version of VAR to every entry in your array
of structs, when you find the right struct, make an assinment to the pointer,
and make sure to initialize the pointer to point to the correct variable.
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT HotMail DOT com
- Raw text -