No that ain't possible because bison generated code is fixed for a set of productions
If you need to perform based on certain conditions, then I'd suggest splitting the parser into multiple parts. Let us call the construct you want to parser differently based on a condition as CONSTRUCT and the two ways of parsing it as PARSE1 and PARSE2 The base parser will have a generic mechanism to parse CONSTRUCT regardless of how it is to be parsed. This parser will assimilate this into a text stream and pass it to either of PARSE1 or PARSE2 based on the situation. This is the worse case if the decision can arbitrarily toggle between PARSE1 and PARSE2 (condition not dependent on parser input). But if the same program is to behave differently depending on input then you could fabricate some special token in you lexer and fabricate the grammar to act differently depending in the presence or absence of the token (linked to the state of the flag). We would give a much better solution if you be a little more specific as to what governs the decision as to which way to parse. Regards Ramaswamy -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vidhya Sent: Monday, July 10, 2006 12:58 PM To: [email protected] Subject: Contional productions Hi All Can I write conditional productions based on a flag . I have a normal production ,then inside the action part I determine the value of the flag . After that I want the productions itself to be controlled by this flag _______________________________________________ [email protected] http://lists.gnu.org/mailman/listinfo/help-bison
