title: lex yacc compare two strings
body: <p>I'm really new in lex and yacc, I'd like to write an extremely simply program that asks input for a string, stores it in a variable, and checks if the same value is inserted once again. Lets say:</p>
  
  <pre><code>input1 = 'abc'
  input2 = 'def'
  input3 = 'ghi'
  input4 = 'def'
  STOP input2 equals input4
  </code></pre>
  
  <p>part of my <strong>lex</strong> file:</p>
  
  <pre><code>%option noyywrap
  %{
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  %}
  alpha [a-zA-Z]
  %%
  {alpha}* return ID;
  </code></pre>
  
  <p>part of my <strong>yacc</strong> file</p>
  
  <pre><code>%{
  # include &lt;stdio.h&gt;
  # include &lt;ctype.h&gt;
  # include &lt;string.h&gt;
  %}
  
  %union {
         char* lexeme;            
         }
  
  %token ID 
  %%
  </code></pre>
  
  <p>all the inputs should be matched within the ID token.</p>