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)
38 lines
940 B
C++
38 lines
940 B
C++
#ifndef POLSERVER_MODULEPROCESSOR_H
|
|
#define POLSERVER_MODULEPROCESSOR_H
|
|
|
|
#include <EscriptGrammar/EscriptParserBaseVisitor.h>
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "ModuleDeclarationBuilder.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class Profile;
|
|
class Report;
|
|
class SourceFile;
|
|
class SourceFileIdentifier;
|
|
class BuilderWorkspace;
|
|
|
|
class ModuleProcessor : public EscriptGrammar::EscriptParserBaseVisitor
|
|
{
|
|
public:
|
|
ModuleProcessor( const SourceFileIdentifier&, BuilderWorkspace&, std::string modulename );
|
|
|
|
antlrcpp::Any visitModuleDeclarationStatement(
|
|
EscriptGrammar::EscriptParser::ModuleDeclarationStatementContext* ) override;
|
|
|
|
private:
|
|
Profile& profile;
|
|
Report& report;
|
|
const SourceFileIdentifier& source_file_identifier;
|
|
BuilderWorkspace& workspace;
|
|
|
|
ModuleDeclarationBuilder tree_builder;
|
|
const std::string modulename;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
#endif // POLSERVER_MODULEPROCESSOR_HModP
|