title: Shift/Reduce Conflict in Yacc/Flex
body: <p>I have this grammar in yacc:</p>
  
  <pre><code>%{
      #include &lt;stdio.h&gt;
  %}
  
  %token texto SEP ERRO word
  
  %start Ini
  
  %%
  
  Ini: Directivas SEP SEP Conceitos '$'
              { printf("Terminou bem...\n"); return 0; };
  
  Directivas: Directiva
            | Directivas SEP Directiva
            ;
  
  Conceitos: Conceito
           | Conceitos SEP SEP Conceito
           ;
  
  Conceito: word SEP Atributos;
  
  Atributos: Atributo
           | Atributos SEP Atributo
           ;
  
  Directiva: texto;
  Atributo: '-' texto;
  
  %%
  
  int main(){
      yyparse();
  }
  
  int yyerror(char *s){
      fprintf(stderr, "%s\n", s);
  }
  </code></pre>
  
  <p>And in flex:</p>
  
  <pre><code>%{
      #include "y.tab.h"
  %}
  
  %%
  
  [a-zA-Z]+           return word;
  
  [a-zA-Z ]+          return texto;
  
  \-                  return '-';
  
  \n                  return SEP;
  
  [ \t]               ;
  
  .                   return ERRO;
  
  &lt;&lt;EOF&gt;&gt;             return '$';
  </code></pre>
  
  <p>I want to make a parse that valids something like:</p>
  
  <pre><code>text line
  text line
  text line
  
  word
  -text line
  -text line
  -text line
  
  word
  -text line
  </code></pre>
  
  <p>where the first lines are the 'Directivas' and then one blank line and then it comes the 'Conceitos' where one Conceito is one word followed by a few text lines with a '-' in the begin. those 'Conceitos are separated by one blank line</p>
  
  <p>but it finds a shift/reduce conflitct.. i am new in this and i cant find out why</p>
  
  <p>Sorry for my english</p>
  
  <p>Thank you</p>