Javascript Formal Logic Parser