Regarding parsing of comment in Clang

Respected,

Look for calls to RawComment::isDocumentation().

Dmitri

Or use the existing option to extract all comments.
clang::CommentOptions::ParseAllComments is a good starting point for
exploring that.

-- James

Respected Sir/ Ma’am

Thanks for the information, but the question is still the same that how can I retrieve the comments in my parser so that I can parse them. clang::CommentOptions::ParseAllComments will start parsing all comments but how can I get those comment in my parser. What are the function to retrieve them or I just have include the header files in which these are define.

One more question is that ACSL have some more comment command, if I am not wrong then those are to be first defined in CommentCommandList.inc

Thanking You

–Surbhi

I recently did some work to parse comments with the Clang APIs, it might help you figure out how to start using the APIs.

https://github.com/mono/CppSharp/blob/master/src/Parser/Comments.cpp#L249

Respected Sir,

Thanks for the information. Now the question arises is “how to apply semantics rules on these comment…??”. Do you have something for applying semantics rules on comment with grammer.

Thanks in advance

–Surbhi

Respected Sir/Ma’am

I want to know how and when is the prologue/epilogue of a function generated?

What I want to do is add a pre-condition and post-condition for every function and every loop which is encountered in my function.

Thanks in advance

–Surbhi