Where can I find standard BNF or YACC grammar for C++ language?

后端 未结 6 1107
小鲜肉
小鲜肉 2021-01-30 18:00

I\'m trying to work on a kind of code generator to help unit-testing an legacy C/C++ blended project. I don\'t find any kind of independent tool can generate stub code from decl

6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 18:41

    For another approach, you could consider piggy-backing on an existing compiler.

    GCC-XML will "compile" C++ into XML files with a lot of useful information; it may be enough for your purposes.

    Unfortunately, GCC-XML is only 1/4-maintained, and getting it to work can be...interesting. Good luck, if you go this route.

提交回复
热议问题