Boost Spirit: parse boolean expression and reduce to canonical normal form
问题 I want to parse a common Boolean with just or , and and not operators, which I think I have done using Boost Spirit below. In phase 2 (or perhaps part of the parsing itself), I wish to transform the AST of the Boolean to disjunctive canonical normal form, which essentially "flattens" the expression and removes all grouping operators. In one of my attempts, I created the Boost static_visitor below, named Transformer . I started by trying to eliminate double not operators by just assigning a