Yeah, p.lineno(0) returns the "zeroth" parameter, which is the non-terminal in a yacc production rule.