• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CSharp.ParametersBlock类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Iterator

 //
 // Our constructor
 //
 public Iterator(ParametersBlock block, IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
     : base(block, TypeManager.bool_type, block.StartLocation)
 {
     this.OriginalMethod = method;
     this.OriginalIteratorType = iterator_type;
     this.IsEnumerable = is_enumerable;
     this.Host = host;
     this.type = method.ReturnType;
 }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:12,代码来源:iterators.cs


示例2: StartFlowBranching

		public FlowBranchingToplevel StartFlowBranching (ParametersBlock stmt, FlowBranching parent)
		{
			FlowBranchingToplevel branching = new FlowBranchingToplevel (parent, stmt);
			current_flow_branching = branching;
			return branching;
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:6,代码来源:context.cs


示例3: end_anonymous

/*
 * Completes the anonymous method processing, if lambda_expr is null, this
 * means that we have a Statement instead of an Expression embedded 
 */
AnonymousMethodExpression end_anonymous (ParametersBlock anon_block)
{
	AnonymousMethodExpression retval;

	if (async_block)
		anon_block.IsAsync = true;

	current_anonymous_method.Block = anon_block;
	retval = current_anonymous_method;

	async_block = (bool) oob_stack.Pop ();
	current_variable = (BlockVariable) oob_stack.Pop ();
	current_local_parameters = (ParametersCompiled) oob_stack.Pop ();
	current_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop ();

	return retval;
}
开发者ID:segaman,项目名称:NRefactory,代码行数:21,代码来源:cs-parser.cs


示例4: FlowBranchingToplevel

		public FlowBranchingToplevel (FlowBranching parent, ParametersBlock stmt)
			: base (parent, BranchingType.Toplevel, SiblingType.Conditional, stmt, stmt.loc)
		{
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:4,代码来源:flowanalysis.cs


示例5: ToplevelBlock

		//
		// Recreates a top level block from parameters block. Used for
		// compiler generated methods where the original block comes from
		// explicit child block. This works for already resolved blocks
		// only to ensure we resolve them in the correct flow order
		//
		public ToplevelBlock (ParametersBlock source, ParametersCompiled parameters)
			: base (source, parameters)
		{
			this.compiler = source.TopBlock.compiler;
			top_block = this;
		}
开发者ID:alisci01,项目名称:mono,代码行数:12,代码来源:statement.cs


示例6: FlowAnalysisContext

		public FlowAnalysisContext (CompilerContext ctx, ParametersBlock parametersBlock)
		{
			this.ctx = ctx;
			this.ParametersBlock = parametersBlock;

			DefiniteAssignment = new DefiniteAssignmentBitSet ();
		}
开发者ID:santosh-pai,项目名称:mono,代码行数:7,代码来源:context.cs


示例7: AnonymousMethodBody

		public AnonymousMethodBody (ParametersCompiled parameters,
					ParametersBlock block, TypeSpec return_type, TypeSpec delegate_type,
					Location loc)
			: base (block, return_type, loc)
		{
			this.type = delegate_type;
			this.parameters = parameters;
		}
开发者ID:rabink,项目名称:mono,代码行数:8,代码来源:anonymous.cs


示例8: CompatibleMethodFactory

		protected virtual AnonymousMethodBody CompatibleMethodFactory (TypeSpec return_type, TypeSpec delegate_type, ParametersCompiled p, ParametersBlock b)
		{
			return new AnonymousMethodBody (p, b, return_type, delegate_type, loc);
		}
开发者ID:rabink,项目名称:mono,代码行数:4,代码来源:anonymous.cs


示例9: ParameterInfo

			public ParameterInfo (ParametersBlock block, int index)
			{
				this.block = block;
				this.index = index;
			}
开发者ID:alisci01,项目名称:mono,代码行数:5,代码来源:statement.cs


示例10: Block

		public Block (Block parent, Flags flags, Location start, Location end)
		{
			if (parent != null) {
				// the appropriate constructors will fixup these fields
				ParametersBlock = parent.ParametersBlock;
				Explicit = parent.Explicit;
			}
			
			this.Parent = parent;
			this.flags = flags;
			this.StartLocation = start;
			this.EndLocation = end;
			this.loc = start;
			statements = new List<Statement> (4);

			this.original = this;
		}
开发者ID:alisci01,项目名称:mono,代码行数:17,代码来源:statement.cs


示例11: FlowAnalysisContext

		public FlowAnalysisContext (CompilerContext ctx, ParametersBlock parametersBlock, int definiteAssignmentLength)
		{
			this.ctx = ctx;
			this.ParametersBlock = parametersBlock;

			DefiniteAssignment = definiteAssignmentLength == 0 ?
				DefiniteAssignmentBitSet.Empty :
				new DefiniteAssignmentBitSet (definiteAssignmentLength);
		}
开发者ID:GirlD,项目名称:mono,代码行数:9,代码来源:context.cs


示例12: end_anonymous

/*
 * Completes the anonymous method processing, if lambda_expr is null, this
 * means that we have a Statement instead of an Expression embedded 
 */
AnonymousMethodExpression end_anonymous (ParametersBlock anon_block)
{
	AnonymousMethodExpression retval;

	current_anonymous_method.Block = anon_block;
	retval = current_anonymous_method;

	current_variable = (BlockVariableDeclaration) oob_stack.Pop ();
	current_local_parameters = (ParametersCompiled) oob_stack.Pop ();
	current_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop ();

	return retval;
}
开发者ID:Ein,项目名称:monodevelop,代码行数:17,代码来源:cs-parser.cs


示例13: DoImplicitConversionStandard

		static Expression DoImplicitConversionStandard (ResolveContext ec, Expression expr, TypeSpec target_type, Location loc, bool explicit_cast, bool upconvert_only)
		{
			if (expr.eclass == ExprClass.MethodGroup){
				if (!target_type.IsDelegate){
					if (ec.FileType == SourceFileType.PlayScript && 
					    (target_type == ec.BuiltinTypes.Dynamic || target_type == ec.BuiltinTypes.Delegate)) {
						MethodGroupExpr mg = expr as MethodGroupExpr;
						if (mg != null) {
							if (mg.Candidates.Count != 1) {
								ec.Report.Error (7021, loc, "Ambiguous overloaded methods `{0}' when assigning to Function or Object type", mg.Name);
								return null;
							}
							var ms = (MethodSpec)mg.Candidates[0];
							var del_type = Delegate.CreateDelegateTypeFromMethodSpec(ec, ms, loc);

							// If return is "Delegate", we create a var args anonymous method which calls the target method..
							if (del_type == ec.BuiltinTypes.Delegate) {
								var objArrayType = new ComposedCast (
									new TypeExpression(ec.BuiltinTypes.Object, loc),  
									ComposedTypeSpecifier.CreateArrayDimension (1, loc));
								var parameters = new ParametersCompiled(new Parameter[] {
									new ParamsParameter(objArrayType, "args", null, loc) }, false);
								var dynCall = new AnonymousMethodExpression(expr.Location, parameters, new TypeExpression(ms.ReturnType, loc));
								var block = new ParametersBlock (ec.CurrentBlock, parameters, expr.Location);
								dynCall.Block = block;
								var args = new Arguments (3);
								args.Add (new Argument(new TypeOf(new TypeExpression(ms.DeclaringType, loc), loc)));
								args.Add (new Argument(new StringLiteral(ec.BuiltinTypes, ms.Name, loc)));
								args.Add (new Argument(new SimpleName("args", loc)));
								var call = new Invocation (new MemberAccess(new MemberAccess(new SimpleName("PlayScript", loc), "Support", loc), "VarArgCall", loc), args);
								if (ms.ReturnType == ec.BuiltinTypes.Void) {
									block.AddStatement (new StatementExpression(call));
								} else {
									block.AddStatement (new Return(call, loc));
								}
								return dynCall.Resolve (ec);
							} else { 
								// Otherwise cast to the specific delegate type
								return new ImplicitDelegateCreation (del_type, mg, loc).Resolve (ec);
							}
						}
					}
					return null;
				}

				//
				// Only allow anonymous method conversions on post ISO_1
				//
				if (ec.Module.Compiler.Settings.Version != LanguageVersion.ISO_1){
					MethodGroupExpr mg = expr as MethodGroupExpr;
					if (mg != null)
						return new ImplicitDelegateCreation (target_type, mg, loc).Resolve (ec);
				}
			}

			TypeSpec expr_type = expr.Type;
			Expression e;

			if (expr_type == target_type) {
				if (expr_type != InternalType.NullLiteral && expr_type != InternalType.AnonymousMethod)
					return expr;
				return null;
			}

			// Auto convert types to type objects..
			if (ec.FileType == SourceFileType.PlayScript && target_type.BuiltinType == BuiltinTypeSpec.Type.Type && expr is FullNamedExpression) {
				FullNamedExpression type_expr = (FullNamedExpression)expr;
				if (expr_type != null) {
					if (expr_type.MemberDefinition.Namespace == PsConsts.PsRootNamespace) {
						switch (expr_type.Name) {
						case "String":
							type_expr = new TypeExpression (ec.BuiltinTypes.String, type_expr.Location);
							break;
						case "Number":
							type_expr = new TypeExpression (ec.BuiltinTypes.Double, type_expr.Location);
							break;
						case "Boolean":
							type_expr = new TypeExpression (ec.BuiltinTypes.Double, type_expr.Location);
							break;
						}
					} else if (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
						type_expr = new TypeExpression (ec.Module.PredefinedTypes.AsObject.Resolve(), type_expr.Location);
					}
				}
				return new TypeOf (type_expr, expr.Location).Resolve (ec);
			}

			if (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {

				// Implicitly cast references to bools in PlayScript
				if (ec.FileType == SourceFileType.PlayScript && 
				    target_type.BuiltinType == BuiltinTypeSpec.Type.Bool &&
				    ec.Target != Target.JavaScript) {

					var cast_args = new Arguments(1);
					cast_args.Add (new Argument(EmptyCast.Create(expr, ec.BuiltinTypes.Object)));

//					ec.Report.Warning (7164, 1, expr.Location, "Expensive reference conversion to bool");

					return new Invocation(new MemberAccess(new MemberAccess(new SimpleName(
//.........这里部分代码省略.........
开发者ID:johnv315,项目名称:playscript-mono,代码行数:101,代码来源:convert.cs


示例14: CaptureParameter

		public void CaptureParameter (ResolveContext ec, ParametersBlock.ParameterInfo parameterInfo, ParameterReference parameterReference)
		{
			if (!(this is StateMachine)) {
				ec.CurrentBlock.Explicit.HasCapturedVariable = true;
			}

			var hoisted = parameterInfo.Parameter.HoistedVariant;
			if (hoisted == null) {
				var storey = parameterInfo.Block.StateMachine ?? this;
				var hp = new HoistedParameter (storey, parameterReference);
				hoisted = hp;
				parameterInfo.Parameter.HoistedVariant = hoisted;

				if (storey.hoisted_params == null)
					storey.hoisted_params = new List<HoistedParameter> (2);

				storey.hoisted_params.Add (hp);
			}

			//
			// Register link between current block and parameter storey. It will
			// be used when setting up storey definition to deploy storey reference
			// when parameters are used from multiple blocks
			//
			if (ec.CurrentBlock.Explicit != parameterInfo.Block) {
				hoisted.Storey.AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit);
			}
		}
开发者ID:zzlang,项目名称:mono,代码行数:28,代码来源:anonymous.cs


示例15: ParametersBlock

		//
		// It's supposed to be used by method body implementation of anonymous methods
		//
		protected ParametersBlock (ParametersBlock source, ParametersCompiled parameters)
			: base (null, 0, source.StartLocation, source.EndLocation)
		{
			this.parameters = parameters;
			this.statements = source.statements;
			this.scope_initializers = source.scope_initializers;

			this.resolved = true;
			this.unreachable = source.unreachable;
			this.am_storey = source.am_storey;

			ParametersBlock = this;

			//
			// Overwrite original for comparison purposes when linking cross references
			// between anonymous methods
			//
			original = source;
		}
开发者ID:wamiq,项目名称:debian-mono,代码行数:22,代码来源:statement.cs


示例16: CompatibleMethodFactory

		protected override AnonymousMethodBody CompatibleMethodFactory (TypeSpec returnType, TypeSpec delegateType, ParametersCompiled p, ParametersBlock b)
		{
			return new LambdaMethod (p, b, returnType, delegateType, loc);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:4,代码来源:lambda.cs


示例17: LambdaMethod

		public LambdaMethod (ParametersCompiled parameters,
					ParametersBlock block, TypeSpec return_type, TypeSpec delegate_type,
					Location loc)
			: base (parameters, block, return_type, delegate_type, loc)
		{
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:6,代码来源:lambda.cs


示例18: BlockScopeExpression

			public BlockScopeExpression (Expression child, ParametersBlock block)
			{
				this.child = child;
				this.block = block;
			}
开发者ID:alisci01,项目名称:mono,代码行数:5,代码来源:statement.cs


示例19: AnonymousExpression

		protected AnonymousExpression (ParametersBlock block, TypeSpec return_type, Location loc)
		{
			this.ReturnType = return_type;
			this.block = block;
			this.loc = loc;
		}
开发者ID:rabink,项目名称:mono,代码行数:6,代码来源:anonymous.cs


示例20: ParametersBlock

		protected ParametersBlock (ParametersBlock source, ParametersCompiled parameters)
			: base (null, 0, source.StartLocation, source.EndLocation)
		{
			this.parameters = parameters;
			this.statements = source.statements;
			this.scope_initializers = source.scope_initializers;

			this.resolved = true;
			this.unreachable = source.unreachable;
			this.am_storey = source.am_storey;

			ParametersBlock = this;
		}
开发者ID:alisci01,项目名称:mono,代码行数:13,代码来源:statement.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CSharp.ParametersCompiled类代码示例发布时间:2022-05-26
下一篇:
C# CSharp.ParameterReference类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap