mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
Adds enough to build the AST nodes for the module function declarations in a .em file. Adds: - Function: base class for module function declarations and user functions - FunctionParameterDeclaration: declaration for a function parameter, as well as its default value if any - FunctionParameterList: just a holder for function parameter declarations - ModuleFunctionDeclaration: for function declarations in .em files - FunctionResolver: hooks up function calls to module functions or user functions - ModuleProcessor: a visitor for processing const declarations and module function declarations (const declarations are yet to come from the main branch)
32 lines
883 B
C++
32 lines
883 B
C++
#ifndef POLSERVER_FUNCTIONPARAMETERDECLARATION_H
|
|
#define POLSERVER_FUNCTIONPARAMETERDECLARATION_H
|
|
|
|
#include "compiler/ast/Node.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class NodeVisitor;
|
|
class Expression;
|
|
|
|
class FunctionParameterDeclaration : public Node
|
|
{
|
|
public:
|
|
FunctionParameterDeclaration( const SourceLocation& source_location, std::string name, bool byref,
|
|
bool unused, std::unique_ptr<Expression> default_value );
|
|
FunctionParameterDeclaration( const SourceLocation& source_location, std::string name, bool byref,
|
|
bool unused );
|
|
|
|
void accept( NodeVisitor& visitor ) override;
|
|
void describe_to( fmt::Writer& ) const override;
|
|
|
|
Expression* default_value();
|
|
|
|
const std::string name;
|
|
const bool byref;
|
|
const bool unused;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
|
|
#endif // POLSERVER_FUNCTIONPARAMETERDECLARATION_H
|