flex-help Mailing List for flex: the fast lexical analyser (Page 4)
flex is a tool for generating scanners
Brought to you by:
wlestes
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(3) |
Jun
(4) |
Jul
(10) |
Aug
(6) |
Sep
(20) |
Oct
(30) |
Nov
(10) |
Dec
(40) |
2007 |
Jan
(25) |
Feb
(18) |
Mar
(34) |
Apr
(36) |
May
(29) |
Jun
(1) |
Jul
(35) |
Aug
(5) |
Sep
(7) |
Oct
(15) |
Nov
(16) |
Dec
(13) |
2008 |
Jan
(11) |
Feb
(23) |
Mar
(17) |
Apr
(32) |
May
(7) |
Jun
(20) |
Jul
(2) |
Aug
(13) |
Sep
(13) |
Oct
(16) |
Nov
(3) |
Dec
(17) |
2009 |
Jan
(10) |
Feb
(10) |
Mar
(13) |
Apr
(3) |
May
(25) |
Jun
(11) |
Jul
(1) |
Aug
(17) |
Sep
(19) |
Oct
(9) |
Nov
(20) |
Dec
(22) |
2010 |
Jan
(29) |
Feb
(13) |
Mar
(11) |
Apr
(10) |
May
(9) |
Jun
(13) |
Jul
(4) |
Aug
(28) |
Sep
(8) |
Oct
(8) |
Nov
(4) |
Dec
(7) |
2011 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(2) |
Jun
(7) |
Jul
(12) |
Aug
(10) |
Sep
(6) |
Oct
(14) |
Nov
(1) |
Dec
(9) |
2012 |
Jan
(6) |
Feb
(1) |
Mar
(13) |
Apr
(4) |
May
(5) |
Jun
(1) |
Jul
(6) |
Aug
(18) |
Sep
(12) |
Oct
(46) |
Nov
(7) |
Dec
(4) |
2013 |
Jan
(2) |
Feb
(3) |
Mar
|
Apr
(5) |
May
(2) |
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(16) |
Dec
(1) |
2014 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(11) |
May
|
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(7) |
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(11) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2016 |
Jan
(1) |
Feb
(4) |
Mar
(6) |
Apr
(2) |
May
(15) |
Jun
(19) |
Jul
(10) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
(4) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(4) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Dennis C. <dc...@bl...> - 2016-05-21 17:35:40
|
On 05/21/2016 08:36 AM, Will Estes wrote: > Hi! Yes, your continued work on blastwave is an inspiration. > I have been running a full software stack in production within a financial services company for four years and the whole stack from top to bottom is full 64-bit and has Apache 2.4.20 with top of the line PHP and a bucket of other goodies. The big snag has been MySQL lately. However I am working that out with kitware and it will be off the ground for a release of a commercial grade stack in "real soon now" timeline. Also .. you should see the new Oracle SPARC gear .. it's amazing. Dennis |
From: Will E. <wes...@gm...> - 2016-05-21 12:36:35
|
Hi! Yes, your continued work on blastwave is an inspiration. On Saturday, 21 May 2016, 2:54 am -0400, Dennis Clarke <dc...@bl...> wrote: > On 05/20/2016 08:44 PM, Will Estes wrote: > > Yes. Recompile is best, although there's hardly anything inside libfl, so compatibility at that level isn't an issue. > > > > > When a "soname" changes the best thing is just to recompile the > dependants. Also, by the way, Hi! long time since I crawled over flex > and I think a new package is needed anyways. Good the see the same > names in the same places doing what we do :-) > > Dennis > > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |
From: Dennis C. <dc...@bl...> - 2016-05-21 06:54:24
|
On 05/20/2016 08:44 PM, Will Estes wrote: > Yes. Recompile is best, although there's hardly anything inside libfl, so compatibility at that level isn't an issue. > When a "soname" changes the best thing is just to recompile the dependants. Also, by the way, Hi! long time since I crawled over flex and I think a new package is needed anyways. Good the see the same names in the same places doing what we do :-) Dennis |
From: Will E. <wes...@gm...> - 2016-05-21 00:44:44
|
Yes. Recompile is best, although there's hardly anything inside libfl, so compatibility at that level isn't an issue. On Friday, 20 May 2016, 8:15 pm -0400, Dennis Clarke <dc...@bl...> wrote: > On 05/19/2016 03:19 PM, Will Estes wrote: > >Absolutely. The change was made when changing how the libraries are built. libtool recommended some settings and just to be clear that things worked differently on the build end, I set the version to 2:0. > > > > > yikes .. so in the ELF header of any downstream binary that needs the > previous version we need to either create a hack symlink or re-compile. > > Okay .. maybe a re-compile is a better way to go anyways. > > Dennis > -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |
From: Dennis C. <dc...@bl...> - 2016-05-21 00:27:39
|
On 05/19/2016 03:19 PM, Will Estes wrote: > Absolutely. The change was made when changing how the libraries are built. libtool recommended some settings and just to be clear that things worked differently on the build end, I set the version to 2:0. > yikes .. so in the ELF header of any downstream binary that needs the previous version we need to either create a hack symlink or re-compile. Okay .. maybe a re-compile is a better way to go anyways. Dennis |
From: Will E. <wes...@gm...> - 2016-05-20 22:12:40
|
The bootstrapping of flex was reworked after 2.6.1 was released. I -think- it's immune to the vpath build that you do. If you can verify that against the current git tree, let me know the results. Ditto the building of the man page. As for finding m4, the solution needs to be more general. While what you do works for people who want to use the stock setup on Solaris, I can easily see other situations where it doesn't do enough. I'll open an issue to describe the problem. What should happen is that configure should have an option that accepts a path to a suitable m4 binary. If that option is passed, then configure sets a variable that gets put into config.h which main.c reads. If that option is not passed, then configure should try to find a suitable m4 and set the symbol as previously. The M4 environment variable is handy for certain situations that might arise as well. Thanks for your report and interest in flex. On Friday, 20 May 2016, 8:02 am -0700, Rich Burridge <ric...@or...> wrote: > Hi, > > In trying to get flex 2.6.1 working in the build environment we > use for FOSS components in Solaris, I encountered three problems > which I was easily able to patch around. Please consider these > changes for a future version of flex. > > 1/ In flex-2.6.1/src/Makefile.am there is a rule: > > stage1scan.l: scan.l > cp $(srcdir)/scan.l $(srcdir)/stage1scan.l > > For Solaris, we don't build things directly in the original source > directories, but use a separate build directory. So we need to apply > the following patch: > > --- flex-2.6.1/src/Makefile.am.orig 2016-05-19 06:21:16.631609293 -0700 > +++ flex-2.6.1/src/Makefile.am 2016-05-19 14:19:29.394717203 -0700 > @@ -87,7 +87,7 @@ > mv skel.c.tmp $(srcdir)/skel.c > > stage1scan.l: scan.l > - cp $(srcdir)/scan.l $(srcdir)/stage1scan.l > + cp $(srcdir)/scan.l $(top_builddir)/src/stage1scan.l > > stage1scan.c: stage1scan.l stage1flex$(EXEEXT) > $(top_builddir)/src/stage1flex$(EXEEXT) -o $@ $< > > 2/ Similarly, in flex-2.6.1/doc/Makefile.am we need to run help2man on > a flex file that's been created in the build directory not the source > directory, so we need to apply this patch: > > --- flex-2.6.1/doc/Makefile.am.orig 2016-05-19 06:45:26.670565152 -0700 > +++ flex-2.6.1/doc/Makefile.am 2016-05-19 06:45:45.734263762 -0700 > @@ -26,5 +26,5 @@ > for i in $(dist_man_MANS) ; do \ > $(help2man) --name='$(PACKAGE_NAME)' \ > --section=`echo $$i | sed -e 's/.*\.\([^.]*\)$$/\1/'` \ > - $(top_srcdir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \ > + $(top_builddir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \ > done > > 3/ The third one is a Solaris specific problem. In /usr/bin, the Solaris > version > of m4 doesn't understand the -P command line option, so fails when it's > part of the chain in flex. We have the GNU m4 binary under /usr/gnu/bin. > We can't rely on the M4 environment variable always being set, or that > /usr/gnu/bin will be found in the PATH environment variable before > /usr/bin, > so the existing logic in flex-2.6.1/src/main.c to find m4 doesn't > work correctly > on Solaris. I've fixed this by using the following patch: > > --- flex-2.6.1/src/main.c.orig 2016-05-19 14:36:18.569346881 -0700 > +++ flex-2.6.1/src/main.c 2016-05-20 07:59:04.169569771 -0700 > @@ -348,6 +348,7 @@ > > /* Setup the filter chain. */ > output_chain = filter_create_int(NULL, filter_tee_header, > headerfilename); > +#ifndef __sun > if ( !(m4 = getenv("M4"))) { > char *slash; > m4 = M4; > @@ -389,6 +390,9 @@ > } > } > filter_create_ext(output_chain, m4, "-P", 0); > +#else > + filter_create_ext(output_chain, "/usr/gnu/bin/m4", "-P", 0); > +#endif > filter_create_int(output_chain, filter_fix_linedirs, NULL); > > /* For debugging, only run the requested number of filters. */ > > > > Thanks. > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |
From: Will E. <wes...@gm...> - 2016-05-20 16:47:02
|
A couple thoughts: Yes, configure tries to find m4. There should be a way to specify it though, and whatever the result of "all that" is, that's what main.c should use. Probably by setting a value in config.h, now that I think about it. Some of this is done in the git tree at https://github.com/westes/flex/, post 2.6.1. If you submit patches against that -- particularly if you submit a pull request -- that makes the paperwork go a bit easier. I've got your submitted changes in my queue to review. On Friday, 20 May 2016, 9:14 am -0700, Rich Burridge <ric...@or...> wrote: > On 05/20/2016 08:02 AM, Rich Burridge wrote: > > ... > > 3/ The third one is a Solaris specific problem. In /usr/bin, the > > Solaris version > > of m4 doesn't understand the -P command line option, so fails when > > it's > > part of the chain in flex. We have the GNU m4 binary under > > /usr/gnu/bin. > > We can't rely on the M4 environment variable always being set, or that > > /usr/gnu/bin will be found in the PATH environment variable before > > /usr/bin, > > so the existing logic in flex-2.6.1/src/main.c to find m4 doesn't > > work correctly > > on Solaris. I've fixed this by using the following patch: > > > > --- flex-2.6.1/src/main.c.orig 2016-05-19 14:36:18.569346881 -0700 > > +++ flex-2.6.1/src/main.c 2016-05-20 07:59:04.169569771 -0700 > > @@ -348,6 +348,7 @@ > > > > /* Setup the filter chain. */ > > output_chain = filter_create_int(NULL, filter_tee_header, > > headerfilename); > > +#ifndef __sun > > if ( !(m4 = getenv("M4"))) { > > char *slash; > > m4 = M4; > > @@ -389,6 +390,9 @@ > > } > > } > > filter_create_ext(output_chain, m4, "-P", 0); > > +#else > > + filter_create_ext(output_chain, "/usr/gnu/bin/m4", "-P", 0); > > +#endif > > filter_create_int(output_chain, filter_fix_linedirs, NULL); > > > > /* For debugging, only run the requested number of filters. */ > > To reply to my own post. > > It was pointed out to me that a better solution here would be for > the flex configure script to provide a --with-m4 option, and that > that was passed done and used in .../src/main.c > > Thanks. > > > > > > > > > Thanks. > > > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes wes...@gm... |
From: Rich B. <ric...@or...> - 2016-05-20 16:14:30
|
On 05/20/2016 08:02 AM, Rich Burridge wrote: > ... > 3/ The third one is a Solaris specific problem. In /usr/bin, the > Solaris version > of m4 doesn't understand the -P command line option, so fails when > it's > part of the chain in flex. We have the GNU m4 binary under > /usr/gnu/bin. > We can't rely on the M4 environment variable always being set, or that > /usr/gnu/bin will be found in the PATH environment variable before > /usr/bin, > so the existing logic in flex-2.6.1/src/main.c to find m4 doesn't > work correctly > on Solaris. I've fixed this by using the following patch: > > --- flex-2.6.1/src/main.c.orig 2016-05-19 14:36:18.569346881 -0700 > +++ flex-2.6.1/src/main.c 2016-05-20 07:59:04.169569771 -0700 > @@ -348,6 +348,7 @@ > > /* Setup the filter chain. */ > output_chain = filter_create_int(NULL, filter_tee_header, > headerfilename); > +#ifndef __sun > if ( !(m4 = getenv("M4"))) { > char *slash; > m4 = M4; > @@ -389,6 +390,9 @@ > } > } > filter_create_ext(output_chain, m4, "-P", 0); > +#else > + filter_create_ext(output_chain, "/usr/gnu/bin/m4", "-P", 0); > +#endif > filter_create_int(output_chain, filter_fix_linedirs, NULL); > > /* For debugging, only run the requested number of filters. */ To reply to my own post. It was pointed out to me that a better solution here would be for the flex configure script to provide a --with-m4 option, and that that was passed done and used in .../src/main.c Thanks. > > > > Thanks. > |
From: Rich B. <ric...@or...> - 2016-05-20 15:02:14
|
Hi, In trying to get flex 2.6.1 working in the build environment we use for FOSS components in Solaris, I encountered three problems which I was easily able to patch around. Please consider these changes for a future version of flex. 1/ In flex-2.6.1/src/Makefile.am there is a rule: stage1scan.l: scan.l cp $(srcdir)/scan.l $(srcdir)/stage1scan.l For Solaris, we don't build things directly in the original source directories, but use a separate build directory. So we need to apply the following patch: --- flex-2.6.1/src/Makefile.am.orig 2016-05-19 06:21:16.631609293 -0700 +++ flex-2.6.1/src/Makefile.am 2016-05-19 14:19:29.394717203 -0700 @@ -87,7 +87,7 @@ mv skel.c.tmp $(srcdir)/skel.c stage1scan.l: scan.l - cp $(srcdir)/scan.l $(srcdir)/stage1scan.l + cp $(srcdir)/scan.l $(top_builddir)/src/stage1scan.l stage1scan.c: stage1scan.l stage1flex$(EXEEXT) $(top_builddir)/src/stage1flex$(EXEEXT) -o $@ $< 2/ Similarly, in flex-2.6.1/doc/Makefile.am we need to run help2man on a flex file that's been created in the build directory not the source directory, so we need to apply this patch: --- flex-2.6.1/doc/Makefile.am.orig 2016-05-19 06:45:26.670565152 -0700 +++ flex-2.6.1/doc/Makefile.am 2016-05-19 06:45:45.734263762 -0700 @@ -26,5 +26,5 @@ for i in $(dist_man_MANS) ; do \ $(help2man) --name='$(PACKAGE_NAME)' \ --section=`echo $$i | sed -e 's/.*\.\([^.]*\)$$/\1/'` \ - $(top_srcdir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \ + $(top_builddir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \ done 3/ The third one is a Solaris specific problem. In /usr/bin, the Solaris version of m4 doesn't understand the -P command line option, so fails when it's part of the chain in flex. We have the GNU m4 binary under /usr/gnu/bin. We can't rely on the M4 environment variable always being set, or that /usr/gnu/bin will be found in the PATH environment variable before /usr/bin, so the existing logic in flex-2.6.1/src/main.c to find m4 doesn't work correctly on Solaris. I've fixed this by using the following patch: --- flex-2.6.1/src/main.c.orig 2016-05-19 14:36:18.569346881 -0700 +++ flex-2.6.1/src/main.c 2016-05-20 07:59:04.169569771 -0700 @@ -348,6 +348,7 @@ /* Setup the filter chain. */ output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); +#ifndef __sun if ( !(m4 = getenv("M4"))) { char *slash; m4 = M4; @@ -389,6 +390,9 @@ } } filter_create_ext(output_chain, m4, "-P", 0); +#else + filter_create_ext(output_chain, "/usr/gnu/bin/m4", "-P", 0); +#endif filter_create_int(output_chain, filter_fix_linedirs, NULL); /* For debugging, only run the requested number of filters. */ Thanks. |
From: Rich B. <ric...@or...> - 2016-05-19 19:34:27
|
On 05/19/2016 12:19 PM, Will Estes wrote: > Absolutely. The change was made when changing how the libraries are built. libtool recommended some settings and just to be clear that things worked differently on the build end, I set the version to 2:0. Thanks. Then until we are sure we've migrated all our flex consumers over to the new version, I'll add in a sym-link from libfl.so.1 to libfl.so.2.0.0 |
From: Will E. <wes...@gm...> - 2016-05-19 19:19:40
|
Absolutely. The change was made when changing how the libraries are built. libtool recommended some settings and just to be clear that things worked differently on the build end, I set the version to 2:0. On Thursday, 19 May 2016, 12:15 pm -0700, Rich Burridge <ric...@or...> wrote: > > Hi, > > I'm in the process of updating the version of flex we have in Solaris > to 2.6.1 and noticed that the library SONAME is now libfl.so.2 > (was libfl.so.1 in the version we've currently got). > > I've looked through the NEWS file but was unable to determine why it > was bumped. Are the two versions binary / ABI compatible? In other > words, for binary compatibility can I provide a sym-link from libfl.so.1 > to libfl.so.2 (really libfl.so.2.0.)? > > Thanks. > > > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |
From: Rich B. <ric...@or...> - 2016-05-19 19:15:31
|
Hi, I'm in the process of updating the version of flex we have in Solaris to 2.6.1 and noticed that the library SONAME is now libfl.so.2 (was libfl.so.1 in the version we've currently got). I've looked through the NEWS file but was unable to determine why it was bumped. Are the two versions binary / ABI compatible? In other words, for binary compatibility can I provide a sym-link from libfl.so.1 to libfl.so.2 (really libfl.so.2.0.)? Thanks. |
From: Will E. <wes...@gm...> - 2016-04-01 14:29:18
|
You need a POSIX-compliant environment. If MS Windows provides that, then yes. There's some work ahead that may make this easier. Otherwise, see what cygwin/mingw/etc do. Beyond that: What have you tried and what problem are you trying to solve? On Friday, 1 April 2016, 7:28 pm +0530, "yogeshldeshmukh ." <yog...@gm...> wrote: > Hi, > > I want to know if I can build flex on Windows instead of taking some binary > distributions for windows. > If yes then what are the steps for that > > Regards, > Yogesh > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 > -- > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |
From: yogeshldeshmukh . <yog...@gm...> - 2016-04-01 13:58:08
|
Hi, I want to know if I can build flex on Windows instead of taking some binary distributions for windows. If yes then what are the steps for that Regards, Yogesh |
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 |
From: Chris v. <che...@gm...> - 2016-03-05 02:33:35
|
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". 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 > |
From: Fabricio S. P. <fab...@gm...> - 2016-03-02 14:14:09
|
> What version of flex are you running? flex 2.5.39 |
From: Will E. <wes...@gm...> - 2016-03-02 01:41:14
|
What version of flex are you running? On Tuesday, 1 March 2016, 10:13 pm -0300, "Fabricio S. Paranhos" <fab...@gm...> wrote: > I did some test to discovery what is going on. > I forward declared the new yylex inside my main file and everything went > OK. For some reason flex is not including the new declaration inside the > header file. > > Here some simple example in gist [1]. The file main2.c is main.c after > gcc preprocessor "gcc -E" > > The generated header file has the new yylex declaration: > >#ifndef yyHEADER_H > >#define yyHEADER_H 1 > >#define yyIN_HEADER 1 > > > >#line 2 "flex.l" > >#define YY_DECL double yylex(yyscan_t yyscanner) > > > > > > > >#line 11 "lex.yy.h" > > But after passing through compiler preprocessor it's removed, as you can > see in the main2.c file, and I have to forward declared the new > function. I don't know if this is the correct behavior or is a bug. > > [1] https://gist.github.com/anonymous/ec6d47fe8d7822f0e554 > > > On 02/29/2016 10:37 PM, Chris verBurg wrote: > > Hey Fabricio, > > > > To first order, your code all looks fine to me. It seems like your > > redeclaration is not making it into main.c -- I'd suggest maybe next > > looking at the generated flex.h and seeing what it's doing with YY_DECL and > > yylex. Maybe your %{..%} block has to be moved earlier or later in the > > first section? > > > > -Chris > > > > > > > > On Mon, Feb 29, 2016 at 2:06 PM, Fabricio S. Paranhos < > > fab...@gm...> wrote: > > > >> Hello, > >> > >> I'm trying to change the default return value (int) from yylex to a > >> structure. According to FLEX manual it's possible to change how yylex is > >> declared[1]: > >> > >> >This definition may be changed by defining the YY_DECL macro. For > >> >example, you could use: > >> > > >> > #define YY_DECL float lexscan( a, b ) float a, b; > >> > > >> > >> In my flex file I declared this way: > >> > >> >#define YY_DECL struct token yylex(yyscan_t yyscanner) > >> > >> But after using this macro and compiling the final main program I got > >> the following GCC error: > >> > >> >main.c: In function ‘main’: > >> >main.c:14:7: error: incompatible types when assigning to type ‘struct > >> >token’ from type ‘int’ > >> > lol = yylex(scanner); > >> > >> > >> Even after changing how yylex is declared the final result didn't > >> change. After some search on the web I found this[2] stack overflow > >> question, but I got the same error from GCC... > >> > >> Anybody can help? > >> > >> Here are some additional info: > >> OS: Debian 8 64bit > >> GCC: Debian 4.9.2-10 4.9.2 > >> Flex: 2.5.39 > >> > >> And here are my source files: > >> https://gist.github.com/anonymous/49beeae0d85b4a7f91d6 > >> > >> Thanks in advance. > >> > >> [1] > >> http://flex.sourceforge.net/manual/Generated-Scanner.html#Generated-Scanner > >> [2] > >> https://stackoverflow.com/questions/3796598/returning-non-ints-from-yylex > >> -- > >> Fabrício S. Paranhos > >> > >> > >> ------------------------------------------------------------------------------ > >> 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 > > ------------------------------------------------------------------------------ > 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 -- Will Estes Flex Project Maintainer wes...@gm... https://github.com/westes/flex |
From: Fabricio S. P. <fab...@gm...> - 2016-03-02 01:13:54
|
I did some test to discovery what is going on. I forward declared the new yylex inside my main file and everything went OK. For some reason flex is not including the new declaration inside the header file. Here some simple example in gist [1]. The file main2.c is main.c after gcc preprocessor "gcc -E" The generated header file has the new yylex declaration: >#ifndef yyHEADER_H >#define yyHEADER_H 1 >#define yyIN_HEADER 1 > >#line 2 "flex.l" >#define YY_DECL double yylex(yyscan_t yyscanner) > > > >#line 11 "lex.yy.h" But after passing through compiler preprocessor it's removed, as you can see in the main2.c file, and I have to forward declared the new function. I don't know if this is the correct behavior or is a bug. [1] https://gist.github.com/anonymous/ec6d47fe8d7822f0e554 On 02/29/2016 10:37 PM, Chris verBurg wrote: > Hey Fabricio, > > To first order, your code all looks fine to me. It seems like your > redeclaration is not making it into main.c -- I'd suggest maybe next > looking at the generated flex.h and seeing what it's doing with YY_DECL and > yylex. Maybe your %{..%} block has to be moved earlier or later in the > first section? > > -Chris > > > > On Mon, Feb 29, 2016 at 2:06 PM, Fabricio S. Paranhos < > fab...@gm...> wrote: > >> Hello, >> >> I'm trying to change the default return value (int) from yylex to a >> structure. According to FLEX manual it's possible to change how yylex is >> declared[1]: >> >> >This definition may be changed by defining the YY_DECL macro. For >> >example, you could use: >> > >> > #define YY_DECL float lexscan( a, b ) float a, b; >> > >> >> In my flex file I declared this way: >> >> >#define YY_DECL struct token yylex(yyscan_t yyscanner) >> >> But after using this macro and compiling the final main program I got >> the following GCC error: >> >> >main.c: In function ‘main’: >> >main.c:14:7: error: incompatible types when assigning to type ‘struct >> >token’ from type ‘int’ >> > lol = yylex(scanner); >> >> >> Even after changing how yylex is declared the final result didn't >> change. After some search on the web I found this[2] stack overflow >> question, but I got the same error from GCC... >> >> Anybody can help? >> >> Here are some additional info: >> OS: Debian 8 64bit >> GCC: Debian 4.9.2-10 4.9.2 >> Flex: 2.5.39 >> >> And here are my source files: >> https://gist.github.com/anonymous/49beeae0d85b4a7f91d6 >> >> Thanks in advance. >> >> [1] >> http://flex.sourceforge.net/manual/Generated-Scanner.html#Generated-Scanner >> [2] >> https://stackoverflow.com/questions/3796598/returning-non-ints-from-yylex >> -- >> Fabrício S. Paranhos >> >> >> ------------------------------------------------------------------------------ >> 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 |
From: Chris v. <che...@gm...> - 2016-03-01 01:37:57
|
Hey Fabricio, To first order, your code all looks fine to me. It seems like your redeclaration is not making it into main.c -- I'd suggest maybe next looking at the generated flex.h and seeing what it's doing with YY_DECL and yylex. Maybe your %{..%} block has to be moved earlier or later in the first section? -Chris On Mon, Feb 29, 2016 at 2:06 PM, Fabricio S. Paranhos < fab...@gm...> wrote: > Hello, > > I'm trying to change the default return value (int) from yylex to a > structure. According to FLEX manual it's possible to change how yylex is > declared[1]: > > >This definition may be changed by defining the YY_DECL macro. For > >example, you could use: > > > > #define YY_DECL float lexscan( a, b ) float a, b; > > > > In my flex file I declared this way: > > >#define YY_DECL struct token yylex(yyscan_t yyscanner) > > But after using this macro and compiling the final main program I got > the following GCC error: > > >main.c: In function ‘main’: > >main.c:14:7: error: incompatible types when assigning to type ‘struct > >token’ from type ‘int’ > > lol = yylex(scanner); > > > Even after changing how yylex is declared the final result didn't > change. After some search on the web I found this[2] stack overflow > question, but I got the same error from GCC... > > Anybody can help? > > Here are some additional info: > OS: Debian 8 64bit > GCC: Debian 4.9.2-10 4.9.2 > Flex: 2.5.39 > > And here are my source files: > https://gist.github.com/anonymous/49beeae0d85b4a7f91d6 > > Thanks in advance. > > [1] > http://flex.sourceforge.net/manual/Generated-Scanner.html#Generated-Scanner > [2] > https://stackoverflow.com/questions/3796598/returning-non-ints-from-yylex > -- > Fabrício S. Paranhos > > > ------------------------------------------------------------------------------ > 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 > |
From: Fabricio S. P. <fab...@gm...> - 2016-02-29 22:06:23
|
Hello, I'm trying to change the default return value (int) from yylex to a structure. According to FLEX manual it's possible to change how yylex is declared[1]: >This definition may be changed by defining the YY_DECL macro. For >example, you could use: > > #define YY_DECL float lexscan( a, b ) float a, b; > In my flex file I declared this way: >#define YY_DECL struct token yylex(yyscan_t yyscanner) But after using this macro and compiling the final main program I got the following GCC error: >main.c: In function ‘main’: >main.c:14:7: error: incompatible types when assigning to type ‘struct >token’ from type ‘int’ > lol = yylex(scanner); Even after changing how yylex is declared the final result didn't change. After some search on the web I found this[2] stack overflow question, but I got the same error from GCC... Anybody can help? Here are some additional info: OS: Debian 8 64bit GCC: Debian 4.9.2-10 4.9.2 Flex: 2.5.39 And here are my source files: https://gist.github.com/anonymous/49beeae0d85b4a7f91d6 Thanks in advance. [1] http://flex.sourceforge.net/manual/Generated-Scanner.html#Generated-Scanner [2] https://stackoverflow.com/questions/3796598/returning-non-ints-from-yylex -- Fabrício S. Paranhos |
From: Ángel G. <an...@le...> - 2016-02-26 00:17:11
|
El mié, 24-02-2016 a las 22:37 +0100, Roberto Valverde Cameselle escribió: > Hello to all, I’m new to flex and i wanted to know how to parse a C > example file and when a #define statement is found, substitute all > the instances of that constant with its value. For example: > > <input file> > > #define TRUE 1 Do you only care about "#define" NAME VALUE, or do you want to properly parse full macros, too? Also, I wonder if directly calling the C preprocessor (cpp / cc -E) wouldn't solve your use case better than developing a new tool with flex… |
From: Arthur <asc...@at...> - 2016-02-24 23:17:24
|
Hi Roberto; The real answer is that is a parser issue, not a lexer issue. flex is a lexer. Bison (bYacc,, ...) are parsers. The lex constructs are straight forward, for example: # can be a token define can be a token TRUE can be a token 1 is an integer In the parser you would do something like: define : '#' define_token ident_token int_token { code } ; I am greatly simplifying but the lexer returns tokens, the parser recognizes a particular configuration of the tokens, in this case a define statement, and the code is code you insert to take some action. Your question is fairly vague and I have provided a fairly vague answer. The key point is that flex passes tokens to, e.g., bison and bison does all the heavy lifting. In general, the lexer does not have the power to do much, it is a regular expression processor. Parsers are normally written in BNF. You can look online for C language BNF. If this does not answer your question, ask again. If the terms are unfamiliar to you, ask about the terms. If you have never, ever done something like this before, then get a book on compiler theory and take a look at what it says. I hope that this helps (a little). art On 2/24/2016 1:37 PM, Roberto Valverde Cameselle wrote: > Hello to all, I’m new to flex and i wanted to know how to parse a C example file and when a #define statement is found, substitute all the instances of that constant with its value. For example: > > <input file> > > #define TRUE 1 > … > > … > … > .. > > a = TRUE; > … > > > <output file> > > … > .. > … > ... > > a = 1; > > > is this possible? > > Thank you in advance! > ------------------------------------------------------------------------------ > 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 |
From: Roberto V. C. <rvc...@es...> - 2016-02-24 21:44:42
|
Hello to all, I’m new to flex and i wanted to know how to parse a C example file and when a #define statement is found, substitute all the instances of that constant with its value. For example: <input file> #define TRUE 1 … … … .. a = TRUE; … <output file> … .. … ... a = 1; is this possible? Thank you in advance! |
From: abhishek g. <zea...@ya...> - 2016-01-05 07:52:40
|
I am facing some issue in flex with 2.5.4 version and not able to figure out issue. In recent, Rhel machine has upgraded to 6.5 from 5 - Can I replace class istream with #include <isotream> using namespace std; in lexer.l file - if yes, what should I write into lexer.l file. - In flex-2.5.3 it generate #include<iostream> using namespace std only - I am not able to use flex-2.5.3 as it does not support RHEL6 machine. - if I want to use -skel option.How can I use it.? The lexer.l (modify to create simple test case){ /* need this for the call to atof() below */ #include <math.h> #include <string> #include <iostream> #undef yyFlexLexer #define yyFlexLexer hSpiceConverterFlexer using namespace std; static bool a = true; %} %option c++ debug %% %{ string copyText; %} %% The generated scanner file(The file is big so adding problem part)/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include <stdlib.h> class istream; #include <unistd.h> if class istream replace with <iostream> using namespace std; I am able to compile with gcc The error which I get with class istreamex.yy.cc: In member function ¡virtual int hSpiceConverterFlexer::yylex()¢: lex.yy.cc:987:37: error: cannot convert ¡std::istream* {aka std::basic_istream<char>*}¢ to ¡istream*¢ in assignment lex.yy.cc: At global scope: lex.yy.cc:1095:25: error: expected constructor, destructor, or type conversion before ¡(¢ token lex.yy.cc:1130:35: error: variable or field ¡switch_streams¢ declared void lex.yy.cc:1130:35: error: reference to ¡istream¢ is ambiguous lexer.cpp:24:7: note: candidates are: class istream class istream; ^ In file included from /depotbld/RHEL6.0/gcc-4.8.2/include/c++/4.8.2/ios:38:0, from /depotbld/RHEL6.0/gcc-4.8.2/include/c++/4.8.2/ostream:38, from /depotbld/RHEL6.0/gcc-4.8.2/include/c++/4.8.2/iostream:39, from ../include/FlexLexer.h:47, from lexer.cpp:239: /depotbld/RHEL6.0/gcc-4.8.2/include/c++/4.8.2/iosfwd:133:33: note: typedef class std::basic_istream<char> std::istream typedef basic_istream<char> istream; ^ lex.yy.cc:1130:44: error: ¡new_in¢ was not declared in this scope lex.yy.cc:1130:59: error: expected primary-expression before ¡*¢ token lex.yy.cc:1130:61: error: ¡new_out¢ was not declared in this scope lexer.cpp:209:14: warning: ¡void* yy_flex_alloc(yy_size_t)¢ declared ¡static¢ but never defined [-Wunused-function] static void *yy_flex_alloc YY_PROTO(( yy_size_t )); ^ lexer.cpp:210:14: warning: ¡void* yy_flex_realloc(void*, yy_size_t)¢ declared ¡static¢ but never defined [-Wunused-function] static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); ^ lexer.cpp:211:13: warning: ¡void yy_flex_free(void*)¢ declared ¡static¢ but never defined [-Wunused-function] static void yy_flex_free YY_PROTO(( void * )); Thanks Abhishek Goswami Phone No -07829580867/9962270999 Skype : abhishekgoswami1 |