On 17 Oct 2005, at 23:57, Arlen Cox wrote:
I am trying to implement a grammar that may have 0 or more of a
construct.
Effectively I want to have a grammar like this:
File:
( Module )*
I've looked through the manual and it appears bison does not
support this
construct,
Right, Bison doesn't support that.
I was trying to replicate it. I've tried two ways:
Waite & Goos, "Compiler construction", gives the following rewritings
Abbreviation Meaning
x -> alpha u* gamma x -> alpha [u+] gamma
x -> alpha u+ gamma x -> alpha Y gamma, where y -> u | y u
x -> alpha [beta] gamma x -> alpha gamma | alpha (beta) gamma
x -> alpha (beta) gamma x -> alpha y gamma, where y -> beta
This should suffice -- I'm too tired too solve this for you. :-)
Hans Aberg
_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison