def p_step_7(p):
    'Step : AbbreviatedStep PredicateList'
    if p[1][1] == 'self':
        a = "."
        x = "self::node()"
    else:
        a = ".."
        x = "parent::node()"
    msg = "%s[<pred>] is illegal syntax.  use %s[<pred>] instead," % (a, x)
    raise xpath_lexer.XPathError(msg, 1, 1)
Step : AbbreviatedStep PredicateList