help-bison
[Top][All Lists]
Advanced

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

Re: How to add "error"


From: JPerez45
Subject: Re: How to add "error"
Date: Wed, 23 May 2007 01:45:57 -0700 (PDT)

If this error it's not a token, if it's an error handler then you could
redefine the yyerror function:

yyerror(message)
char *message;
{
        fprintf(stderr, "%s near '%s'\n", message, yytext);
        exit(1);
};

And everytime a syntactic error occurs it will display: kind_of_error 'near'
text before the error ocurred.
YACC and Bison includes so many usefull functions.
-- 
View this message in context: 
http://www.nabble.com/How-to-add-%22error%22-tf3556241.html#a10759771
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.





reply via email to

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