gencpp/base/components/gen/ast_inlines.hpp

987 lines
18 KiB
C++
Raw Normal View History

#ifdef GEN_INTELLISENSE_DIRECTIVES
#pragma once
#include "components/types.hpp"
#endif
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
#pragma region generated code inline implementation
2024-12-07 14:17:02 -08:00
inline Code& Code::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline Code::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeBody& CodeBody::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeBody::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeAttributes& CodeAttributes::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeAttributes::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeAttributes::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Attributes* CodeAttributes::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeComment& CodeComment::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeComment::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeComment::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Comment* CodeComment::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeConstructor& CodeConstructor::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeConstructor::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeConstructor::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Constructor* CodeConstructor::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeClass& CodeClass::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeClass::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeDefine& CodeDefine::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeDefine::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeDefine::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Define* CodeDefine::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
2024-12-14 18:21:13 -08:00
inline CodeDefineParams& CodeDefineParams::operator=( Code other )
{
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
inline CodeDefineParams::operator bool()
{
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeDestructor& CodeDestructor::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeDestructor::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeDestructor::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Destructor* CodeDestructor::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeEnum& CodeEnum::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeEnum::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeEnum::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Enum* CodeEnum::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeExec& CodeExec::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeExec::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeExec::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Exec* CodeExec::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeExtern& CodeExtern::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeExtern::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeExtern::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Extern* CodeExtern::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeFriend& CodeFriend::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeFriend::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeFriend::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Friend* CodeFriend::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeFn& CodeFn::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeFn::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeFn::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Fn* CodeFn::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeInclude& CodeInclude::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeInclude::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeInclude::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Include* CodeInclude::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeModule& CodeModule::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeModule::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeModule::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Module* CodeModule::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeNS& CodeNS::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeNS::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeNS::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_NS* CodeNS::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeOperator& CodeOperator::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeOperator::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeOperator::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Operator* CodeOperator::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeOpCast& CodeOpCast::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeOpCast::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeOpCast::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_OpCast* CodeOpCast::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeParams& CodeParams::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeParams::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodePragma& CodePragma::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodePragma::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodePragma::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Pragma* CodePragma::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodePreprocessCond& CodePreprocessCond::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodePreprocessCond::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodePreprocessCond::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_PreprocessCond* CodePreprocessCond::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeSpecifiers& CodeSpecifiers::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeSpecifiers::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeStruct& CodeStruct::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeStruct::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeTemplate& CodeTemplate::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeTemplate::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeTemplate::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Template* CodeTemplate::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeTypename& CodeTypename::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeTypename::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeTypename::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Typename* CodeTypename::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeTypedef& CodeTypedef::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeTypedef::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeTypedef::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Typedef* CodeTypedef::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeUnion& CodeUnion::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeUnion::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeUnion::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Union* CodeUnion::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeUsing& CodeUsing::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeUsing::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeUsing::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Using* CodeUsing::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
2024-12-07 14:17:02 -08:00
inline CodeVar& CodeVar::operator=( Code other )
{
2024-12-07 14:17:02 -08:00
if ( other.ast != nullptr && other->Parent != nullptr )
{
ast = rcast( decltype( ast ), code_duplicate( other ).ast );
ast->Parent = { nullptr };
}
ast = rcast( decltype( ast ), other.ast );
return *this;
}
2024-12-07 14:17:02 -08:00
inline CodeVar::operator bool()
{
2024-12-07 14:17:02 -08:00
return ast != nullptr;
}
2024-12-07 14:17:02 -08:00
inline CodeVar::operator Code()
{
2024-12-07 14:17:02 -08:00
return *rcast( Code*, this );
}
2024-12-07 14:17:02 -08:00
inline AST_Var* CodeVar::operator->()
{
2024-12-07 14:17:02 -08:00
if ( ast == nullptr )
{
log_failure( "Attempt to dereference a nullptr!\n" );
2024-12-07 14:17:02 -08:00
return nullptr;
}
return ast;
}
#pragma endregion generated code inline implementation
#pragma region generated AST/Code cast implementation
GEN_OPTIMIZE_MAPPINGS_BEGIN
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeBody() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Body*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeAttributes() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Attributes*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeComment() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Comment*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeConstructor() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Constructor*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeClass() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Class*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeDefine() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Define*)ast };
}
2024-12-07 14:17:02 -08:00
2024-12-14 18:21:13 -08:00
forceinline Code::operator CodeDefineParams() const
{
return { (AST_DefineParams*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeDestructor() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Destructor*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeEnum() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Enum*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeExec() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Exec*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeExtern() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Extern*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeFriend() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Friend*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeFn() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Fn*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeInclude() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Include*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeModule() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Module*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeNS() const
{
2024-12-07 14:17:02 -08:00
return { (AST_NS*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeOperator() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Operator*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeOpCast() const
{
2024-12-07 14:17:02 -08:00
return { (AST_OpCast*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeParams() const
{
return { (AST_Params*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodePragma() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Pragma*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodePreprocessCond() const
{
2024-12-07 14:17:02 -08:00
return { (AST_PreprocessCond*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeSpecifiers() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Specifiers*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeStruct() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Struct*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeTemplate() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Template*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeTypename() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Typename*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeTypedef() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Typedef*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeUnion() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Union*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeUsing() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Using*)ast };
}
2024-12-07 14:17:02 -08:00
forceinline Code::operator CodeVar() const
{
2024-12-07 14:17:02 -08:00
return { (AST_Var*)ast };
}
GEN_OPITMIZE_MAPPINGS_END
2024-12-07 14:17:02 -08:00
#pragma endregion generated AST / Code cast implementation