Parse a string expression into an Expression object that can be evaluated within the rule engine.
The string representation of the expression to parse.
An Expression object representing the parsed expression if successful.
ProtectedtokenizeProtectedsplitProtectedisProtectedisProtectedstripProtectedreadSafely split function arguments or array items) by commas while respecting nested structures like parentheses, brackets, and string literals.
the whole argument string, e.g. "candidate : scoreCandidate(candidate), otherArg: 5, arr: [1, 2, 3]"
an array of individual argument strings
ProtectedreadProtectedreadProtectedreadProtectedfindProtectedreadProtectedreadProtectedreadProtectedreadProtectedread
Parser class for parsing expressions from rule syntax. You should normally not need to use this parser directly, as it is primarily used internally by the RuleParser and ExecutableParser when parsing conditions and consequences from rule syntax. This parser handles parsing of literals, variables, function calls, logical expressions (AND/OR), comparison expressions (==, !=, <, >, <=, >=, in), arithmetic expressions (+, -, *, /, %), and ternary expressions (condition ? trueExpr : falseExpr). It uses a recursive descent parsing approach, starting with the most complex expressions (function calls, logical expressions) and working down to simpler expressions (literals, variables). The parser also handles operator precedence by first parsing lower-precedence operators (like + and -) before higher-precedence operators (like * and /).