Cppcheck
Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
PathAnalysis Struct Reference

#include <pathanalysis.h>

Classes

struct  Info
 

Public Types

enum class  Progress { Continue , Break }
 

Public Member Functions

 PathAnalysis (const Token *start, const Library &library)
 
void forward (const std::function< Progress(const Info &)> &f) const
 
Info forwardFind (std::function< bool(const Info &)> pred) const
 

Public Attributes

const Tokenstart
 
const Librarylibrary
 

Private Member Functions

Progress forwardRange (const Token *startToken, const Token *endToken, Info info, const std::function< Progress(const Info &)> &f) const
 

Static Private Member Functions

static Progress forwardRecursive (const Token *tok, Info info, const std::function< PathAnalysis::Progress(const Info &)> &f)
 
static const ScopefindOuterScope (const Scope *scope)
 
static std::pair< bool, bool > checkCond (const Token *tok, bool &known)
 

Detailed Description

Definition at line 32 of file pathanalysis.h.

Member Enumeration Documentation

◆ Progress

Enumerator
Continue 
Break 

Definition at line 33 of file pathanalysis.h.

Constructor & Destructor Documentation

◆ PathAnalysis()

PathAnalysis::PathAnalysis ( const Token start,
const Library library 
)
inline

Definition at line 37 of file pathanalysis.h.

Member Function Documentation

◆ checkCond()

std::pair< bool, bool > PathAnalysis::checkCond ( const Token tok,
bool &  known 
)
staticprivate

Definition at line 49 of file pathanalysis.cpp.

References Token::hasKnownIntValue(), and Token::values().

Referenced by forwardRange().

◆ findOuterScope()

const Scope * PathAnalysis::findOuterScope ( const Scope scope)
staticprivate

Definition at line 30 of file pathanalysis.cpp.

References Scope::eSwitch, Scope::isLocal(), Scope::nestedIn, and Scope::type.

Referenced by forward().

◆ forward()

void PathAnalysis::forward ( const std::function< Progress(const Info &)> &  f) const

Definition at line 175 of file pathanalysis.cpp.

References Scope::bodyEnd, findOuterScope(), forwardRange(), Token::scope(), and start.

Referenced by forwardFind().

◆ forwardFind()

Info PathAnalysis::forwardFind ( std::function< bool(const Info &)>  pred) const
inline

Definition at line 51 of file pathanalysis.h.

References Break, Continue, and forward().

◆ forwardRange()

PathAnalysis::Progress PathAnalysis::forwardRange ( const Token startToken,
const Token endToken,
Info  info,
const std::function< Progress(const Info &)> &  f 
) const
private

◆ forwardRecursive()

PathAnalysis::Progress PathAnalysis::forwardRecursive ( const Token tok,
Info  info,
const std::function< PathAnalysis::Progress(const Info &)> &  f 
)
staticprivate

Definition at line 70 of file pathanalysis.cpp.

References Token::astOperand1(), Token::astOperand2(), Break, Continue, and PathAnalysis::Info::tok.

Referenced by forwardRange().

Member Data Documentation

◆ library

const Library* PathAnalysis::library

Definition at line 41 of file pathanalysis.h.

◆ start

const Token* PathAnalysis::start

Definition at line 40 of file pathanalysis.h.

Referenced by forward(), and forwardRange().


The documentation for this struct was generated from the following files: