From: "Christopher Nelson" To: Subject: Re: Bison help Date: Tue, 29 Jun 1999 16:50:03 -0600 Message-ID: <01bec281$ba1a2d40$LocalHost@thendren> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Reply-To: djgpp AT delorie DOT com >I am trying to get bison to accept multiple parameter functions. Does >anyone know how to do this? I got single params to wolk by looking at >the calc exemple in the info files, but multiple doesnt work that way. if you're writing the Bison code to read and interpret and run the script all at the same time it gets a little problematic. that's because it's difficult to parse a GENERAL set of functions with varying parameter lengths at run-time. the only simple way to do it that I can see is have either (1) a set of nonterminals that collect a set number of parameters and call the function with those parameters, or (2) have a nonterminal that gathers the arguments sent to the function, for example, push them onto an internal stack, then, instead of calling the function immediately, call an intermediate function that calls the function and uses the va_args functions to pass the parameters. if you run it compiled as byte-codes, that's another thing. or, if you only expect certain functions to ever be executed, you can simply look for them specifically. like i said, it's difficult to run a GENERAL set of functions with varying parameter list lengths at runtime. if you take away one of these it gets much simpler. -={C}=-