public void Convert(List<string> output, SystemFunctionInvocation sysFunction) { Expression[] args = sysFunction.Args; System.Reflection.MethodInfo method; if (this.methodLookup.TryGetValue(sysFunction.Name, out method)) { if (this.argCount[sysFunction.Name] != args.Length) { throw new ParserException(sysFunction.FirstToken, "Invalid number of args for $" + sysFunction.Name + ". Expected " + this.argCount[sysFunction.Name] + " but found " + sysFunction.Args.Length + "."); } List<object> methodArgs = new List<object>() { output }; methodArgs.AddRange(args); method.Invoke(this, methodArgs.ToArray()); } else { throw new ParserException(sysFunction.FirstToken, "Unknown primitive function:" + sysFunction.Name); } }
private void SerializeSystemFunctionInvocation(List<string> output, SystemFunctionInvocation sysfun) { PRIMITIVE_METHODS.Convert(output, sysfun); }