help-bison
[Top][All Lists]
Advanced

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

Re: go back to initial state - yyparse()


From: Joel E. Denny
Subject: Re: go back to initial state - yyparse()
Date: Mon, 3 May 2010 12:25:04 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Sun, 2 May 2010, falcore wrote:

> I´m using a parser to analize strings introduced interactively from the
> standard output. There is a call to yyparse() inside a loop, something like
> that

> Well, the first time is called works fine, but in consecutively calls, the
> parser fails.
> 
> It fails because the internal state and the stack do not restart themselves.

A Bison-generated yyparse does not maintain state between invocations.

However, between yyparse's invocations of your scanner, your scanner must 
remember, for example, where it is in the input string, so you should 
figure out how to point the scanner to a new string.

reply via email to

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