lark-parser

Failed tree-less parsing using python lark

Failed tree-less parsing using python lark Question: I use lark to parse lines of a log file. The log file contains some equations and I would like to extract the left hand side and right hand side of the equations and store them in a dictionary. However, in my context the parsing seems to be …

Total answers: 1

How can I fix my DSL grammar to parse a problem statement?

How can I fix my DSL grammar to parse a problem statement? Question: I’ve been tasked with creating a grammar for a legacy DSL that’s been in use for over 20 years. The original parser was written using a mess of regular expressions, so I’ve been told. The syntax is generally of the "if this …

Total answers: 2

How do I add operator precedence to a lark grammar for FOL with Equality?

How do I add operator precedence to a lark grammar for FOL with Equality? Question: How do I modify this grammar so it matches parenthesis that are further away? ?wff: compound_wff ?compound_wff: biconditional_wff ?biconditional_wff: conditional_wff (SPACE? BICONDITIONAL_SYMBOL SPACE? biconditional_wff)* ?conditional_wff: disjunctive_wff (SPACE? CONDITIONAL_SYMBOL SPACE? conditional_wff)* ?disjunctive_wff: conjunctive_wff (SPACE? DISJUNCTION_SYMBOL SPACE? disjunctive_wff)* ?conjunctive_wff: negated_wff (SPACE? CONJUNCTION_SYMBOL …

Total answers: 2

How do I write the lark grammar for First Order Logic with Equality?

How do I write the lark grammar for First Order Logic with Equality? Question: According to AIMA (Russell & Norvig, 2010) this is the BNF grammar for FOL with Equality: How do I convert this to a lark grammar? Specifically, how do I represent n-ary predicates using lark grammar? Asked By: daegontaven || Source Answers: …

Total answers: 2