Interesting topic. I am implementing IF operator in my little DSL, and I want a provision for an option for expression that resolves to value, rather than just value. So that one can compare
if (expression, like (2+2) etc) >= (another expression) THEN
IF ((booleanTypeVariable) OR ( myVariable > 0)) AND ((3-1)>0) THEN...
Still in the works, also want to be able to resolve function to either numeric value, or straight boolean, not sure how it will play out. Right now EBNF look like so:
ifOperator = 'IF' boolean 'THEN' statementList ('END'| ('ELSE' statementList 'END'))
boolean = 'true' | 'false' | booleanTypeVariable | condition { ('AND'|'OR') condition}
condition = expression comparator expression
comparator = '>' | '<' | '='.. etc
expression = variable | function call | mathExpression
turned out not a straightforward task.