title: Bison nonterminal useless in grammar
body: <p>When I compile the below grammar with <code>bison test.y</code>, it warns that the nonterminals "header_stms" and "forward" are useless. Why? They are used in the "program" rule. The nonterminal "stm" is not reported useless.</p>
  
  <pre><code>%%
  
  program: /* empty */
      | stm
      | header_stms
      ;
  
  header_stms: header_stms forward
      ;
  
  /* forward proc declaration */
  forward: "forward" TK_ID ";"
      ;
  
  stm: TK_ID "+" TK_ID
      ;
  
  %%
  </code></pre>
  
  <p>The rules that use those nonterminals are also deemed useless.</p>