alpag.net manual
Parser / Error handling and recovery
< Managing conflicts | Error recovery mechanism >

Error handling and recovery

Parser automaton can handle only valid input conforming to the grammar. Automaton states have actions defined only for symbols that are expected in those states. When unexpected input symbol appears, parser has no action for such symbol, and reports an error. Default behavior in such case is to stop parsing and leave rest of input unread. Such behavior is not always acceptable.

It is possible to perform error recovery by attempting to resynchronize input symbol sequence with grammar constructions. This cannot be done fully automatically by parser. Grammar author must decide how to handle such situation and how to recover from it.

< Managing conflicts | Error recovery mechanism >
Alpag Manual