Пример #1
0
        private static string GetTranslation(string source)
        {
            // Getting the AST node
            CSharpSyntaxTree tree = ASTExtractor.Extract(source);

            SyntaxNode node = new NodeLocator(tree).LocateLast(typeof(InterfaceDeclarationSyntax));
            InterfaceDeclarationSyntax interfaceDeclarationNode = node as InterfaceDeclarationSyntax;

            // Creating the walker
            var astWalker = InterfaceASTWalker.Create(interfaceDeclarationNode);

            // Getting the translation unit
            ITranslationUnit translationUnit = astWalker.Walk();

            return(translationUnit.Translate());
        }
Пример #2
0
 public static MockedInterfaceASTWalker Create(CSharpSyntaxNode node)
 {
     return(new MockedInterfaceASTWalker(InterfaceASTWalker.Create(node)));
 }