title: Lex: C keyword rules not identifying correctly
body: <p>I wrote a simple lex file to identify C keywords.  My rules looks like:</p>
  
  <pre><code>keyword do|while|char|if
  %%
  {keyword}  { printf("Keyword %s found.", yytext); }
  </code></pre>
  
  <p>The problem is the rule correctly identifies <code>char</code> in source code, but it also identifies things like <code>putchar</code> as keyword <code>char</code>.  How can I force the rule to only identify the keyword <code>char</code> and not when it's present in other words? </p>