2020-08-31 18:46:27 -07:00
|
|
|
#ifndef POLSERVER_USERFUNCTION_H
|
|
|
|
|
#define POLSERVER_USERFUNCTION_H
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/Function.h"
|
|
|
|
|
#include "bscript/compiler/model/LocalVariableScopeInfo.h"
|
2020-08-31 18:46:27 -07:00
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
class FunctionParameterList;
|
|
|
|
|
class FunctionBody;
|
|
|
|
|
class Variable;
|
|
|
|
|
|
|
|
|
|
class UserFunction : public Function
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
UserFunction( const SourceLocation&, bool exported, std::string name,
|
|
|
|
|
std::unique_ptr<FunctionParameterList>, std::unique_ptr<FunctionBody>,
|
|
|
|
|
const SourceLocation& endfunction_location );
|
|
|
|
|
|
|
|
|
|
void accept( NodeVisitor& ) override;
|
2024-01-12 06:51:44 +01:00
|
|
|
void describe_to( std::string& ) const override;
|
2020-08-31 18:46:27 -07:00
|
|
|
|
|
|
|
|
const bool exported;
|
|
|
|
|
const SourceLocation endfunction_location;
|
|
|
|
|
|
2020-09-12 09:31:52 -07:00
|
|
|
LocalVariableScopeInfo local_variable_scope_info;
|
2020-08-31 18:46:27 -07:00
|
|
|
|
|
|
|
|
FunctionBody& body();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
|
|
|
|
|
|
#endif // POLSERVER_USERFUNCTION_H
|