[cfe-dev] Why can't library users create a Sema?

Martin C.Martin martin at martincmartin.com
Tue Mar 16 07:20:02 PDT 2010


Hi,

I'm trying to create an AST, not by parsing a file, but by calling 
function from within a program.  It seems reasonable to do what the 
Clang parser does, which is creating a Sema and calling methods on it. 
For example, create an AST for x + y by calling CreateBuiltinBinOp() and 
BuildDeclRefExpr().

However, Sema.h isn't in the include directory, but rather the lib 
directory, which makes me think it's not "public facing."  Is that 
right?  If so, why?  It seems to have well defined functionality and 
should be reusable.

Best,
Martin



More information about the cfe-dev mailing list