title: Syntax error in JISON with simple grammar
body: <p>I'm trying to implement a very simple parser, but I'm having a problem. I have the following grammar:</p>
  <pre><code>%lex
  
  %options flex case-insensitive
  
  CaracterEscape              [\'\&quot;\\bfnrtv]
  Escape                      \\{CaracterEscape}
  CaracterCadena              [^\&quot;\\]+
  CadenaDoble                 ({Escape}|{CaracterCadena})
  LiteralCadena               \&quot;{CadenaDoble}*\&quot;
  CaracterChar                [^\'\\]
  CadenaSimple                {Escape}|{CaracterChar}
  LiteralChar                 \'{CadenaSimple}\'
  
  %%
  
  \s+                                     {}                               
  &quot;//&quot;.*                                  {}
  [/][*][^*]*[*]+([^/*][^*]*[*]+)*[/]     {}
  
  &quot;+&quot;                         return 'A_MAS';
  &quot;-&quot;                         return 'A_MENOS';
  &quot;*&quot;                         return 'A_MULTI';
  &quot;/&quot;                         return 'A_DIV';
  &quot;**&quot;                        return 'A_POTENCIA';
  &quot;%&quot;                         return 'A_MOD';
  
  &quot;++&quot;                        return 'O_INCREMENTO';
  &quot;--&quot;                        return 'O_DECREMENTO';
  
  &quot;=&quot;                         return 'O_ASIGNACION';
  
  &quot;&lt;&quot;                         return 'R_MENOR_QUE';
  &quot;&gt;&quot;                         return 'R_MAYOR_QUE';
  &quot;&lt;=&quot;                        return 'R_MENOR_IGUAL';
  &quot;&gt;=&quot;                        return 'R_MAYOR_IGUAL';
  &quot;==&quot;                        return 'R_IGUAL';
  &quot;!=&quot;                        return 'R_DIFERENTE';
  
  &quot;||&quot;                        return 'L_OR';
  &quot;&amp;&amp;&quot;                        return 'L_AND';
  &quot;^&quot;                         return 'L_XOR';
  &quot;!&quot;                         return 'L_NOT';
  
  &quot;,&quot;                         return 'S_COMA';
  &quot;;&quot;                         return 'S_PUNTO_COMA';
  &quot;:&quot;                         return 'S_DOS_PUNTOS';
  &quot;(&quot;                         return 'S_PAR_APERTURA';
  &quot;)&quot;                         return 'S_PAR_CIERRE';
  &quot;{&quot;                         return 'S_LLAVE_APERTURA';
  &quot;}&quot;                         return 'S_LLAVE_CIERRE';
  
  &quot;int&quot;                       return 'T_INT';
  &quot;double&quot;                    return 'T_DOUBLE';
  &quot;char&quot;                      return 'T_CHAR';
  &quot;boolean&quot;                   return 'T_BOOLEAN';
  &quot;string&quot;                    return 'T_STRING';
  
  &quot;if&quot;                        return 'I_IF';
  &quot;else&quot;                      return 'I_ELSE';
  &quot;switch&quot;                    return 'I_SWITCH';
  &quot;case&quot;                      return 'I_CASE';
  &quot;default&quot;                   return 'I_DEFAULT';
  &quot;break&quot;                     return 'I_BREAK';
  &quot;for&quot;                       return 'I_FOR';
  &quot;while&quot;                     return 'I_WHILE';
  &quot;do&quot;                        return 'I_DO_WHILE';
  &quot;continue&quot;                  return 'I_CONTINUE';
  
  &quot;void&quot;                      return 'P_VOID';
  &quot;const&quot;                     return 'P_CONSTANTE';
  
  &quot;call&quot;                      return 'F_CALL';
  &quot;return&quot;                    return 'F_RETURN';
  &quot;print&quot;                     return 'F_PRINT';
  &quot;println&quot;                   return 'F_PRINTLN';
  &quot;typeof&quot;                    return 'F_TYPEOF';
  
  [0-9]+\b                    return 'ENTERO';
  [0-9]+(&quot;.&quot;[0-9]+)?\b        return 'DECIMAL';
  {LiteralChar}               return 'CARACTER';
  {LiteralCadena}             return 'CADENA';
                              
  (&quot;true&quot;|&quot;false&quot;)            return 'BOOLEANO';
  
  [a-zA-Z_][a-zA-Z0-9_]*      return 'ID';
  
  &lt;&lt;EOF&gt;&gt;                     return 'EOF';
  
  .                           {
                                  console.error(`Error lexico: ${yytext}, en:\nlinea: ${yylloc.first_line}, columna: ${yylloc.first_column + 1}`);
                              }
  
  /lex
  
  %{
  %}
  
  %left           'L_OR'
  %left           'L_AND'
  %left           'L_XOR'
  %nonassoc       'R_MENOR_QUE' 'R_MAYOR_QUE' 'R_MENOR_IGUAL' 'R_MAYOR_IGUAL' 'R_IGUAL' 'R_DIFERENTE'
  %left           'R_IGUAL' 'R_DIFERENTE'
  %left           'R_MAYOR_QUE' 'R_MENOR_QUE' 'R_MAYOR_IGUAL' 'R_MENOR_IGUAL'
  %left           'A_MAS' 'A_MENOS'
  %left           'A_MULTI' 'A_DIV' 'A_MOD'
  %right          'A_POTENCIA'
  %right          'UMINUS' 'L_NOT'
  %right          'O_INCREMENTO' 'O_DECREMENTO'
  //%right          'S_PAR_APERTURA'
  
  %start axioma
  
  %%
  
  axioma          :           S_LLAVE_APERTURA instrucciones S_LLAVE_CIERRE  EOF {                                
                              };
  
  instrucciones   :           instrucciones instruccion {
                       
                                  }
                              }
                  |           instruccion {
                           
                              };
  
  instruccion     :           asignacion fin_instr {
                       
                              }                
                  |           call func {
  }
                              }
                  |           error {
                                  console.log(`Error sintactico en: linea ${@1.first_line}, columna ${@1.first_column} `);
                              };
  
  
  expresion       :           expresion A_MAS expresion {                                
                       
                              }
                  |           expresion A_MENOS expresion {
                       
                              }
                  |           expresion A_MULTI expresion {
                       
                              }
                  |           expresion A_DIV expresion {
                       
                              }
                  |           expresion A_POTENCIA expresion {
                       
                              }
                  |           expresion A_MOD expresion {
                       
                              }
                  |           A_MENOS expresion %prec UMINUS {
                       
                              }
                  |           expresion R_MENOR_QUE expresion {
                       
                              }
                  |           expresion R_MAYOR_QUE expresion {
                       
                              }
                  |           expresion R_MENOR_IGUAL expresion {
                       
                              }
                  |           expresion R_MAYOR_IGUAL expresion {
                       
                              }
                  |           expresion R_IGUAL expresion {
                       
                              }
                  |           expresion R_DIFERENTE expresion {
                       
                              }
                  |           expresion L_AND expresion {
                       
                              }
                  |           expresion L_OR expresion {
                       
                              }
                  |           expresion L_XOR expresion {
                       
                              }
                  |           L_NOT expresion {                                
                       
                              }
                  |           S_PAR_APERTURA expresion S_PAR_CIERRE {
                       
                              }
                  |           ENTERO {
                       
                              }
                  |           DECIMAL {
                       
                              }
                  |           CARACTER {
                       
                              }
                  |           CADENA {
                       
                              }
                  |           BOOLEANO {                                
                       
                              }
                  |           ID {
                       
                              };
  
  asignacion      :           ID O_ASIGNACION expresion {
                       
                              }
                  |           ID O_INCREMENTO {                                
                       
                              }
                  |           ID O_DECREMENTO {                                
                       
                              };
  
  lista_params    :           lista_params COMA expresion {
                       
                              }
                  |           expresion {
                       
                              };
  
  call_func       :           F_CALL ID S_PAR_APERTURA S_PAR_CIERRE {
                              }
                  |           F_CALL ID S_PAR_APERTURA lista_params S_PAR_CIERRE {
  };
  
  fin_instr       :           S_PUNTO_COMA;
  </code></pre>
  <p>The grammar contains more productions but it is this part that is creating conflicts. The problem comes when trying to parse the following text:</p>
  <pre><code>{
      call add(2, 3)
  }
  </code></pre>
  <p>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?</p>
  <p>The output is:
  Error sintactico en: linea 2, columna 18</p>