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

C# Ast.ParameterDeclarationCollection类代码示例

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

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



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

示例1: GetParameterTypes

 Type[] GetParameterTypes(ParameterDeclarationCollection parameters)
 {
     Type[] types = new Type[parameters.Count];
     for (int i=0; i<types.Length; ++i)
     {
         types[i] = GetSystemType(parameters[i].Type);
         if (parameters[i].IsByRef && !types[i].IsByRef)
         {
             types[i] = types[i].MakeByRefType();
         }
     }
     return types;
 }
开发者ID:Bombadil77,项目名称:boo,代码行数:13,代码来源:EmitAssembly.cs


示例2: ImplicitBaseClassCompilerStep

        /// <summary>
        /// Create new instance of <seealso cref="ImplicitBaseClassCompilerStep"/>
        /// </summary>
        /// <param name="baseClass">The base class that will be used</param>
        /// <param name="methodName">The name of the method that will get all the code from globals moved to it.</param>
        /// <param name="parameters">The parameters of this method</param>        
        /// <param name="namespaces">Namespaces that would be automatically imported into all modules</param>               
        public ImplicitBaseClassCompilerStep(Type baseClass, string methodName, ParameterDeclarationCollection parameters, params string[] namespaces)
			: base(baseClass, namespaces)
        {
            this.methodName = methodName;
            this.parameters = parameters;
        }
开发者ID:JackWangCUMT,项目名称:rhino-dsl,代码行数:13,代码来源:ImplicitBaseClassCompilerStep.cs


示例3: DefineParameters

 void DefineParameters(MethodBuilder builder, ParameterDeclarationCollection parameters)
 {
     DefineParameters(parameters, new ParameterFactory(builder.DefineParameter));
 }
开发者ID:Bombadil77,项目名称:boo,代码行数:4,代码来源:EmitAssembly.cs


示例4: WriteParameterList

 void WriteParameterList(ParameterDeclarationCollection items)
 {
     WriteParameterList(items, "(", ")");
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:BooPrinterVisitor.cs


示例5: parameter_declaration

        //throws RecognitionException, TokenStreamException
        protected bool parameter_declaration(
            ParameterDeclarationCollection c
            )
        {
            bool variableArguments;

            IToken  id1 = null;
            IToken  id2 = null;

                IToken id = null;
                TypeReference tr = null;
                ParameterModifiers pm = ParameterModifiers.None;
                variableArguments = false;

            try {      // for error handling
            attributes();
            {
                switch ( LA(1) )
                {
                case MULTIPLY:
                {
                    {
                        match(MULTIPLY);
                        if (0==inputState.guessing)
                        {
                            variableArguments=true;
                        }
                        id1 = LT(1);
                        match(ID);
                        {
                            switch ( LA(1) )
                            {
                            case AS:
                            {
                                match(AS);
                                tr=array_type_reference();
                                break;
                            }
                            case RPAREN:
                            case RBRACK:
                            case COMMA:
                            case BITWISE_OR:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        if (0==inputState.guessing)
                        {
                            id = id1;
                        }
                    }
                    break;
                }
                case REF:
                case ID:
                {
                    {
                        {
                            switch ( LA(1) )
                            {
                            case REF:
                            {
                                pm=parameter_modifier();
                                break;
                            }
                            case ID:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        id2 = LT(1);
                        match(ID);
                        {
                            switch ( LA(1) )
                            {
                            case AS:
                            {
                                match(AS);
                                tr=type_reference();
                                break;
                            }
                            case RPAREN:
                            case RBRACK:
                            case COMMA:
                            case BITWISE_OR:
                            {
                                break;
                            }
                            default:
//.........这里部分代码省略.........
开发者ID:0xb1dd1e,项目名称:boo,代码行数:101,代码来源:WSABooParserBase.cs


示例6: CustomizeCompiler

        protected override void CustomizeCompiler(BooCompiler compiler, CompilerPipeline pipeline, string[] urls)
        {
            ParameterDeclarationCollection parameters = new ParameterDeclarationCollection();
            ParameterDeclaration newParameterDeclaration =
                new ParameterDeclaration("input", new SimpleTypeReference("System.String"));
            parameters.Add(newParameterDeclaration);

            pipeline.Insert(1, new ImplicitBaseClassCompilerStep(typeof(MyClassWithParams),
                "Hello",
                parameters,
                "System"));
        }
开发者ID:neilb14,项目名称:rhino-dsl,代码行数:12,代码来源:DslEngineFixture.cs


示例7: callable_parameter_declaration_list

	protected void callable_parameter_declaration_list(
		ParameterDeclarationCollection c
	) //throws RecognitionException, TokenStreamException
{
		
		
			bool varArgs = false;
		
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case CALLABLE:
				case CHAR:
				case REF:
				case THEN:
				case LPAREN:
				case ID:
				case MULTIPLY:
				case SPLICE_BEGIN:
				{
					varArgs=callable_parameter_declaration(c);
					{    // ( ... )*
						for (;;)
						{
							if (((LA(1)==COMMA))&&(!varArgs))
							{
								{
									match(COMMA);
									varArgs=callable_parameter_declaration(c);
								}
							}
							else
							{
								goto _loop224_breakloop;
							}
							
						}
_loop224_breakloop:						;
					}    // ( ... )*
					if (0==inputState.guessing)
					{
						c.HasParamArray = varArgs;
					}
					break;
				}
				case RPAREN:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "callable_parameter_declaration_list");
				recover(ex,tokenSet_53_);
			}
			else
			{
				throw ex;
			}
		}
	}
开发者ID:hlizard,项目名称:boo,代码行数:71,代码来源:BooParserBase.cs


示例8: callable_parameter_declaration

        //throws RecognitionException, TokenStreamException
        protected void callable_parameter_declaration(
		ParameterDeclarationCollection c
	)
        {
            TypeReference tr = null;
                ParameterModifiers pm = ParameterModifiers.None;

            try {      // for error handling
            {
                {
                    switch ( LA(1) )
                    {
                    case REF:
                    {
                        pm=parameter_modifier();
                        break;
                    }
                    case CALLABLE:
                    case CHAR:
                    case ID:
                    case LPAREN:
                    case SPLICE_BEGIN:
                    {
                        break;
                    }
                    default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                     }
                }
                {
                    tr=type_reference();
                }
            }
            if (0==inputState.guessing)
            {

                        ParameterDeclaration pd = new ParameterDeclaration(tr.LexicalInfo);
                        pd.Name = "arg" + c.Count;
                        pd.Type = tr;
                        pd.Modifiers = pm;
                        c.Add(pd);

            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex);
                recover(ex,tokenSet_69_);
            }
            else
            {
                throw ex;
            }
            }
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:60,代码来源:WSABooParserBase.cs


示例9: callable_parameter_declaration_list

        //throws RecognitionException, TokenStreamException
        protected void callable_parameter_declaration_list(
		ParameterDeclarationCollection c
	)
        {
            try {      // for error handling
            {
                switch ( LA(1) )
                {
                case CALLABLE:
                case CHAR:
                case REF:
                case ID:
                case LPAREN:
                case SPLICE_BEGIN:
                {
                    callable_parameter_declaration(c);
                    {    // ( ... )*
                        for (;;)
                        {
                            if ((LA(1)==COMMA))
                            {
                                match(COMMA);
                                callable_parameter_declaration(c);
                            }
                            else
                            {
                                goto _loop184_breakloop;
                            }

                        }
            _loop184_breakloop:						;
                    }    // ( ... )*
                    break;
                }
                case RPAREN:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex);
                recover(ex,tokenSet_37_);
            }
            else
            {
                throw ex;
            }
            }
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:59,代码来源:WSABooParserBase.cs


示例10: DefineParameters

 void DefineParameters(ParameterDeclarationCollection parameters, ParameterFactory defineParameter)
 {
     int last = parameters.Count - 1;
     for (int i=0; i<parameters.Count; ++i)
     {
         ParameterBuilder paramBuilder = defineParameter(i+1, GetParameterAttributes(parameters[i]), parameters[i].Name);
         if (last == i && parameters.VariableNumber)
         {
             SetParamArrayAttribute(paramBuilder);
         }
         SetBuilder(parameters[i], paramBuilder);
     }
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:13,代码来源:EmitAssembly.cs


示例11: Map

 public IParameter[] Map(ParameterDeclarationCollection parameters)
 {
     IParameter[] mapped = new IParameter[parameters.Count];
     for (int i=0; i<mapped.Length; ++i)
     {
         mapped[i] = (IParameter)GetEntity(parameters[i]);
     }
     return mapped;
 }
开发者ID:boo,项目名称:boo-lang,代码行数:9,代码来源:TypeSystemServices.cs


示例12: parameter_declaration_list

	protected void parameter_declaration_list(
		ParameterDeclarationCollection c
	) //throws RecognitionException, TokenStreamException
{
		
		
				bool variableArguments = false;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case REF:
				case ID:
				case MULTIPLY:
				case LBRACK:
				case SPLICE_BEGIN:
				{
					variableArguments=parameter_declaration(c);
					{    // ( ... )*
						for (;;)
						{
							if (((LA(1)==COMMA))&&(!variableArguments))
							{
								{
									match(COMMA);
									variableArguments=parameter_declaration(c);
								}
							}
							else
							{
								goto _loop210_breakloop;
							}
							
						}
_loop210_breakloop:						;
					}    // ( ... )*
					break;
				}
				case RPAREN:
				case RBRACK:
				case BITWISE_OR:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			if (0==inputState.guessing)
			{
				c.HasParamArray = variableArguments;
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "parameter_declaration_list");
				recover(ex,tokenSet_42_);
			}
			else
			{
				throw ex;
			}
		}
	}
开发者ID:hlizard,项目名称:boo,代码行数:70,代码来源:BooParserBase.cs


示例13: DefineParameters

		void DefineParameters(ConstructorBuilder builder, ParameterDeclarationCollection parameters)
		{
			DefineParameters(parameters, builder.DefineParameter);
		}
开发者ID:hlizard,项目名称:boo,代码行数:4,代码来源:EmitAssembly.cs


示例14: parameter_declaration

	protected bool  parameter_declaration(
		ParameterDeclarationCollection c
	) //throws RecognitionException, TokenStreamException
{
		bool variableArguments;
		
		IToken  id1 = null;
		IToken  begin1 = null;
		IToken  id2 = null;
		IToken  begin2 = null;
				
				IToken id = null;
				TypeReference tr = null;
				ParameterModifiers pm = ParameterModifiers.None;
				variableArguments = false;
				Expression nameSplice = null;
			
		
		try {      // for error handling
			attributes();
			{
				switch ( LA(1) )
				{
				case MULTIPLY:
				{
					{
						match(MULTIPLY);
						if (0==inputState.guessing)
						{
							variableArguments=true;
						}
						{
							switch ( LA(1) )
							{
							case ID:
							{
								id1 = LT(1);
								match(ID);
								if (0==inputState.guessing)
								{
									id = id1;
								}
								break;
							}
							case SPLICE_BEGIN:
							{
								begin1 = LT(1);
								match(SPLICE_BEGIN);
								nameSplice=atom();
								if (0==inputState.guessing)
								{
									id = begin1;
								}
								break;
							}
							default:
							{
								throw new NoViableAltException(LT(1), getFilename());
							}
							 }
						}
						{
							switch ( LA(1) )
							{
							case AS:
							{
								match(AS);
								tr=array_type_reference();
								break;
							}
							case RPAREN:
							case RBRACK:
							case COMMA:
							case BITWISE_OR:
							{
								break;
							}
							default:
							{
								throw new NoViableAltException(LT(1), getFilename());
							}
							 }
						}
					}
					break;
				}
				case REF:
				case ID:
				case SPLICE_BEGIN:
				{
					{
						{
							switch ( LA(1) )
							{
							case REF:
							{
								pm=parameter_modifier();
								break;
							}
							case ID:
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例15: callable_parameter_declaration

	protected bool  callable_parameter_declaration(
		ParameterDeclarationCollection c
	) //throws RecognitionException, TokenStreamException
{
		bool varArgs;
		
				
				TypeReference tr = null;
				ParameterModifiers pm = ParameterModifiers.None;
				varArgs = false;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case MULTIPLY:
				{
					{
						match(MULTIPLY);
						if (0==inputState.guessing)
						{
							varArgs=true;
						}
						tr=type_reference();
					}
					break;
				}
				case CALLABLE:
				case CHAR:
				case REF:
				case THEN:
				case LPAREN:
				case ID:
				case SPLICE_BEGIN:
				{
					{
						{
							switch ( LA(1) )
							{
							case REF:
							{
								pm=parameter_modifier();
								break;
							}
							case CALLABLE:
							case CHAR:
							case THEN:
							case LPAREN:
							case ID:
							case SPLICE_BEGIN:
							{
								break;
							}
							default:
							{
								throw new NoViableAltException(LT(1), getFilename());
							}
							 }
						}
						{
							tr=type_reference();
						}
					}
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			if (0==inputState.guessing)
			{
				
						ParameterDeclaration pd = new ParameterDeclaration(tr.LexicalInfo);
						pd.Name = "arg" + c.Count;
						pd.Type = tr;
						pd.Modifiers = pm;
						c.Add(pd);
					
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "callable_parameter_declaration");
				recover(ex,tokenSet_87_);
			}
			else
			{
				throw ex;
			}
		}
		return varArgs;
	}
开发者ID:hlizard,项目名称:boo,代码行数:97,代码来源:BooParserBase.cs


示例16: function_type_parameters

        public void function_type_parameters(ParameterDeclarationCollection parameters)
        {
            try
            {
                this.match(0x3f);
                switch (this.LA(1))
                {
                    case 0x13:
                    case 0x3b:
                    {
                        TypeReference reference = this.type_reference();
                        if (base.inputState.guessing == 0)
                        {
                            ParameterDeclaration declaration;
                            ParameterDeclaration declaration1 = declaration = new ParameterDeclaration();
                            declaration.set_Type(reference);
                            declaration.set_Name("arg" + parameters.Count);
                            parameters.Add(declaration);
                        }
                        while (this.LA(1) == 0x43)
                        {
                            this.match(0x43);
                            reference = this.type_reference();
                            if (base.inputState.guessing == 0)
                            {
                                ParameterDeclaration declaration2;
                                ParameterDeclaration declaration3 = declaration2 = new ParameterDeclaration();
                                declaration2.set_Type(reference);
                                declaration2.set_Name("arg" + parameters.Count);
                                parameters.Add(declaration2);
                            }
                        }
                        break;
                    }
                    case 0x40:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                this.match(0x40);
            }
            catch (RecognitionException exception)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception);
                this.recover(exception, tokenSet_35_);
            }
        }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:52,代码来源:UnityScriptParser.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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