On Fri, 22 Jul 2011 17:37:32 +0200 Lucio De Re <[email protected]>  wrote:
> But until I clear my slate of a number of distractions, I can only ask
> more knowledgeable persons to look at the code and make suggestions to
> the Go Authors, directly or through my submissions to CodeReview, on
> how to eliminate Bison dependencies that make porting the Go code base
> to Plan 9 difficult.  Or help me deal with these problems in a manner
> that can be incorporated into the Go release.

go is too big and changes too fast so rather than try bend it
in the plan9 direction, my advice is to make *no* changes to
the go sources. Just use sed / ed scripts & patch to modify
what you need to during a build, and add some plan9 specific
files/scripts -- this is approach b) from my previous email --
usually what is done in *BSD ports. This can get a port up
quickly. You may still want to feed back changes to the
authors but this usually involves lengthy interactions and is
best done in background mode.

More specifically
1. comment out %error-version
2. fix plan9 yacc to handle apostrophes in // comments because
   that is a bug.  Alternatively sed 's,//.*,/* & */,'
3. if you find any other bison dependency, work around.
4. avoid porting bison!

I commented out %error-version and removed apostrophes in //
comments in go.y and now the plan9 yacc handles the syntax
fine.

Trying all.bash with yacc, I see that the output of awk script
"bisonerrors" fails. I don't have a great desire to port go to
plan9 so I stopped here but you can checkout what is done here
in the 9front port and/or compare bison y.output.c with yacc
y.output.c because y.output.c is what bisonerrors munges. My
guess is you will need a more or less equivalent yaccerrors
script. As Steve says you won't get nicer error handling but
so it goes.

Reply via email to