in reply to Parse::RecDescent and mini-language parsing

Your expressions and subexpressions look a little too complicated to me. Try setting the two variables :
$RD_TRACE = 1; $RD_HINT = 1;
And watch what happens. The ')' that it prints is the result of the first set of brackets (if you dont create any actions, it returns the last thing that successfully matched.) It threw the rest away as it couldnt match it.
Heres a snippet of something that I was using to evaluate expressions, maybe it helps:
condition: booleanexpr | '&&' booleanexpr | '||' booleanexpr booleanexpr: '!' booleanexpr { $return = $item[1] . $item[2]; } | '(' booleanexpr ')' { $return = $item[1] . $item[2] . $item[3]; } | Value_op comparator Value_op { $return = $item[1] . $item[2] . $item[3]; } comparator: '==' | '<' | '>' | '<=' | '>=' | '!=' Value_op: operation | Value Value: String | Number | Float operation: operator plusminus(?) { my $op; $op = ''; if(@{$item[2]}) { $op = $item[2]->[0]; } $return = $item[1] . $op; 1; } plusminus: '+' operator { $return = $item[1] . $item[2]; } | '-' operator { $return = $item[1] . $item[2]; } operator: ('*' Value | '/' Value) | '(' operation ')' | Value
C.