[Top][All Lists]

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

Re: push parser documentation

From: Joel E. Denny
Subject: Re: push parser documentation
Date: Sat, 11 Aug 2007 19:05:29 -0400 (EDT)

On Sat, 4 Aug 2007, Bob Rossi wrote:

> +A push parser is typically useful when the parser is part of a 
> +main event loop in the clients application.  Especially when
> +the event loop needs to be triggered within a certain time period.  
> +This is often the case with a GUI application.

"clients" -> "client's"

The sentence starting with "Especially" is a sentence fragment.

> +a pure parser (@pxref{Pure Decl, ,A Pure (Reentrant) Parser}).  The only
> +time you should create an impure push parser is to have backwards 
> +compatibility with the Yacc pull mode interface.  Unless you know

Let's say "with the impure Yacc pull mode interface".

> address@hidden
> +int yystatus;
> +yypstate *yyps = yypstate_new ();
> +do @{
> +  yystatus = yypush_parse (yyps, yylex ());
> address@hidden while (yystatus == YYPUSH_MORE);
> +yypstate_delete (yyps);
> address@hidden example

In this and your other examples, symbols named by users (yystatus, yyps) 
should not start with yy.  The yy namespace is reserved for Bison symbols.  
(I'll correct this in the test suite.)

Also, the pure examples will not compile because they don't pass a 
semantic value to yypush_parse.  Please test each of your examples.

> +stream.  It is possible to yypush_parse tokens to select a subgrammar and 
> +then yypull_parse the rest of the input stream.  If you would like to 
> +switch back and forth between between parsing styles, you would have to 
> write 
> +your own yypull_parse function that knows when to quit looking for input.
> +An example of using the yypull_parse function would look like this:

@code around the function names.

> address@hidden {Function} yypstate_delete
> +The function to delete a parser instance, produced by Bison in push mode; 
> +call this function to delete the memory associate with a parser.


Please post an updated patch and then commit it.  Don't forget to update 
the date in the ChangeLog entry.  Also, I believe the entry was wider than 
80 columns.  If you could reformat, that would be best.

Thanks for all your hard work, Bob.

reply via email to

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