flex: end of buffer missed; possible reasons?

flex: end of buffer missed; possible reasons?

Post by Espen Waa » Thu, 14 Jul 1994 21:57:11


I have a problem with flex, maybe related to bison.
I get this error when parsing an input-file:

   fatal flex scanner internal error--end of buffer missed

This happens only when I have *37 or more* number of lines conforming to
a special grammar rule in my bison source file.

It says in the manual about this error:

          fatal flex scanner internal error--end of buffer missed -

          This can occur in an scanner which is reentered after a  
          long-jump has jumped out (or over) the scanner's activation
          frame.  Before reentering the scanner, use:              

              yyrestart( yyin );                                    

          or, as noted above, switch to using the C++ scanner class.

I have just *one* scanner, and I'm parsing the file just once; I'm not
"reentering the scanner". I have tried to put yyrestart(yyin) after I've
opened the inputfile and before I start yyparse without any luck.

This is the output of compiling the flex-sourcefile:
flex -v -B inilex.l                                                  
flex version 2.4.6 usage statistics:                                
  scanner options: -vB8 -Cem                                        
  518/2000 NFA states                                                
  273/1000 DFA states (1309 words)                                  
  74 rules                                                          
  Compressed tables always back-up                                  
  1/40 start conditions                                              
  172 epsilon states, 87 double epsilon states                      
  10/100 character classes needed 138/500 words of storage, 9 reused
  11220 state/nextstate pairs created                                
  564/10656 unique/duplicate transitions                            
  277/1000 base-def entries created                                  
  385/2000 (peak 315) nxt-chk entries created                        
  12/2500 (peak 208) template nxt-chk entries created                
  0 empty table entries                                              
  4 protos created                                                  
  4 templates created, 251 uses                                      
  52/256 equivalence classes created                                
  3/256 meta-equivalence classes created                            
  3 (6 saved) hash collisions, 294 DFAs equal                        
  0 sets of reallocations needed                                    
  1632 total table entries needed                                    

It doesn't tell me much. I can provide the flex and bison
sourcefiles by email if somebody is willing to dig into it.

So: have anybody experienced this problem? As I wrote, I'm using Bison
to create the parser. Can there be any problems with the parser that
propagates to the flex-scanner?

Any help are appreciated!


|                                      |  mail : Birkebeinervg. 6      |
|The Norwegian Institute of Technology |         N-7031 TRONDHEIM      |
|                                      |         NORWAY                |
|(Confuser Science)                    |  phone: +47 73 94 18 44 (home)|
|                                                                      |
|                WWW page: http://www.idt.unit.no/~ewaage              |
|   "I believe OS/2 is destined to be the most important operating     |
|    system, and possible program, of all time." - Bill Gates, 1987    |