Cppcheck
Classes | Namespaces | Typedefs | Functions | Variables
clangimport.cpp File Reference
#include "clangimport.h"
#include "errortypes.h"
#include "mathlib.h"
#include "settings.h"
#include "standards.h"
#include "symboldatabase.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include "vfvalue.h"
#include <algorithm>
#include <cctype>
#include <cstring>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <numeric>

Go to the source code of this file.

Classes

struct  clangimport::Data
 
struct  clangimport::Data::Decl
 
class  clangimport::AstNode
 

Namespaces

 clangimport
 

Typedefs

using clangimport::AstNodePtr = std::shared_ptr< AstNode >
 

Functions

static std::string unquote (const std::string &s)
 
static std::vector< std::string > splitString (const std::string &line)
 
static void setTypes (TokenList &tokenList)
 
static void setValues (const Tokenizer &tokenizer, const SymbolDatabase *symbolDatabase)
 

Variables

static const std::string AccessSpecDecl = "AccessSpecDecl"
 
static const std::string ArraySubscriptExpr = "ArraySubscriptExpr"
 
static const std::string BinaryOperator = "BinaryOperator"
 
static const std::string BreakStmt = "BreakStmt"
 
static const std::string CallExpr = "CallExpr"
 
static const std::string CaseStmt = "CaseStmt"
 
static const std::string CharacterLiteral = "CharacterLiteral"
 
static const std::string ClassTemplateDecl = "ClassTemplateDecl"
 
static const std::string ClassTemplateSpecializationDecl = "ClassTemplateSpecializationDecl"
 
static const std::string ConditionalOperator = "ConditionalOperator"
 
static const std::string ConstantExpr = "ConstantExpr"
 
static const std::string CompoundAssignOperator = "CompoundAssignOperator"
 
static const std::string CompoundStmt = "CompoundStmt"
 
static const std::string ContinueStmt = "ContinueStmt"
 
static const std::string CStyleCastExpr = "CStyleCastExpr"
 
static const std::string CXXBindTemporaryExpr = "CXXBindTemporaryExpr"
 
static const std::string CXXBoolLiteralExpr = "CXXBoolLiteralExpr"
 
static const std::string CXXConstructorDecl = "CXXConstructorDecl"
 
static const std::string CXXConstructExpr = "CXXConstructExpr"
 
static const std::string CXXDefaultArgExpr = "CXXDefaultArgExpr"
 
static const std::string CXXDeleteExpr = "CXXDeleteExpr"
 
static const std::string CXXDestructorDecl = "CXXDestructorDecl"
 
static const std::string CXXForRangeStmt = "CXXForRangeStmt"
 
static const std::string CXXFunctionalCastExpr = "CXXFunctionalCastExpr"
 
static const std::string CXXMemberCallExpr = "CXXMemberCallExpr"
 
static const std::string CXXMethodDecl = "CXXMethodDecl"
 
static const std::string CXXNewExpr = "CXXNewExpr"
 
static const std::string CXXNullPtrLiteralExpr = "CXXNullPtrLiteralExpr"
 
static const std::string CXXOperatorCallExpr = "CXXOperatorCallExpr"
 
static const std::string CXXRecordDecl = "CXXRecordDecl"
 
static const std::string CXXStaticCastExpr = "CXXStaticCastExpr"
 
static const std::string CXXStdInitializerListExpr = "CXXStdInitializerListExpr"
 
static const std::string CXXTemporaryObjectExpr = "CXXTemporaryObjectExpr"
 
static const std::string CXXThisExpr = "CXXThisExpr"
 
static const std::string CXXThrowExpr = "CXXThrowExpr"
 
static const std::string DeclRefExpr = "DeclRefExpr"
 
static const std::string DeclStmt = "DeclStmt"
 
static const std::string DefaultStmt = "DefaultStmt"
 
static const std::string DoStmt = "DoStmt"
 
static const std::string EnumConstantDecl = "EnumConstantDecl"
 
static const std::string EnumDecl = "EnumDecl"
 
static const std::string ExprWithCleanups = "ExprWithCleanups"
 
static const std::string FieldDecl = "FieldDecl"
 
static const std::string FloatingLiteral = "FloatingLiteral"
 
static const std::string ForStmt = "ForStmt"
 
static const std::string FunctionDecl = "FunctionDecl"
 
static const std::string FunctionTemplateDecl = "FunctionTemplateDecl"
 
static const std::string GotoStmt = "GotoStmt"
 
static const std::string IfStmt = "IfStmt"
 
static const std::string ImplicitCastExpr = "ImplicitCastExpr"
 
static const std::string InitListExpr = "InitListExpr"
 
static const std::string IntegerLiteral = "IntegerLiteral"
 
static const std::string LabelStmt = "LabelStmt"
 
static const std::string LinkageSpecDecl = "LinkageSpecDecl"
 
static const std::string MaterializeTemporaryExpr = "MaterializeTemporaryExpr"
 
static const std::string MemberExpr = "MemberExpr"
 
static const std::string NamespaceDecl = "NamespaceDecl"
 
static const std::string NullStmt = "NullStmt"
 
static const std::string ParenExpr = "ParenExpr"
 
static const std::string ParmVarDecl = "ParmVarDecl"
 
static const std::string RecordDecl = "RecordDecl"
 
static const std::string ReturnStmt = "ReturnStmt"
 
static const std::string StringLiteral = "StringLiteral"
 
static const std::string SwitchStmt = "SwitchStmt"
 
static const std::string TemplateArgument = "TemplateArgument"
 
static const std::string TypedefDecl = "TypedefDecl"
 
static const std::string UnaryOperator = "UnaryOperator"
 
static const std::string UnaryExprOrTypeTraitExpr = "UnaryExprOrTypeTraitExpr"
 
static const std::string VarDecl = "VarDecl"
 
static const std::string WhileStmt = "WhileStmt"
 

Function Documentation

◆ setTypes()

static void setTypes ( TokenList tokenList)
static

◆ setValues()

static void setValues ( const Tokenizer tokenizer,
const SymbolDatabase symbolDatabase 
)
static

◆ splitString()

static std::vector<std::string> splitString ( const std::string &  line)
static

Definition at line 125 of file clangimport.cpp.

Referenced by clangimport::AstNode::addTypeTokens().

◆ unquote()

static std::string unquote ( const std::string &  s)
static

Variable Documentation

◆ AccessSpecDecl

const std::string AccessSpecDecl = "AccessSpecDecl"
static

Definition at line 48 of file clangimport.cpp.

Referenced by clangimport::AstNode::createScope().

◆ ArraySubscriptExpr

const std::string ArraySubscriptExpr = "ArraySubscriptExpr"
static

Definition at line 49 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ BinaryOperator

const std::string BinaryOperator = "BinaryOperator"
static

Definition at line 50 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ BreakStmt

const std::string BreakStmt = "BreakStmt"
static

Definition at line 51 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CallExpr

const std::string CallExpr = "CallExpr"
static

Definition at line 52 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CaseStmt

const std::string CaseStmt = "CaseStmt"
static

Definition at line 53 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CharacterLiteral

const std::string CharacterLiteral = "CharacterLiteral"
static

Definition at line 54 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ClassTemplateDecl

const std::string ClassTemplateDecl = "ClassTemplateDecl"
static

Definition at line 55 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ClassTemplateSpecializationDecl

const std::string ClassTemplateSpecializationDecl = "ClassTemplateSpecializationDecl"
static

Definition at line 56 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CompoundAssignOperator

const std::string CompoundAssignOperator = "CompoundAssignOperator"
static

◆ CompoundStmt

const std::string CompoundStmt = "CompoundStmt"
static

◆ ConditionalOperator

const std::string ConditionalOperator = "ConditionalOperator"
static

Definition at line 57 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ConstantExpr

const std::string ConstantExpr = "ConstantExpr"
static

Definition at line 58 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ContinueStmt

const std::string ContinueStmt = "ContinueStmt"
static

Definition at line 61 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CStyleCastExpr

const std::string CStyleCastExpr = "CStyleCastExpr"
static

Definition at line 62 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXBindTemporaryExpr

const std::string CXXBindTemporaryExpr = "CXXBindTemporaryExpr"
static

Definition at line 63 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXBoolLiteralExpr

const std::string CXXBoolLiteralExpr = "CXXBoolLiteralExpr"
static

Definition at line 64 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXConstructExpr

const std::string CXXConstructExpr = "CXXConstructExpr"
static

Definition at line 66 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXConstructorDecl

const std::string CXXConstructorDecl = "CXXConstructorDecl"
static

◆ CXXDefaultArgExpr

const std::string CXXDefaultArgExpr = "CXXDefaultArgExpr"
static

Definition at line 67 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokensCall().

◆ CXXDeleteExpr

const std::string CXXDeleteExpr = "CXXDeleteExpr"
static

Definition at line 68 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXDestructorDecl

const std::string CXXDestructorDecl = "CXXDestructorDecl"
static

◆ CXXForRangeStmt

const std::string CXXForRangeStmt = "CXXForRangeStmt"
static

Definition at line 70 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXFunctionalCastExpr

const std::string CXXFunctionalCastExpr = "CXXFunctionalCastExpr"
static

Definition at line 71 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXMemberCallExpr

const std::string CXXMemberCallExpr = "CXXMemberCallExpr"
static

Definition at line 72 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXMethodDecl

const std::string CXXMethodDecl = "CXXMethodDecl"
static

◆ CXXNewExpr

const std::string CXXNewExpr = "CXXNewExpr"
static

Definition at line 74 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXNullPtrLiteralExpr

const std::string CXXNullPtrLiteralExpr = "CXXNullPtrLiteralExpr"
static

Definition at line 75 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXOperatorCallExpr

const std::string CXXOperatorCallExpr = "CXXOperatorCallExpr"
static

◆ CXXRecordDecl

const std::string CXXRecordDecl = "CXXRecordDecl"
static

Definition at line 77 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXStaticCastExpr

const std::string CXXStaticCastExpr = "CXXStaticCastExpr"
static

Definition at line 78 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXStdInitializerListExpr

const std::string CXXStdInitializerListExpr = "CXXStdInitializerListExpr"
static

Definition at line 79 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXTemporaryObjectExpr

const std::string CXXTemporaryObjectExpr = "CXXTemporaryObjectExpr"
static

Definition at line 80 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXThisExpr

const std::string CXXThisExpr = "CXXThisExpr"
static

Definition at line 81 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ CXXThrowExpr

const std::string CXXThrowExpr = "CXXThrowExpr"
static

Definition at line 82 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ DeclRefExpr

const std::string DeclRefExpr = "DeclRefExpr"
static

◆ DeclStmt

const std::string DeclStmt = "DeclStmt"
static

Definition at line 84 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ DefaultStmt

const std::string DefaultStmt = "DefaultStmt"
static

Definition at line 85 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ DoStmt

const std::string DoStmt = "DoStmt"
static

Definition at line 86 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ EnumConstantDecl

const std::string EnumConstantDecl = "EnumConstantDecl"
static

Definition at line 87 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ EnumDecl

const std::string EnumDecl = "EnumDecl"
static

Definition at line 88 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ExprWithCleanups

const std::string ExprWithCleanups = "ExprWithCleanups"
static

Definition at line 89 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ FieldDecl

const std::string FieldDecl = "FieldDecl"
static

Definition at line 90 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ FloatingLiteral

const std::string FloatingLiteral = "FloatingLiteral"
static

Definition at line 91 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ForStmt

const std::string ForStmt = "ForStmt"
static

Definition at line 92 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ FunctionDecl

const std::string FunctionDecl = "FunctionDecl"
static

◆ FunctionTemplateDecl

const std::string FunctionTemplateDecl = "FunctionTemplateDecl"
static

Definition at line 94 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ GotoStmt

const std::string GotoStmt = "GotoStmt"
static

Definition at line 95 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ IfStmt

const std::string IfStmt = "IfStmt"
static

Definition at line 96 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ImplicitCastExpr

const std::string ImplicitCastExpr = "ImplicitCastExpr"
static

Definition at line 97 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ InitListExpr

const std::string InitListExpr = "InitListExpr"
static

Definition at line 98 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ IntegerLiteral

const std::string IntegerLiteral = "IntegerLiteral"
static

Definition at line 99 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ LabelStmt

const std::string LabelStmt = "LabelStmt"
static

Definition at line 100 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ LinkageSpecDecl

const std::string LinkageSpecDecl = "LinkageSpecDecl"
static

Definition at line 101 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ MaterializeTemporaryExpr

const std::string MaterializeTemporaryExpr = "MaterializeTemporaryExpr"
static

Definition at line 102 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ MemberExpr

const std::string MemberExpr = "MemberExpr"
static

Definition at line 103 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ NamespaceDecl

const std::string NamespaceDecl = "NamespaceDecl"
static

Definition at line 104 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ NullStmt

const std::string NullStmt = "NullStmt"
static

Definition at line 105 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ParenExpr

const std::string ParenExpr = "ParenExpr"
static

Definition at line 106 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ ParmVarDecl

const std::string ParmVarDecl = "ParmVarDecl"
static

Definition at line 107 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokensFunctionDecl().

◆ RecordDecl

const std::string RecordDecl = "RecordDecl"
static

◆ ReturnStmt

const std::string ReturnStmt = "ReturnStmt"
static

Definition at line 109 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ StringLiteral

const std::string StringLiteral = "StringLiteral"
static

Definition at line 110 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ SwitchStmt

const std::string SwitchStmt = "SwitchStmt"
static

Definition at line 111 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ TemplateArgument

const std::string TemplateArgument = "TemplateArgument"
static

Definition at line 112 of file clangimport.cpp.

Referenced by clangimport::AstNode::getTemplateParameters().

◆ TypedefDecl

const std::string TypedefDecl = "TypedefDecl"
static

◆ UnaryExprOrTypeTraitExpr

const std::string UnaryExprOrTypeTraitExpr = "UnaryExprOrTypeTraitExpr"
static

◆ UnaryOperator

const std::string UnaryOperator = "UnaryOperator"
static

Definition at line 114 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().

◆ VarDecl

const std::string VarDecl = "VarDecl"
static

◆ WhileStmt

const std::string WhileStmt = "WhileStmt"
static

Definition at line 117 of file clangimport.cpp.

Referenced by clangimport::AstNode::createTokens().