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


C# TypeDefinition.get_Members方法代码示例

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


在下文中一共展示了TypeDefinition.get_Members方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddFunctionTo

 public Method AddFunctionTo(TypeDefinition type, IToken nameToken, IToken getter, IToken setter)
 {
     Method method;
     string name = nameToken.getText();
     LexicalInfo info = ToLexicalInfo(nameToken);
     Method method1 = method = new Method(info);
     method.set_Name(name);
     Method node = !IsConstructorName(name, type) ? method : new Constructor(info);
     if ((getter != null) || (setter != null))
     {
         Property property = type.get_Members().get_Item(name) as Property;
         if (property == null)
         {
             Property property2;
             Property property1 = property2 = new Property(info);
             property2.set_Name(name);
             property = property2;
             type.get_Members().Add(property);
         }
         if (getter != null)
         {
             if (property.get_Getter() != null)
             {
                 throw new AssertionFailedException("p.Getter is null");
             }
             property.set_Getter(node);
         }
         else
         {
             if (property.get_Setter() != null)
             {
                 throw new AssertionFailedException("p.Setter is null");
             }
             property.set_Setter(node);
         }
         this.FlushAttributes(property);
         return node;
     }
     type.get_Members().Add(node);
     this.FlushAttributes(node);
     return node;
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:42,代码来源:UnityScriptParser.cs

示例2: interface_declaration

        public TypeMember interface_declaration(TypeDefinition parent)
        {
            TypeMember member = null;
            IToken token = null;
            IToken token2 = null;
            try
            {
                InterfaceDefinition definition2;
                TypeReferenceCollection references;
                this.match(0x19);
                token = this.LT(1);
                this.match(0x3b);
                if (base.inputState.guessing == 0)
                {
                    InterfaceDefinition definition;
                    InterfaceDefinition definition1 = definition = new InterfaceDefinition(ToLexicalInfo(token));
                    definition.set_Name(token.getText());
                    member = definition2 = definition;
                    references = definition2.get_BaseTypes();
                    this.FlushAttributes(definition2);
                    parent.get_Members().Add(definition2);
                }
                switch (this.LA(1))
                {
                    case 14:
                        this.match(14);
                        this.type_reference_list(references);
                        break;

                    case 0x3d:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                this.match(0x3d);
                while (true)
                {
                    if ((this.LA(1) != 0x13) && (this.LA(1) != 0x63))
                    {
                        break;
                    }
                    switch (this.LA(1))
                    {
                        case 0x63:
                            this.attributes();
                            break;

                        case 0x13:
                            break;

                        default:
                            throw new NoViableAltException(this.LT(1), this.getFilename());
                    }
                    this.interface_member(definition2);
                }
                token2 = this.LT(1);
                this.match(0x3e);
                if (base.inputState.guessing == 0)
                {
                    SetEndSourceLocation(definition2, token2);
                }
                while ((this.LA(1) == 0x4d) && tokenSet_33_.member(this.LA(2)))
                {
                    this.match(0x4d);
                }
                return member;
            }
            catch (RecognitionException exception)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception);
                this.recover(exception, tokenSet_33_);
                return member;
            }
            return member;
        }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:80,代码来源:UnityScriptParser.cs

示例3: enum_declaration

        public TypeMember enum_declaration(TypeDefinition container)
        {
            TypeMember node = null;
            IToken token = null;
            IToken token2 = null;
            try
            {
                EnumDefinition definition2;
                this.match(13);
                token = this.LT(1);
                this.match(0x3b);
                if (base.inputState.guessing == 0)
                {
                    EnumDefinition definition;
                    EnumDefinition definition1 = definition = new EnumDefinition(ToLexicalInfo(token));
                    definition.set_Name(token.getText());
                    node = definition2 = definition;
                    this.FlushAttributes(node);
                    container.get_Members().Add(definition2);
                }
                this.match(0x3d);
                switch (this.LA(1))
                {
                    case 12:
                    case 0x10:
                    case 0x21:
                    case 0x3b:
                    case 0x63:
                        this.enum_member(definition2);
                        while ((this.LA(1) == 0x43) && tokenSet_34_.member(this.LA(2)))
                        {
                            this.match(0x43);
                            this.enum_member(definition2);
                        }
                        switch (this.LA(1))
                        {
                            case 0x43:
                                this.match(0x43);
                                goto Label_015B;
                        }
                        throw new NoViableAltException(this.LT(1), this.getFilename());

                    case 0x3e:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
            Label_015B:
                token2 = this.LT(1);
                this.match(0x3e);
                if (base.inputState.guessing == 0)
                {
                    SetEndSourceLocation(definition2, token2);
                }
                while ((this.LA(1) == 0x4d) && tokenSet_33_.member(this.LA(2)))
                {
                    this.match(0x4d);
                }
                return node;
            }
            catch (RecognitionException exception)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception);
                this.recover(exception, tokenSet_33_);
                return node;
            }
            return node;
        }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:73,代码来源:UnityScriptParser.cs

示例4: field_member


//.........这里部分代码省略.........
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                switch (this.LA(1))
                {
                    case 0x4e:
                        this.match(0x4e);
                        expression = this.expression();
                        break;

                    case 1:
                    case 5:
                    case 8:
                    case 9:
                    case 10:
                    case 12:
                    case 13:
                    case 15:
                    case 0x10:
                    case 0x12:
                    case 0x13:
                    case 20:
                    case 0x15:
                    case 0x19:
                    case 0x1b:
                    case 0x1d:
                    case 30:
                    case 0x1f:
                    case 0x20:
                    case 0x21:
                    case 0x22:
                    case 0x23:
                    case 0x24:
                    case 0x25:
                    case 0x26:
                    case 0x27:
                    case 40:
                    case 0x29:
                    case 0x2a:
                    case 0x2b:
                    case 0x2c:
                    case 0x2d:
                    case 0x2e:
                    case 0x2f:
                    case 0x30:
                    case 0x31:
                    case 0x3b:
                    case 60:
                    case 0x3d:
                    case 0x3e:
                    case 0x3f:
                    case 0x44:
                    case 0x4d:
                    case 0x4f:
                    case 80:
                    case 0x52:
                    case 0x58:
                    case 0x63:
                    case 0x67:
                    case 0x69:
                    case 0x6a:
                    case 0x6b:
                    case 0x6c:
                    case 0x6d:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                IToken token2 = this.eos();
                if (base.inputState.guessing != 0)
                {
                    return node;
                }
                Field field1 = field = new Field(ToLexicalInfo(token));
                field.set_Name(token.getText());
                field.set_Type(reference);
                field.set_Initializer(expression);
                node = field;
                if (token2 != null)
                {
                    SetEndSourceLocation(node, token2);
                }
                this.FlushAttributes(node);
                cd.get_Members().Add(node);
            }
            catch (RecognitionException exception)
            {
                if (base.inputState.guessing != 0)
                {
                    throw;
                }
                this.reportError(exception);
                this.recover(exception, tokenSet_33_);
                return node;
            }
            return node;
        }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:101,代码来源:UnityScriptParser.cs

示例5: class_declaration

        public TypeMember class_declaration(TypeDefinition parent)
        {
            TypeMember member = null;
            IToken token = null;
            IToken token2 = null;
            IToken token3 = null;
            try
            {
                TypeReference reference;
                ClassDefinition definition2;
                TypeReferenceCollection references;
                switch (this.LA(1))
                {
                    case 0x23:
                        token = this.LT(1);
                        this.match(0x23);
                        break;

                    case 8:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                this.match(8);
                token2 = this.LT(1);
                this.match(0x3b);
                switch (this.LA(1))
                {
                    case 14:
                        this.match(14);
                        reference = this.type_reference();
                        break;

                    case 0x17:
                    case 0x3d:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                if (base.inputState.guessing == 0)
                {
                    ClassDefinition definition;
                    ClassDefinition definition1 = definition = new ClassDefinition(ToLexicalInfo(token2));
                    definition.set_Name(token2.getText());
                    member = definition2 = definition;
                    references = definition2.get_BaseTypes();
                    if (reference != null)
                    {
                        references.Add(reference);
                    }
                    if (token != null)
                    {
                        definition2.set_Modifiers(definition2.get_Modifiers() | 0x400);
                    }
                    this.FlushAttributes(definition2);
                    parent.get_Members().Add(definition2);
                }
                switch (this.LA(1))
                {
                    case 0x17:
                        this.match(0x17);
                        this.type_reference_list(references);
                        break;

                    case 0x3d:
                        break;

                    default:
                        throw new NoViableAltException(this.LT(1), this.getFilename());
                }
                if (base.inputState.guessing == 0)
                {
                    foreach (TypeReference reference2 in references)
                    {
                        if (reference2 == reference)
                        {
                            BaseTypeAnnotations.AnnotateExtends(reference2);
                        }
                        else
                        {
                            BaseTypeAnnotations.AnnotateImplements(reference2);
                        }
                    }
                }
                this.match(0x3d);
                while (true)
                {
                    TypeMemberModifiers modifiers;
                    TypeMember member2;
                    if (!tokenSet_29_.member(this.LA(1)))
                    {
                        break;
                    }
                    if (base.inputState.guessing == 0)
                    {
                        modifiers = 0;
                    }
                    switch (this.LA(1))
//.........这里部分代码省略.........
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:101,代码来源:UnityScriptParser.cs


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