title: How to convert boolean expression strings to objects?
body: <p>How could I best evaluate user-given boolean expression strings like:</p>
  
  <pre><code>A &amp; B | (C &amp; !D)
  </code></pre>
  
  <p>What do I need this for? Example:
  Imagine we have a set of people, and the user has an input field where he can connect two (and more) of these peoples with boolean expressions written as <code>String</code> like:</p>
  
  <pre><code>Peter &amp; Klaus | (Peter &amp; Clair | !Klaus)
  </code></pre>
  
  <p>(I know this expression does not make any sence, just as an example).</p>
  
  <p>I then want to split this boolean string somehow using boolean grammer.
  Later, if a person is renamed (eg. Peter -> John), I want the expression the user gave to also be auto-renamed with the new names. So that the user sees an update on his saved expression with the new names.</p>
  
  <p>Therefore I probably have to store the boolean expression using the id's representing the objects behind the names. Therefore having to look up each name from the expression in the db, therefore having to split the string by boolean grammer.</p>
  
  <p>Questions:</p>
  
  <ul>
  <li><p>How could I best split this string?</p></li>
  <li><p>How could I store this expression using object values, so that this string can be revaluated when names change?</p></li>
  </ul>