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

C# Ast.TypeMemberCollection类代码示例

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

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



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

示例1: FromArray

		public static TypeMemberCollection FromArray(params object[] items)
		{
			var result = new TypeMemberCollection();
			foreach (var item in items)
			{
				var typeMember = item as TypeMember;
				if (typeMember != null)
					result.Add(typeMember);
				else
					result.AddRange((IEnumerable<TypeMember>)item);
			}
			return result;
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:13,代码来源:TypeMemberCollection.cs


示例2: Lift

 public static TypeMemberCollection Lift(Block block)
 {
     var members = new TypeMemberCollection();
     foreach (var stmt in block.Statements)
         members.Add(TypeMember.Lift(stmt));
     return members;
 }
开发者ID:elfrostie,项目名称:boo,代码行数:7,代码来源:TypeMember.cs


示例3: type_member

	protected void type_member(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		
		try {      // for error handling
			attributes();
			modifiers();
			{
				switch ( LA(1) )
				{
				case CALLABLE:
				case CLASS:
				case ENUM:
				case INTERFACE:
				case STRUCT:
				{
					type_definition(container);
					break;
				}
				case CONSTRUCTOR:
				case DEF:
				case DESTRUCTOR:
				{
					method(container);
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "type_member");
				recover(ex,tokenSet_16_);
			}
			else
			{
				throw ex;
			}
		}
	}
开发者ID:hlizard,项目名称:boo,代码行数:48,代码来源:BooParserBase.cs


示例4: interface_property

	protected void interface_property(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  id1 = null;
		IToken  s = null;
		
				IToken id = null;
		Property p = null;
		TypeReference tr = null;
		ParameterDeclarationCollection parameters = null;
		
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case ID:
				{
					id1 = LT(1);
					match(ID);
					if (0==inputState.guessing)
					{
						id=id1;
					}
					break;
				}
				case SELF:
				{
					s = LT(1);
					match(SELF);
					if (0==inputState.guessing)
					{
						id=s;
					}
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			if (0==inputState.guessing)
			{
				
				p = new Property(ToLexicalInfo(id));
				p.Name = id.getText();
				AddAttributes(p.Attributes);
				container.Add(p);
				parameters = p.Parameters;
				
			}
			{
				switch ( LA(1) )
				{
				case LPAREN:
				case LBRACK:
				{
					{
						switch ( LA(1) )
						{
						case LBRACK:
						{
							match(LBRACK);
							break;
						}
						case LPAREN:
						{
							match(LPAREN);
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					parameter_declaration_list(parameters);
					{
						switch ( LA(1) )
						{
						case RBRACK:
						{
							match(RBRACK);
							break;
						}
						case RPAREN:
						{
							match(RPAREN);
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					break;
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例5: field_or_property

	protected void field_or_property(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  id1 = null;
		IToken  begin1 = null;
		IToken  s = null;
		IToken  lparen = null;
		IToken  id2 = null;
		IToken  begin2 = null;
		
			IToken id = null;
			TypeMember tm = null;
			TypeReference tr = null;
			Property p = null;
			Field field = null;
			ExplicitMemberInfo emi = null;
			Expression initializer = null;
			ParameterDeclarationCollection parameters = null;
			Expression nameSplice = null;
		
		
		try {      // for error handling
			{
				bool synPredMatched156 = false;
				if (((LA(1)==SELF||LA(1)==ID||LA(1)==SPLICE_BEGIN) && (tokenSet_34_.member(LA(2)))))
				{
					int _m156 = mark();
					synPredMatched156 = true;
					inputState.guessing++;
					try {
						{
							property_header();
						}
					}
					catch (RecognitionException)
					{
						synPredMatched156 = false;
					}
					rewind(_m156);
					inputState.guessing--;
				}
				if ( synPredMatched156 )
				{
					{
						{
							if ((LA(1)==ID) && (LA(2)==DOT))
							{
								emi=explicit_member_info();
							}
							else if ((LA(1)==SELF||LA(1)==ID||LA(1)==SPLICE_BEGIN) && (tokenSet_34_.member(LA(2)))) {
							}
							else
							{
								throw new NoViableAltException(LT(1), getFilename());
							}
							
						}
						{
							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;
							}
							case SELF:
							{
								s = LT(1);
								match(SELF);
								if (0==inputState.guessing)
								{
									id=s;
								}
								break;
							}
							default:
							{
								throw new NoViableAltException(LT(1), getFilename());
							}
							 }
						}
						{
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例6: splice_type_definition_body

	public void splice_type_definition_body(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  begin = null;
		
			Expression e = null;
		
		
		try {      // for error handling
			begin = LT(1);
			match(SPLICE_BEGIN);
			e=atom();
			eos();
			if (0==inputState.guessing)
			{
				
						container.Add(new SpliceTypeDefinitionBody(e));
					
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "splice_type_definition_body");
				recover(ex,tokenSet_49_);
			}
			else
			{
				throw ex;
			}
		}
	}
开发者ID:hlizard,项目名称:boo,代码行数:35,代码来源:BooParserBase.cs


示例7: callable_definition

	protected void callable_definition(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  id = null;
		
				CallableDefinition cd = null;
				TypeReference returnType = null;
				GenericParameterDeclarationCollection genericParameters = null;
			
		
		try {      // for error handling
			match(CALLABLE);
			id = LT(1);
			match(ID);
			if (0==inputState.guessing)
			{
				
						cd = new CallableDefinition(ToLexicalInfo(id));
						cd.Name = id.getText();
						cd.Modifiers = _modifiers;
						AddAttributes(cd.Attributes);
						container.Add(cd);
						genericParameters = cd.GenericParameters;
					
			}
			{
				switch ( LA(1) )
				{
				case LBRACK:
				{
					match(LBRACK);
					{
						switch ( LA(1) )
						{
						case OF:
						{
							match(OF);
							break;
						}
						case ID:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					generic_parameter_declaration_list(genericParameters);
					match(RBRACK);
					break;
				}
				case LPAREN:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			match(LPAREN);
			parameter_declaration_list(cd.Parameters);
			match(RPAREN);
			{
				switch ( LA(1) )
				{
				case AS:
				{
					match(AS);
					returnType=type_reference();
					if (0==inputState.guessing)
					{
						cd.ReturnType=returnType;
					}
					break;
				}
				case EOL:
				case EOS:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			eos();
			docstring(cd);
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "callable_definition");
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例8: interface_definition

	protected void interface_definition(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  id = null;
		IToken  begin = null;
		
				InterfaceDefinition itf = null;
				TypeMemberCollection members = null;
				GenericParameterDeclarationCollection genericParameters = null;
				Expression nameSplice = null;
			
		
		try {      // for error handling
			match(INTERFACE);
			{
				switch ( LA(1) )
				{
				case ID:
				{
					id = LT(1);
					match(ID);
					break;
				}
				case SPLICE_BEGIN:
				{
					{
						begin = LT(1);
						match(SPLICE_BEGIN);
						nameSplice=atom();
					}
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			if (0==inputState.guessing)
			{
				
						IToken token = id ?? begin;
						itf = new InterfaceDefinition(ToLexicalInfo(token));
						itf.Name = token.getText();
						itf.Modifiers = _modifiers;
						AddAttributes(itf.Attributes);
						if (id != null) {
							container.Add(itf);
						} else {
							container.Add(new SpliceTypeMember(itf, nameSplice));
						}
						members = itf.Members;
						genericParameters = itf.GenericParameters;
					
			}
			{
				switch ( LA(1) )
				{
				case LBRACK:
				{
					match(LBRACK);
					{
						switch ( LA(1) )
						{
						case OF:
						{
							match(OF);
							break;
						}
						case ID:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					generic_parameter_declaration_list(genericParameters);
					match(RBRACK);
					break;
				}
				case LPAREN:
				case COLON:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			{
				switch ( LA(1) )
				{
				case LPAREN:
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例9: field_or_property

        //throws RecognitionException, TokenStreamException
        protected void field_or_property(
            TypeMemberCollection container
            )
        {
            IToken  id1 = null;
            IToken  s = null;
            IToken  id2 = null;

                IToken id = null;
                TypeMember tm = null;
                TypeReference tr = null;
                Property p = null;
                Field field = null;
                ExplicitMemberInfo emi = null;
                Expression initializer = null;
                ParameterDeclarationCollection parameters = null;

            try {      // for error handling
            bool synPredMatched132 = false;
            if (((LA(1)==SELF||LA(1)==ID) && (tokenSet_50_.member(LA(2)))))
            {
                int _m132 = mark();
                synPredMatched132 = true;
                inputState.guessing++;
                try {
                    {
                        property_header();
                    }
                }
                catch (RecognitionException)
                {
                    synPredMatched132 = false;
                }
                rewind(_m132);
                inputState.guessing--;
            }
            if ( synPredMatched132 )
            {
                {
                    {
                        if ((LA(1)==ID) && (LA(2)==DOT))
                        {
                            emi=explicit_member_info();
                        }
                        else if ((LA(1)==SELF||LA(1)==ID) && (tokenSet_51_.member(LA(2)))) {
                        }
                        else
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }

                    }
                    {
                        switch ( LA(1) )
                        {
                        case ID:
                        {
                            id1 = LT(1);
                            match(ID);
                            if (0==inputState.guessing)
                            {
                                id=id1;
                            }
                            break;
                        }
                        case SELF:
                        {
                            s = LT(1);
                            match(SELF);
                            if (0==inputState.guessing)
                            {
                                id=s;
                            }
                            break;
                        }
                        default:
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }
                         }
                    }
                    {
                        if (0==inputState.guessing)
                        {

                                            if (emi != null)
                                                p = new Property(emi.LexicalInfo);
                                            else
                                                p = new Property(SourceLocationFactory.ToLexicalInfo(id));
                                            p.Name = id.getText();
                                            p.ExplicitInfo = emi;
                                            AddAttributes(p.Attributes);
                                            parameters = p.Parameters;

                        }
                        {
                            switch ( LA(1) )
                            {
                            case LPAREN:
//.........这里部分代码省略.........
开发者ID:0xb1dd1e,项目名称:boo,代码行数:101,代码来源:WSABooParserBase.cs


示例10: enum_member

        //throws RecognitionException, TokenStreamException
        protected void enum_member(
            TypeMemberCollection container
            )
        {
            IToken  id = null;

                EnumMember em = null;
                IntegerLiteralExpression initializer = null;
                bool negative = false;

            try {      // for error handling
            attributes();
            id = LT(1);
            match(ID);
            {
                switch ( LA(1) )
                {
                case ASSIGN:
                {
                    match(ASSIGN);
                    {
                        if ((LA(1)==SUBTRACT) && (LA(2)==SUBTRACT||LA(2)==LONG||LA(2)==INT))
                        {
                            match(SUBTRACT);
                            if (0==inputState.guessing)
                            {
                                negative = true;
                            }
                        }
                        else if ((LA(1)==SUBTRACT||LA(1)==LONG||LA(1)==INT) && (tokenSet_42_.member(LA(2)))) {
                        }
                        else
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }

                    }
                    initializer=integer_literal();
                    break;
                }
                case EOF:
                case EOS:
                case NEWLINE:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            if (0==inputState.guessing)
            {

                        em = new EnumMember(SourceLocationFactory.ToLexicalInfo(id));
                        em.Name = id.getText();
                        em.Initializer = initializer;
                        if (negative && null != initializer)
                        {
                            initializer.Value *= -1;
                        }
                        AddAttributes(em.Attributes);
                        container.Add(em);

            }
            eos();
            docstring(em);
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex);
                recover(ex,tokenSet_43_);
            }
            else
            {
                throw ex;
            }
            }
        }
开发者ID:0xb1dd1e,项目名称:boo,代码行数:83,代码来源:WSABooParserBase.cs


示例11: class_definition

        //throws RecognitionException, TokenStreamException
        protected void class_definition(
            TypeMemberCollection container
            )
        {
            IToken  id = null;

                TypeDefinition td = null;
                TypeReferenceCollection baseTypes = null;
                TypeMemberCollection members = null;
                GenericParameterDeclarationCollection genericParameters = null;

            try {      // for error handling
            {
                switch ( LA(1) )
                {
                case CLASS:
                {
                    match(CLASS);
                    if (0==inputState.guessing)
                    {
                        td = new ClassDefinition();
                    }
                    break;
                }
                case STRUCT:
                {
                    match(STRUCT);
                    if (0==inputState.guessing)
                    {
                        td = new StructDefinition();
                    }
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            id = LT(1);
            match(ID);
            if (0==inputState.guessing)
            {

                        td.LexicalInfo = SourceLocationFactory.ToLexicalInfo(id);
                        td.Name = id.getText();
                        td.Modifiers = _modifiers;
                        AddAttributes(td.Attributes);
                        container.Add(td);
                        baseTypes = td.BaseTypes;
                        members = td.Members;
                        genericParameters = td.GenericParameters;

            }
            {
                switch ( LA(1) )
                {
                case LBRACK:
                {
                    match(LBRACK);
                    {
                        switch ( LA(1) )
                        {
                        case OF:
                        {
                            match(OF);
                            break;
                        }
                        case ID:
                        {
                            break;
                        }
                        default:
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }
                         }
                    }
                    generic_parameter_declaration_list(genericParameters);
                    match(RBRACK);
                    break;
                }
                case LPAREN:
                case COLON:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            {
                switch ( LA(1) )
                {
                case LPAREN:
                {
                    base_types(baseTypes);
//.........这里部分代码省略.........
开发者ID:0xb1dd1e,项目名称:boo,代码行数:101,代码来源:WSABooParserBase.cs


示例12: type_member_stmt

        //throws RecognitionException, TokenStreamException
        protected void type_member_stmt(
            StatementCollection container
            )
        {
            TypeMemberCollection members = new TypeMemberCollection();

            try {      // for error handling
            type_member(members);
            if (0==inputState.guessing)
            {

                        container.Add(new TypeMemberStatement(members[0]));

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


示例13: enum_definition

        //throws RecognitionException, TokenStreamException
        protected void enum_definition(
            TypeMemberCollection container
            )
        {
            IToken  id = null;

                EnumDefinition ed = null;

            try {      // for error handling
            match(ENUM);
            id = LT(1);
            match(ID);
            if (0==inputState.guessing)
            {
                ed = new EnumDefinition(ToLexicalInfo(id));
            }
            begin_with_doc(ed);
            if (0==inputState.guessing)
            {

                        ed.Name = id.getText();
                        ed.Modifiers = _modifiers;
                        AddAttributes(ed.Attributes);
                        container.Add(ed);

            }
            {
                { // ( ... )+
                    int _cnt40=0;
                    for (;;)
                    {
                        if ((LA(1)==ID||LA(1)==LBRACK))
                        {
                            enum_member(ed);
                        }
                        else
                        {
                            if (_cnt40 >= 1) { goto _loop40_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
                        }

                        _cnt40++;
                    }
            _loop40_breakloop:					;
                }    // ( ... )+
            }
            end(ed);
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex);
                recover(ex,tokenSet_20_);
            }
            else
            {
                throw ex;
            }
            }
        }
开发者ID:elfrostie,项目名称:boo,代码行数:61,代码来源:BooParserBase.cs


示例14: LiftBlockInto

		private static void LiftBlockInto(TypeMemberCollection collection, Block block)
		{
			foreach (var stmt in block.Statements)
			{
				var childBlock = stmt as Block;
				if (childBlock != null)
					LiftBlockInto(collection, childBlock);
				else
					collection.Add(TypeMember.Lift(stmt));
			}
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:11,代码来源:TypeMember.cs


示例15: Lift

		public static TypeMemberCollection Lift(Block block)
		{
			var members = new TypeMemberCollection();
			LiftBlockInto(members, block);
			return members;
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:6,代码来源:TypeMember.cs


示例16: method

	protected void method(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  t = null;
		IToken  spliceBegin = null;
		IToken  c = null;
		IToken  d = null;
		IToken  cc = null;
		IToken  dd = null;
		
				Method m = null;
				TypeReference rt = null;
				TypeReference it = null;
				ExplicitMemberInfo emi = null;
				ParameterDeclarationCollection parameters = null;
				GenericParameterDeclarationCollection genericParameters = null;
				Block body = null;
				StatementCollection statements = null;
				Expression nameSplice = null;
				TypeMember typeMember = null;
				IToken id = null;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case DEF:
				{
					t = LT(1);
					match(DEF);
					{
						switch ( LA(1) )
						{
						case EVENT:
						case GET:
						case INTERNAL:
						case PUBLIC:
						case PROTECTED:
						case REF:
						case SET:
						case YIELD:
						case ID:
						case SPLICE_BEGIN:
						{
							{
								{
									{
										if ((LA(1)==ID) && (LA(2)==DOT))
										{
											emi=explicit_member_info();
										}
										else if ((tokenSet_33_.member(LA(1))) && (tokenSet_34_.member(LA(2)))) {
										}
										else
										{
											throw new NoViableAltException(LT(1), getFilename());
										}
										
									}
									{
										switch ( LA(1) )
										{
										case EVENT:
										case GET:
										case INTERNAL:
										case PUBLIC:
										case PROTECTED:
										case REF:
										case SET:
										case YIELD:
										case ID:
										{
											id=member();
											break;
										}
										case SPLICE_BEGIN:
										{
											spliceBegin = LT(1);
											match(SPLICE_BEGIN);
											nameSplice=atom();
											break;
										}
										default:
										{
											throw new NoViableAltException(LT(1), getFilename());
										}
										 }
									}
								}
								if (0==inputState.guessing)
								{
									
														IToken token = id ?? spliceBegin;
														if (emi != null) {
															m = new Method(emi.LexicalInfo);
														} else {
															m = new Method(ToLexicalInfo(token));
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例17: class_definition

	protected void class_definition(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  id = null;
		IToken  begin = null;
		
				TypeDefinition td = null;
				TypeReferenceCollection baseTypes = null;
				TypeMemberCollection members = null;
				GenericParameterDeclarationCollection genericParameters = null;
				Expression nameSplice = null;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case CLASS:
				{
					match(CLASS);
					if (0==inputState.guessing)
					{
						td = new ClassDefinition();
					}
					break;
				}
				case STRUCT:
				{
					match(STRUCT);
					if (0==inputState.guessing)
					{
						td = new StructDefinition();
					}
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			{
				switch ( LA(1) )
				{
				case ID:
				{
					id = LT(1);
					match(ID);
					break;
				}
				case SPLICE_BEGIN:
				{
					begin = LT(1);
					match(SPLICE_BEGIN);
					nameSplice=atom();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			if (0==inputState.guessing)
			{
						
						IToken token = id ?? begin;
						td.LexicalInfo = ToLexicalInfo(token);
						td.Name = token.getText();
						td.Modifiers = _modifiers;
						AddAttributes(td.Attributes);
						baseTypes = td.BaseTypes;
						members = td.Members;
						genericParameters = td.GenericParameters;
						
						if (id != null) {
							container.Add(td);
						} else {
							container.Add(new SpliceTypeMember(td, nameSplice));
						}
					
			}
			{
				switch ( LA(1) )
				{
				case LBRACK:
				{
					match(LBRACK);
					{
						switch ( LA(1) )
						{
						case OF:
						{
							match(OF);
							break;
						}
						case ID:
						{
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs


示例18: interface_definition

        //throws RecognitionException, TokenStreamException
        protected void interface_definition(
            TypeMemberCollection container
            )
        {
            IToken  id = null;

                InterfaceDefinition itf = null;
                TypeMemberCollection members = null;
                GenericParameterDeclarationCollection genericParameters = null;

            try {      // for error handling
            match(INTERFACE);
            id = LT(1);
            match(ID);
            if (0==inputState.guessing)
            {

                        itf = new InterfaceDefinition(SourceLocationFactory.ToLexicalInfo(id));
                        itf.Name = id.getText();
                        itf.Modifiers = _modifiers;
                        AddAttributes(itf.Attributes);
                        container.Add(itf);
                        members = itf.Members;
                        genericParameters = itf.GenericParameters;

            }
            {
                switch ( LA(1) )
                {
                case LBRACK:
                {
                    match(LBRACK);
                    {
                        switch ( LA(1) )
                        {
                        case OF:
                        {
                            match(OF);
                            break;
                        }
                        case ID:
                        {
                            break;
                        }
                        default:
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }
                         }
                    }
                    generic_parameter_declaration_list(genericParameters);
                    match(RBRACK);
                    break;
                }
                case LPAREN:
                case COLON:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            {
                switch ( LA(1) )
                {
                case LPAREN:
                {
                    base_types(itf.BaseTypes);
                    break;
                }
                case COLON:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            begin_with_doc(itf);
            {    // ( ... )*
                for (;;)
                {
                    if ((tokenSet_33_.member(LA(1))))
                    {
                        attributes();
                        {
                            switch ( LA(1) )
                            {
                            case DEF:
                            {
                                interface_method(members);
                                break;
                            }
                            case EVENT:
//.........这里部分代码省略.........
开发者ID:0xb1dd1e,项目名称:boo,代码行数:101,代码来源:WSABooParserBase.cs


示例19: enum_definition

	protected void enum_definition(
		TypeMemberCollection container
	) //throws RecognitionException, TokenStreamException
{
		
		IToken  id = null;
		
				EnumDefinition ed = null;
				TypeMemberCollection members = null;
			
		
		try {      // for error handling
			match(ENUM);
			id = LT(1);
			match(ID);
			if (0==inputState.guessing)
			{
				ed = new EnumDefinition(ToLexicalInfo(id));
			}
			begin_with_doc(ed);
			if (0==inputState.guessing)
			{
				
							ed.Name = id.getText();
							ed.Modifiers = _modifiers;
							AddAttributes(ed.Attributes);
							container.Add(ed);
							members = ed.Members;
						
			}
			{
				switch ( LA(1) )
				{
				case PASS:
				{
					{
						match(PASS);
						eos();
					}
					break;
				}
				case ID:
				case LBRACK:
				case SPLICE_BEGIN:
				{
					{ // ( ... )+
						int _cnt48=0;
						for (;;)
						{
							switch ( LA(1) )
							{
							case ID:
							case LBRACK:
							{
								enum_member(members);
								break;
							}
							case SPLICE_BEGIN:
							{
								splice_type_definition_body(members);
								break;
							}
							default:
							{
								if (_cnt48 >= 1) { goto _loop48_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
							}
							break; }
							_cnt48++;
						}
_loop48_breakloop:						;
					}    // ( ... )+
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
			end(ed);
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "enum_definition");
				recover(ex,tokenSet_22_);
			}
			else
			{
				throw ex;
			}
		}
	}
开发者ID:hlizard,项目名称:boo,代码行数:94,代码来源:BooParserBase.cs


示例20: interface_method

        //throws RecognitionException, TokenStreamException
        protected void interface_method(
            TypeMemberCollection container
            )
        {
            Method m = null;
                TypeReference rt = null;
                IToken id = null;

            try {      // for error handling
            match(DEF);
            id=member();
            if (0==inputState.guessing)
            {

                        m = new Method(SourceLocationFactory.ToLexicalInfo(id));
                        m.Name = id.getText();
                        AddAttributes(m.Attributes);
                        container.Add(m);

            }
            {
                switch ( LA(1) )
                {
                case LBRACK:
                {
                    {
                        match(LBRACK);
                        {
                            switch ( LA(1) )
                            {
                            case OF:
                            {
                                match(OF);
                                break;
                            }
                            case ID:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        generic_parameter_declaration_list(m.GenericParameters);
                        match(RBRACK);
                    }
                    break;
                }
                case OF:
                {
                    {
                        match(OF);
                        generic_parameter_declaration(m.GenericParameters);
                    }
                    break;
                }
                case LPAREN:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            match(LPAREN);
            parameter_declaration_list(m.Parameters);
            match(RPAREN);
            {
                switch ( LA(1) )
                {
                case AS:
                {
                    match(AS);
                    rt=type_reference();
                    if (0==inputState.guessing)
                    {
                        m.ReturnType=rt;
                    }
                    break;
                }
                case EOF:
                case EOS:
                case NEWLINE:
                case COLON:
                {
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            {
                switch ( LA(1) )
//.........这里部分代码省略.........
开发者ID:0xb1dd1e,项目名称:boo,代码行数:101,代码来源:WSABooParserBase.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Ast.TypeReference类代码示例发布时间:2022-05-24
下一篇:
C# Ast.TypeMember类代码示例发布时间: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