title: Undefined token while compiling Bison/Flex files
body: <p>I'm getting started with Bison/YACC and Flex/Lex, but I cannot compile the simplest of parsers.</p>
  
  <p>File: Ruby.y</p>
  
  <pre><code>%{ 
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt; 
  %}
  
  %start program
  %token NUMBER
  
  %%
  
  program : NUMBER;
  
  %%
  
  main( int argc, char* argv[] ) {
      yyparse();
  } 
  
  yyerror(char *s){
      printf("%s\n", s);
  }
  </code></pre>
  
  <p>File: Ruby.l</p>
  
  <pre><code>%{
  #define "Ruby.tab.h"
  %}
  DIGIT   [0-9]
  %%
  {DIGIT}+    { return(NUMBER);           }
  [ \t\n]+
  .           { return(yytext[0]);        }
  %%
  </code></pre>
  
  <p>I compiled Ruby.y using "Bison -vd Ruby.y", then "Flex Ruby.l" and then tried to compile the whole thing using GCC with "GCC -c Ruby.tab.c" and "GCC -c lex.yy.c" but I get the following error on the latter:</p>
  
  <p>Ruby.l:2:9: error: macro names must be identifiers
  Ruby.l: In function 'yylex':
  Ruby.l:6:10: error: 'NUMBER' undeclared (first use in this function)
  Ruby.l:6:10: note: each undeclared identifier is reported only once for each fun
  ction it appears in</p>
  
  <p>I am clueless, any idea?</p>
  
  <p>Thank you.</p>