2
我有类似以下(简体版)通过用户定义的参数setParseAction在pyparsing
class ParseClass(object):
def __init__(self, tokens):
# do some processing on tokens
expr = Word().setParseAction(ParseClass)
有没有办法把一些用户自定义的参数ParseClass的初始化功能?像一些上下文等,所以我会 -
class ParseClass(object):
def __init__(self, tokens, context):
# do some processing on tokens based on context
expr = Word().setParseAction(ParseClass, context)
这可能吗?
这应该只是罚款。 – PaulMcG
@PaulMcGuire - 很高兴知道我不在左场。 – mgilson