public override void OnGenericReferenceExpression(GenericReferenceExpression node) { Write(node.Target); Write("<"); WriteCommaSeparatedList(node.GenericArguments); Write(">"); }
private void MapMember(GenericReferenceExpression node, IMember member) { if (member.EntityType == EntityType.Constructor) { //if this is an External constructor, we don't care about mapping it here. var mappedCtor = member as GenericMappedConstructor; if (mappedCtor != null) { MapConstructor(node, mappedCtor); } return; } var genArgs = node.GenericArguments .Select(ga => _methodToStateMachineMapper.MapType((IType)ga.Entity)) .ToArray(); var mapped = member as IGenericMappedMember; if (mapped != null) { var source = mapped.SourceMember; member = source.DeclaringType.GenericInfo.ConstructType(genArgs).ConstructedInfo.Map(source); } else { var method = ((IMethod)member).ConstructedInfo; member = method.GenericDefinition.GenericInfo.ConstructMethod(genArgs); } node.Entity = member; node.ExpressionType = member.Type; }
public override void OnMethodInvocationExpression(MethodInvocationExpression node) { if (node is MethodInvocationExpression && node.Target is GenericReferenceExpression) { GenericReferenceExpression genericReferenceExpression = (GenericReferenceExpression)node.Target; if (genericReferenceExpression.Target is ReferenceExpression) { ReferenceExpression referenceExpression = (ReferenceExpression)genericReferenceExpression.Target; if (referenceExpression.Name == "array" && 1 == ((ICollection)genericReferenceExpression.GenericArguments).Count) { TypeReference node2 = genericReferenceExpression.GenericArguments[0]; if (1 == ((ICollection)node.Arguments).Count) { Expression node3 = node.Arguments[0]; Write("new "); Write(node2); Write("["); Write(node3); Write("]"); return; } } } } if (IsInstantiation(node)) { Write("new "); } Write(node.Target); WriteParenthesidCommaSeparatedList(node.Arguments); }
public static Expression my(ReferenceExpression typeReference) { var myReference = new GenericReferenceExpression(typeReference.LexicalInfo); myReference.Target = AstUtil.CreateReferenceExpression(typeReference.LexicalInfo, "Boo.Lang.Environments.My"); myReference.GenericArguments.Add(TypeReference.Lift(typeReference)); return(new MemberReferenceExpression(typeReference.LexicalInfo, myReference, "Instance")); }
public IEntity ResolveGenericReferenceExpression(GenericReferenceExpression gre, IEntity definition) { ResolveTypeReferenceCollection(gre.GenericArguments); IType[] typeArguments = gre.GenericArguments.ToArray(t => TypeSystemServices.GetType(t)); return(My <GenericsServices> .Instance.ConstructEntity( gre, definition, typeArguments)); }
public override void OnMethodInvocationExpression(MethodInvocationExpression node) { if (node is MethodInvocationExpression && node.Target is GenericReferenceExpression) { var genericReferenceExpression = (GenericReferenceExpression)node.Target; if (genericReferenceExpression.Target is MemberReferenceExpression) { var memberReferenceExpression = (MemberReferenceExpression)genericReferenceExpression.Target; if (memberReferenceExpression.Target is MemberReferenceExpression) { var memberReferenceExpression2 = (MemberReferenceExpression)memberReferenceExpression.Target; if (memberReferenceExpression2.Target is MemberReferenceExpression) { var memberReferenceExpression3 = (MemberReferenceExpression)memberReferenceExpression2.Target; if (memberReferenceExpression3.Target is ReferenceExpression) { var referenceExpression = (ReferenceExpression)memberReferenceExpression3.Target; if (referenceExpression.Name == "Boo" && memberReferenceExpression3.Name == "Lang" && memberReferenceExpression2.Name == "Builtins" && memberReferenceExpression.Name == "array" && 1 == ((ICollection)genericReferenceExpression.GenericArguments).Count) { TypeReference node2 = genericReferenceExpression.GenericArguments[0]; if (1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is CastExpression) { var castExpression = (CastExpression)node.Arguments[0]; Expression target = castExpression.Target; if (castExpression.Type is SimpleTypeReference) { var simpleTypeReference = (SimpleTypeReference)castExpression.Type; if (simpleTypeReference.Name == "int") { var methodInvocationExpression = new MethodInvocationExpression(LexicalInfo.Empty); var arg_255_0 = methodInvocationExpression; var genericReferenceExpression2 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_226_0 = genericReferenceExpression2; var referenceExpression2 = new ReferenceExpression(LexicalInfo.Empty); string text = referenceExpression2.Name = "array"; Expression expression = arg_226_0.Target = referenceExpression2; TypeReferenceCollection typeReferenceCollection = genericReferenceExpression2.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(node2) }); Expression expression2 = arg_255_0.Target = genericReferenceExpression2; ExpressionCollection expressionCollection = methodInvocationExpression.Arguments = ExpressionCollection.FromArray(new Expression[] { Expression.Lift(target) }); ReplaceCurrentNode(methodInvocationExpression); } } } } } } } } } }
public override void OnGenericReferenceExpression(GenericReferenceExpression node) { base.OnGenericReferenceExpression(node); node.ExpressionType = _methodToStateMachineMapper.MapType(node.ExpressionType); var member = node.Entity as IMember; if (member != null) { MapMember(node, member); } }
private void MapConstructor(GenericReferenceExpression node, GenericMappedConstructor member) { var source = member.SourceMember; var genArgs = node.GenericArguments .Select(ga => _methodToStateMachineMapper.MapType((IType)ga.Entity)) .ToArray(); var result = source.DeclaringType.GenericInfo.ConstructType(genArgs).ConstructedInfo.Map(source); node.Entity = result; node.ExpressionType = result.Type; }
private static GenericReferenceExpression BuildReplacement(TypeDefinition type) { var result = new GenericReferenceExpression { Target = new ReferenceExpression(type.Name) }; foreach (var gpd in type.GenericParameters) { result.GenericArguments.Add(new SimpleTypeReference(gpd.Name)); } return(result); }
override public void OnJoinClauseExpression(JoinClauseExpression node) { if (node.DeclaredType) { var typ = node.Identifier.Type; var gen = new GenericReferenceExpression(typ.LexicalInfo); gen.GenericArguments.Add(typ); gen.Target = new MemberReferenceExpression(node.Container, "Cast"); var inv = new MethodInvocationExpression(node.Container.LexicalInfo, gen); node.Container = inv; } base.OnJoinClauseExpression(node); }
public override void OnGenericReferenceExpression(GenericReferenceExpression node) { if (node.IsArrayInstantiation()) { var parent = (MethodInvocationExpression)node.ParentNode; if (parent.Arguments.Count == 1 && parent.Arguments[0].NodeType == NodeType.CastExpression) { parent.Arguments[0] = ((CastExpression)parent.Arguments[0]).Target; } return; } base.OnGenericReferenceExpression(node); }
public GenericReferenceExpression CreateGenericReference(ReferenceExpression baseRef, IEnumerable <TypeReference> typeArgs) { var gre = new GenericReferenceExpression { Target = baseRef }; foreach (var arg in typeArgs) { gre.GenericArguments.Add(arg); } var entity = My <NameResolutionService> .Instance.ResolveGenericReferenceExpression(gre, gre.Target.Entity); gre.Entity = entity; return(gre); ; }
public override void OnMethodInvocationExpression(MethodInvocationExpression node) { var target = node.Target as ReferenceExpression; if (target != null && target.Name == "Array" && target.Entity.EntityType == EntityType.Constructor) { var invokedMethod = (IMethodBase)node.Target.Entity; var parameters = invokedMethod.GetParameters(); if (parameters.Length == 0) { //if we have no parameters we are instantiating an "empty" array which probably will be populated by through the "Add" method. //this will not work (user will get compilation errors in C#), but lets not crash here anyway. var array = new GenericReferenceExpression { Target = new ReferenceExpression("array"), GenericArguments = TypeReferenceCollection.FromArray(CodeBuilder.CreateTypeReference(TypeSystemServices.ObjectType)) }; node.Replace(node.Target, array); node.Arguments.Add(CodeBuilder.CreateIntegerLiteral(0)); } else if (parameters.Length == 1 && parameters[0].Type == TypeSystemServices.IntType) { //if we have one parameter of type int, we are invoking the ctor with capacity, which is equivalent to instantiate an array with such size var array = new GenericReferenceExpression { Target = new ReferenceExpression("array"), GenericArguments = TypeReferenceCollection.FromArray(CodeBuilder.CreateTypeReference(TypeSystemServices.ObjectType)) }; node.Replace(node.Target, array); } else { if (node.Arguments[0].ExpressionType == TypeSystemServices.IEnumerableType) { Context.Errors.Add(CompilerErrorFactory.InvalidArray(node)); } ReplaceCurrentNode(node.Arguments[0]); } } base.OnMethodInvocationExpression(node); }
public IEntity ResolveGenericReferenceExpression(GenericReferenceExpression gre, IEntity definition) { ResolveTypeReferenceCollection(gre.GenericArguments); return(_context.TypeSystemServices.GenericsServices.ConstructEntity(definition, gre, gre.GenericArguments)); }
public override void OnGenericReferenceExpression(GenericReferenceExpression node) { base.OnGenericReferenceExpression(node); Check(node); }
public override void OnMethodInvocationExpression(MethodInvocationExpression node) { if (node == null || !(node.Target is GenericReferenceExpression)) { return; } var genericReferenceExpression = (GenericReferenceExpression)node.Target; if (!(genericReferenceExpression.Target is MemberReferenceExpression)) { return; } var memberReferenceExpression = (MemberReferenceExpression)genericReferenceExpression.Target; if (!(memberReferenceExpression.Target is MemberReferenceExpression)) { return; } var memberReferenceExpression2 = (MemberReferenceExpression)memberReferenceExpression.Target; if (!(memberReferenceExpression2.Target is MemberReferenceExpression)) { return; } var memberReferenceExpression3 = (MemberReferenceExpression)memberReferenceExpression2.Target; if (!(memberReferenceExpression3.Target is ReferenceExpression)) { return; } var referenceExpression = (ReferenceExpression)memberReferenceExpression3.Target; if (referenceExpression.Name != "Boo" || memberReferenceExpression3.Name != "Lang" || memberReferenceExpression2.Name != "Builtins" || memberReferenceExpression.Name != "array" || 1 != genericReferenceExpression.GenericArguments.Count) { return; } var node2 = genericReferenceExpression.GenericArguments[0]; if (1 != node.Arguments.Count || !(node.Arguments[0] is CastExpression)) { return; } var castExpression = (CastExpression)node.Arguments[0]; var target = castExpression.Target; if (!(castExpression.Type is SimpleTypeReference)) { return; } var simpleTypeReference = (SimpleTypeReference)castExpression.Type; if (simpleTypeReference.Name != "int") { return; } var methodInvocationExpression = new MethodInvocationExpression(LexicalInfo.Empty); var genericReferenceExpression2 = new GenericReferenceExpression(LexicalInfo.Empty) { Entity = Error.Default }; var referenceExpression2 = new ReferenceExpression(LexicalInfo.Empty) { Name = "array" }; genericReferenceExpression2.Target = referenceExpression2; genericReferenceExpression2.GenericArguments = TypeReferenceCollection.FromArray(TypeReference.Lift(node2)); methodInvocationExpression.Target = genericReferenceExpression2; methodInvocationExpression.Arguments = ExpressionCollection.FromArray(Expression.Lift(target)); ReplaceCurrentNode(methodInvocationExpression); }
public override void OnGenericReferenceExpression(GenericReferenceExpression node) { MakeTypeResult(ConstructTypeFromGenericReferenceExpression(node)); }
public override void OnGenericReferenceExpression(GenericReferenceExpression node) { throw new NotImplementedException(); }
public ConstructedReturnType ConstructTypeFromGenericReferenceExpression(GenericReferenceExpression node) { Stack <Expression> stack = new Stack <Expression>(); Expression expr = node; while (expr != null) { stack.Push(expr); if (expr is MemberReferenceExpression) { expr = ((MemberReferenceExpression)expr).Target; } else if (expr is GenericReferenceExpression) { expr = ((GenericReferenceExpression)expr).Target; } else { expr = null; } } StringBuilder name = new StringBuilder(); List <IReturnType> typeArguments = new List <IReturnType>(); while (stack.Count > 0) { expr = stack.Pop(); if (expr is MemberReferenceExpression) { name.Append('.'); name.Append(((MemberReferenceExpression)expr).Name); } else if (expr is GenericReferenceExpression) { foreach (TypeReference tr in ((GenericReferenceExpression)expr).GenericArguments) { typeArguments.Add(ConvertVisitor.CreateReturnType(tr, callingClass, resolver.CallingMember, resolver.CaretLine, resolver.CaretColumn, projectContent)); } } else if (expr is ReferenceExpression) { name.Append(((ReferenceExpression)expr).Name); } else { LoggingService.Warn("Unknown expression in GenericReferenceExpression: " + expr); } } IReturnType rt = projectContent.SearchType(new SearchTypeRequest(name.ToString(), typeArguments.Count, callingClass, cu, resolver.CaretLine, resolver.CaretColumn)).Result; if (rt != null) { return(new ConstructedReturnType(rt, typeArguments)); } else { return(null); } }
public override void OnGenericReferenceExpression(GenericReferenceExpression node) { base.OnGenericReferenceExpression(node); node.ExpressionType = _replacer.MapType(node.ExpressionType); }
override public void LeaveGenericReferenceExpression(GenericReferenceExpression node) { OnExpression(node); }
override public void OnGenericReferenceExpression(GenericReferenceExpression node) { Visit(node.Target); WriteGenericArguments(node.GenericArguments); }
public override void LeaveMethodInvocationExpression(MethodInvocationExpression node) { if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression.Target; if (true && memberReferenceExpression.Name == "GetComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is StringLiteralExpression) { StringLiteralExpression stringLiteralExpression = (StringLiteralExpression)node.Arguments[0]; if (true) { string value = stringLiteralExpression.Value; if (true) { TryCastExpression tryCastExpression = new TryCastExpression(LexicalInfo.Empty); TryCastExpression arg_13A_0 = tryCastExpression; MethodInvocationExpression methodInvocationExpression = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_10B_0 = methodInvocationExpression; MemberReferenceExpression memberReferenceExpression2 = new MemberReferenceExpression(LexicalInfo.Empty); string text = memberReferenceExpression2.Name = "GetComponent"; Expression expression = memberReferenceExpression2.Target = Expression.Lift(target); Expression expression2 = arg_10B_0.Target = memberReferenceExpression2; ExpressionCollection expressionCollection = methodInvocationExpression.Arguments = ExpressionCollection.FromArray(new Expression[] { Expression.Lift(value) }); Expression expression3 = arg_13A_0.Target = methodInvocationExpression; TypeReference typeReference = tryCastExpression.Type = TypeReference.Lift(value); this.ReplaceCurrentNode(tryCastExpression); return; } } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression = (ReferenceExpression)node.Target; if (true && referenceExpression.Name == "GetComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is StringLiteralExpression) { StringLiteralExpression stringLiteralExpression2 = (StringLiteralExpression)node.Arguments[0]; if (true) { string value = stringLiteralExpression2.Value; if (true) { TryCastExpression tryCastExpression2 = new TryCastExpression(LexicalInfo.Empty); TryCastExpression arg_280_0 = tryCastExpression2; MethodInvocationExpression methodInvocationExpression2 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_251_0 = methodInvocationExpression2; ReferenceExpression referenceExpression2 = new ReferenceExpression(LexicalInfo.Empty); string text2 = referenceExpression2.Name = "GetComponent"; Expression expression4 = arg_251_0.Target = referenceExpression2; ExpressionCollection expressionCollection2 = methodInvocationExpression2.Arguments = ExpressionCollection.FromArray(new Expression[] { Expression.Lift(value) }); Expression expression5 = arg_280_0.Target = methodInvocationExpression2; TypeReference typeReference2 = tryCastExpression2.Type = TypeReference.Lift(value); this.ReplaceCurrentNode(tryCastExpression2); return; } } } } if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression3 = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression3.Target; if (true && memberReferenceExpression3.Name == "GetComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression3 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_3D8_0 = methodInvocationExpression3; GenericReferenceExpression genericReferenceExpression = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_3A9_0 = genericReferenceExpression; MemberReferenceExpression memberReferenceExpression4 = new MemberReferenceExpression(LexicalInfo.Empty); string text3 = memberReferenceExpression4.Name = "GetComponent"; Expression expression6 = memberReferenceExpression4.Target = Expression.Lift(target); Expression expression7 = arg_3A9_0.Target = memberReferenceExpression4; TypeReferenceCollection typeReferenceCollection = genericReferenceExpression.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression8 = arg_3D8_0.Target = genericReferenceExpression; this.ReplaceCurrentNode(methodInvocationExpression3); return; } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression3 = (ReferenceExpression)node.Target; if (true && referenceExpression3.Name == "GetComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression4 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_4F9_0 = methodInvocationExpression4; GenericReferenceExpression genericReferenceExpression2 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_4CA_0 = genericReferenceExpression2; ReferenceExpression referenceExpression4 = new ReferenceExpression(LexicalInfo.Empty); string text4 = referenceExpression4.Name = "GetComponent"; Expression expression9 = arg_4CA_0.Target = referenceExpression4; TypeReferenceCollection typeReferenceCollection2 = genericReferenceExpression2.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression10 = arg_4F9_0.Target = genericReferenceExpression2; this.ReplaceCurrentNode(methodInvocationExpression4); return; } } } if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression5 = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression5.Target; if (true && memberReferenceExpression5.Name == "GetComponents" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression5 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_63D_0 = methodInvocationExpression5; GenericReferenceExpression genericReferenceExpression3 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_60E_0 = genericReferenceExpression3; MemberReferenceExpression memberReferenceExpression6 = new MemberReferenceExpression(LexicalInfo.Empty); string text5 = memberReferenceExpression6.Name = "GetComponents"; Expression expression11 = memberReferenceExpression6.Target = Expression.Lift(target); Expression expression12 = arg_60E_0.Target = memberReferenceExpression6; TypeReferenceCollection typeReferenceCollection3 = genericReferenceExpression3.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression13 = arg_63D_0.Target = genericReferenceExpression3; this.ReplaceCurrentNode(methodInvocationExpression5); return; } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression5 = (ReferenceExpression)node.Target; if (true && referenceExpression5.Name == "GetComponents" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression6 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_75E_0 = methodInvocationExpression6; GenericReferenceExpression genericReferenceExpression4 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_72F_0 = genericReferenceExpression4; ReferenceExpression referenceExpression6 = new ReferenceExpression(LexicalInfo.Empty); string text6 = referenceExpression6.Name = "GetComponents"; Expression expression14 = arg_72F_0.Target = referenceExpression6; TypeReferenceCollection typeReferenceCollection4 = genericReferenceExpression4.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression15 = arg_75E_0.Target = genericReferenceExpression4; this.ReplaceCurrentNode(methodInvocationExpression6); return; } } } if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression7 = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression7.Target; if (true && memberReferenceExpression7.Name == "GetComponentsInChildren" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression7 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_8A2_0 = methodInvocationExpression7; GenericReferenceExpression genericReferenceExpression5 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_873_0 = genericReferenceExpression5; MemberReferenceExpression memberReferenceExpression8 = new MemberReferenceExpression(LexicalInfo.Empty); string text7 = memberReferenceExpression8.Name = "GetComponentsInChildren"; Expression expression16 = memberReferenceExpression8.Target = Expression.Lift(target); Expression expression17 = arg_873_0.Target = memberReferenceExpression8; TypeReferenceCollection typeReferenceCollection5 = genericReferenceExpression5.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression18 = arg_8A2_0.Target = genericReferenceExpression5; this.ReplaceCurrentNode(methodInvocationExpression7); return; } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression7 = (ReferenceExpression)node.Target; if (true && referenceExpression7.Name == "GetComponentsInChildren" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression8 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_9C3_0 = methodInvocationExpression8; GenericReferenceExpression genericReferenceExpression6 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_994_0 = genericReferenceExpression6; ReferenceExpression referenceExpression8 = new ReferenceExpression(LexicalInfo.Empty); string text8 = referenceExpression8.Name = "GetComponentsInChildren"; Expression expression19 = arg_994_0.Target = referenceExpression8; TypeReferenceCollection typeReferenceCollection6 = genericReferenceExpression6.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression20 = arg_9C3_0.Target = genericReferenceExpression6; this.ReplaceCurrentNode(methodInvocationExpression8); return; } } } if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression9 = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression9.Target; if (true && memberReferenceExpression9.Name == "GetComponentInChildren" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression9 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_B07_0 = methodInvocationExpression9; GenericReferenceExpression genericReferenceExpression7 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_AD8_0 = genericReferenceExpression7; MemberReferenceExpression memberReferenceExpression10 = new MemberReferenceExpression(LexicalInfo.Empty); string text9 = memberReferenceExpression10.Name = "GetComponentInChildren"; Expression expression21 = memberReferenceExpression10.Target = Expression.Lift(target); Expression expression22 = arg_AD8_0.Target = memberReferenceExpression10; TypeReferenceCollection typeReferenceCollection7 = genericReferenceExpression7.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression23 = arg_B07_0.Target = genericReferenceExpression7; this.ReplaceCurrentNode(methodInvocationExpression9); return; } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression9 = (ReferenceExpression)node.Target; if (true && referenceExpression9.Name == "GetComponentInChildren" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression10 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_C28_0 = methodInvocationExpression10; GenericReferenceExpression genericReferenceExpression8 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_BF9_0 = genericReferenceExpression8; ReferenceExpression referenceExpression10 = new ReferenceExpression(LexicalInfo.Empty); string text10 = referenceExpression10.Name = "GetComponentInChildren"; Expression expression24 = arg_BF9_0.Target = referenceExpression10; TypeReferenceCollection typeReferenceCollection8 = genericReferenceExpression8.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression25 = arg_C28_0.Target = genericReferenceExpression8; this.ReplaceCurrentNode(methodInvocationExpression10); return; } } } if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression11 = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression11.Target; if (true && memberReferenceExpression11.Name == "AddComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is StringLiteralExpression) { StringLiteralExpression stringLiteralExpression3 = (StringLiteralExpression)node.Arguments[0]; if (true) { string value = stringLiteralExpression3.Value; if (true) { if (!this.isBinaryExp) { MethodInvocationExpression methodInvocationExpression11 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_D49_0 = methodInvocationExpression11; MemberReferenceExpression memberReferenceExpression12 = new MemberReferenceExpression(LexicalInfo.Empty); string text11 = memberReferenceExpression12.Name = "AddComponent"; Expression expression26 = memberReferenceExpression12.Target = Expression.Lift(target); Expression expression27 = arg_D49_0.Target = memberReferenceExpression12; ExpressionCollection expressionCollection3 = methodInvocationExpression11.Arguments = ExpressionCollection.FromArray(new Expression[] { Expression.Lift(value) }); this.ReplaceCurrentNode(methodInvocationExpression11); this.isBinaryExp = false; } return; } } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression11 = (ReferenceExpression)node.Target; if (true && referenceExpression11.Name == "AddComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is StringLiteralExpression) { StringLiteralExpression stringLiteralExpression4 = (StringLiteralExpression)node.Arguments[0]; if (true) { string value = stringLiteralExpression4.Value; if (true) { if (!this.isBinaryExp) { MethodInvocationExpression methodInvocationExpression12 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_E70_0 = methodInvocationExpression12; ReferenceExpression referenceExpression12 = new ReferenceExpression(LexicalInfo.Empty); string text12 = referenceExpression12.Name = "AddComponent"; Expression expression28 = arg_E70_0.Target = referenceExpression12; ExpressionCollection expressionCollection4 = methodInvocationExpression12.Arguments = ExpressionCollection.FromArray(new Expression[] { Expression.Lift(value) }); this.ReplaceCurrentNode(methodInvocationExpression12); this.isBinaryExp = false; } return; } } } } if (node is MethodInvocationExpression && true && node.Target is MemberReferenceExpression) { MemberReferenceExpression memberReferenceExpression13 = (MemberReferenceExpression)node.Target; if (true) { Expression target = memberReferenceExpression13.Target; if (true && memberReferenceExpression13.Name == "AddComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression13 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_FDD_0 = methodInvocationExpression13; GenericReferenceExpression genericReferenceExpression9 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_FAE_0 = genericReferenceExpression9; MemberReferenceExpression memberReferenceExpression14 = new MemberReferenceExpression(LexicalInfo.Empty); string text13 = memberReferenceExpression14.Name = "AddComponent"; Expression expression29 = memberReferenceExpression14.Target = Expression.Lift(target); Expression expression30 = arg_FAE_0.Target = memberReferenceExpression14; TypeReferenceCollection typeReferenceCollection9 = genericReferenceExpression9.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression31 = arg_FDD_0.Target = genericReferenceExpression9; this.ReplaceCurrentNode(methodInvocationExpression13); return; } } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression13 = (ReferenceExpression)node.Target; if (true && referenceExpression13.Name == "AddComponent" && 1 == ((ICollection)node.Arguments).Count && node.Arguments[0] is ReferenceExpression) { ReferenceExpression e = (ReferenceExpression)node.Arguments[0]; if (true) { MethodInvocationExpression methodInvocationExpression14 = new MethodInvocationExpression(LexicalInfo.Empty); MethodInvocationExpression arg_10FE_0 = methodInvocationExpression14; GenericReferenceExpression genericReferenceExpression10 = new GenericReferenceExpression(LexicalInfo.Empty); GenericReferenceExpression arg_10CF_0 = genericReferenceExpression10; ReferenceExpression referenceExpression14 = new ReferenceExpression(LexicalInfo.Empty); string text14 = referenceExpression14.Name = "AddComponent"; Expression expression32 = arg_10CF_0.Target = referenceExpression14; TypeReferenceCollection typeReferenceCollection10 = genericReferenceExpression10.GenericArguments = TypeReferenceCollection.FromArray(new TypeReference[] { TypeReference.Lift(e) }); Expression expression33 = arg_10FE_0.Target = genericReferenceExpression10; this.ReplaceCurrentNode(methodInvocationExpression14); return; } } } if (node is MethodInvocationExpression && true && node.Target is ReferenceExpression) { ReferenceExpression referenceExpression15 = (ReferenceExpression)node.Target; if (true && referenceExpression15.Name == "Instantiate" && 3 == ((ICollection)node.Arguments).Count) { Expression expression34 = node.Arguments[0]; if (true) { Expression expression35 = node.Arguments[1]; if (true) { expression35 = node.Arguments[2]; if (true) { IType expressionType = expression34.ExpressionType; if (expressionType != null) { TryCastExpression tryCastExpression3 = new TryCastExpression(LexicalInfo.Empty); Expression expression36 = tryCastExpression3.Target = Expression.Lift(node); TypeReference typeReference3 = tryCastExpression3.Type = TypeReference.Lift(this.CodeBuilder.CreateTypeReference(expressionType)); this.ReplaceCurrentNode(tryCastExpression3); } } } } } } }