help-bison
[Top][All Lists]
Advanced

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

RE: Conditional generation of Grammar rules


From: Ramaswamy R - TLS, Chennai.
Subject: RE: Conditional generation of Grammar rules
Date: Wed, 3 May 2006 09:38:39 +0530

Why don't you just rewrite the same this way ... it seems much simpler to
me.

nonterminal X:
{
#ifdef FEATURE
  rule1;
#else
  rule1; rule2;
#endif
}

would it be a problem for you to write it this way?? Or is your problem much
bigger than what I just addressed.

Regards
Ramaswamy

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Jeganatan, Srividhya
Sent: Tuesday, May 02, 2006 10:08 PM
To: 'address@hidden'
Subject: Conditional generation of Grammar rules

All,
Is there a way to conditionally generate grammar rules? 
For example, I need to do something like

nonterminal X:
#ifdef FEATURE
 { rule 1 }
#else
 { rule 1; rule 2 }
#endif

I know that ifdefs dont work with the grammar but is there anything else
that can be done?
Or is it possible to make bison to read define variables from a make file?

I want to avoid writing different parsers / recursive parsers to do this.

Thanks for your help.

Srividhya.




_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison
DISCLAIMER 
The contents of this e-mail and any attachment(s) are confidential and intended 
for the 

named recipient(s) only. It shall not attach any liability on the originator or 
HCL or its 

affiliates. Any views or opinions presented in this email are solely those of 
the author and 

may not necessarily reflect the opinions of HCL or its affiliates. Any form of 
reproduction, 

dissemination, copying, disclosure, modification, distribution and / or 
publication of this 

message without the prior written consent of the author of this e-mail is 
strictly 

prohibited. If you have received this email in error please delete it and 
notify the sender 

immediately. Before opening any mail and attachments please check them for 
viruses and 

defect.




reply via email to

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