How to get typed abstract syntax tree from F # compiler service
How can I access the typed syntax tree for all source files in an af # project in the way described "parsing the whole project" . So, I need a specific Microsoft.FSharp.Compiler.Tast file of all files in the project.
Accessing the untyped syntax tree is fairly straightforward, as described in the following untyped ast . So, I expect there will be an appropriate interface for flavor.
The goal is to translate the code from F # into another typed language, in this case scala, that needs type annotations. The whole project must be translated immediately.
source to share
The first url you link to shows how to get FSharpAssemblySignature
, but doesn't explain what to do with such a value. This type, and the immediate types it contains, FSharpEntity
and FSharpMemberOrFunctionOrValue
are defined in Symbols.fs . Sam typed AST determined tast.fs . I am not aware of any document explaining the different types other than the comments in these two files.
source to share