Select Git revision
ASTModulesImporter.hpp
-
Stéphane Del Pino authored
This is a special module that is *always* imported For this first version of the module we have three functions: getAvailableModules() -> string which returns the list of available pugs modules getPugsVersion() -> string getPugsBuildInfo() -> string which are moved from the 'utils' module There is no need to use `import core` in the preamble of a pugs script file.
Stéphane Del Pino authoredThis is a special module that is *always* imported For this first version of the module we have three functions: getAvailableModules() -> string which returns the list of available pugs modules getPugsVersion() -> string getPugsBuildInfo() -> string which are moved from the 'utils' module There is no need to use `import core` in the preamble of a pugs script file.
ASTModulesImporter.hpp 718 B
#ifndef AST_MODULES_IMPORTER_HPP
#define AST_MODULES_IMPORTER_HPP
#include <language/ast/ASTNode.hpp>
#include <language/modules/ModuleRepository.hpp>
#include <set>
#include <string>
class SymbolTable;
class ASTModulesImporter
{
std::set<std::string> m_imported_modules;
SymbolTable& m_symbol_table;
ModuleRepository m_module_repository;
void _importModule(ASTNode& import_node);
void _importAllModules(ASTNode& node);
public:
const ModuleRepository&
moduleRepository() const
{
return m_module_repository;
}
ASTModulesImporter(ASTNode& root_node);
ASTModulesImporter(const ASTModulesImporter&) = delete;
~ASTModulesImporter() = default;
};
#endif // AST_MODULES_IMPORTER_HPP