title: yylineno has always the same value in yacc file
body: <p>for one project in compilers i have one problem in the syntax analyzer,
  when i go to add a symbol in a symbol table, i take always the same value in yylineno...</p>
  
  <p>i did this in the begining:</p>
  
  <pre><code>%{
  
      int yylex(void);
      int yyerror(char* yaccProvidedMessage);    
      extern int yylineno;     //i declare yylineno from the lexical analyzer
      extern char *yytext;
      extern FILE *yyin;       
  
      int scope=0;  
      int max_scope;
  %}
  </code></pre>
  
  <p>and in the grammar when i go to add something in symbol table:</p>
  
  <p>i.e</p>
  
  <pre><code>lvalue: ID {
  
          printf("&lt;-ID");     
          add_data_to_symbol_table((char*)($1),scope,yylineno);
          printf("lineNO:%d",yylineno);
  
          }
          ;
  </code></pre>
  
  <p>in the output when i give an input 
  with different lines it doesnt recognize the new line</p>
  
  <pre><code>if(x&lt;=2)
  {
  
      if(t&lt;1)
      {
          k=2;   
      }
  }
  </code></pre>
  
  <p>the lineNO never change,always have 1 as value...</p>
  
  <p>any ideas?</p>