如何防止结构规则中的“,”文字在Instaparse的以下EBNF语法中被解析为运算符?
语法:
structure = atom <"("> term ("," term)* <")">
term = atom | number | structure | variable | "(" term ")" | term operator term
operator = "," | ";" | "\\=" | "=="
答案 0 :(得分:0)
使用逗号作为分隔符和像你一样的运算符使得逗号上下文敏感,而Ebnf本身无法处理。