I must be missing something. I am already using yyerror () to capture error messages ("syntax error", "memory exhausted", etc.), but I want to capture debugging output as well. That output is, by default, sent directly to stderr by the YYFPRINTF #define.

Also, I see no reference to a global yytext in the C output file (perhaps you meant ctxt?).

Sorry, but I don't see how yyerror can be used to accomplish this.

On 10/26/2006 2:50 AM, Ramaswamy R wrote:
You should be able to use the function yyerror to capture the debug
messages. The function prototype would be like this in a re-entrant parser -


int yyerror(void *ctxt, const char *msg)
{
 if ( 0 == yytext[0] )
   return fprintf(stderr, "\n%s.", msg);
 else
   return fprintf(stderr, "\n%s at '%s'.", msg, asntext);
}

I believe the ctxt would not be there in a non re-entrant version (globals
being used if context information is required). You can use this function to
do what you want with the message. Hope this helps.

Regards
Ramaswamy

--
_______________________________________________________________
Bob Smith - [EMAIL PROTECTED] - http://www.sudleyplace.com

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to