polserver/pol-core/bscript/compiler/ast/Function.h
Eric Swanson 86c0efbc21
Build AST nodes for module function declarations (#239)
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)
2020-08-23 15:01:39 -07:00

26 lines
569 B
C++

#ifndef POLSERVER_FUNCTION_H
#define POLSERVER_FUNCTION_H
#include "compiler/ast/Node.h"
namespace Pol::Bscript::Compiler
{
class FunctionParameterDeclaration;
class FunctionParameterList;
class FunctionBody;
class Function : public Node
{
public:
Function( const SourceLocation&, std::string name, std::unique_ptr<FunctionParameterList> );
unsigned parameter_count() const;
std::vector<std::reference_wrapper<FunctionParameterDeclaration>> parameters();
const std::string name;
};
} // namespace Pol::Bscript::Compiler
#endif // POLSERVER_FUNCTION_H