Re: Stopping as soon as a valid symbol is read

2011-07-27 Thread Akim Demaille
Le 25 juil. 2011 à 16:22, Ludovic Courtès a écrit : > However, with a pure API, I don’t see how to get yyresult back from user > code? The code snippet in the manual pushes tokens but never asks for > the result. If you dive into the generated code, you might find something useful, but certain

Re: Stopping as soon as a valid symbol is read

2011-07-27 Thread Ludovic Courtès
Hi Hans, Hans Aberg skribis: > On 25 Jul 2011, at 10:52, Ludovic Courtès wrote: > >> I’m trying to parse a C expression from an input stream. I’d like the >> parser to stop as soon as a valid expression is read (or an error is >> encountered). >> >> However, the default behavior is to stop whe

Re: Stopping as soon as a valid symbol is read

2011-07-26 Thread Akim Demaille
Le 25 juil. 2011 à 17:52, Hans Aberg a écrit : > Akim has been working on this parser; perhaps he can give an answer. Actually I did not :) And I never used it either. Some day I'd like to port the push-parser structure to C++, but that's all. ___ h

Re: Stopping as soon as a valid symbol is read

2011-07-25 Thread Hans Aberg
On 25 Jul 2011, at 16:22, Ludovic Courtès wrote: > However, with a pure API, I don’t see how to get yyresult back from user > code? The code snippet in the manual pushes tokens but never asks for > the result. Typically one adds the value as an extra argument, as a reference in C++ or pointer i

Re: Stopping as soon as a valid symbol is read

2011-07-25 Thread Hans Aberg
On 25 Jul 2011, at 16:22, Ludovic Courtès wrote: >>> I’m trying to parse a C expression from an input stream. I’d like the >>> parser to stop as soon as a valid expression is read (or an error is >>> encountered). >>> >>> However, the default behavior is to stop whenever a valid expression >>> /

Re: Stopping as soon as a valid symbol is read

2011-07-25 Thread Hans Aberg
On 25 Jul 2011, at 10:52, Ludovic Courtès wrote: > I’m trying to parse a C expression from an input stream. I’d like the > parser to stop as soon as a valid expression is read (or an error is > encountered). > > However, the default behavior is to stop whenever a valid expression > /followed by

Fwd: Stopping as soon as a valid symbol is read

2011-07-25 Thread John P. Hartmann
From: Ludovic Courtès Date: 25 July 2011 12:14 Subject: Re: Stopping as soon as a valid symbol is read To: "John P. Hartmann" "John P. Hartmann" skribis: > Is a+b an expression?  You don't know until you see something that is > not an operator, it might be a+

Stopping as soon as a valid symbol is read

2011-07-25 Thread Ludovic Courtès
Hello, I’m trying to parse a C expression from an input stream. I’d like the parser to stop as soon as a valid expression is read (or an error is encountered). However, the default behavior is to stop whenever a valid expression /followed by the end-of-file marker/ is encountered. Thus, if the