示例#1
0
        public override void VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)
        {
            var intfObj = CSharpEntityCreationHelper.CreateInterface(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(intfObj);

            base.VisitInterfaceDeclaration(node);
            m_currentParent = oldParent;
        }
示例#2
0
        public override void VisitEnumDeclaration(EnumDeclarationSyntax node)
        {
            var enumObj = CSharpEntityCreationHelper.CreateEnum(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(enumObj);

            base.VisitEnumDeclaration(node);
            m_currentParent = oldParent;
        }
示例#3
0
        public override void VisitForEachStatement(ForEachStatementSyntax node)
        {
            var foreachObj = CSharpEntityCreationHelper.CreateForEachBlock(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(foreachObj);

            base.VisitForEachStatement(node);
            m_currentParent = oldParent;
        }
示例#4
0
        public override void VisitStructDeclaration(StructDeclarationSyntax node)
        {
            var classObj = CSharpEntityCreationHelper.CreateStruct(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(classObj);

            base.VisitStructDeclaration(node);
            m_currentParent = oldParent;
        }
示例#5
0
        public override void VisitWhileStatement(WhileStatementSyntax node)
        {
            var whileObj = CSharpEntityCreationHelper.CreateWhileBlock(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(whileObj);

            base.VisitWhileStatement(node);
            m_currentParent = oldParent;
        }
示例#6
0
        public override void VisitCatchClause(CatchClauseSyntax node)
        {
            var catchObj = CSharpEntityCreationHelper.CreateCatchBlock(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(catchObj);

            base.VisitCatchClause(node);
            m_currentParent = oldParent;
        }
示例#7
0
        public override void VisitElseClause(ElseClauseSyntax node)
        {
            var elseObj = CSharpEntityCreationHelper.CreateElseBlock(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(elseObj);

            base.VisitElseClause(node);
            m_currentParent = oldParent;
        }
示例#8
0
        public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
        {
            var propertyObj = CSharpEntityCreationHelper.CreateProperty(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(propertyObj);

            base.VisitPropertyDeclaration(node);
            m_currentParent = oldParent;
        }
示例#9
0
        public override void VisitTryStatement(TryStatementSyntax node)
        {
            var tryObj = CSharpEntityCreationHelper.CreateTryBlock(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(tryObj);

            base.VisitTryStatement(node);
            m_currentParent = oldParent;
        }
示例#10
0
        public override void VisitDestructorDeclaration(DestructorDeclarationSyntax node)
        {
            var methodObj = CSharpEntityCreationHelper.CreateMethod(node, m_currentParent, m_currentCodeFile, m_currentTree);

            ISyntaxEntity oldParent = setCurrentParent(methodObj);

            base.VisitDestructorDeclaration(node);
            m_currentParent = oldParent;
        }
示例#11
0
        public override void VisitIndexerDeclaration(IndexerDeclarationSyntax node)
        {
            var prop = CSharpEntityCreationHelper.CreateProperty(node, m_currentParent, m_currentCodeFile, m_currentTree);

            Debug.Assert(prop.IsIndexer);

            ISyntaxEntity oldParent = setCurrentParent(prop);

            base.VisitIndexerDeclaration(node);
            m_currentParent = oldParent;
        }
示例#12
0
        public override void VisitConversionOperatorDeclaration(ConversionOperatorDeclarationSyntax node)
        {
            var methodObj = CSharpEntityCreationHelper.CreateMethod(node, m_currentParent, m_currentCodeFile, m_currentTree);

            Debug.Assert(methodObj.TypeOfFunction == FunctionTypes.ConversionOperator);

            ISyntaxEntity oldParent = setCurrentParent(methodObj);

            base.VisitConversionOperatorDeclaration(node);
            m_currentParent = oldParent;
        }
示例#13
0
        public override void VisitAnonymousMethodExpression(AnonymousMethodExpressionSyntax node)
        {
            var methodObj = CSharpEntityCreationHelper.CreateMethod(node, m_currentParent, m_currentCodeFile, m_currentTree);

            Debug.Assert(methodObj.TypeOfFunction == FunctionTypes.AnonymousDelegate);

            ISyntaxEntity oldParent = setCurrentParent(methodObj);

            base.VisitAnonymousMethodExpression(node);
            m_currentParent = oldParent;
        }
示例#14
0
        public override void VisitNamespaceDeclaration(NamespaceDeclarationSyntax node)
        {
            if (node == null)
            {
                throw new InvalidOperationException("Namespace Declaration node is null!");
            }
            var namespaceObj = new NamespaceDefinition(node.Name.GetText().ToString().Trim(),
                                                       new FileSpan(m_currentTree.GetLineSpan(node.Span)),
                                                       m_currentParent,
                                                       m_currentCodeFile);

            namespaceObj.AssociatedComment = CSharpEntityCreationHelper.GetComment(namespaceObj, node, m_currentTree, m_currentCodeFile);

            ISyntaxEntity oldParent = setCurrentParent(namespaceObj);

            base.VisitNamespaceDeclaration(node);
            m_currentParent = oldParent;
        }
示例#15
0
        public override void VisitParameter(ParameterSyntax node)
        {
            FormalParameter fp = CSharpEntityCreationHelper.CreateFormalParameter(node);

            if (m_currentParent.GetType() == typeof(FunctionDefinition))
            {
                (m_currentParent as FunctionDefinition).AddFormalParameter(fp);
            }
            else if (m_currentParent.GetType() == typeof(MemberProperty))
            {
                (m_currentParent as MemberProperty).SoleParameter = fp;
            }
            else
            {
                String msg = String.Format(CultureInfo.InvariantCulture, "Cannot process parameter if parent is: {0} [{1}]", m_currentParent.Kind, m_currentParent.Name);
                throw new InvalidOperationException(msg);
            }
            base.VisitParameter(node);
        }