public new static ConditionExpression Parse(Metamodel metaModel, string expressionText) { var groupedMatches = Syntax.Condition.Matches(expressionText)[0].Groups; // e.g - Func.GreaterThan:Int32:1,Logic.IsTrue:Boolean:True string methodNameText = groupedMatches[1].Value; string parametersText = groupedMatches[5].Value; MethodMapping methodMapping = metaModel.Conditions[methodNameText]; MethodNameExpression methodNameExpression = MethodNameExpression.Parse(metaModel, methodNameText); Parameters parameters = Parameters.Parse(metaModel, methodMapping.EnumParameterTypes, parametersText); return(new ConditionExpression(methodNameExpression, parameters)); }
public static ActionExpression Parse(Metamodel metaModel, string expressionText) { Match match = FullMatch(Syntax.Action, expressionText); if (match == null) { throw new Exception($"Unmatched {nameof(ActionExpression)} {expressionText}"); } ; MethodNameExpression methodNameExpression = MethodNameExpression.Parse(metaModel, match.Groups[1].Value); MethodMapping methodMapping = metaModel.Actions[methodNameExpression.ToString()]; Parameters parameters = Parameters.Parse(metaModel, methodMapping.EnumParameterTypes, match.Groups[5].Value); return(new ActionExpression(methodNameExpression, parameters)); }
public ActionExpression(MethodNameExpression methodName, Parameters parameters = null) { MethodName = methodName; Parameters = parameters; }
public ConditionExpression(MethodNameExpression methodNameExpression, Parameters parameters = null) { MethodName = methodNameExpression; Parameters = parameters; }