Re: [Flex-help] Error changing yylex return.
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Fabricio S. P. <fab...@gm...> - 2016-03-05 16:30:52
|
On 03/04/2016 11:33 PM, Chris verBurg wrote: > I gave this a shot on my own (using the same version) and got it working > with a tweak. My next question: where did lex.yy.h come from? As far as I > know, flex does not generate header files unless you put it in C++ mode. I > got your main.c to compile by changing its include from "lex.yy.h" to > "lex.yy.c", and the resulting binary recognizes "test" input and prints out > "T: 2.000000". Chris the lex.yy.h came from flex command line option: Files: -o, --outfile=FILE specify output filename -S, --skel=FILE specify skeleton file -t, --stdout write scanner on stdout instead of lex.yy.c --yyclass=NAME name of C++ class --header-file=FILE create a C header file in addition to the scanner --header-file option > Of course the best-practices answer is to not to #include a .c file, but > rather add a bunch of extern declarations and link, blah blah blah... But > the point is the YY_DECL worked. > > -Chris > > > On Wed, Mar 2, 2016 at 6:13 AM, Fabricio S. Paranhos < > fab...@gm...> wrote: > >>> What version of flex are you running? >> >> flex 2.5.39 >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 >> -- >> Flex-help mailing list >> Fle...@li... >> https://lists.sourceforge.net/lists/listinfo/flex-help >> > -- Fabrício S. Paranhos |