MethodDeclarationSyntax AddBody(CXCursor compountStmt, MethodDeclarationSyntax mDecl)
 {
     mDecl = mDecl.AddBodyStatements (new StatementSyntax[0]);
     SyntaxToken cl = mDecl.Body.CloseBraceToken.WithLeadingTrivia (FetchTrivias (compountStmt));
     return mDecl.ReplaceToken(mDecl.Body.CloseBraceToken, cl);
 }
        private void ProcessNodes(IEnumerable<MyVisualSyntaxNode> nodes, ref MethodDeclarationSyntax methodDeclaration, IEnumerable<StatementSyntax> statementsToAppend = null)
        {
            m_helperStatementList.Clear();
            m_navigator.ResetNodes();
            m_builderNode.Reset();
            m_builderNode.SequenceOutputs.AddRange(nodes);
            m_builderNode.Navigator = m_navigator;

            foreach (var node in nodes)
            {
                Debug.Assert(node is IMyVisualSyntaxEntryPoint);
                ((IMyVisualSyntaxEntryPoint)node).AddSequenceInput(m_builderNode);
            }

            m_builderNode.Preprocess();
            m_builderNode.CollectSequenceExpressions(m_helperStatementList);

            if (statementsToAppend != null)
                m_helperStatementList.AddRange(statementsToAppend);

            methodDeclaration = methodDeclaration.AddBodyStatements(m_helperStatementList.ToArray());
        }