Support a method setFailAction(func) taking a single
function as argument exactly as the setParseAction() does.
setFailActions should be functions having the same three
arguments as setParseActions: func(s, loc, doActions)
's' is the string to parse, 'loc' is the location at
which the failing element was called, and doActions is
the same as it was when the failing element was called.
The fail action function should be able to return one
of three instructions to the parser:
1) NO-OP: Raise the default 'did not match' exception
(as if no setFailAction had been specified
2) FATAL: Raise a fatal error to terminate parsing
3) RECOVERY: Tell the parser to try again from loc
(func having changed the input string).
I don't know if 3) is feasible/desirable with PyParsing
but it does complete the picture.