From mboxrd@z Thu Jan 1 00:00:00 1970 To: lucio@proxima.alt.za, Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Fri, 22 Jul 2011 08:33:50 +0200." <20110722063350.GK1803@fangle.proxima.alt.za> References: <201107220536.p6M5agtv019617@freefriends.org> <20110722063350.GK1803@fangle.proxima.alt.za> Date: Fri, 22 Jul 2011 00:42:12 -0700 From: Bakul Shah Message-Id: <20110722074212.D3CB0B827@mail.bitblocks.com> Subject: Re: [9fans] Plan 9 Go (Was: GNU/Linux/Plan 9 disto) Topicbox-Message-UUID: 03ebd31c-ead7-11e9-9d60-3106f5b1d025 On Fri, 22 Jul 2011 08:33:50 +0200 Lucio De Re wrote: > On Fri, Jul 22, 2011 at 05:36:42AM +0000, arnold@skeeve.com wrote: > > > > Does Go use things that are bison-specific? If not, maybe Berkeley Yacc > > (there are various versions around) would be easier to port. > > > That's why I ask about Bison experts, it's hard to tell how deep the > usage of bison-specific features goes without some familiarity. I do > suspect that there is a whole generation of programmers out there that > only knows the GNU dialects and I'm not a member of that club. > > I am only slightly curious about BSD Yacc (is that what NetBSD uses, > I wonder?) as my education stopped short of compiler construction > principles. Back then compiler generators were still a novelty. You shouldn't need to dig into yacc. I see from Make.* that has bison -y -d is used, which means it is supposed emulate posix yacc. Just to check I tried with yaccing with the FreeBSD yacc: *a/a.y -- ok cc/cc.y -- ok goyacc/units.y -- ok $ yacc gc/go.y yacc: e - line 120 of "go.y", syntax error %error-verbose ^ This is a bison dropping. I haven't looked at the go sources but hopefully this can be worked around easily. I didn't actually run any of the generated code but given the -y flag I have hopes.... In the worst can you can write a bison script around byacc and massage what needs to be. Try compiling /usr/src/usr.bin/yacc from *BSD. Let me know if you run into problems.