title: Compiling a Lex program on OS X
body: <p>Is anyone able to better inform me on successfully compiling a Lex source file on OS X in terminal. I have written in <code>HelloWorld.l</code> the following:</p>
  
  <pre><code>%%
  
  "hello world"    printf("GOODBYE\n");
  .                ;
  
  %%
  </code></pre>
  
  <p>Within the console I executed <code>lex HelloWorld.l</code> followed by <code>gcc lex.yy.c -ll</code> and <code>./a.out</code> receiving a blank state within my window and no result. </p>
  
  <p>I am basing my knowledge on this topic from the source <a href="https://www.youtube.com/watch?v=54bo1qaHAfk" rel="nofollow noreferrer">[1]</a> and similar Stack question <a href="https://stackoverflow.com/questions/8859710/lex-how-to-run-compile-a-lex-program-on-commandline">[2]</a>.</p>