help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

parser stack overflow


From: Nosnos
Subject: parser stack overflow
Date: Thu, 27 Nov 2003 11:37:37 +0000

hi,

I must make a real time parser/lexer (bison/flex), that lex/parse the stdin 
stream.

The parser must work in continuous without stoping.

My first rule was something like that :

frame : FRAME other frame
      | FRAME other
      ;

other : [...]


Of course, i get a stack overflow.

So i want to know how to prevent this ? :

- Maybe with a better set of rules, but I don't know how (precision my file 
come from a sniffer, so the file contains lot a part separate by the work 
frame).
- I thought about having a loop outside the parser that always called yyparse 
...
  the starting rules will be so :
  frame : FRAME other   { return 0;} 
        |               { ERROR ; return -1;}

- ???

Is the second solution a possible way ?
Have you other better suggestion ?

thx a lot




reply via email to

[Prev in Thread] Current Thread [Next in Thread]