CppParser
Loading...
Searching...
No Matches
cppast.h File Reference
#include "cppconst.h"
#include "cppeasyptr.h"
#include "cppvisitorbase.h"
#include "typemodifier.h"
#include "string-utils.h"
#include <cassert>
#include <cstdint>
#include <iostream>
#include <list>
#include <memory>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for cppast.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CppObj
 An abstract class that is used as base class of all other classes. More...
 
struct  CppBlob
 A stream of text that represents some content in a C++ program. More...
 
struct  CppDefine
 
struct  CppUndef
 
struct  CppInclude
 
struct  CppImport
 
struct  CppHashIf
 Represents all variants of #if preprocessors. More...
 
struct  CppPragma
 
struct  CppHashError
 
struct  CppHashWarning
 
struct  CppUnRecogPrePro
 Any other C/C++ preprocessor for which there is no class defined. More...
 
struct  AttribSpecified
 A mixin class to allow objects to have attribute specifier sequence as described at https://en.cppreference.com/w/cpp/language/attributes. More...
 
struct  CppVarType
 
struct  CppVarDecl
 
struct  CppVar
 Class to represent C++ variable definition. More...
 
struct  CppVarDeclInList
 
struct  CppVarList
 List of variables declared in a line without repeating its type, e.g. More...
 
struct  CppTypedefName
 
struct  CppTypedefList
 
struct  CppMacroCall
 
struct  CppInheritInfo
 
struct  CppTemplateParam
 Parameter types that are used to define a template class or function. More...
 
struct  CppFwdClsDecl
 
struct  CppCompound
 All classes, structs, unions, and namespaces can be classified as a Compound object. More...
 
struct  CppFuncLikeBase
 
struct  CppFunctionBase
 Base class of constructor, destructor, and functions. More...
 
struct  CppFuncCtorBase
 
struct  CppFunction
 
struct  CppLambda
 
struct  CppFunctionPointer
 Function pointer type definition using typedef, e.g. More...
 
struct  CppMemInits
 Entire member initialization list. More...
 
struct  CppConstructor
 
struct  CppDestructor
 
struct  CppTypeConverter
 
struct  CppUsingNamespaceDecl
 
struct  CppUsingDecl
 
struct  CppNamespaceAlias
 
struct  CppDocComment
 
struct  CppExprAtom
 An individual expression. More...
 
struct  CppExpr
 An expression in a C/C++ program. More...
 
struct  CppEnumItem
 
struct  CppEnum
 
struct  CppCommonBlock< _ObjType >
 Some blocks have common structure like if, while, and do-while. More...
 
struct  CppIfBlock
 
struct  CppForBlock
 
struct  CppRangeForBlock
 
struct  CppCase
 
struct  CppSwitchBlock
 
struct  CppCatchBlock
 
struct  CppTryBlock
 
struct  CppAsmBlock
 
struct  CppLabel
 

Macros

#define VISIT_COND(CALL)
 

Typedefs

using CppDefineEPtr = CppEasyPtr< CppDefine >
 
using CppUndefEPtr = CppEasyPtr< CppUndef >
 
using CppIncludeEPtr = CppEasyPtr< CppInclude >
 
using CppHashIfEPtr = CppEasyPtr< CppHashIf >
 
using CppPragmaEPtr = CppEasyPtr< CppPragma >
 
using CppHashErrorEPtr = CppEasyPtr< CppHashError >
 
using CppHashWarningEPtr = CppEasyPtr< CppHashWarning >
 
using CppExprPtr = std::unique_ptr< CppExpr >
 
using AttribSpecifier = CppExprPtr
 
using AttribSpecifierArray = std::vector< AttribSpecifier >
 
using AttribSpecifierSequence = std::unique_ptr< AttribSpecifierArray >
 
using CppUnRecogPreProEPtr = CppEasyPtr< CppUnRecogPrePro >
 
using CppCompoundPtr = std::unique_ptr< CppCompound >
 
using CppObjPtr = std::unique_ptr< CppObj >
 
using CppVarTypeEPtr = CppEasyPtr< CppVarType >
 
using CppArraySizes = std::vector< CppExprPtr >
 
using CppVarTypePtr = std::unique_ptr< CppVarType >
 
using CppTemplateParamList = std::vector< std::unique_ptr< CppTemplateParam > >
 
using CppTemplateParamListPtr = std::unique_ptr< CppTemplateParamList >
 
using CppVarPtr = std::unique_ptr< CppVar >
 
using CppVarEPtr = CppEasyPtr< CppVar >
 
using CppVarDeclList = std::vector< CppVarDeclInList >
 
using CppTypedefNameEPtr = CppEasyPtr< CppTypedefName >
 
using CppVarListPtr = std::unique_ptr< CppVarList >
 
using CppVarListEPtr = CppEasyPtr< CppVarList >
 
using CppTypedefListEPtr = CppEasyPtr< CppTypedefList >
 
using CppMacroCallEPtr = CppEasyPtr< CppMacroCall >
 
using CppFwdClsDeclEPtr = CppEasyPtr< CppFwdClsDecl >
 
using CppInheritanceList = std::list< CppInheritInfo >
 
using CppInheritanceListPtr = std::unique_ptr< CppInheritanceList >
 
using CppObjPtrArray = std::vector< std::unique_ptr< CppObj > >
 
using CppCompoundEPtr = CppEasyPtr< CppCompound >
 
using CppIdentifierList = std::vector< std::string >
 
using CppFuncThrowSpec = CppIdentifierList
 
using CppFuncThrowSpecPtr = std::unique_ptr< CppFuncThrowSpec >
 
using CppParamVector = std::vector< CppObjPtr >
 
using CppParamVectorPtr = std::unique_ptr< CppParamVector >
 
using CppFunctionEPtr = CppEasyPtr< CppFunction >
 
using CppFunctionPointerEPtr = CppEasyPtr< CppFunctionPointer >
 
using CppMemInit = std::pair< std::string, CppExpr * >
 Class data member initialization as part of class constructor. More...
 
using CppConstructorEPtr = CppEasyPtr< CppConstructor >
 
using CppDestructorEPtr = CppEasyPtr< CppDestructor >
 
using CppTypeConverterEPtr = CppEasyPtr< CppTypeConverter >
 
using CppUsingNamespaceDeclEPtr = CppEasyPtr< CppUsingNamespaceDecl >
 
using CppUsingDeclEPtr = CppEasyPtr< CppUsingDecl >
 
using CppNamespaceAliasEPtr = CppEasyPtr< CppNamespaceAlias >
 
using CppDocCommentEPtr = CppEasyPtr< CppDocComment >
 
using CppExprEPtr = CppEasyPtr< CppExpr >
 
using CppEnumItemList = std::list< CppEnumItem * >
 
using CppEnumItemListPtr = std::unique_ptr< CppEnumItemList >
 
using CppEnumEPtr = CppEasyPtr< CppEnum >
 
using CppIfBlockEPtr = CppEasyPtr< CppIfBlock >
 
using CppWhileBlock = CppCommonBlock< CppObjType::kWhileBlock >
 
using CppDoWhileBlock = CppCommonBlock< CppObjType::kDoWhileBlock >
 
using CppWhileBlockEPtr = CppEasyPtr< CppWhileBlock >
 
using CppDoWhileBlockEPtr = CppEasyPtr< CppDoWhileBlock >
 
using CppForBlockEPtr = CppEasyPtr< CppForBlock >
 
using CppSwitchBody = std::vector< CppCase >
 
using CppSwitchBodyPtr = std::unique_ptr< CppSwitchBody >
 
using CppSwitchBlockEPtr = CppEasyPtr< CppSwitchBlock >
 
using CppCatchBlockPtr = std::unique_ptr< CppCatchBlock >
 
using CppCatchBlocks = std::vector< CppCatchBlockPtr >
 
using CppLabelEPtr = CppEasyPtr< CppLabel >
 

Functions

CppMemInits makeEmptyCppMemInitList ()
 
CppMemInits makeCppMemInitList (std::list< CppMemInit > *memInitList)
 
CppMemInits makeCppMemInitList (CppBlob *blob)
 
bool operator== (const CppExpr &expr1, const CppExpr &expr2)
 
bool operator!= (const CppExpr &expr1, const CppExpr &expr2)
 
bool operator== (const CppExprAtom &exprAtom1, const CppExprAtom &exprAtom2)
 
bool operator!= (const CppExprAtom &exprAtom1, const CppExprAtom &exprAtom2)
 

Macro Definition Documentation

◆ VISIT_COND

#define VISIT_COND (   CALL)
Value:
if (!CALL) \
return;

Definition at line 124 of file cppast.h.

Typedef Documentation

◆ AttribSpecifier

Definition at line 392 of file cppast.h.

◆ AttribSpecifierArray

using AttribSpecifierArray = std::vector<AttribSpecifier>

Definition at line 393 of file cppast.h.

◆ AttribSpecifierSequence

Definition at line 394 of file cppast.h.

◆ CppArraySizes

using CppArraySizes = std::vector<CppExprPtr>

Definition at line 492 of file cppast.h.

◆ CppCatchBlockPtr

using CppCatchBlockPtr = std::unique_ptr<CppCatchBlock>

Definition at line 2100 of file cppast.h.

◆ CppCatchBlocks

using CppCatchBlocks = std::vector<CppCatchBlockPtr>

Definition at line 2102 of file cppast.h.

◆ CppCompoundEPtr

Definition at line 1151 of file cppast.h.

◆ CppCompoundPtr

typedef std::unique_ptr< CppCompound > CppCompoundPtr

Definition at line 416 of file cppast.h.

◆ CppConstructorEPtr

Definition at line 1506 of file cppast.h.

◆ CppDefineEPtr

Definition at line 210 of file cppast.h.

◆ CppDestructorEPtr

Definition at line 1523 of file cppast.h.

◆ CppDocCommentEPtr

Definition at line 1664 of file cppast.h.

◆ CppDoWhileBlock

◆ CppDoWhileBlockEPtr

Definition at line 1983 of file cppast.h.

◆ CppEnumEPtr

Definition at line 1917 of file cppast.h.

◆ CppEnumItemList

using CppEnumItemList = std::list<CppEnumItem*>

Definition at line 1883 of file cppast.h.

◆ CppEnumItemListPtr

using CppEnumItemListPtr = std::unique_ptr<CppEnumItemList>

Definition at line 1884 of file cppast.h.

◆ CppExprEPtr

Definition at line 1862 of file cppast.h.

◆ CppExprPtr

using CppExprPtr = std::unique_ptr<CppExpr>

Definition at line 391 of file cppast.h.

◆ CppForBlockEPtr

Definition at line 2045 of file cppast.h.

◆ CppFuncThrowSpec

Definition at line 1156 of file cppast.h.

◆ CppFuncThrowSpecPtr

using CppFuncThrowSpecPtr = std::unique_ptr<CppFuncThrowSpec>

Definition at line 1158 of file cppast.h.

◆ CppFunctionEPtr

Definition at line 1382 of file cppast.h.

◆ CppFunctionPointerEPtr

Definition at line 1420 of file cppast.h.

◆ CppFwdClsDeclEPtr

Definition at line 910 of file cppast.h.

◆ CppHashErrorEPtr

Definition at line 345 of file cppast.h.

◆ CppHashIfEPtr

Definition at line 305 of file cppast.h.

◆ CppHashWarningEPtr

Definition at line 365 of file cppast.h.

◆ CppIdentifierList

using CppIdentifierList = std::vector<std::string>

Definition at line 1155 of file cppast.h.

◆ CppIfBlockEPtr

Definition at line 1977 of file cppast.h.

◆ CppIncludeEPtr

Definition at line 268 of file cppast.h.

◆ CppInheritanceList

using CppInheritanceList = std::list<CppInheritInfo>

Definition at line 912 of file cppast.h.

◆ CppInheritanceListPtr

using CppInheritanceListPtr = std::unique_ptr<CppInheritanceList>

Definition at line 913 of file cppast.h.

◆ CppLabelEPtr

Definition at line 2203 of file cppast.h.

◆ CppMacroCallEPtr

Definition at line 800 of file cppast.h.

◆ CppMemInit

using CppMemInit = std::pair<std::string, CppExpr*>

Class data member initialization as part of class constructor.

Definition at line 1425 of file cppast.h.

◆ CppNamespaceAliasEPtr

Definition at line 1644 of file cppast.h.

◆ CppObjPtr

using CppObjPtr = std::unique_ptr<CppObj>

Definition at line 417 of file cppast.h.

◆ CppObjPtrArray

using CppObjPtrArray = std::vector<std::unique_ptr<CppObj> >

Definition at line 914 of file cppast.h.

◆ CppParamVector

using CppParamVector = std::vector<CppObjPtr>

Definition at line 1253 of file cppast.h.

◆ CppParamVectorPtr

using CppParamVectorPtr = std::unique_ptr<CppParamVector>

Definition at line 1254 of file cppast.h.

◆ CppPragmaEPtr

Definition at line 325 of file cppast.h.

◆ CppSwitchBlockEPtr

Definition at line 2091 of file cppast.h.

◆ CppSwitchBody

using CppSwitchBody = std::vector<CppCase>

Definition at line 2059 of file cppast.h.

◆ CppSwitchBodyPtr

using CppSwitchBodyPtr = std::unique_ptr<CppSwitchBody>

Definition at line 2060 of file cppast.h.

◆ CppTemplateParamList

using CppTemplateParamList = std::vector<std::unique_ptr<CppTemplateParam> >

Definition at line 556 of file cppast.h.

◆ CppTemplateParamListPtr

Definition at line 557 of file cppast.h.

◆ CppTypeConverterEPtr

Definition at line 1545 of file cppast.h.

◆ CppTypedefListEPtr

Definition at line 780 of file cppast.h.

◆ CppTypedefNameEPtr

Definition at line 755 of file cppast.h.

◆ CppUndefEPtr

Definition at line 230 of file cppast.h.

◆ CppUnRecogPreProEPtr

Definition at line 415 of file cppast.h.

◆ CppUsingDeclEPtr

Definition at line 1622 of file cppast.h.

◆ CppUsingNamespaceDeclEPtr

◆ CppVarDeclList

using CppVarDeclList = std::vector<CppVarDeclInList>

Definition at line 693 of file cppast.h.

◆ CppVarEPtr

Definition at line 682 of file cppast.h.

◆ CppVarListEPtr

Definition at line 758 of file cppast.h.

◆ CppVarListPtr

using CppVarListPtr = std::unique_ptr<CppVarList>

Definition at line 757 of file cppast.h.

◆ CppVarPtr

using CppVarPtr = std::unique_ptr<CppVar>

Definition at line 681 of file cppast.h.

◆ CppVarTypeEPtr

Definition at line 491 of file cppast.h.

◆ CppVarTypePtr

typedef std::unique_ptr< CppVarType > CppVarTypePtr

Definition at line 553 of file cppast.h.

◆ CppWhileBlock

Definition at line 1979 of file cppast.h.

◆ CppWhileBlockEPtr

Definition at line 1982 of file cppast.h.

Function Documentation

◆ makeCppMemInitList() [1/2]

CppMemInits makeCppMemInitList ( CppBlob blob)
inline

Definition at line 1453 of file cppast.h.

Here is the call graph for this function:

◆ makeCppMemInitList() [2/2]

CppMemInits makeCppMemInitList ( std::list< CppMemInit > *  memInitList)
inline

Definition at line 1445 of file cppast.h.

Here is the call graph for this function:

◆ makeEmptyCppMemInitList()

CppMemInits makeEmptyCppMemInitList ( )
inline

Definition at line 1440 of file cppast.h.

Here is the caller graph for this function:

◆ operator!=() [1/2]

bool operator!= ( const CppExpr expr1,
const CppExpr expr2 
)
inline

Definition at line 2260 of file cppast.h.

◆ operator!=() [2/2]

bool operator!= ( const CppExprAtom exprAtom1,
const CppExprAtom exprAtom2 
)
inline

Definition at line 2280 of file cppast.h.

◆ operator==() [1/2]

bool operator== ( const CppExpr expr1,
const CppExpr expr2 
)

Definition at line 194 of file cppast.cpp.

◆ operator==() [2/2]

bool operator== ( const CppExprAtom exprAtom1,
const CppExprAtom exprAtom2 
)
inline

Definition at line 2265 of file cppast.h.