help-bison
[Top][All Lists]
Advanced

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

inserting into tab.h, after %union


From: Jeff Inman
Subject: inserting into tab.h, after %union
Date: Fri, 1 Dec 2006 16:22:38 -0700

Hi folks,

I'm running bison 2.3 on OSX 10.4.8

It seems wrong to me that the second set of "%{ ... %}", after a "% union{ ...}", should insert into the tab.cpp file, instead of into the tab.hpp file. I want to make more declarations that depend on the type produced by the union. It seems to me that the main purpose in allowing for a second set of %{ ... %} would be just that. If I wanted to generate text
into the tab.cpp file, I can do that after the final "%%".

I had thought this new capability would allow me to get rid of the little support file I used to need, which includes the tab.hpp file and then adds some more declarations. Then I'd include the support header file everywhere, instead of the tab.hpp file. I thought I would now be able to get rid of that and do everything in the grammar file itself, using the second "%{ %}"
body, and generate everything into the tab.hpp file.

Suggestions?  Am I missing something?

Thanks,

Jeff





Jeff Inman
Parallel and Distributed Visualization
Los Alamos National Laboratory
PO Box 1663, B287 / Los Alamos, NM 87545





reply via email to

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