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

Allow custom header code #1

Open
nox opened this issue Dec 14, 2010 · 3 comments
Open

Allow custom header code #1

nox opened this issue Dec 14, 2010 · 3 comments

Comments

@nox
Copy link
Contributor

nox commented Dec 14, 2010

In every generated grammar_mod.erl, abnfc automatically includes grammar_mod.hrl. The grammar files should provide a way to include custom header Erlang code instead of doing that.

@nygge
Copy link
Owner

nygge commented Dec 15, 2010

That mandatory include file is an artifact from an earlier version where it was used for including the "semantic" functions for each rule. It is on my TODO list to remove it and instead add to abnfc an option to specify any .hrl files to include.

@nox
Copy link
Contributor Author

nox commented Dec 15, 2010

Why not an equivalent feature to the Header statement in yecc?

@nygge
Copy link
Owner

nygge commented Dec 15, 2010

The header section in yecc is only usable for comments. It is included BEFORE the module declaration. What I had in mind was something like the includefile option to yecc:file/2. But it would be nice to have a header section that can contain any erlang code.

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