title: Use of Flex and Bison
body: <p>I'm a newby for Flex and Bison, and I have tried to write a Flex lexical scanner and then a Bison grammar, but I encounter the following problem:</p>
  
  <ul>
  <li>a word can sometimes match with different definitions in the Flex definitions, and I would like Bison to find from it's grammar the good Flex definition to choose.</li>
  </ul>
  
  <p>For example, if the word <code>abc</code> can be seen as <code>category1</code> or <code>category2</code> in Flex, I would like Bison to choose <code>category1</code> if it appears without syntax error as <code>category1</code> in the Bison grammar and incorrect as category2; but if it appears as a syntax error when it is <code>category1</code> and not as <code>category2</code>, then Flex should classify it as <code>category2</code>.</p>
  
  <p>Is there a way to do this? Or am I totally misunderstanding Flex and Bison?</p>