pyparsing如何使用条件

时间:2019-05-30 19:21:17

标签: python pyparsing

我是pyparsing的新手,我有以下内容:

operator = Word("+-*/", max=1)
comparator = Word("><=!", max=1)
condition = CaselessKeyword("IF")
comma = Literal(",")
open = Literal("(")
close = Literal(")")
number = Word(nums)

operation = number + op + number
exp = operation + ZeroOrMore(op + operation)

cond = condition + open + operation + comparator + operation + comma + number + comma + number + close

我正在使用在Linux Mint Tessa系统上运行的Python 3.6.7。如何告诉pyparsing我想解析number规则中的expcond

0 个答案:

没有答案