Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 PLY 时,是否可以跳过给定生产规则?(就像 lex 允许使用 obj.lexer.skip(1) 跳过某些标记一样)
例如:
def p_variable(p): 'variable : identifier' if variabledict.getitem(p[1]) == None: p.parser.skip(1) # << else: p[0] = p[1]
如何才能做到这一点?