in reply to Parse::RecDescent and boolean expressions
Off the top of my head, the traditional grammar for an expression looks more like:
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.expression: <leftop: exp1 'OR' exp1> exp1: <leftop: exp2 'AND' exp2> exp2: ('NOT')(s?) exp3 exp3: item | '(' expression ')' item: ...
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|