# Error handling rule
def t_error(t):
msg = "Illegal character '%s' " % t.value[0]
msg+= "Line %d, col %d" % (t.lineno, _find_column(t.lexer.parser.mof, t))
t.lexer.parser.log(msg)
t.lexer.skip(1)
def p_error(p):
print '*******GOT HERE'
p.parser.log('Syntax Error in input!')
p.parser.log(p)
p.parser.log('column: '+ _find_column(p.lexer.parser.mof, p))
The full code can be found here:
http://pywbem.svn.sourceforge.net/viewvc/pywbem/pywbem/trunk/mof_compiler.py?view=markup