BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
586 stars 165 forks source link

Moving frontend files to directory #138

Closed robstewart57 closed 9 years ago

robstewart57 commented 9 years ago

This isn't a bug report, just a feature request. Currently with

bnfc -m --haskell Language.cf

I get LexLanguage.hs ParLanguage.hs SkelLanguage.hs PrintLanguage AbsLanguage.hs and ParLanguage.hs . Rather than being created in the same directory as Language.cf, what about instead an option to put these Haskell files in a sub directly, e.g. src. My reason for asking is that I'd like to integrate the Haskell files created with bnfc with a cabal project. My usual cabal setup is to have Haskell files in a src directory, which use the modules LexLanguage ParLanguage.. and son on. I don't think it's possible to have a cabal project that can see Haskell files in both . and ./src/ .

gdetrez commented 9 years ago

If I understood your request correctly, that feature is already implemented and will be available in the next version to be release very soon. You can try it with the code from git, the option is -o and should work with every language:

-o DIR --outputdir=DIR Redirects all generated files into DIR

robstewart57 commented 9 years ago

Terrific, thanks. That's exactly the functionality I was looking for. I've a project that depends on this command line flag, so I'll keep an eye out for when this feature is reflected on hackage, so that I can version bump my cabal file.

Thanks again.

On 3 May 2015 at 13:00, Grégoire Détrez notifications@github.com wrote:

If I understood your request correctly, that feature is already implemented and will be available in the next version to be release very soon. You can try it with the code from git, the option is -o and should work with every language:

-o DIR --outputdir=DIR Redirects all generated files into DIR

— Reply to this email directly or view it on GitHub https://github.com/BNFC/bnfc/issues/138#issuecomment-98474055.