How to Extract AST of given Typescript code using the open source Typescript compiler code?
问题 As it is known that Typescript is completely opensource now. which is available at Tyescript. I am building an application that will get Typescript code as input and give output the AST of the given code. Provide me a proper way to extract this AST(Abstract Syntax Tree) of input Typescript code rather than comppliling it and converting it into Javascript. 回答1: Basic code: const fileNames = ["C:\\MyFile.ts"]; const compilerOptions: ts.CompilerOptions = { // compiler options go here if any... /