I need to use LALR algorithm to be able to use the interactive mode of the parsing later on.
I get the following error message :
UnexpectedToken: Unexpected token Token('CONJUNCTION_SYMBOL', '&') at line 2, column 13.
Expected one of:
* COMPARISON_OPERATOR
In my understanding, the parser recognises well my_rule in expression. Then, in my_rule, body is well recognised, which leads to conjunction. And then, B(x) is well recognised as a predicate. In my understanding, the problem arises in predicate.
The parser should recognise B(x) as a predicate in the form of int_ext_identifier PRED_L_PAR arguments PRED_R_PAR. Instead of this, it seems to consider B(x) as a comparison, which explains why it expects to find a COMPARISON_OPERATOR instead of a CONJUNCTION_COMMA.
How can I force the parser to recognise, in predicate, a int_ext_identifier PRED_L_PAR arguments PRED_R_PAR instead of a comparison ?
I tried to give a bigger priority to CONJUNCTION_SYMBOL as follows but nothing changed :
CONJUNCTION_SYMBOL.2 : "&" | "\N{LOGICAL AND}"
I have no clue about the approach to have.
Thank you in advance for your help.
EDIT :
If I use the input string A(x)::~B(x), I get the following error message :
UnexpectedToken: Unexpected token Token('$END', '') at line 2, column 11.
Expected one of:
* COMPARISON_OPERATOR
Considering the following input string
input_str = "C(x) :: B(x) & A(x)"
.I have the following grammar :
I parse the input string as follows :
I need to use LALR algorithm to be able to use the interactive mode of the parsing later on.
I get the following error message :
In my understanding, the parser recognises well my_rule in expression. Then, in my_rule, body is well recognised, which leads to conjunction. And then, B(x) is well recognised as a predicate. In my understanding, the problem arises in predicate.
The parser should recognise B(x) as a predicate in the form of
int_ext_identifier PRED_L_PAR arguments PRED_R_PAR
. Instead of this, it seems to consider B(x) as acomparison
, which explains why it expects to find a COMPARISON_OPERATOR instead of a CONJUNCTION_COMMA.How can I force the parser to recognise, in predicate, a
int_ext_identifier PRED_L_PAR arguments PRED_R_PAR
instead of acomparison
?I tried to give a bigger priority to CONJUNCTION_SYMBOL as follows but nothing changed :
I have no clue about the approach to have.
Thank you in advance for your help.
EDIT :
If I use the input string
A(x)::~B(x)
, I get the following error message :