GNU bug report logs -
#19020
improve support for flex in C++ mode
Previous Next
Full log
View this message in rfc822 format
retitle 19020 improve support for flex in C++ mode
tags 19020 + moreinfo
thanks
Reference: http://debbugs.gnu.org/19020
On 11/11/2014 11:51 AM, brahim sahbi wrote:
> Hello,
>
Hi, sorry for the delay.
> I am trying to use flex with these options
> AM_LFLAGS = --header-file=lang.h --yyclass=Lang --c++
> My problem is that the file generated by lex is lex.yy.cc and not lex.yy.c.
> So this command in the generated Makefile:
> .lpp.cpp:
> $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@
> -- $(LEXCOMPILE)
>
> turns my lang.lpp to lang.cppc
>
> I have looked in the ylwrap by launching it with $(SHELL) -x and had this
> printed
> ++ printf '%s\n' lex.yy.cc
> ++ sed 's|lex\.yy\.c|lang.cpp|g;'
> + to=lang.cppc
>
> Am I doing it worng or is this a bug?
>
This is sadly a limitation, in that we must assume that the output generated
by lex and flex when a '-o' option is not given is 'yy.lex.c' (this would
not be needed if we could assume the '-o' option works, but that assumption
is not portable enough yet). The --c++ option of flex seem to break this
expectation of the ylwrap script. I *think* it can be worked around by
explicitly adding "-o lex.yy.c" to your AM_LFLAGS. Can you verify that
solves your problem?
Thanks,
Stefano
This bug report was last modified 10 years and 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.