예제 #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)));
 }
예제 #3
0
 protected MockedInterfaceASTWalker(InterfaceASTWalker original)
     : base(original)
 {
     // Reassigning since base class operated on it
     this.interfaceDeclaration = MockedInterfaceDeclarationTranslationUnit.Create(this.interfaceDeclaration);
 }