def t_argument_error(self, t): """Argument error handler.""" if t is None: raise katcp.KatcpSyntaxError("Argument syntax error.") else: raise katcp.KatcpSyntaxError("Invalid argument token: %s " % t.value)
def t_error(self, t): """Error handler.""" if t is None: raise katcp.KatcpSyntaxError("Syntax error.") else: raise katcp.KatcpSyntaxError("Invalid token: %s " % t.value)
def p_error(self, p): """Error handler.""" # Note: this error handler should be unreachable because the # anything the lexer can tokenise should be parsable in our # case. raise katcp.KatcpSyntaxError("Parsing error (production: %r)." % (p, ))