Exemplo n.º 1
0
        protected override void NewChild(SyntaxNode node)
        {
            switch (node.SyntaxType)
            {
            case SyntaxType.StructKeyword:
                this.StructKeyword = node as SyntaxToken;
                break;

            case SyntaxType.TypeName:
                this.TypeName = node as TypeNameSyntax;
                break;

            case SyntaxType.LeftBraceToken:
                this.LeftBrace = node as SyntaxToken;
                break;

            case SyntaxType.StructDeclaration:
                this.structDeclarations.Add(node as StructDeclarationSyntax);
                break;

            case SyntaxType.RightBraceToken:
                this.RightBrace = node as SyntaxToken;
                break;
            }
        }
Exemplo n.º 2
0
        protected override void NewChild(SyntaxNode node)
        {
            switch (node.SyntaxType)
            {
            case SyntaxType.TypeName:
                this.TypeName = node as TypeNameSyntax;
                break;

            case SyntaxType.StructSpecifier:
                this.StructSpecifier = node as StructSpecifierSyntax;
                break;

            default:
                if (node.SyntaxType.IsType())
                {
                    this.Keyword = node as SyntaxToken;
                }

                break;
            }
        }