[HttpPost("VisualBasic")] // POST: /SyntaxTree/VisualBasic public async Task <SyntaxTreeNode> VisualBasicPost(CancellationToken cancellationToken) { using var reader = new StreamReader(Request.Body, Encoding.UTF8); string body = await reader.ReadToEndAsync().ConfigureAwait(false); SyntaxTree tree = VisualBasicSyntaxTree.ParseText(body); SyntaxNode root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false); Compilation compilation = VisualBasicCompilation.Create("HelloWorld", new[] { tree }); SemanticModel model = compilation.GetSemanticModel(tree); SyntaxTreeNode myRoot = SyntaxTreeNode.CreateMyOwnTree(root, model); return(myRoot); }