5

I currently using bison and flex in my project which has the following structure:

Project
|
|--include/
|--src/

all the headers are going into the include directory, and all the source files are going into the src directory. I have my grammars and the flexer grammar in the include directory, and I would like to have the generated header files also in the include directory, but the generated source files in the src directory. I there an option or something for bison to achieve this?

Brian
  • 3,850
  • 3
  • 21
  • 37
Exagon
  • 4,798
  • 6
  • 25
  • 53
  • Are you using bison or bisonc++? Please only use tags which apply to the actual tools you are using; otherwise, it is impossible to provide tool-specific answers. – rici Mar 02 '17 at 21:32

1 Answers1

5

Here is an excerpt of the output of bison --help with relevant command-line options:

$ bison --help
Output:
      --defines[=FILE]       also produce a header file
  -d                         likewise but cannot specify FILE (for POSIX Yacc)
  -b, --file-prefix=PREFIX   specify a PREFIX for output files
  -o, --output=FILE          leave output to FILE

And for flex:

$ flex --help
Files:
  -o, --outfile=FILE      specify output filename
rici
  • 234,347
  • 28
  • 237
  • 341