public override Node ExitFunctionCallExpression(Production node) { IList childValues = this.GetChildValues(node); string name = (string)childValues[0]; childValues.RemoveAt(0); ArgumentList args = new ArgumentList(childValues); FunctionCallElement funcCall = new FunctionCallElement(name, args); node.AddValue(funcCall); return(node); }
private bool FindIndexer(Type targetType) { // Get the default members MemberInfo[] members = targetType.GetDefaultMembers(); List <MethodInfo> methods = new List <MethodInfo>(); // Use the first one that's valid for our indexer type foreach (MemberInfo mi in members) { PropertyInfo pi = mi as PropertyInfo; if ((pi != null)) { methods.Add(pi.GetGetMethod(true)); } } FunctionCallElement func = new FunctionCallElement("Indexer", methods.ToArray(), MyIndexerElements); func.Resolve(MyServices); MyIndexerElement = func; return(true); }
private void EmitIndexer(FleeILGenerator ilg, IServiceProvider services) { FunctionCallElement func = MyIndexerElement as FunctionCallElement; func.EmitFunctionCall(this.NextRequiresAddress, ilg, services); }