help-bison
[Top][All Lists]
Advanced

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

How to raise an error


From: BradDaBug
Subject: How to raise an error
Date: Fri, 9 Oct 2009 09:34:47 -0700 (PDT)

My parser basically works by calling various functions that build a big parse
tree. Something like this:

identifier:
   LOCALIDENTIFIER { $$ = CreateIdentifierNode(yytext); }

The problem is that I need to be able to detect errors within those
functions (for example, is the identifier name too long) and propagate them
back to Bison. But I don't know how. I don't have access to the YYERROR
macro in those functions, and I can't manually "goto yyerrorlab;" since I'm
in a different function.

How can I do it?
-- 
View this message in context: 
http://www.nabble.com/How-to-raise-an-error-tp25824253p25824253.html
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.





reply via email to

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