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


C# ClassDefinition.set_Name方法代码示例

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


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

示例1: GetContextFieldDeclaration

 public ClassDefinition GetContextFieldDeclaration()
 {
     Field field;
     Field field2;
     ParameterDeclaration declaration;
     MemberReferenceExpression expression;
     ReferenceExpression expression2;
     BinaryExpression expression3;
     ReferenceExpression expression4;
     ReferenceExpression expression5;
     MemberReferenceExpression expression6;
     BinaryExpression expression7;
     Block block;
     Constructor constructor;
     ClassDefinition definition;
     Type type = this._evaluationContext.GetType();
     Type type2 = this._evaluationContext.ScriptContainer.GetType();
     ClassDefinition definition1 = definition = new ClassDefinition(LexicalInfo.Empty);
     definition.set_Name("_");
     TypeMember[] memberArray1 = new TypeMember[3];
     Field field1 = field = new Field(LexicalInfo.Empty);
     field.set_Modifiers(40);
     field.set_Name("ScriptContainer");
     field.set_Type(TypeReference.Lift(type2));
     field.set_IsVolatile(false);
     memberArray1[0] = field;
     Field field3 = field2 = new Field(LexicalInfo.Empty);
     field2.set_Name("EvaluationContext");
     field2.set_Type(TypeReference.Lift(type));
     field2.set_IsVolatile(false);
     memberArray1[1] = field2;
     Constructor constructor1 = constructor = new Constructor(LexicalInfo.Empty);
     constructor.set_Name("constructor");
     ParameterDeclaration[] declarationArray1 = new ParameterDeclaration[1];
     ParameterDeclaration declaration1 = declaration = new ParameterDeclaration(LexicalInfo.Empty);
     declaration.set_Name("context");
     declaration.set_Type(TypeReference.Lift(type));
     declarationArray1[0] = declaration;
     constructor.set_Parameters(ParameterDeclarationCollection.FromArray(false, declarationArray1));
     Block block1 = block = new Block(LexicalInfo.Empty);
     Statement[] statementArray1 = new Statement[2];
     BinaryExpression expression1 = expression3 = new BinaryExpression(LexicalInfo.Empty);
     expression3.set_Operator(15);
     MemberReferenceExpression expression14 = expression = new MemberReferenceExpression(LexicalInfo.Empty);
     expression.set_Name("EvaluationContext");
     expression.set_Target(new SelfLiteralExpression(LexicalInfo.Empty));
     expression3.set_Left(expression);
     ReferenceExpression expression15 = expression2 = new ReferenceExpression(LexicalInfo.Empty);
     expression2.set_Name("context");
     expression3.set_Right(expression2);
     statementArray1[0] = Statement.Lift(expression3);
     BinaryExpression expression16 = expression7 = new BinaryExpression(LexicalInfo.Empty);
     expression7.set_Operator(15);
     ReferenceExpression expression17 = expression4 = new ReferenceExpression(LexicalInfo.Empty);
     expression4.set_Name("ScriptContainer");
     expression7.set_Left(expression4);
     MemberReferenceExpression expression18 = expression6 = new MemberReferenceExpression(LexicalInfo.Empty);
     expression6.set_Name("ScriptContainer");
     ReferenceExpression expression19 = expression5 = new ReferenceExpression(LexicalInfo.Empty);
     expression5.set_Name("context");
     expression6.set_Target(expression5);
     expression7.set_Right(expression6);
     statementArray1[1] = Statement.Lift(expression7);
     block.set_Statements(StatementCollection.FromArray(statementArray1));
     constructor.set_Body(block);
     memberArray1[2] = constructor;
     definition.set_Members(TypeMemberCollection.FromArray(memberArray1));
     return definition;
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:69,代码来源:IntroduceEvaluationContext.cs

示例2: 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.ClassDefinition.set_Name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。