<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def p_error(p):
 """ YACC Error Callback from the parser. The parameter is the token in error and contains information on the file and position of the error. If p is `None`, PLY is returning eof error. """


    if p is None:
        raise MOFParseError(msg='Unexpected end of file')

    msg = p.lexer.last_msg
    p.lexer.last_msg = None
    raise MOFParseError(parser_token=p, msg=msg)