|
CppParser
|
An expression in a C/C++ program. More...
#include <cppast.h>


Public Types | |
| enum | Flag { kReturn = 0x01 , kNew = 0x02 , kDelete = 0x08 , kDeleteArray = 0x10 , kBracketed = 0x20 , kInitializer = 0x40 , kThrow = 0x80 , kSizeOf = 0x100 , kVariadicPack = 0x200 , kGoto = 0x400 } |
Public Member Functions | |
| CppExpr (CppExprAtom e1, CppOperator op, CppExprAtom e2=CppExprAtom()) | |
| CppExpr (CppExprAtom e1, short flags) | |
| CppExpr (CppExprAtom e1, CppOperator op, CppExprAtom e2, short flags) | |
| CppExpr (CppExprAtom e1, CppExprAtom e2, CppExprAtom e3) | |
| CppExpr (std::string name) | |
| CppExpr (CppLambda *l) | |
| ~CppExpr () override | |
| void | accept (CppVisitorBase *v) override |
Public Member Functions inherited from CppObj | |
| CppObj (CppObjType type, CppAccessType accessType) | |
| CppCompound * | owner () |
| void | owner (CppCompound *o) |
| virtual void | accept (CppVisitorBase *v)=0 |
| virtual | ~CppObj () |
Public Attributes | |
| CppExprAtom | expr1_ {(CppExpr*) (nullptr)} |
| CppExprAtom | expr2_ {(CppExpr*) (nullptr)} |
| CppExprAtom | expr3_ {(CppExpr*) (nullptr)} |
| CppOperator | oper_ |
| short | flags_ |
Public Attributes inherited from CppObj | |
| CppObjType | objType_ |
| CppAccessType | accessType_ |
| All objects do not need this. More... | |
Static Public Attributes | |
| static constexpr CppObjType | kObjectType = CppObjType::kExpression |
An expression in a C/C++ program.
In C/C++ an expression is a complicated beast that needs to be tamed to parse it correctly. An expression can be as simple as a word, e.g. x, 5 are valid expressions. It can be a function call. It can be an initialization list for an array or struct. e.g. POINT pt = {100, 500}; It can be a list of expressions used to call a function e.g. gcd(36, 42); new/delete statements are also expressions. It can be any of the arithmetic expression, e.g. a+b. To make things simple we treat a return statement as an expression.
structs CppExprAtom, and CppExpr are required to tame this difficult beast called expression in C/C++.
| enum CppExpr::Flag |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverride |
|
inlineoverridevirtual |
| CppExprAtom CppExpr::expr1_ {(CppExpr*) (nullptr)} |
| CppExprAtom CppExpr::expr2_ {(CppExpr*) (nullptr)} |
| CppExprAtom CppExpr::expr3_ {(CppExpr*) (nullptr)} |
|
staticconstexpr |
| CppOperator CppExpr::oper_ |