Parse a rule from its syntax string and return the corresponding AbstractRule implementation.
The syntax string of the rule to parse.
The parsed implementation of AbstractRule object if successful, null otherwise.
Create a deep clone of the given AbstractRule by parsing its syntax and copying its annotations.
the original AbstractRule object to clone.
a new AbstractRule object that is a deep clone of the original.
ProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparse
Parser class for parsing rule syntax into AbstractRule objects. You should normally not need to use this parser directly, as it is primarily used internally when creating rules from syntax. This parser handles parsing of conditional rules (IF-THEN, IF-THEN-ELSE, IF-THROW) as well as assignment rules (SET x = value). It also supports parsing of annotations for rules, such as @name, @hint, and @salience. The parser uses regular expressions to identify the structure of the rule syntax and delegates to the ExpressionParser and ExecutableParser for parsing specific components of the rules (like conditions and consequences). The parser is designed to be extensible, allowing for additional rule types and syntax patterns to be added in the future as needed.