title: Boolean Query / Expression to a Concrete syntax tree
body: <p>I'm creating a search form that allows boolean expressions, like: "foo AND bar" or "foo AND NOT bar". </p>
  
  <p>Is there a library for PHP, Ruby or Java that can transform boolean expressions to a concrete syntax tree? </p>
  
  <p>(I could write my own lexer/parser, but I rather use something tried and tested)</p>
  
  <p>EDIT: To clarify, I'm not parsing arrhythmic expressions. It's going to be used for parsing full text queries that allow boolean operators.</p>