title: How can I build a Truth Table Generator?
body: <p>I'm looking to write a Truth Table Generator as a personal project.</p>
  
  <p>There are several web-based online ones <a href="http://www.brian-borowski.com/Software/Truth/" rel="noreferrer">here</a> and <a href="http://www-cs-students.stanford.edu/~silver/truth/" rel="noreferrer">here</a>.</p>
  
  <p><img src="https://imgur.com/t1S9u.png" alt="alt text"><br>
  <em><code>(Example screenshot of an existing Truth Table Generator</code>)</em></p>
  
  <p>I have the following questions:</p>
  
  <ul>
  <li>How should I go about parsing expressions like: <em>((P => Q) &amp; (Q => R)) => (P => R)</em></li>
  <li>Should I use a parser generator like ANTLr or YACC, or use straight regular expressions?</li>
  <li>Once I have the expression parsed, how should I go about generating the truth table?  Each section of the expression needs to be divided up into its smallest components and re-built from the left side of the table to the right.  How would I evaluate something like that?</li>
  </ul>
  
  <p>Can anyone provide me with tips concerning the parsing of these arbitrary expressions and eventually evaluating the parsed expression?</p>