Contents    Page-10    Prev    Next    Page+10    Index   

Error Productions[slide by John Werth.]

The earlier example grammar contains an error production:


lines : error '\n' { yyerror("reenter last line:");
                     yyerrok; }

An error production uses the keyword error followed by a string: A : error α
yyerrok resets the parser so it can continue.