4

Is there any way to generate AST from C++ code using Microsoft Visual Studio compiler?

I think about something similar to -ast-dump option from clang.

Kao
  • 7,225
  • 9
  • 41
  • 65
  • No, MSVC doesn't actually produce an AST during compilation. – sjdowling Jan 22 '15 at 09:24
  • 2
    It does, but it consumes it during compilation. There was work on it a while back according to this post from 2007: http://blogs.msdn.com/b/vcblog/archive/2007/08/17/visual-c-code-model.aspx – graham.reeds Jun 22 '15 at 10:15

1 Answers1

2

I don't believe MSVC produces an AST you can access.

You can get ASTs for MSVC from our DMS Software Reengineering Toolkit. See this DMS-generated example of a C++ AST.

Community
  • 1
  • 1
Ira Baxter
  • 93,541
  • 22
  • 172
  • 341