help-bison
[Top][All Lists]
Advanced

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

Re: parser stack overflow


From: Valter G. Nogueira Jr.
Subject: Re: parser stack overflow
Date: Thu, 27 Nov 2003 10:36:53 -0200

I am a newbie, but I believe that you must implement your rules as left
recursive:

frame: FRAME other
| frame FRAME other
;

Valter

----- Original Message -----
From: "Nosnos" <address@hidden>
To: <address@hidden>
Sent: Thursday, November 27, 2003 9:37 AM
Subject: parser stack overflow


> 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
>
>
> _______________________________________________
> address@hidden http://mail.gnu.org/mailman/listinfo/help-bison
>





reply via email to

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