in reply to Parse::RecDescent and boolean expressions

Your grammar appears sideways. You're permitting "AND foo" as a legal construct, for example.

Off the top of my head, the traditional grammar for an expression looks more like:

expression: <leftop: exp1 'OR' exp1> exp1: <leftop: exp2 'AND' exp2> exp2: ('NOT')(s?) exp3 exp3: item | '(' expression ')' item: ...
This also gets all the precedence right. You're not going to be able to parse "AND" and "OR" in the same rule and get the precedence right.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.