44 const auto dotPos = file.rfind(
'.');
45 const auto dotNotFound = (dotPos == file.npos);
46 const auto dotIsTheLastChar = (dotPos == (file.length() - 1));
47 if (dotNotFound || dotIsTheLastChar)
49 return file[dotPos + 1] ==
'h';
Parses C++ source and generates an AST.
Represents an entire C++ program.
CppCompoundArray fileAsts_
Array of all top level ASTs corresponding to files.
CppTypeTreeNode cppTypeTreeRoot_
Repository of all compound objects arranged as type-tree.
void addCppAst(CppCompoundPtr cppAst)
Adds a new file AST to this program.
void addCompound(CppCompound *compound, CppCompound *parent)
CppCompoundArray & getFileAsts()
const CppTypeTreeNode * typeTreeNodeFromCppObj(CppObj *cppObj) const
void loadType(CppCompound *cppCompound, CppTypeTreeNode *typeNode)
const CppTypeTreeNode * nameLookup(const std::string &name, const CppTypeTreeNode *beginFrom=nullptr) const
Finds the CppTypeTreeNode object corresponding to a given name.
const CppTypeTreeNode * searchTypeNode(const std::string &name, const CppTypeTreeNode *parentNode=nullptr) const
Searches down (in breadth first manner) the CppTypeTreeNode object corresponding to a given name.
CppObjToTypeNodeMap cppObjToTypeNode_
std::map< CppObj *, CppTypeTreeNode * > CppObjToTypeNodeMap
std::unique_ptr< CppCompound > CppCompoundPtr
std::function< bool(const std::string &)> CppProgFileSelecter
bool selectAllFiles(const std::string &file)
std::vector< CppCompoundPtr > CppCompoundArray
bool selectHeadersOnly(const std::string &file)
std::string & name(CppVar *var)
All classes, structs, unions, and namespaces can be classified as a Compound object.
An abstract class that is used as base class of all other classes.