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