Cppcheck
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
clangimport::AstNode Class Reference

Public Member Functions

 AstNode (std::string nodeType, const std::string &ext, Data *data)
 
void setLocations (TokenList &tokenList, int file, int line, int col)
 
void dumpAst (int num=0, int indent=0) const
 
void createTokens1 (TokenList &tokenList)
 
AstNodePtr getChild (int c)
 

Public Attributes

std::string nodeType
 
std::vector< AstNodePtrchildren
 

Private Member Functions

TokencreateTokens (TokenList &tokenList)
 
Tokenaddtoken (TokenList &tokenList, const std::string &str, bool valueType=true)
 
const ::TypeaddTypeTokens (TokenList &tokenList, const std::string &str, const Scope *scope=nullptr)
 
void addFullScopeNameTokens (TokenList &tokenList, const Scope *recordScope)
 
ScopecreateScope (TokenList &tokenList, Scope::ScopeType scopeType, AstNodePtr astNode, const Token *def)
 
ScopecreateScope (TokenList &tokenList, Scope::ScopeType scopeType, const std::vector< AstNodePtr > &children2, const Token *def)
 
TokencreateTokensCall (TokenList &tokenList)
 
void createTokensFunctionDecl (TokenList &tokenList)
 
void createTokensForCXXRecord (TokenList &tokenList)
 
TokencreateTokensVarDecl (TokenList &tokenList)
 
std::string getSpelling () const
 
std::string getType (int index=0) const
 
std::string getFullType (int index=0) const
 
bool isDefinition () const
 
std::string getTemplateParameters () const
 
const ScopegetNestedInScope (TokenList &tokenList)
 
void setValueType (Token *tok)
 

Private Attributes

int mFile = 0
 
int mLine = 1
 
int mCol = 1
 
std::vector< std::string > mExtTokens
 
DatamData
 

Detailed Description

Definition at line 321 of file clangimport.cpp.

Constructor & Destructor Documentation

◆ AstNode()

clangimport::AstNode::AstNode ( std::string  nodeType,
const std::string &  ext,
Data data 
)
inline

Definition at line 323 of file clangimport.cpp.

Member Function Documentation

◆ addFullScopeNameTokens()

void clangimport::AstNode::addFullScopeNameTokens ( TokenList tokenList,
const Scope recordScope 
)
private

◆ addtoken()

Token * clangimport::AstNode::addtoken ( TokenList tokenList,
const std::string &  str,
bool  valueType = true 
)
private

Definition at line 534 of file clangimport.cpp.

References TokenList::addtoken(), TokenList::back(), and Token::scope().

Referenced by createTokens1().

◆ addTypeTokens()

const ::Type * clangimport::AstNode::addTypeTokens ( TokenList tokenList,
const std::string &  str,
const Scope scope = nullptr 
)
private

◆ createScope() [1/2]

Scope * clangimport::AstNode::createScope ( TokenList tokenList,
Scope::ScopeType  scopeType,
AstNodePtr  astNode,
const Token def 
)
private

Definition at line 647 of file clangimport.cpp.

◆ createScope() [2/2]

Scope * clangimport::AstNode::createScope ( TokenList tokenList,
Scope::ScopeType  scopeType,
const std::vector< AstNodePtr > &  children2,
const Token def 
)
private

◆ createTokens()

Token * clangimport::AstNode::createTokens ( TokenList tokenList)
private

Definition at line 719 of file clangimport.cpp.

References ArraySubscriptExpr, Token::astOperand1(), Token::astOperand2(), TokenList::back(), BinaryOperator, Scope::bodyEnd, BreakStmt, CallExpr, CaseStmt, CharacterLiteral, Scope::className, ClassTemplateDecl, ClassTemplateSpecializationDecl, CompoundAssignOperator, CompoundStmt, ConditionalOperator, ConstantExpr, contains(), ContinueStmt, CStyleCastExpr, CXXBindTemporaryExpr, CXXBoolLiteralExpr, CXXConstructExpr, CXXConstructorDecl, CXXDeleteExpr, CXXDestructorDecl, CXXForRangeStmt, CXXFunctionalCastExpr, CXXMemberCallExpr, CXXMethodDecl, CXXNewExpr, CXXNullPtrLiteralExpr, CXXOperatorCallExpr, CXXRecordDecl, CXXStaticCastExpr, CXXStdInitializerListExpr, CXXTemporaryObjectExpr, CXXThisExpr, CXXThrowExpr, DeclRefExpr, DeclStmt, DefaultStmt, Scope::definedType, DoStmt, EnumConstantDecl, EnumDecl, Scope::enumeratorList, ExprWithCleanups, FieldDecl, FloatingLiteral, ForStmt, FunctionDecl, FunctionTemplateDecl, GotoStmt, IfStmt, ImplicitCastExpr, InitListExpr, IntegerLiteral, LabelStmt, Token::link(), LinkageSpecDecl, Token::Match(), MaterializeTemporaryExpr, MemberExpr, Enumerator::name, NamespaceDecl, Token::next(), NullStmt, Token::originalName(), ParenExpr, Token::previous(), RecordDecl, ReturnStmt, Token::scope(), Token::setValueType(), Token::simpleMatch(), startsWith(), Token::str(), StringLiteral, SwitchStmt, MathLib::toBigNumber(), TypedefDecl, UnaryExprOrTypeTraitExpr, UnaryOperator, unquote(), Enumerator::value, Enumerator::value_known, Token::valueType(), VarDecl, and WhileStmt.

Referenced by createTokens1().

◆ createTokens1()

void clangimport::AstNode::createTokens1 ( TokenList tokenList)
inline

◆ createTokensCall()

Token * clangimport::AstNode::createTokensCall ( TokenList tokenList)
private

◆ createTokensForCXXRecord()

void clangimport::AstNode::createTokensForCXXRecord ( TokenList tokenList)
private

◆ createTokensFunctionDecl()

void clangimport::AstNode::createTokensFunctionDecl ( TokenList tokenList)
private

◆ createTokensVarDecl()

Token * clangimport::AstNode::createTokensVarDecl ( TokenList tokenList)
private

◆ dumpAst()

void clangimport::AstNode::dumpAst ( int  num = 0,
int  indent = 0 
) const

Definition at line 489 of file clangimport.cpp.

References indent().

◆ getChild()

AstNodePtr clangimport::AstNode::getChild ( int  c)
inline

Definition at line 348 of file clangimport.cpp.

References children, mExtTokens, and nodeType.

◆ getFullType()

std::string clangimport::AstNode::getFullType ( int  index = 0) const
private

Definition at line 450 of file clangimport.cpp.

◆ getNestedInScope()

const Scope * clangimport::AstNode::getNestedInScope ( TokenList tokenList)
private

Definition at line 615 of file clangimport.cpp.

References TokenList::back(), Token::scope(), and Token::str().

◆ getSpelling()

std::string clangimport::AstNode::getSpelling ( ) const
private

◆ getTemplateParameters()

std::string clangimport::AstNode::getTemplateParameters ( ) const
private

Definition at line 472 of file clangimport.cpp.

References TemplateArgument, and unquote().

◆ getType()

std::string clangimport::AstNode::getType ( int  index = 0) const
private

Definition at line 429 of file clangimport.cpp.

References unquote().

◆ isDefinition()

bool clangimport::AstNode::isDefinition ( ) const
private

Definition at line 467 of file clangimport.cpp.

References contains().

◆ setLocations()

void clangimport::AstNode::setLocations ( TokenList tokenList,
int  file,
int  line,
int  col 
)

Definition at line 504 of file clangimport.cpp.

References TokenList::appendFileIfNew(), and startsWith().

Referenced by createTokens1().

◆ setValueType()

void clangimport::AstNode::setValueType ( Token tok)
private

Member Data Documentation

◆ children

std::vector<AstNodePtr> clangimport::AstNode::children

Definition at line 327 of file clangimport.cpp.

Referenced by getChild().

◆ mCol

int clangimport::AstNode::mCol = 1
private

Definition at line 379 of file clangimport.cpp.

◆ mData

Data* clangimport::AstNode::mData
private

Definition at line 381 of file clangimport.cpp.

Referenced by createTokens1().

◆ mExtTokens

std::vector<std::string> clangimport::AstNode::mExtTokens
private

Definition at line 380 of file clangimport.cpp.

Referenced by getChild(), and getSpelling().

◆ mFile

int clangimport::AstNode::mFile = 0
private

Definition at line 377 of file clangimport.cpp.

◆ mLine

int clangimport::AstNode::mLine = 1
private

Definition at line 378 of file clangimport.cpp.

◆ nodeType

std::string clangimport::AstNode::nodeType

Definition at line 326 of file clangimport.cpp.

Referenced by createTokens1(), getChild(), and getSpelling().


The documentation for this class was generated from the following file: