Simulating error and accept in actions
The parsing actions of error and accept can be simulated
in an action by use of macros YYACCEPT and YYERROR.
The YYACCEPT macro causes
yyparse()
to return the value 0;
YYERROR causes
the parser to behave as if the current input symbol
had been a syntax error;
yyerror()
is called, and error recovery takes place.
These mechanisms can be used to simulate parsers
with multiple end-markers or context sensitive syntax checking.
Next topic:
Accessing values in enclosing rules
Previous topic:
Advanced topics
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004