2023-08-28 20:46:50 -07:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
2023-08-21 22:51:59 -07:00
|
|
|
#pragma once
|
2023-09-25 13:42:29 -07:00
|
|
|
#include "components/types.hpp"
|
2023-08-28 20:46:50 -07:00
|
|
|
#endif
|
|
|
|
|
2023-08-22 21:05:58 -07:00
|
|
|
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
2023-08-21 20:28:39 -07:00
|
|
|
|
|
|
|
#pragma region generated code inline implementation
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* Code::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code Code::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool Code::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool Code::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void Code::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code& Code::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool Code::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool Code::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeBody::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeBody::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeBody::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeBody::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeBody::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeBody& CodeBody::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeBody::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeBody::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeBody::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeAttributes::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeAttributes::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeAttributes::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeAttributes::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeAttributes::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeAttributes& CodeAttributes::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeAttributes::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeAttributes::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeAttributes::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeAttributes::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeAttributes::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Attributes* CodeAttributes::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeComment::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeComment::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeComment::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeComment::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeComment::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeComment& CodeComment::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeComment::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeComment::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeComment::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeComment::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeComment::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Comment* CodeComment::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeConstructor::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeConstructor::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeConstructor::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeConstructor::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeConstructor::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeConstructor& CodeConstructor::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeConstructor::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeConstructor::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeConstructor::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeConstructor::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeConstructor::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Constructor* CodeConstructor::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeClass::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeClass::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeClass::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeClass::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeClass::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeClass& CodeClass::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeClass::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeClass::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeClass::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeDefine::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeDefine::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDefine::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDefine::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeDefine::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeDefine& CodeDefine::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDefine::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDefine::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeDefine::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeDefine::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeDefine::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Define* CodeDefine::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeDestructor::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeDestructor::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDestructor::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDestructor::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeDestructor::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeDestructor& CodeDestructor::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDestructor::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeDestructor::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeDestructor::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeDestructor::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeDestructor::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Destructor* CodeDestructor::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeEnum::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeEnum::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeEnum::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeEnum::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeEnum::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeEnum& CodeEnum::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeEnum::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeEnum::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeEnum::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeEnum::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeEnum::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Enum* CodeEnum::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeExec::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeExec::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExec::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExec::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeExec::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeExec& CodeExec::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExec::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExec::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeExec::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeExec::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeExec::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Exec* CodeExec::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeExtern::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeExtern::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExtern::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExtern::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeExtern::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeExtern& CodeExtern::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExtern::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeExtern::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeExtern::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeExtern::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeExtern::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Extern* CodeExtern::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeFriend::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeFriend::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFriend::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFriend::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeFriend::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeFriend& CodeFriend::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFriend::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFriend::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeFriend::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeFriend::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeFriend::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Friend* CodeFriend::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeFn::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeFn::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFn::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFn::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeFn::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeFn& CodeFn::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFn::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeFn::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeFn::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeFn::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeFn::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Fn* CodeFn::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeInclude::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeInclude::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeInclude::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeInclude::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeInclude::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeInclude& CodeInclude::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeInclude::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeInclude::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeInclude::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeInclude::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeInclude::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Include* CodeInclude::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeModule::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeModule::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeModule::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeModule::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeModule::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeModule& CodeModule::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeModule::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeModule::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeModule::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeModule::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeModule::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Module* CodeModule::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeNS::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeNS::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeNS::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeNS::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeNS::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeNS& CodeNS::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeNS::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeNS::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeNS::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeNS::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeNS::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_NS* CodeNS::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeOperator::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeOperator::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOperator::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOperator::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeOperator::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeOperator& CodeOperator::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOperator::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOperator::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeOperator::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeOperator::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeOperator::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Operator* CodeOperator::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeOpCast::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeOpCast::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOpCast::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOpCast::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeOpCast::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeOpCast& CodeOpCast::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOpCast::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeOpCast::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeOpCast::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeOpCast::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeOpCast::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_OpCast* CodeOpCast::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeParam::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeParam::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeParam::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeParam::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeParam::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeParam& CodeParam::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeParam::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeParam::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeParam::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodePragma::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodePragma::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePragma::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePragma::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodePragma::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodePragma& CodePragma::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePragma::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePragma::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodePragma::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodePragma::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodePragma::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Pragma* CodePragma::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodePreprocessCond::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodePreprocessCond::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePreprocessCond::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePreprocessCond::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodePreprocessCond::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodePreprocessCond& CodePreprocessCond::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePreprocessCond::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodePreprocessCond::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodePreprocessCond::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodePreprocessCond::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodePreprocessCond::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_PreprocessCond* CodePreprocessCond::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeSpecifiers::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeSpecifiers::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeSpecifiers::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeSpecifiers::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeSpecifiers::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeSpecifiers& CodeSpecifiers::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeSpecifiers::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeSpecifiers::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeSpecifiers::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeStruct::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeStruct::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeStruct::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeStruct::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeStruct::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeStruct& CodeStruct::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeStruct::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeStruct::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeStruct::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeTemplate::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeTemplate::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTemplate::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTemplate::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeTemplate::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeTemplate& CodeTemplate::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTemplate::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTemplate::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeTemplate::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeTemplate::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeTemplate::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Template* CodeTemplate::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeType::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeType::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeType::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeType::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeType::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeType& CodeType::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeType::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeType::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeType::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeType::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeType::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Type* CodeType::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeTypedef::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeTypedef::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTypedef::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTypedef::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeTypedef::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeTypedef& CodeTypedef::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTypedef::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeTypedef::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeTypedef::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeTypedef::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeTypedef::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Typedef* CodeTypedef::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeUnion::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeUnion::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUnion::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUnion::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeUnion::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeUnion& CodeUnion::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUnion::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUnion::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeUnion::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeUnion::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeUnion::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Union* CodeUnion::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeUsing::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeUsing::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUsing::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUsing::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeUsing::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeUsing& CodeUsing::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUsing::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeUsing::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeUsing::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeUsing::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeUsing::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Using* CodeUsing::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline char const* CodeVar::debug_str()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
return "Code::debug_str: AST is null!";
|
|
|
|
return rcast( AST*, ast )->debug_str();
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline Code CodeVar::duplicate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::duplicate: Cannot duplicate code, AST is null!" );
|
|
|
|
return Code::Invalid;
|
|
|
|
}
|
|
|
|
return { rcast( AST*, ast )->duplicate() };
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeVar::is_equal( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr || other.ast == nullptr )
|
|
|
|
{
|
2024-10-24 23:59:56 -07:00
|
|
|
log_failure( "Code::is_equal: Cannot compare code, AST is null!" );
|
|
|
|
return false;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
return rcast( AST*, ast )->is_equal( other.ast );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeVar::is_valid()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != nullptr && rcast( AST*, ast )->Type != CodeT::Invalid;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline void CodeVar::set_global()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Code::set_global: Cannot set code as global, AST is null!" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rcast( AST*, ast )->Parent = Code::Global.ast;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline CodeVar& CodeVar::operator=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( other.ast && other->Parent )
|
|
|
|
{
|
|
|
|
ast = rcast( decltype( ast ), other.ast->duplicate() );
|
|
|
|
rcast( AST*, ast )->Parent = nullptr;
|
|
|
|
}
|
|
|
|
ast = rcast( decltype( ast ), other.ast );
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeVar::operator==( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast == other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline bool CodeVar::operator!=( Code other )
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return (AST*)ast != other.ast;
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeVar::operator bool()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return ast != nullptr;
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST* CodeVar::raw()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return rcast( AST*, ast );
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline CodeVar::operator Code()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return *rcast( Code*, this );
|
|
|
|
}
|
|
|
|
|
2024-10-24 23:59:56 -07:00
|
|
|
inline AST_Var* CodeVar::operator->()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
if ( ast == nullptr )
|
|
|
|
{
|
|
|
|
log_failure( "Attempt to dereference a nullptr!" );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return ast;
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma endregion generated code inline implementation
|
|
|
|
|
|
|
|
#pragma region generated AST/Code cast implementation
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeBody()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Body*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeBody() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Body*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeAttributes()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Attributes*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeAttributes() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Attributes*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeComment()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Comment*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeComment() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Comment*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeConstructor()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Constructor*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeConstructor() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Constructor*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeClass()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Class*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeClass() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Class*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeDefine()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Define*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeDefine() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Define*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeDestructor()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Destructor*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeDestructor() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Destructor*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeEnum()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Enum*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeEnum() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Enum*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeExec()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Exec*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeExec() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Exec*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeExtern()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Extern*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeExtern() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Extern*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeFriend()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Friend*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeFriend() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Friend*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeFn()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Fn*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeFn() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Fn*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeInclude()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Include*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeInclude() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Include*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeModule()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Module*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeModule() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Module*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeNS()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_NS*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeNS() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_NS*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeOperator()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Operator*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeOperator() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Operator*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeOpCast()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_OpCast*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeOpCast() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_OpCast*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeParam()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Param*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeParam() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Param*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodePragma()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Pragma*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodePragma() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Pragma*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodePreprocessCond()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_PreprocessCond*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodePreprocessCond() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_PreprocessCond*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeSpecifiers()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Specifiers*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeSpecifiers() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Specifiers*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeStruct()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Struct*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeStruct() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Struct*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeTemplate()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Template*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeTemplate() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Template*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeType()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Type*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeType() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Type*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeTypedef()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Typedef*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeTypedef() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Typedef*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeUnion()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Union*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeUnion() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Union*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeUsing()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Using*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeUsing() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Using*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline AST::operator CodeVar()
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
|
|
|
return { rcast( AST_Var*, this ) };
|
|
|
|
}
|
|
|
|
|
2024-10-25 01:08:20 -07:00
|
|
|
inline Code::operator CodeVar() const
|
2023-08-21 20:28:39 -07:00
|
|
|
{
|
2024-04-17 14:40:32 -07:00
|
|
|
return { (AST_Var*)ast };
|
2023-08-21 20:28:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma endregion generated AST / Code cast implementation
|