2020-08-24 01:47:38 -07:00
|
|
|
#ifndef POLSERVER_FUNCTIONLINK_H
|
|
|
|
|
#define POLSERVER_FUNCTIONLINK_H
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/file/SourceLocation.h"
|
2020-08-24 01:47:38 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
class Function;
|
|
|
|
|
class ModuleFunctionDeclaration;
|
2020-08-31 18:46:27 -07:00
|
|
|
class UserFunction;
|
2020-08-24 01:47:38 -07:00
|
|
|
|
|
|
|
|
class FunctionLink
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FunctionLink( const SourceLocation& );
|
|
|
|
|
FunctionLink( const FunctionLink& ) = delete;
|
|
|
|
|
FunctionLink& operator=( const FunctionLink& ) = delete;
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] Function* function() const;
|
|
|
|
|
[[nodiscard]] ModuleFunctionDeclaration* module_function_declaration() const;
|
2020-08-31 18:46:27 -07:00
|
|
|
[[nodiscard]] UserFunction* user_function() const;
|
2020-08-24 01:47:38 -07:00
|
|
|
|
|
|
|
|
void link_to( Function* );
|
|
|
|
|
|
|
|
|
|
const SourceLocation source_location;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Function* linked_function;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
|
|
|
|
|
|
#endif // POLSERVER_FUNCTIONLINK_H
|