Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!newstop!texsun!texbell!helps!pcd From: pcd@helps.cactus.org (Paul C. Dingman) Newsgroups: comp.sources.d Subject: Re: Flex (latest 2.1 beta) on VMS Message-ID: <482@helps.cactus.org> Date: 27 Aug 89 22:14:54 GMT References: <13603@bloom-beacon.MIT.EDU> <1664@naucse.UUCP> Reply-To: pcd@helps.UUCP (Paul C. Dingman) Organization: Howard Electronic Laboratories Products & Services, Austin, TX Lines: 39 In article <1664@naucse.UUCP> jdc@naucse.UUCP (John Campbell) writes: >I'm the original poster of the first article. To date I have not proven >that there is a bug in flex. I still believe this is true, but I haven't >had the time to make the obvious tests in other environments. I still >believe that yyunput() is in error in some way, but I would like to have >some follow up information before I bug Vern Paxson with my worries. > There does indeed seem to be a bug in yyunput(). I had a similar problem with the "NULL in input" error trying to rebuild flex after having checked it in to RCS. The $Header string that RCS put in scan.l was a few characters longer than the one in the original distribution of scan.l. For some reason this slight change caused flex to generate the "NULL in input" error. Eventually, I discovered that flex could handle the original scan.l without any problems. In one case yyunput() was trying to make room in the input buffer for pushed back characters, in the other it wasn't. It appears that flex does not remember the number of characters in the input buffer after making a call to yyunput(). A one line change to the flex skeleton seems to take care of the problem. *** src/flex.skel Sun Jul 30 23:28:22 1989 --- dist/flex.skel Mon Aug 7 23:19:28 1989 *************** *** 411,417 yy_cp += dest - source; yy_bp += dest - source; - yy_n_chars += dest - source; if ( yy_cp < yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); --- 411,416 ----- yy_cp += dest - source; yy_bp += dest - source; if ( yy_cp < yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" );