alpag.net manual
Parser / Error handling and recovery / Custom error tokens
< Error recovery mechanism | Error recovery and lookahead >

Custom error tokens

Error recovery can be handled using built-in error token. If necessary user can also define own custom error tokens which enable:

Error tokens are declared with command:

%parserror identifier

Custom error tokens behave the same as built-in error token. When error occurs, parser searches stack for first state that has any error-handling actions defined. Both built-in error token as well as user-defined custom tokens can be matched during this search. If a state has actions for multiple error tokens, the one declared earlier in grammar will be chosen.

< Error recovery mechanism | Error recovery and lookahead >
Alpag Manual