I have gotten so far as to implement two directives into Bison, in order to facilitate the writing of parsers for C+ and other languages. One directive has the form
%code <identifier> {<code>}
It creates a M4 macro based on the name <identifier>, with the expansion <code> braces "{" and "}" excluded. The idea is to enable one to place code more in detail. I decided to use a syntax that is better for entering code than %define. The other is a directive %typed, which merely triggers Bison's typing mechanism, without invoking the %union mechanism. It will be needed to be able to use static_cast and dynamic_cast in C++ type casting.


I need to experiment more with this, but perhaps it should be it into Bison.
--
  Hans Aberg




Reply via email to