当前位置: 首页>>代码示例>>C#>>正文


C# Ast.MethodInvocationExpression类代码示例

本文整理汇总了C#中Boo.Lang.Compiler.Ast.MethodInvocationExpression的典型用法代码示例。如果您正苦于以下问题:C# MethodInvocationExpression类的具体用法?C# MethodInvocationExpression怎么用?C# MethodInvocationExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MethodInvocationExpression类属于Boo.Lang.Compiler.Ast命名空间,在下文中一共展示了MethodInvocationExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PropagateChanges

 public override void PropagateChanges(MethodInvocationExpression eval, List chain)
 {
     ExpressionCollection expressions = new ExpressionCollection();
     foreach (object local1 in chain.Reversed)
     {
         if (!(local1 is ProcessAssignmentsToSpecialMembers.ChainItem))
         {
         }
         ProcessAssignmentsToSpecialMembers.ChainItem item = (ProcessAssignmentsToSpecialMembers.ChainItem) RuntimeServices.Coerce(local1, typeof(ProcessAssignmentsToSpecialMembers.ChainItem));
         if (item.Container is MethodInvocationExpression)
         {
             break;
         }
         if (item.Container is SlicingExpression)
         {
             SlicingExpression expression = item.Container;
             Expression[] expressionArray1 = new Expression[] { expression.get_Target().CloneNode(), expression.get_Indices().get_Item(0).get_Begin().CloneNode(), this.get_CodeBuilder().CreateReference(item.Local) };
             expressions.Add(this.CreateConstructorInvocation(this._sliceValueTypeChangeConstructor, expressionArray1));
             break;
         }
         MemberReferenceExpression container = item.Container;
         Expression[] args = new Expression[] { container.get_Target().CloneNode(), this.get_CodeBuilder().CreateStringLiteral(container.get_Name()), this.get_CodeBuilder().CreateReference(item.Local) };
         expressions.Add(this.CreateConstructorInvocation(this._valueTypeChangeConstructor, args));
     }
     MethodInvocationExpression expression3 = this.get_CodeBuilder().CreateMethodInvocation(this._propagateChanges);
     IArrayType type = this._valueTypeChangeType.MakeArrayType(1);
     expression3.get_Arguments().Add(this.get_CodeBuilder().CreateArray(type, expressions));
     eval.get_Arguments().Add(expression3);
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:29,代码来源:ProcessAssignmentToDuckMembers.cs

示例2: OnMethodInvocationExpression

		/// <summary>
		/// This turn a call to TryGetParemeter('item') where item is a local variable
		/// into a WrapIfNull(item) method call.
		/// </summary>
		/// <param name="node">The node.</param>
		public override void OnMethodInvocationExpression(MethodInvocationExpression node)
		{
			var expression = node.Target as ReferenceExpression;
			if (expression == null || expression.Name != "TryGetParameter")
			{
				base.OnMethodInvocationExpression(node);
				return;
			}
			var name = ((StringLiteralExpression)node.Arguments[0]).Value;
			var entity = NameResolutionService.Resolve(name);
			if (entity == null)
			{
				base.OnMethodInvocationExpression(node);
				return;
			}
			var parentNode = node.ParentNode;
			var mie = CodeBuilder.CreateMethodInvocation(
				CodeBuilder.CreateSelfReference(_currentMethod.DeclaringType),
				wrapNullValue);

			var item = new ReferenceExpression(node.LexicalInfo, name);
			TypeSystemServices.Bind(item, entity);
			mie.Arguments.Add(item);
			parentNode.Replace(node, mie);
		}
开发者ID:rambo-returns,项目名称:MonoRail,代码行数:30,代码来源:ReplaceUknownWithParameters.cs

示例3: ProcessBuiltinInvocation

		override protected void ProcessBuiltinInvocation(MethodInvocationExpression node, BuiltinFunction function)
		{
			if (TypeSystemServices.IsQuackBuiltin(function))
				BindDuck(node);
			else
				base.ProcessBuiltinInvocation(node, function);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:7,代码来源:ProcessMethodBodiesWithDuckTyping.cs

示例4: LeaveMethodInvocationExpression

 public override void LeaveMethodInvocationExpression(MethodInvocationExpression node)
 {
     if (LookingFor(node))
     {
         Found(node);
     }
 }
开发者ID:paveltimofeev,项目名称:documentation,代码行数:7,代码来源:MethodInvocationFinder.cs

示例5: VisitCompilationUnit

		public object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
		{
			module = new B.Module();
			module.LexicalInfo = new B.LexicalInfo(fileName, 1, 1);
			compilationUnit.AcceptChildren(this, data);
			if (entryPointMethod != null) {
				bool allMembersAreStatic = true;
				foreach (B.TypeMember member in entryPointMethod.DeclaringType.Members) {
					allMembersAreStatic &= member.IsStatic;
				}
				if (allMembersAreStatic) {
					entryPointMethod.DeclaringType.Attributes.Add(MakeAttribute(("module")));
				} else {
					lastLexicalInfo = entryPointMethod.LexicalInfo;
					B.Expression expr = MakeReferenceExpression(entryPointMethod.DeclaringType.Name + ".Main");
					B.MethodInvocationExpression mie = new B.MethodInvocationExpression(lastLexicalInfo, expr);
					if (entryPointMethod.Parameters.Count > 0) {
						mie.Arguments.Add(MakeReferenceExpression("argv"));
					}
					B.SimpleTypeReference ret = entryPointMethod.ReturnType as B.SimpleTypeReference;
					if (ret.Name == "void" || ret.Name == "System.Void")
						module.Globals.Add(new B.ExpressionStatement(mie));
					else
						module.Globals.Add(new B.ReturnStatement(lastLexicalInfo, mie, null));
				}
			}
			B.Module tmp = module;
			module = null;
			return tmp;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:30,代码来源:ConvertVisitorGlobal.cs

示例6: ExpandImpl

        protected override Statement ExpandImpl(MacroStatement macro){
            if (macro.Arguments.Count == 0){
                Context.Errors.Add(new CompilerError(macro.LexicalInfo,
                                                     "sub macro requires at least one reference or string attribute for subview name"));
            }

            var call = new MethodInvocationExpression(AstUtil.CreateReferenceExpression("OutputSubView"));
            int i = 0;
            foreach (Expression argument in macro.Arguments){
                i++;
                Expression exp = argument;
                if (i == 1){
//action and contrller parameters
                    if (argument is ReferenceExpression && !(argument is MemberReferenceExpression)){
                        if (argument.ToCodeString().StartsWith("@") || argument.ToCodeString().Contains(".")){
                            exp = AstUtil.CreateReferenceExpression(argument.ToCodeString().Substring(1));
                        }
                        else{
                            exp = new StringLiteralExpression(argument.ToCodeString());
                        }
                    }
                }
                call.Arguments.Add(exp);
            }
            return new ExpressionStatement(call);
        }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:26,代码来源:SubMacro.cs

示例7: CreateMethodInvocationExpression

 public static MethodInvocationExpression CreateMethodInvocationExpression(LexicalInfo li, Expression target, Expression arg)
 {
     MethodInvocationExpression mie = new MethodInvocationExpression(li);
     mie.Target = (Expression)target.Clone();
     mie.Arguments.Add((Expression)arg.Clone());
     mie.IsSynthetic = true;
     return mie;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:8,代码来源:AstUtil.cs

示例8: NormalizeMethodInvocationTarget

		void NormalizeMethodInvocationTarget(MethodInvocationExpression node)
		{
			if (node.Target.NodeType != NodeType.ReferenceExpression) return;
			
			node.Target = MemberReferenceFromReference(
							(ReferenceExpression)node.Target,
							CallableResolutionService.ValidCandidates[0].Method);
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:8,代码来源:ProcessMethodBodiesWithDuckTyping.cs

示例9: ReturnValueVisitor

		public ReturnValueVisitor()
		{
			normalizer = new NormalizeStatementModifiers();
			mie = new MethodInvocationExpression
			{
				Target = AstUtil.CreateReferenceExpression("transform")
			};
		}
开发者ID:rambo-returns,项目名称:MonoRail,代码行数:8,代码来源:ReturnValueVisitor.cs

示例10: OnMethodInvocationExpression

        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);
                                            }
                                        }

                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:paveltimofeev,项目名称:documentation,代码行数:57,代码来源:RenameArrayDeclaration.cs

示例11: OnMethodInvocationExpression

 public override void OnMethodInvocationExpression(MethodInvocationExpression node)
 {
     base.OnMethodInvocationExpression(node);
     if (this.IsConstructorInvocation(node))
     {
         base.EnsureDocumentInitialized(node);
         node.set_LexicalInfo(BooExtensions.AsLexicalInfo(base.doc.FindPrevious(node.get_LexicalInfo(), 'n'), node.get_LexicalInfo().get_FileName()));
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:9,代码来源:FixParsedSourceLocations.cs

示例12: GetInvokedMethodName_SafeForPropertyEvals

 private static string GetInvokedMethodName_SafeForPropertyEvals(MethodInvocationExpression mie)
 {
     if (mie.Target.ToString() == "__eval__")
     {
         BinaryExpression binaryExpression = (BinaryExpression)mie.Arguments[0];
         MethodInvocationExpression right = (MethodInvocationExpression)binaryExpression.Right;
         return right.Target.ToString();
     }
     return mie.Target.ToString();
 }
开发者ID:JackWangCUMT,项目名称:rhino-tools,代码行数:10,代码来源:RegisterComponentAndFacilitiesAfterCreation.cs

示例13: ExpandImpl

 protected override Statement ExpandImpl(MacroStatement macro){
     var call = new MethodInvocationExpression(
         new ReferenceExpression("__Export")
         );
     call.Arguments.Add(new StringLiteralExpression(macro.Arguments[0].ToCodeString()));
     if(macro.Arguments.Count==2){
         call.Arguments.Add(macro.Arguments[1]);
     }
     return new ExpressionStatement(call);
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:10,代码来源:ExportMacro.cs

示例14: build_with

        public static Expression build_with(ReferenceExpression builder, MethodInvocationExpression build, ReferenceExpression frameWorkVersion)
        {
            var targetName = builder.Name;

            return new MethodInvocationExpression(
                    new ReferenceExpression(targetName),
                    build.Arguments[0],
                    new StringLiteralExpression(frameWorkVersion.Name)
                );
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:10,代码来源:BooConfigReader.cs

示例15: MethodInvocationForEventSubscription

        private MethodInvocationExpression MethodInvocationForEventSubscription(BinaryExpression node, IMethod method)
        {
            var methodTarget = CodeBuilder.CreateMemberReference(node.Left.LexicalInfo,
                ((MemberReferenceExpression)node.Left).Target, method);

            var mie = new MethodInvocationExpression(methodTarget);
            mie.Arguments.Add(node.Right);
            BindExpressionType(mie, method.ReturnType);
            return mie;
        }
开发者ID:HaKDMoDz,项目名称:GNet,代码行数:10,代码来源:ExpandPropertiesAndEvents.cs


注:本文中的Boo.Lang.Compiler.Ast.MethodInvocationExpression类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。