79507868

Date: 2025-03-13 23:34:41
Score: 1
Natty:
Report link

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.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Andrew