title: How to make semantic check using flex/bison?
body: <p>I have created a context free grammar in bison and a scanner in flex. Now i also want to make a semantic check, for example, suppose the input is something like this:</p>
  
  <pre><code>int m=5;
  c=c+5;
  </code></pre>
  
  <p>This input is syntactically correct but there is an undeclared variable being used, namely "c". How can i do such a semantic check? Where should i start? Should i write my code in flex or in bison? I appreciate if anyone can help. Thanks.</p>