private static string GetTranslation(string source) { // Getting the AST node CSharpSyntaxTree tree = ASTExtractor.Extract(source); SyntaxNode node = new NodeLocator(tree).LocateLast(typeof(MethodDeclarationSyntax)); var methodDeclarationNode = node as MethodDeclarationSyntax; // Creating the walker var astWalker = MethodASTWalker.Create(methodDeclarationNode); // Getting the translation unit ITranslationUnit translationUnit = astWalker.Walk(); return(translationUnit.Translate()); }
protected MockedMethodASTWalker(MethodASTWalker original) : base(original) { // Reassigning since base class operated on it this.methodDeclaration = MockedMethodDeclarationTranslationUnit.Create(this.methodDeclaration); }
public static MockedMethodASTWalker Create(CSharpSyntaxNode node) { return(new MockedMethodASTWalker(MethodASTWalker.Create(node))); }