asking about existense of validating generating AST from libclang

Hi all,
I am using python libclang to parse cpp codes. But I came across that llvm creates AST(Abstract Syntax Tree) partially/ full depending upon source code is parsable or not. Going through documentation, I found that there is diagnostic property for every translation unit.

It’s Users’ sole responsibility to validate this generated AST using diagnostic

I think this is the general function to validate if the generated AST is valid or not. If someone have written, can you share or throw some light?

The main reason behind posting is that there is no proper documentation about diagnostic . I found it very hard to use category_number , severity without any documentation.

Awaiting for reply!

regards,
zeel shah
india