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


C# Ast.Constructor类代码示例

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


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

示例1: LeaveConstructor

 public override void LeaveConstructor(Constructor node)
 {
     if (!node.IsVisibilitySet)
     {
         node.Modifiers |= TypeMemberModifiers.Public;
     }
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:7,代码来源:NormalizeTypeAndMemberDefinitions.cs

示例2: AddConstructor

        // create a constructor that delegate to the base class
        private void AddConstructor(ClassDefinition macro)
        {
            var ctor = new Constructor(macro.LexicalInfo);

            ctor.Parameters.Add(
                new ParameterDeclaration("viewEngine",
                                         new SimpleTypeReference("MvcContrib.BrailViewEngine.BooViewEngine"))); // TODO: Update Reference

            //			ctor.Parameters.Add(
            //				new ParameterDeclaration("output",
            //				                         new SimpleTypeReference("System.IO.TextWriter")));
            //			ctor.Parameters.Add(
            //				new ParameterDeclaration("context",
            //				                         new SimpleTypeReference("Castle.MonoRail.Framework.IEngineContext")));
            //
            //			ctor.Parameters.Add(
            //				new ParameterDeclaration("__controller",
            //				                         new SimpleTypeReference("Castle.MonoRail.Framework.IController")));
            //
            //			ctor.Parameters.Add(
            //				new ParameterDeclaration("__controllerContext",
            //										 new SimpleTypeReference("Castle.MonoRail.Framework.IControllerContext")));

            var mie = new MethodInvocationExpression(new SuperLiteralExpression());
            mie.Arguments.Add(AstUtil.CreateReferenceExpression("viewEngine"));
            //			mie.Arguments.Add(AstUtil.CreateReferenceExpression("output"));
            //			mie.Arguments.Add(AstUtil.CreateReferenceExpression("context"));
            //			mie.Arguments.Add(AstUtil.CreateReferenceExpression("__controller"));
            //			mie.Arguments.Add(AstUtil.CreateReferenceExpression("__controllerContext"));

            ctor.Body.Add(mie);

            macro.Members.Add(ctor);
        }
开发者ID:JonKruger,项目名称:MvcContrib,代码行数:35,代码来源:TransformToBrailStep.cs

示例3: CreateConstructor

 public static Constructor CreateConstructor(Node lexicalInfoProvider, TypeMemberModifiers modifiers)
 {
     Constructor constructor = new Constructor(lexicalInfoProvider.LexicalInfo);
     constructor.Modifiers = modifiers;
     constructor.IsSynthetic = true;
     return constructor;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:7,代码来源:AstUtil.cs

示例4: LeaveConstructor

 public override void LeaveConstructor(Constructor node)
 {
     MakeStaticIfNeeded(node);
     CantBeMarkedTransient(node);
     CantBeMarkedPartial(node);
     CantBeMarkedFinal(node);
     CannotReturnValue(node);
     ConstructorCannotBePolymorphic(node);
 }
开发者ID:scottstephens,项目名称:boo,代码行数:9,代码来源:PreErrorChecking.cs

示例5: LeaveConstructor

        public override void LeaveConstructor(Constructor node)
        {
            if (node.IsVisibilitySet) return;

            if (!node.IsStatic)
                node.Modifiers |= Context.Parameters.DefaultMethodVisibility;
            else
                node.Modifiers |= TypeMemberModifiers.Private;
        }
开发者ID:elfrostie,项目名称:boo,代码行数:9,代码来源:NormalizeTypeAndMemberDefinitions.cs

示例6: GenerateConstructors

		private void GenerateConstructors(TypeDefinition definition)
		{
			ConstructorInfo[] ctors =
				baseClass.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
			foreach (ConstructorInfo ctor in ctors)
			{
				if (ctor.IsPrivate)
					continue;
				Constructor constructor = new Constructor(definition.LexicalInfo);
				definition.Members.Add(constructor);
				MethodInvocationExpression super = new MethodInvocationExpression(new SuperLiteralExpression());
				constructor.Body.Add(super);
				foreach (ParameterInfo info in ctor.GetParameters())
				{
					SimpleTypeReference typeReference =
						new SimpleTypeReference(TypeUtilities.GetFullName(info.ParameterType));
					constructor.Parameters.Add(new ParameterDeclaration(info.Name,
																		typeReference)
						);
					super.Arguments.Add(new ReferenceExpression(info.Name));
				}
			}
		}
开发者ID:yonglehou,项目名称:NGinnBPM,代码行数:23,代码来源:BaseClassCompilerStep.cs

示例7: EnterConstructor

        public override bool EnterConstructor(Constructor node)
        {
            base.EnterConstructor(node);

            return EnterMethod(node);
        }
开发者ID:gogobyte,项目名称:boolangstudio,代码行数:6,代码来源:BooDocumentVisitor.cs

示例8: LeaveConstructor

        public override void LeaveConstructor(Constructor node)
        {
            base.LeaveConstructor(node);

            LeaveMethod(node);
        }
开发者ID:gogobyte,项目名称:boolangstudio,代码行数:6,代码来源:BooDocumentVisitor.cs

示例9: OnConstructor

 public override void OnConstructor(Constructor node)
 {
     Visit(node.Parameters);
     _emitter.EmitConstructorAttributes(node);
 }
开发者ID:Bombadil77,项目名称:boo,代码行数:5,代码来源:EmitAssembly.cs

示例10: OnConstructor

 public override void OnConstructor(Constructor node)
 {
     _parameters.Add(node);
     base.OnConstructor(node);
 }
开发者ID:turugina,项目名称:boo,代码行数:5,代码来源:BindTypeMembers.cs

示例11: VisitConstructorDeclaration

		public object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data)
		{
			B.Constructor m = new B.Constructor(GetLexicalInfo(constructorDeclaration));
			m.Modifiers = ConvertModifier(constructorDeclaration, B.TypeMemberModifiers.Private);
			ConvertAttributes(constructorDeclaration.Attributes, m.Attributes);
			if (currentType != null) currentType.Members.Add(m);
			ConvertParameters(constructorDeclaration.Parameters, m.Parameters);
			m.EndSourceLocation = GetEndLocation((INode)constructorDeclaration.Body ?? constructorDeclaration);
			m.Body = ConvertMethodBlock(constructorDeclaration.Body);
			ConstructorInitializer ci = constructorDeclaration.ConstructorInitializer;
			if (ci != null && !ci.IsNull) {
				B.Expression initializerBase;
				if (ci.ConstructorInitializerType == ConstructorInitializerType.Base)
					initializerBase = new B.SuperLiteralExpression();
				else
					initializerBase = new B.SelfLiteralExpression();
				B.MethodInvocationExpression initializer = new B.MethodInvocationExpression(initializerBase);
				ConvertExpressions(ci.Arguments, initializer.Arguments);
				m.Body.Insert(0, new B.ExpressionStatement(initializer));
			}
			return m;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:22,代码来源:ConvertVisitorTypeMembers.cs

示例12: EntityFor

 private IMethod EntityFor(Constructor node)
 {
     return (IMethod)EntityFor((TypeMember)node);
 }
开发者ID:scottstephens,项目名称:boo,代码行数:4,代码来源:PreErrorChecking.cs

示例13: AddConstructor

        public BooMethodBuilder AddConstructor()
        {
            Constructor constructor = new Constructor();
            constructor.IsSynthetic = true;
            constructor.Modifiers = TypeMemberModifiers.Public;
            constructor.Entity = new InternalConstructor(_codeBuilder.TypeSystemServices, constructor);
            _cd.Members.Add(constructor);

            return new BooMethodBuilder(_codeBuilder, constructor);
        }
开发者ID:boo,项目名称:boo-lang,代码行数:10,代码来源:BooClassBuilder.cs

示例14: OnConstructor

 public override void OnConstructor(Constructor node)
 {
     if (null == node.Entity)
     {
         node.Entity = new InternalConstructor(TypeSystemServices, node);
     }
     _parameters.Add(node);
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:8,代码来源:BindTypeMembers.cs

示例15: OnConstructor

 public override void OnConstructor(Constructor node)
 {
     OnMethod(node);
 }
开发者ID:boo,项目名称:boo-lang,代码行数:4,代码来源:BranchChecking.cs


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