I’m trying to implement a very simple parser, but I’m having a problem. I have the following grammar:
axioma : '{' list_instr '}' EOF;
list_instr : list_instr instr
| instr;
instr : call_func;
call_func : 'call' ID '(' params_list ')'
| 'call' ID '(' ')';
params_list : params_list ',' NUM
| NUM;
The grammar contains more productions but it is this part that is creating conflicts. The problem comes when trying to parse the following text:
{
call add(2, 3)
}
JISON tells me that there was a syntactic error in ‘(‘, however the characters are provided by the lexical analyzer, so I think the problem may be the grammar but I really don’t understand what the cause is. Any ideas?