in reply to converting a boolean syntax

How about this (example used is "(A AND B) OR (C OR D NOT E) OR Q"):

  1. Break the statement into smaller ones on the joiner -- AND, OR, NOT -- which are not inside parent expression. That will yield: { OR <-- { (A AND B) , (C OR D NOT E) } , OR <-- { Q } }.
  2. Go thru to each of the component of the broken down tokens, to search for the joiner as above, giving: { AND <-- { A, B } , OR <-- { C , D , NOT E } }.
  3. Do the above for all other sub components, till all are exhausted.
  4. Ending up w/...
    { OR <-- { AND <-- { A , B } , OR <-- { C , D , NOT <-- { E } } } , OR <-- { Q } }
  5. Last step would be add the appropriate signs (or nothing at all) based on parent joiner, which can be easily done in a loop.

Well, that is what currently comes to mind, bugs expected.

Updated (Jun 24 2003) the parsed expressions as after adding "OR Q" in the example, forgot to correctly update the hierarchy.