Python 如何解析逻辑表达式?
資深大佬 : al0ne 2
例如我输入一个条件 status:200 && port:333 这种逻辑表达式,有没有现成的库可以调用?
大佬有話說 (7)
ANTLR generates recursive descent parsers, which means the “processing logic” is contained in the parser’s code, as each production rule of the grammar is represented by a function in the parser’s code. The pay off is that it is easier to understand what the parser is doing by reading its code. Also, recursive descent parsers are typically faster than table driven ones.
谢谢几位大佬 我去试试你们说的