I followed the calculator example and modified my original grammar to add operator precedence which resulted in this. But it's no longer accepting the input string.
I'm getting this error:
lark.exceptions.UnexpectedCharacters: No terminal matches '\' in the current parser context, at line 1 col 35
\exists{x} \forall{y} (P(f(x, y)) \vee \forall{z}(V(z) \iff \neg R(a) \wed
^
Expected one of:
* RIGHT_PARENTHESIS
Ideally I want to force requiring parenthesis wherever possible except in the case of in front of a negated atomic_wff without parenthesis. This is to make sure only one parse tree is produced even on explicit ambiguity setting. How do I resolve this issue?
This is my first time using lark. Any help appreciated!
How do I modify this grammar so it matches parenthesis that are further away?
I'm trying to parse this using my grammar: $$\exists{x} \forall{y} (P(f(x, y)) \vee \forall{z}(V(z) \iff \neg R(a) \wedge B(a)))$$ Which in LaTeX is:
I followed the calculator example and modified my original grammar to add operator precedence which resulted in this. But it's no longer accepting the input string.
I'm getting this error:
Ideally I want to force requiring parenthesis wherever possible except in the case of in front of a negated
atomic_wff
without parenthesis. This is to make sure only one parse tree is produced even on explicit ambiguity setting. How do I resolve this issue?This is my first time using lark. Any help appreciated!