Hi all,
I know it is a very old thread but I used it to implement my bison/flex parser with Qt, at least I tried.
I wrote a .pro file:
# Flex/bison specifics
FLEXSOURCES = VHDLParser.l
BISONSOURCES = VHDLParser.y
#flex definition
flex.name = Flex
flex.input = FLEXSOURCES
flex.output = ${QMAKE_FILE_BASE}.cpp
flex.commands = flex -i -o${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
#flex.CONFIG += target_predeps
flex.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += flex
#bison definition
bison.name = Bison
bison.input = BISONSOURCES
bison.output = ${QMAKE_FILE_BASE}.cpp
bison.commands = bison -d -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
bison.clean = position.hh stack.hh location.hh VHDLParser.hpp
bison.CONFIG += target_predeps
bison.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += bison
OTHER_FILES += \
$$BISONSOURCES \
$$FLEXSOURCES
# Flex/bison specifics
FLEXSOURCES = VHDLParser.l
BISONSOURCES = VHDLParser.y
#flex definition
flex.name = Flex
flex.input = FLEXSOURCES
flex.output = ${QMAKE_FILE_BASE}.cpp
flex.commands = flex -i -o${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
#flex.CONFIG += target_predeps
flex.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += flex
#bison definition
bison.name = Bison
bison.input = BISONSOURCES
bison.output = ${QMAKE_FILE_BASE}.cpp
bison.commands = bison -d -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
bison.clean = position.hh stack.hh location.hh VHDLParser.hpp
bison.CONFIG += target_predeps
bison.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += bison
OTHER_FILES += \
$$BISONSOURCES \
$$FLEXSOURCES
To copy to clipboard, switch view to plain text mode
But when I build my project, the flex compiler simply doesn't start. I can clearly see bison running in the console but not flex.
Of course, when comes the time to link every object files, it doesn't work beceause yylex() is missing ...
Please tell me what's wrong with this .pro.
Bookmarks