mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-22 15:54:45 -08:00
reduction on debug_str
This commit is contained in:
parent
937235b776
commit
37c33ffb3e
@ -168,7 +168,7 @@ struct Code
|
|||||||
{
|
{
|
||||||
|
|
||||||
# define Using_Code( Typename ) \
|
# define Using_Code( Typename ) \
|
||||||
char const* debug_str(); \
|
char const* debug_str() { return GEN_NS debug_str(*this); } \
|
||||||
Code duplicate(); \
|
Code duplicate(); \
|
||||||
bool is_equal( Code other ); \
|
bool is_equal( Code other ); \
|
||||||
bool is_body(); \
|
bool is_body(); \
|
||||||
|
@ -7,13 +7,6 @@
|
|||||||
|
|
||||||
#pragma region generated code inline implementation
|
#pragma region generated code inline implementation
|
||||||
|
|
||||||
inline char const* Code::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code Code::duplicate()
|
inline Code Code::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -73,13 +66,6 @@ inline Code::operator bool()
|
|||||||
return ast != nullptr;
|
return ast != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeBody::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeBody::duplicate()
|
inline Code CodeBody::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -139,13 +125,6 @@ inline CodeBody::operator bool()
|
|||||||
return ast != nullptr;
|
return ast != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeAttributes::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeAttributes::duplicate()
|
inline Code CodeAttributes::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -225,13 +204,6 @@ inline AST_Attributes* CodeAttributes::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeComment::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeComment::duplicate()
|
inline Code CodeComment::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -311,13 +283,6 @@ inline AST_Comment* CodeComment::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeConstructor::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeConstructor::duplicate()
|
inline Code CodeConstructor::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -397,13 +362,6 @@ inline AST_Constructor* CodeConstructor::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeClass::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeClass::duplicate()
|
inline Code CodeClass::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -463,13 +421,6 @@ inline CodeClass::operator bool()
|
|||||||
return ast != nullptr;
|
return ast != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeDefine::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeDefine::duplicate()
|
inline Code CodeDefine::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -549,13 +500,6 @@ inline AST_Define* CodeDefine::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeDestructor::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeDestructor::duplicate()
|
inline Code CodeDestructor::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -635,13 +579,6 @@ inline AST_Destructor* CodeDestructor::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeEnum::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeEnum::duplicate()
|
inline Code CodeEnum::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -721,13 +658,6 @@ inline AST_Enum* CodeEnum::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeExec::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeExec::duplicate()
|
inline Code CodeExec::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -807,13 +737,6 @@ inline AST_Exec* CodeExec::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeExtern::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeExtern::duplicate()
|
inline Code CodeExtern::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -893,13 +816,6 @@ inline AST_Extern* CodeExtern::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeFriend::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeFriend::duplicate()
|
inline Code CodeFriend::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -979,13 +895,6 @@ inline AST_Friend* CodeFriend::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeFn::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeFn::duplicate()
|
inline Code CodeFn::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1065,13 +974,6 @@ inline AST_Fn* CodeFn::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeInclude::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeInclude::duplicate()
|
inline Code CodeInclude::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1151,13 +1053,6 @@ inline AST_Include* CodeInclude::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeModule::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeModule::duplicate()
|
inline Code CodeModule::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1237,13 +1132,6 @@ inline AST_Module* CodeModule::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeNS::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeNS::duplicate()
|
inline Code CodeNS::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1323,13 +1211,6 @@ inline AST_NS* CodeNS::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeOperator::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeOperator::duplicate()
|
inline Code CodeOperator::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1409,13 +1290,6 @@ inline AST_Operator* CodeOperator::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeOpCast::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeOpCast::duplicate()
|
inline Code CodeOpCast::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1495,13 +1369,6 @@ inline AST_OpCast* CodeOpCast::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeParam::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeParam::duplicate()
|
inline Code CodeParam::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1561,13 +1428,6 @@ inline CodeParam::operator bool()
|
|||||||
return ast != nullptr;
|
return ast != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodePragma::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodePragma::duplicate()
|
inline Code CodePragma::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1647,13 +1507,6 @@ inline AST_Pragma* CodePragma::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodePreprocessCond::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodePreprocessCond::duplicate()
|
inline Code CodePreprocessCond::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1733,13 +1586,6 @@ inline AST_PreprocessCond* CodePreprocessCond::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeSpecifiers::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeSpecifiers::duplicate()
|
inline Code CodeSpecifiers::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1799,13 +1645,6 @@ inline CodeSpecifiers::operator bool()
|
|||||||
return ast != nullptr;
|
return ast != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeStruct::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeStruct::duplicate()
|
inline Code CodeStruct::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1865,13 +1704,6 @@ inline CodeStruct::operator bool()
|
|||||||
return ast != nullptr;
|
return ast != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeTemplate::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeTemplate::duplicate()
|
inline Code CodeTemplate::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -1951,13 +1783,6 @@ inline AST_Template* CodeTemplate::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeType::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeType::duplicate()
|
inline Code CodeType::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -2037,13 +1862,6 @@ inline AST_Type* CodeType::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeTypedef::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeTypedef::duplicate()
|
inline Code CodeTypedef::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -2123,13 +1941,6 @@ inline AST_Typedef* CodeTypedef::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeUnion::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeUnion::duplicate()
|
inline Code CodeUnion::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -2209,13 +2020,6 @@ inline AST_Union* CodeUnion::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeUsing::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeUsing::duplicate()
|
inline Code CodeUsing::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
@ -2295,13 +2099,6 @@ inline AST_Using* CodeUsing::operator->()
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* CodeVar::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
return GEN_NS debug_str( rcast( AST*, ast ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Code CodeVar::duplicate()
|
inline Code CodeVar::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
|
@ -88,6 +88,17 @@ AST::operator Code()
|
|||||||
return { this };
|
return { this };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma region Code
|
||||||
|
|
||||||
|
inline
|
||||||
|
char const* debug_str( Code code )
|
||||||
|
{
|
||||||
|
if ( code.ast == nullptr )
|
||||||
|
return "Code::debug_str: AST is null!";
|
||||||
|
|
||||||
|
return debug_str( code.ast );
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
Code& Code::operator ++()
|
Code& Code::operator ++()
|
||||||
{
|
{
|
||||||
@ -97,6 +108,8 @@ Code& Code::operator ++()
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma endregion Code
|
||||||
|
|
||||||
inline
|
inline
|
||||||
void CodeClass::add_interface( CodeType type )
|
void CodeClass::add_interface( CodeType type )
|
||||||
{
|
{
|
||||||
|
@ -354,14 +354,6 @@ CodeBody gen_ast_inlines()
|
|||||||
char const* code_impl_tmpl = stringize(
|
char const* code_impl_tmpl = stringize(
|
||||||
\n
|
\n
|
||||||
inline
|
inline
|
||||||
char const* <typename>::debug_str()
|
|
||||||
{
|
|
||||||
if ( ast == nullptr )
|
|
||||||
return "Code::debug_str: AST is null!";
|
|
||||||
|
|
||||||
return GEN_NS debug_str( rcast(AST*, ast) );
|
|
||||||
}
|
|
||||||
inline
|
|
||||||
Code <typename>::duplicate()
|
Code <typename>::duplicate()
|
||||||
{
|
{
|
||||||
if ( ast == nullptr )
|
if ( ast == nullptr )
|
||||||
|
Loading…
Reference in New Issue
Block a user