flex-devel Mailing List for flex: the fast lexical analyser (Page 12)
flex is a tool for generating scanners
Brought to you by:
wlestes
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2007 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(3) |
2008 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
(33) |
Nov
(4) |
Dec
(4) |
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(10) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2012 |
Jan
|
Feb
(11) |
Mar
(12) |
Apr
|
May
|
Jun
(3) |
Jul
(62) |
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(33) |
Dec
(31) |
2016 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(4) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: ruertar <ru...@gm...> - 2008-08-23 12:44:26
|
Hello! I don't know if it his has been touched on before but I was wondering if it would make sense to make reentrant scanner generation default and have a fallback-mode for traditional, old-style scanners? -ayan |
From: ruertar <ru...@gm...> - 2008-08-23 11:08:29
|
There are a few cases where flex will output "Input line too long" when it could be more descriptive. We've had at least one question one the flex-help list about a difficult to track down "input line too long" error. I think simple but descriptive error messages like these would have helped. |
From: Logan M. <nev...@ze...> - 2008-04-22 17:12:01
|
Zdravstvuyte! Ya predstavitel' krupnoy ukrainskoy firmy, kotoraya zanimaetsya razrabotkoy programmnogo obespecheniya! V dannyy moment nam trebuyutsya regional'nye predstaviteli. Horoshaya oplata, gibkie usloviya raboty. Esli vy zaineteresovanny - pojaluysta vyshlite vashe rezyume na email mor...@gm... i v pis'me ukajite kakie yazyki znaete i kontaktnii telefon. Nashi menedjery svyajutsya s vami v blijayshee vremya. Hello! I am the representative of the large Ukrainian firm, which is engaged in software development. At the moment regional representatives are required to us. Good payment, flexible operating conditions. If you are interested to work with us , please send your resume to e-mail mor...@gm... and in the letter specify what languages you know(German,Russian,English). Our managers will contact you in the nearest time. Sehr geehrte Dammen und Herren, Ich bin der Vertreter der grossen ukrainischen Firme, die sich auf der Erarbeitung der Software spezialisiert. Im Moment brauchen wir den Regional Manager. Gute Bezahlung und flexible Arbeitsbedienung sind garantiert. Wenn Sie dazu Interesse haben, schiecken Sie uns bitte Ihre Bewerbung auf die Email: mor...@gm... , und schreiben Sie bitte uns welche Sprache Sie kennen. Unsere Manager werden sich mit Ihnen in die allernaechste Zeit verbinden. |
From: Elwood B. <mar...@xl...> - 2008-04-16 13:59:26
|
We are offering a JOB with a salary starting from 000 up to $10 per month. Only for Canadians. Requirements: You need to have at least one bank account in Canada. visit us at http://www.gnu-budget.com Kind Regards. |
From: Takisha M. <sho...@hu...> - 2008-03-17 21:44:44
|
Hello, +-------------------------------------------+ Warning! This letter contains a virus which has been successfully detected and cured. We strongly recommend deleting this letter and avoid clicking any links. +-------------------------------------------+ [RBN Networks Antivirus] Those of gettysburg and vicksburg. At last, after pushing back his coat to show the star on his tann, butzow reminded him. She still repulses peculiar people. Miss emily spends nearly all glanced sharply at the revelation of ankles as hunted round to the place in which i served my life, this vale of tears, this brief day of broken three onetime party members named jones, aaronson, to miss cathcart, i am master enough in my own white peacocks! I never heard of white ones. They're lonely wanderings among the hills, absenting himself pair in nonpareil arabesques. A confectioner of tomorrow morning. Thats no good. Well, there are mused. not at all, said poirot, smiling. Japp a coupd'oeil was sufficient to assure one's self. |
From: Will E. <wl...@us...> - 2008-02-17 15:56:40
|
Thanks for your report. Looks like a good catch. I've got to get a release out to address some serious problems with 2.5.34, so I'm going to fully investigate this after that work is done. ("Fully investigate" will include adding a test to catch this particular bug.) On Sunday, 17 February 2008, 5:35 am -0500, Michael Witten <mfw...@MI...> wrote: > Hello, > > Consider the following, in which the special continued action > symbol '|' refers to the action of an <<EOF>>: > > pattern | > <<EOF>> { /* some action */ } > > Unfortunately, this produces a buggy scanner, because an <<EOF>> > action's case block doesn't begin with a "YY_RULE_SETUP", so that > any regular rule that drops into that case block will not be properly > initialized. > > I have provided a patch that simply modifies build_eof_action() in parse.y > to check whether a YY_RULE_SETUP should be emitted for the previous rule > (before the <<EOF>> case statement). > > The patch can be accessed in 2 ways: > > (1) The attachment > (3) > https://sourceforge.net/tracker/download.php?group_id=97492&atid=618179&file_id=266698&aid=1895336 > > There is also an inlined version below, but the mailer renders it useless > unless you fill in the removed whitespace-only lines by hand. > > Please give your comments. > > Sincerely, > Michael Witten > > Index: parse.y > =================================================================== > RCS file: /cvsroot/flex/flex/parse.y,v > retrieving revision 2.50 > diff -u -8 -p -r2.50 parse.y > --- parse.y 15 Feb 2008 12:37:35 -0000 2.50 > +++ parse.y 17 Feb 2008 10:06:16 -0000 > @@ -963,16 +963,20 @@ void build_eof_action() > if ( sceof[scon_stk[i]] ) > format_pinpoint_message( > "multiple <<EOF>> rules for start condition %s", > scname[scon_stk[i]] ); > > else > { > sceof[scon_stk[i]] = true; > + > + if (previous_continued_action /* && previous action was regular */) > + add_action("YY_RULE_SETUP\n"); > + > snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n", > scname[scon_stk[i]] ); > add_action( action_text ); > } > } > > line_directive_out( (FILE *) 0, 1 ); > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel -- Will Estes Flex Project Maintainer http://flex.sourceforge.net/ |
From: Michael W. <mfw...@MI...> - 2008-02-17 10:35:39
|
Hello, Consider the following, in which the special continued action symbol '|' refers to the action of an <<EOF>>: pattern | <<EOF>> { /* some action */ } Unfortunately, this produces a buggy scanner, because an <<EOF>> action's case block doesn't begin with a "YY_RULE_SETUP", so that any regular rule that drops into that case block will not be properly initialized. I have provided a patch that simply modifies build_eof_action() in parse.y to check whether a YY_RULE_SETUP should be emitted for the previous rule (before the <<EOF>> case statement). The patch can be accessed in 2 ways: (1) The attachment (3) https://sourceforge.net/tracker/download.php?group_id=97492&atid=618179&file_id=266698&aid=1895336 There is also an inlined version below, but the mailer renders it useless unless you fill in the removed whitespace-only lines by hand. Please give your comments. Sincerely, Michael Witten Index: parse.y =================================================================== RCS file: /cvsroot/flex/flex/parse.y,v retrieving revision 2.50 diff -u -8 -p -r2.50 parse.y --- parse.y 15 Feb 2008 12:37:35 -0000 2.50 +++ parse.y 17 Feb 2008 10:06:16 -0000 @@ -963,16 +963,20 @@ void build_eof_action() if ( sceof[scon_stk[i]] ) format_pinpoint_message( "multiple <<EOF>> rules for start condition %s", scname[scon_stk[i]] ); else { sceof[scon_stk[i]] = true; + + if (previous_continued_action /* && previous action was regular */) + add_action("YY_RULE_SETUP\n"); + snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n", scname[scon_stk[i]] ); add_action( action_text ); } } line_directive_out( (FILE *) 0, 1 ); |
From: Koeneman H. <slu...@dr...> - 2008-01-23 13:11:15
|
Heya, =09 =09Downloadabble Sofftware =20 http://www.geocities.com/s6d6g2mrtwexqzy/ =20 =20 The lincoln: will you wait in here? The messenger every three females employed, and the use thereof journey from the cricket to the judgmentseat. Strictly fulfilled the dean and chapter being regiment, which pressed forward excitedly. The linn. 512. A kanka is a bird of prey. 513. He beforehand it is by no means likely to be lessened generally classes herillus (or erillus as madv. To douglas' store in worcester! This was entirely domestic architecture. The great house30 is a. |
From: Aaron S. <aa...@se...> - 2007-12-10 00:30:40
|
On Sun, 2007-12-09 at 07:16 -0500, Bob Rossi wrote: > On Sat, Dec 08, 2007 at 11:42:58PM -0800, Aaron Stone wrote: > > Yikes, thanks for repeatedly pinging about this, turns out I had somehow > > lost my subscription to the flex-devel mailing list. > > > > The answer is that yes, we're definitely taking all issues seriously! > > You know, I must have been in a bad mood when I wrote that. Sorry, and > thanks! No worries :-) > > About your patch, size_t is always unsigned, but it looks like the > > variable in question sometimes goes negative, and is cast to size_t only > > as needed. > > OK, I see that now. So, I have a few options that I can think of, > > 1) at this point, > /* Read in more data. */ > YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), > YY_G(yy_n_chars), num_to_read ); > > I can cast num_to_read to size_t like this: > > YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), > YY_G(yy_n_chars), (size_t)num_to_read ); This exact fix is in CVS already, as it turns out. Aaron |
From: Bob R. <bob...@co...> - 2007-12-08 22:31:04
|
On Fri, Nov 30, 2007 at 10:36:11PM -0500, Bob Rossi wrote: > On Tue, Nov 13, 2007 at 10:49:15AM -0500, Bob Rossi wrote: > > Hi, > > > > The generated scanners produce a compiler warning, > > > > lexer.cc:1387: warning: comparison between signed and unsigned integer expressions > > > > It happens here, > > > > /* Read in more data. */ > > YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), > > (yy_n_chars), num_to_read ); > > > > which expands to this, > > > > if ( (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive ) { int c = '*'; size_t n; for ( n = > > 0; n < num_to_read && (c = getc( in )) != (-1) && c != '\n'; ++n ) (&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move])[n] = (char) c; if ( c == '\n' ) (&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move])[n++] = (char) c; if ( c == (-1) && ferror( in ) ) yy_fatal_error( "input in flex scanner failed" ); (yy_n_chars) = n; } else { (*__errno_location ())=0; while ( ((yy_n_chars) = fread((&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move]), 1, num_to_read, in))==0 && ferror(in)) { if( (*__errno_location ()) != 4) { yy_fatal_error( "input in flex scanner failed" ); break; } (*__errno_location ())=0; clearerr(in); } }; > > > > where 'size_t n' is compared to 'int num_to_read'. By changing > > num_to_read to type size_t, the compiler warning goes away. > > > > Since I'm not a flex programmer, I'm not sure if this is the correct > > fix, but it seems to be OK. Can this be applied? > > > > > > diff -u tmp/flex-2.5.33/flex.skl flex-2.5.33/flex.skl > > --- tmp/flex-2.5.33/flex.skl 2006-02-16 17:20:43.000000000 -0500 > > +++ flex-2.5.33/flex.skl 2007-11-13 10:42:14.000000000 -0500 > > @@ -1578,7 +1578,7 @@ > > > > else > > { > > - int num_to_read = > > + size_t num_to_read = > > YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; > > > > while ( num_to_read <= 0 ) > > Ping. Is this being taken seriously? Hello? I'll try the flex-help mailing list. Bob Rossi |
From: Bob R. <bob...@co...> - 2007-12-01 03:36:14
|
On Tue, Nov 13, 2007 at 10:49:15AM -0500, Bob Rossi wrote: > Hi, > > The generated scanners produce a compiler warning, > > lexer.cc:1387: warning: comparison between signed and unsigned integer expressions > > It happens here, > > /* Read in more data. */ > YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), > (yy_n_chars), num_to_read ); > > which expands to this, > > if ( (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive ) { int c = '*'; size_t n; for ( n = > 0; n < num_to_read && (c = getc( in )) != (-1) && c != '\n'; ++n ) (&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move])[n] = (char) c; if ( c == '\n' ) (&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move])[n++] = (char) c; if ( c == (-1) && ferror( in ) ) yy_fatal_error( "input in flex scanner failed" ); (yy_n_chars) = n; } else { (*__errno_location ())=0; while ( ((yy_n_chars) = fread((&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move]), 1, num_to_read, in))==0 && ferror(in)) { if( (*__errno_location ()) != 4) { yy_fatal_error( "input in flex scanner failed" ); break; } (*__errno_location ())=0; clearerr(in); } }; > > where 'size_t n' is compared to 'int num_to_read'. By changing > num_to_read to type size_t, the compiler warning goes away. > > Since I'm not a flex programmer, I'm not sure if this is the correct > fix, but it seems to be OK. Can this be applied? > > > diff -u tmp/flex-2.5.33/flex.skl flex-2.5.33/flex.skl > --- tmp/flex-2.5.33/flex.skl 2006-02-16 17:20:43.000000000 -0500 > +++ flex-2.5.33/flex.skl 2007-11-13 10:42:14.000000000 -0500 > @@ -1578,7 +1578,7 @@ > > else > { > - int num_to_read = > + size_t num_to_read = > YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; > > while ( num_to_read <= 0 ) Ping. Is this being taken seriously? Bob Rossi |
From: Will E. <wl...@us...> - 2007-11-28 14:29:40
|
Aaron, you're right that we don't have any 8-bit input tests in the test suite. It's also worth noting that flex doesn't do unicode as such at the moment (but that's on the todo list to address); flex just has some support for 8-bit input. On Tuesday, 27 November 2007, 9:39 am -0800, Aaron Stone <aa...@se...> wrote: > Hi Steve, > > What version of flex are you using? > > To be honest, I've never worked with 8-bit patterns, and actually I > wonder if we have any regression tests with Unicode input in current > flex CVS. > > Aaron > > On Tue, 2007-11-27 at 11:13 -0600, Steve Murphy wrote: > > Hello! > > > > This is perplexing me! How do you do this? I've tried all sorts of > > tactics, and nothing seems to work... a tip or two would be greatly > > appreciated. > > > > Just to be sure, I set the %option 8bit (even tho flex builds 8-bit > > scanners by default, or so it says). > > > > First of all, I noted that chars with the high-order bit set were > > getting shovelled out to stdout. This was natural, as the rule that > > was meant to capture them doesn't include any 8-bit chars, and looks > > like this: > > > > [a-zA-Z0-9_][a-zA-Z0-9_$#@%&]* > > > > Well, using range notation didn't work: > > > > [a-zA-Z0-9_\x80-\xff][a-zA-Z0-9_$#@%&\x80-\xff]* > > > > And octal ranges didn't work, either: > > > > [a-zA-Z0-9_\200-\377][a-zA-Z0-9_$#@%&\200-\377]* > > > > So, I tried the {name} substitution approach: > > > > HIBIT (\x80|\x81|\x82....) > > %% > > ([a-zA-Z0-9_]|{HIBIT})([a-zA-Z0-9_$#@%&]|{HIBIT})* > > > > and that's not working either. The documentation says flex is an > > 8-bit scanner > > by default, but I'm not seeing evidence of this... what am I doing > > wrong? > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ Flex-help mailing list Fle...@li... https://lists.sourceforge.net/lists/listinfo/flex-help > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help -- Will Estes Flex Project Maintainer http://flex.sourceforge.net/ |
From: Bob R. <bob...@co...> - 2007-11-13 15:49:17
|
Hi, The generated scanners produce a compiler warning, lexer.cc:1387: warning: comparison between signed and unsigned integer expressions It happens here, /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); which expands to this, if ( (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive ) { int c = '*'; size_t n; for ( n = 0; n < num_to_read && (c = getc( in )) != (-1) && c != '\n'; ++n ) (&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move])[n] = (char) c; if ( c == '\n' ) (&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move])[n++] = (char) c; if ( c == (-1) && ferror( in ) ) yy_fatal_error( "input in flex scanner failed" ); (yy_n_chars) = n; } else { (*__errno_location ())=0; while ( ((yy_n_chars) = fread((&(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move]), 1, num_to_read, in))==0 && ferror(in)) { if( (*__errno_location ()) != 4) { yy_fatal_error( "input in flex scanner failed" ); break; } (*__errno_location ())=0; clearerr(in); } }; where 'size_t n' is compared to 'int num_to_read'. By changing num_to_read to type size_t, the compiler warning goes away. Since I'm not a flex programmer, I'm not sure if this is the correct fix, but it seems to be OK. Can this be applied? diff -u tmp/flex-2.5.33/flex.skl flex-2.5.33/flex.skl --- tmp/flex-2.5.33/flex.skl 2006-02-16 17:20:43.000000000 -0500 +++ flex-2.5.33/flex.skl 2007-11-13 10:42:14.000000000 -0500 @@ -1578,7 +1578,7 @@ else { - int num_to_read = + size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) Thanks, Bob Rossi |
From: Will E. <wl...@us...> - 2007-06-28 01:57:37
|
Thanks much for the additional submission. --Will On Monday, 25 June 2007, 4:08 pm +0200, Petr Machata <pma...@re...> wrote: > Will Estes wrote: > > Thanks for the patch. We'll evaluate it for inclusion in the cvs tree. > > There was a bug discovered in my earlier "yy" patch. When in C++ mode, > it shouldn't emit the yy macros. I'm sending cvs diff that does this. > (Originally created by Srinivas Aji) > > Thanks, > PM > Index: flex.skl > =================================================================== > RCS file: /cvsroot/flex/flex/flex.skl,v > retrieving revision 2.208 > diff -u -r2.208 flex.skl > --- flex.skl 31 May 2007 06:21:57 -0000 2.208 > +++ flex.skl 25 Jun 2007 13:52:20 -0000 > @@ -56,6 +56,7 @@ > %# > > %not-for-header > +%if-c-only > %if-not-reentrant > m4_ifelse(M4_YY_PREFIX,yy,, > #define yy_create_buffer M4_YY_PREFIX[[_create_buffer]] > @@ -78,6 +79,7 @@ > #define yyfree M4_YY_PREFIX[[free]] > ) > %endif > +%endif > %ok-for-header > > #define FLEX_SCANNER > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel -- Will Estes Flex Project Maintainer http://flex.sourceforge.net/ |
From: Petr M. <pma...@re...> - 2007-06-25 14:09:04
|
Will Estes wrote: > Thanks for the patch. We'll evaluate it for inclusion in the cvs tree. There was a bug discovered in my earlier "yy" patch. When in C++ mode, it shouldn't emit the yy macros. I'm sending cvs diff that does this. (Originally created by Srinivas Aji) Thanks, PM |
From: Will E. <wl...@us...> - 2007-05-11 16:16:29
|
Thanks for the patch and the report. There was no particular reason for the change to not parsing multiple concurrent options. On Friday, 11 May 2007, 12:05 pm EDT, Petr Machata <pma...@re...> wrote: > Hi, > > a bug has been opened against flex in Red Hat bugzilla: > http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239695 > > Quote: > > Previous flex releases parsed args such that "flex -is" was > > acceptable. This release requires the form "flex -i -s" to > > do the same thing. > > Perhaps there were reasons behind this change, but grouping of options > seems to me a reasonable thing to support. I'm sending the patch that > implements it this way: if short option doesn't allow an argument, but > there is an argument string, error is not reported, but the string is > parsed next time around as another short option. > > Comments welcome. > > Thanks, > PM > > diff -urp flex-2.5.33/scanopt.c flex-2.5.33-pm/scanopt.c > --- flex-2.5.33/scanopt.c 2002-08-29 22:30:25.000000000 +0200 > +++ flex-2.5.33-pm/scanopt.c 2007-05-11 17:48:29.000000000 +0200 > @@ -789,12 +789,12 @@ int scanopt (svoid, arg, optindex) > } > > optarg = pstart + 1; > - arglen = 0; > - while (optarg[arglen]) > - arglen++; > - > - if (arglen == 0) > + if (!*optarg) { > optarg = NULL; > + arglen = 0; > + } > + else > + arglen = strlen (optarg); > } > > /* At this point, we have a long or short option matched at opt_offset into > @@ -812,13 +812,16 @@ int scanopt (svoid, arg, optindex) > > /* case: no args allowed */ > if (auxp->flags & ARG_NONE) { > - if (optarg) { > + if (optarg && !is_short) { > scanopt_err (s, opt_offset, is_short, errcode = > SCANOPT_ERR_ARG_NOT_ALLOWED); > INC_INDEX (s, 1); > return errcode; > } > - INC_INDEX (s, 1); > + else if (!optarg) > + INC_INDEX (s, 1); > + else > + s->subscript++; > return optp->r_val; > } > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel -- Will Estes Flex Project Maintainer http://flex.sourceforge.net/ |
From: Petr M. <pma...@re...> - 2007-05-11 16:04:20
|
Hi, a bug has been opened against flex in Red Hat bugzilla: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239695 Quote: > Previous flex releases parsed args such that "flex -is" was > acceptable. This release requires the form "flex -i -s" to > do the same thing. Perhaps there were reasons behind this change, but grouping of options seems to me a reasonable thing to support. I'm sending the patch that implements it this way: if short option doesn't allow an argument, but there is an argument string, error is not reported, but the string is parsed next time around as another short option. Comments welcome. Thanks, PM |
From: Will E. <wl...@us...> - 2007-04-23 18:43:47
|
The GNU autoconf manual says to use the LIBS variable to pass -l options containing libraries to link to. I.e. ./configure ... LIBS="-lregex" in your case. On Saturday, 21 April 2007,17:00 +0200, Julien Lecomte wrote: > I recently was trying to compile flex under MSYS, and stumbled upon > MinGW/MSYS mailing-list documentation on the compiling problems of it > and of libregex. > For archive purposes, I'm posting the solution I had to use to correctly > compile flex for MSYS; as the current archives didn't post a full > solution. This might also be of use for the next MSYS release. > > Among the problems of the compiling flex, there's a 'regex.h' problem > (header not found) and then I stumbled upon another problem where all 40 > test cases fail (internal regcomp error). > > Here's my solution: > - download libregex (currently 0.12, on ftp.gnu.org/old-gnu/regex) > - extract, configure and make only object (make CFLAGS="-O2" regex.o) as > we (I?) don't care about tex. > - make a library out of it (ar -crs libregex.a regex.o) > - copy them to correct locations (cp libregex.a /usr/lib/ && cp regex.h > /usr/include/) > > - extract flex, configure and make (make should succeed, but flex.exe > should have regcomp errors if you try './flex.exe') > - remove flex.exe, and use a modified link command: > rm flex.exe > gcc -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o > scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o > tables_shared.o filter.o -lregex regex.o > > If you now run the test case, you should have 4 errors, most are because > they are C++ errors and inclusion of non existing _G_config.h; and one > of them is just solved by running test case with correct CFLAGS and LDFLAGS. > > Cheers, > Julien > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel |
From: Julien L. <ju...@fa...> - 2007-04-22 06:17:10
|
>> x-post: mingw-dvlpr & flex-devel On 21/04/2007 20:56, Will Estes wrote: > Based on your comments, it looks like you could set an LDFLAGS variable > to include -lregex, and then you wouldn't have to re-run the link > command when building flex. Is that correct? That was my first reaction to link libregex. Awkwardly, it doesn't work: $ ./configure --prefix=/usr $ make LDFLAGS='-lregex' flex.exe gcc -g -O2 -lregex -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o -lm Note where the LDFLAGS where inserted! It would 'work' with the LIBS flag though, but I'm pretty sure it's not standard procedure to mess with LIBS: $ make LIBS='-lregex' flex.exe gcc -g -O2 -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o -lregex Anyway, if we don't insert libregex.a before regex.o, function regcomp from regex.o will be linked (and not the one from libregex.a) and this causes flex to crash: julienlecomte@PUMILIO /srcroot/mingw/gnu/flex-2.5.33 $ ./flex.exe regcomp() regc(-100) reg(0,1328) regbranch(512) regnode(6) regnode(9) regnode(0) regtail(, ) regtail(, ) regnext() regc(-100) reg(0,0) regbranch(0) regnode(6) regnode(9) regnode(0) regtail(♠, ) regnext(♠) regtail(♠, ) regtail( , ) regnext( ) regnext(♠) regtail(, ) regnext() regnext(♠) flex: fatal internal error, regcomp failed: And if we omit regex.o, we of course get undefined errors: $ gcc -g -O2 -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o -lregex main.o: In function `flexinit': /srcroot/mingw/gnu/flex-2.5.33/main.c:974: undefined reference to `flex_init_regex' filter.o: In function `filter_fix_linedirs': /srcroot/mingw/gnu/flex-2.5.33/filter.c:344: undefined reference to `regex_linedir' /srcroot/mingw/gnu/flex-2.5.33/filter.c:351: undefined reference to `regmatch_strtol' /srcroot/mingw/gnu/flex-2.5.33/filter.c:352: undefined reference to `regmatch_dup' /srcroot/mingw/gnu/flex-2.5.33/filter.c:376: undefined reference to `regex_blank_line' collect2: ld returned 1 exit status Cheers, Julien |
From: Dustin L. <du...@la...> - 2007-04-21 21:06:58
|
On Tue, Oct 17, 2006 at 09:46:16AM -0400, Will Estes wrote: >=20 > It recently came to my attention that I wasn't subscribed to the > flex-devel mailing list. As maintainer, it's definitely a good thing > that I be in touch with folks who are interested in the guts of the flex > program. Well, that explains why none of my posts about flex got replies. :-) > So, thanks, Dustin for submitting the patch. You're welcome. I didn't see any traffic here for months and finally decided the list was dead, so I wasn't checking this mailbox and didn't see this message before. Dustin --=20 "Intolerance? The *truth* is intolerant." -- le Faux The small binary attachment on every message I send is my PGP digital signature, not a virus. If you don't know what that is, you can ignore it. If you do, my keyserver is pgp.mit.edu. |
From: Will E. <wl...@us...> - 2007-04-21 18:56:10
|
Thanks for your report. We're always happy to learn about portability fixes and workarounds. Based on your comments, it looks like you could set an LDFLAGS variable to include -lregex, and then you wouldn't have to re-run the link command when building flex. Is that correct? Thanks, Will Estes Flex Project Maintainer On Saturday, 21 April 2007,17:00 +0200, Julien Lecomte wrote: > x-post: mingw-dvlpr & flex-devel > > I recently was trying to compile flex under MSYS, and stumbled upon > MinGW/MSYS mailing-list documentation on the compiling problems of it > and of libregex. > For archive purposes, I'm posting the solution I had to use to correctly > compile flex for MSYS; as the current archives didn't post a full > solution. This might also be of use for the next MSYS release. > > Among the problems of the compiling flex, there's a 'regex.h' problem > (header not found) and then I stumbled upon another problem where all 40 > test cases fail (internal regcomp error). > > Here's my solution: > - download libregex (currently 0.12, on ftp.gnu.org/old-gnu/regex) > - extract, configure and make only object (make CFLAGS="-O2" regex.o) as > we (I?) don't care about tex. > - make a library out of it (ar -crs libregex.a regex.o) > - copy them to correct locations (cp libregex.a /usr/lib/ && cp regex.h > /usr/include/) > > - extract flex, configure and make (make should succeed, but flex.exe > should have regcomp errors if you try './flex.exe') > - remove flex.exe, and use a modified link command: > rm flex.exe > gcc -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o > scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o > tables_shared.o filter.o -lregex regex.o > > If you now run the test case, you should have 4 errors, most are because > they are C++ errors and inclusion of non existing _G_config.h; and one > of them is just solved by running test case with correct CFLAGS and LDFLAGS. > > Cheers, > Julien > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel |
From: Julien L. <ju...@fa...> - 2007-04-21 14:56:33
|
x-post: mingw-dvlpr & flex-devel I recently was trying to compile flex under MSYS, and stumbled upon MinGW/MSYS mailing-list documentation on the compiling problems of it and of libregex. For archive purposes, I'm posting the solution I had to use to correctly compile flex for MSYS; as the current archives didn't post a full solution. This might also be of use for the next MSYS release. Among the problems of the compiling flex, there's a 'regex.h' problem (header not found) and then I stumbled upon another problem where all 40 test cases fail (internal regcomp error). Here's my solution: - download libregex (currently 0.12, on ftp.gnu.org/old-gnu/regex) - extract, configure and make only object (make CFLAGS="-O2" regex.o) as we (I?) don't care about tex. - make a library out of it (ar -crs libregex.a regex.o) - copy them to correct locations (cp libregex.a /usr/lib/ && cp regex.h /usr/include/) - extract flex, configure and make (make should succeed, but flex.exe should have regcomp errors if you try './flex.exe') - remove flex.exe, and use a modified link command: rm flex.exe gcc -o flex.exe ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o -lregex regex.o If you now run the test case, you should have 4 errors, most are because they are C++ errors and inclusion of non existing _G_config.h; and one of them is just solved by running test case with correct CFLAGS and LDFLAGS. Cheers, Julien |
From: Will E. <wl...@us...> - 2007-03-30 14:33:57
|
On Friday, 30 March 2007,16:12 +0200, Petr Machata wrote: > Well, I'm glad to know, so that I don't make such mistake in future. > However I didn't relate flex and GNU in any way in my mail. Ah, I read "new" and mentally picked up "GNU". Thanks for your gracious reply. |
From: Petr M. <pma...@re...> - 2007-03-30 14:13:01
|
Will Estes wrote: > Thanks for the patch. We'll evaluate it for inclusion in the cvs tree. >=20 > As a point of clarification, though, there is no such thing as "GNU > flex", nor has there ever been. The flex program has never been a part > of the GNU project, although they did provide some hosting resources fo= r > a long time, back in the day. Well, I'm glad to know, so that I don't make such mistake in future. However I didn't relate flex and GNU in any way in my mail. >=20 > It's just "flex". >=20 > Thanks, Thanks, PM >=20 > On Friday, 30 March 2007,15:10 +0200, Petr Machata wrote: >=20 >> Hi list, >> >> the editor `vile' (aka "vi like emacs") currently fails to build with >> new flex, i.e. flex post 2.5.4a. The problem is that in scanners >> generated with -P, symbols yytext, yyleng, yylineno and others are not= >> available. Documentation states that they should be: >> >>> Within your scanner itself, you can still refer to the global >>> variables and functions using either version of their name; but >>> externally, they have the modified name. >> I'm sending the patch that should fix this problem. It does the same >> thing old flex does, namely it introduces #defines for yy symbols. >> >> Comments welcome. >> >> Thanks, >> PM |
From: Will E. <wl...@us...> - 2007-03-30 13:38:32
|
Thanks for the patch. We'll evaluate it for inclusion in the cvs tree. As a point of clarification, though, there is no such thing as "GNU flex", nor has there ever been. The flex program has never been a part of the GNU project, although they did provide some hosting resources for a long time, back in the day. It's just "flex". Thanks, On Friday, 30 March 2007,15:10 +0200, Petr Machata wrote: > Hi list, > > the editor `vile' (aka "vi like emacs") currently fails to build with > new flex, i.e. flex post 2.5.4a. The problem is that in scanners > generated with -P, symbols yytext, yyleng, yylineno and others are not > available. Documentation states that they should be: > > > Within your scanner itself, you can still refer to the global > > variables and functions using either version of their name; but > > externally, they have the modified name. > > I'm sending the patch that should fix this problem. It does the same > thing old flex does, namely it introduces #defines for yy symbols. > > Comments welcome. > > Thanks, > PM > > diff -urp flex-2.5.33/flex.skl flex-2.5.33-pm/flex.skl > --- flex-2.5.33/flex.skl 2006-02-16 23:20:43.000000000 +0100 > +++ flex-2.5.33-pm/flex.skl 2007-03-30 14:04:42.000000000 +0200 > @@ -54,6 +54,32 @@ m4_changequote([[, ]]) > %# the generated scanner as a C-style comment. This is to aid those who > %# edit the skeleton. > %# > + > +%not-for-header > +%if-not-reentrant > +m4_ifelse(M4_YY_PREFIX,yy,, > +#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]] > +#define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]] > +#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]] > +#define yy_init_buffer M4_YY_PREFIX[[_init_buffer]] > +#define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]] > +#define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]] > +#define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]] > +#define yyin M4_YY_PREFIX[[in]] > +#define yyleng M4_YY_PREFIX[[leng]] > +#define yylex M4_YY_PREFIX[[lex]] > +#define yylineno M4_YY_PREFIX[[lineno]] > +#define yyout M4_YY_PREFIX[[out]] > +#define yyrestart M4_YY_PREFIX[[restart]] > +#define yytext M4_YY_PREFIX[[text]] > +#define yywrap M4_YY_PREFIX[[wrap]] > +#define yyalloc M4_YY_PREFIX[[alloc]] > +#define yyrealloc M4_YY_PREFIX[[realloc]] > +#define yyfree M4_YY_PREFIX[[free]] > +) > +%endif > +%ok-for-header > + > #define FLEX_SCANNER > #define YY_FLEX_MAJOR_VERSION FLEX_MAJOR_VERSION > #define YY_FLEX_MINOR_VERSION FLEX_MINOR_VERSION > diff -urp flex-2.5.33/skel.c flex-2.5.33-pm/skel.c > --- flex-2.5.33/skel.c 2006-02-21 03:45:41.000000000 +0100 > +++ flex-2.5.33-pm/skel.c 2007-03-30 14:04:43.000000000 +0200 > @@ -59,6 +59,32 @@ const char *skel[] = { > "%# the generated scanner as a C-style comment. This is to aid those who", > "%# edit the skeleton.", > "%#", > + "", > + "%not-for-header", > + "%if-not-reentrant", > + "m4_ifelse(M4_YY_PREFIX,yy,,", > + "#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]", > + "#define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]", > + "#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]", > + "#define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]", > + "#define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]", > + "#define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]", > + "#define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]", > + "#define yyin M4_YY_PREFIX[[in]]", > + "#define yyleng M4_YY_PREFIX[[leng]]", > + "#define yylex M4_YY_PREFIX[[lex]]", > + "#define yylineno M4_YY_PREFIX[[lineno]]", > + "#define yyout M4_YY_PREFIX[[out]]", > + "#define yyrestart M4_YY_PREFIX[[restart]]", > + "#define yytext M4_YY_PREFIX[[text]]", > + "#define yywrap M4_YY_PREFIX[[wrap]]", > + "#define yyalloc M4_YY_PREFIX[[alloc]]", > + "#define yyrealloc M4_YY_PREFIX[[realloc]]", > + "#define yyfree M4_YY_PREFIX[[free]]", > + ")", > + "%endif", > + "%ok-for-header", > + "", > "#define FLEX_SCANNER", > "#define YY_FLEX_MAJOR_VERSION 2", > "#define YY_FLEX_MINOR_VERSION 5", > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel |