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


C# IBlockNode.AddRange方法代码示例

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


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

示例1: DeclDef


//.........这里部分代码省略.........
                    n += ")";
                }

                if (laKind == (Colon))
                    Step();
            }

            //TODO
            else if (laKind == (Else))
            {
                Step();
            }

            //StaticAssert
            else if (laKind == (Assert))
            {
                Step();

                if (DAttribute.ContainsAttribute(DeclarationAttributes, Static))
                {
                    //HACK: Assume that there's only our 'static' attribute applied to the 'if'-statement
                    DeclarationAttributes.Clear();
                }
                else
                    SynErr(Static, "Static assert statements must be explicitly marked as static");

                if (Expect(OpenParenthesis))
                {
                    AssignExpression();
                    if (laKind == (Comma))
                    {
                        Step();
                        AssignExpression();
                    }
                    Expect(CloseParenthesis);
                }
                    Expect(Semicolon);
            }

            //TemplateMixin
            else if (laKind == Mixin && Peek(1).Kind == Identifier)
                TemplateMixin();

            //MixinDeclaration
            else if (laKind == (Mixin))
                MixinDeclaration();

            //;
            else if (laKind == (Semicolon))
                Step();

            // {
            else if (laKind == (OpenCurlyBrace))
            {
                // Due to having a new attribute scope, we'll have use a new attribute stack here
                var AttrBackup = BlockAttributes;
                BlockAttributes = new Stack<DAttribute>();

                while (DeclarationAttributes.Count > 0)
                    BlockAttributes.Push(DeclarationAttributes.Pop());

                ClassBody(module, true);

                // After the block ended, restore the previous block attributes
                BlockAttributes = AttrBackup;
            }

            // Class Allocators
            // Note: Although occuring in global scope, parse it anyway but declare it as semantic nonsense;)
            else if (laKind == (New))
            {
                Step();

                var dm = new DMethod(DMethod.MethodType.Allocator);
                dm.Name = "new";
                ApplyAttributes(dm);

                dm.Parameters = Parameters(dm);
                FunctionBody(dm);
                module.Add(dm);
            }

            // Class Deallocators
            else if (laKind == Delete)
            {
                Step();

                var dm = new DMethod(DMethod.MethodType.Deallocator);
                dm.Name = "delete";
                ApplyAttributes(dm);

                dm.Parameters = Parameters(dm);
                FunctionBody(dm);
                module.Add(dm);
            }

            // else:
            else
                module.AddRange(Declaration(module));
        }
开发者ID:nazriel,项目名称:Mono-D,代码行数:101,代码来源:Parser_Impl.cs


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