mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Update grammar * Implement selfIs in BObjectImp * Add tests * Update grammar * Support obj.function as a MemberAccess [1/2] - AST generation changes * Support obj.function as a MemberAccess [2/2] - add funcref index to eprog class table ctor entry - allow check_mro on non-class inst (skip ctor calls) * Move address of funcref into funcref table * Add funcref.new() - Add class index to funcref table entry - Add MTH_NEW * Fix formatting * Address self-review comments * Some more tests * Address self-review comments * Update grammar * Remove ObjMember read_only, hidden No need to special-handle MBR_FUNCTION * Addres GitHub CI annotations - '=': conversion from 'size_t' to 'unsigned int', possible loss of data
59 lines
1.7 KiB
C++
59 lines
1.7 KiB
C++
#ifndef POLSERVER_COMPILERWORKSPACE_H
|
|
#define POLSERVER_COMPILERWORKSPACE_H
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "bscript/compiler/analyzer/Constants.h"
|
|
#include "bscript/compiler/ast/Node.h"
|
|
#include "clib/maputil.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class Block;
|
|
class ClassDeclaration;
|
|
class FlowControlLabel;
|
|
class ConstDeclaration;
|
|
class ModuleFunctionDeclaration;
|
|
class Program;
|
|
class Report;
|
|
class SourceFile;
|
|
class SourceFileIdentifier;
|
|
class TopLevelStatements;
|
|
class UserFunction;
|
|
|
|
class CompilerWorkspace
|
|
{
|
|
public:
|
|
explicit CompilerWorkspace( Report& );
|
|
~CompilerWorkspace();
|
|
|
|
void accept( NodeVisitor& );
|
|
|
|
std::vector<std::unique_ptr<ConstDeclaration>> const_declarations;
|
|
Constants constants;
|
|
|
|
std::unique_ptr<TopLevelStatements> top_level_statements;
|
|
std::vector<std::unique_ptr<ModuleFunctionDeclaration>> module_function_declarations;
|
|
std::vector<std::unique_ptr<UserFunction>> user_functions;
|
|
std::vector<std::unique_ptr<ClassDeclaration>> class_declarations;
|
|
std::map<std::string, size_t> class_declaration_indexes;
|
|
std::unique_ptr<Program> program;
|
|
|
|
// These reference ModuleFunctionDeclaration objects that are in module_functions
|
|
std::vector<ModuleFunctionDeclaration*> referenced_module_function_declarations;
|
|
|
|
std::vector<std::unique_ptr<SourceFileIdentifier>> referenced_source_file_identifiers;
|
|
|
|
std::map<std::string, SourceLocation, Clib::ci_cmp_pred> all_function_locations;
|
|
std::map<std::string, SourceLocation, Clib::ci_cmp_pred> all_class_locations;
|
|
|
|
std::vector<std::string> global_variable_names;
|
|
std::map<std::string, FlowControlLabel> user_function_labels;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
#endif // POLSERVER_COMPILERWORKSPACE_H
|