def p_statement_bad(p):
 print ('MALFORMED STATEMENT AT LINE %s' % p[1])
 p[0] = None
 p.parser.error = 1

def p_statement_bad ( p ) : print ( 'MALFORMED STATEMENT AT LINE %s' % p [ 1 ] ) p [ 0 ] = None p . parser . error = 1
statement : integer error newline .