Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle location.hh, position.hh, and stack.hh #6

Open
nicmcd opened this issue Feb 5, 2021 · 1 comment
Open

Handle location.hh, position.hh, and stack.hh #6

nicmcd opened this issue Feb 5, 2021 · 1 comment

Comments

@nicmcd
Copy link

nicmcd commented Feb 5, 2021

out_src = ctx.actions.declare_file("{}.{}".format(ctx.attr.name, out_src_ext))

I have a bison ypp that uses both %defines and %locations, thus these files should be generated per https://www.gnu.org/software/bison/manual/html_node/C_002b_002b-Bison-Interface.html. Have you thought about how to handle these files? Otherwise, the compilation process won't work because the output source file contains # include "location.hh"

@jmillikin
Copy link
Owner

Definitions are handled by setting the --defines flag, and the resulting generated header file is available to dependent targets.

The GNU Bison flag --locations doesn't support passing in the path to the locations header output, so it's difficult to use that functionality from within Bazel. If a future version of Bison supports argv-specified location.hh paths, then rules_bison could support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants