hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
moduleContext.h
Go to the documentation of this file.
1//
2// Created by XIaokang00010 on 2024/9/4.
3//
4
5#ifndef HOSHI_LANG_MODULECONTEXT_H
6#define HOSHI_LANG_MODULECONTEXT_H
7
8#include "share/def.hpp"
10#include "compilerContext.h"
11#include "compiler/ir/IR.h"
12#include <map>
13#include <vector>
14
15namespace yoi {
16
20 std::map<yoi::wstr, std::shared_ptr<moduleContext>> referencedModules;
21 std::shared_ptr<yoi::compilerContext> compilerContext;
22 std::stack<yoi::IRBuilder> IRBuilderStack;
23 std::vector<IRTemplateBuilder> templateBuilders;
24 public:
25 moduleContext(std::shared_ptr<yoi::compilerContext> compilerContext, yoi::wstr path, yoi::hoshiModule *moduleAST);
26
28
30
31 void pushIRBuilder(const yoi::IRBuilder &builder);
32
33 void popIRBuilder();
34
36
37 void popTemplateBuilder();
38
39 std::vector<IRTemplateBuilder> &getTemplateBuilders();
40
41 std::shared_ptr<yoi::compilerContext> getCompilerContext();
42 };
43
44} // hoshi
45
46#endif //HOSHI_LANG_MODULECONTEXT_H
yoi::IRBuilder & getIRBuilder()
std::vector< IRTemplateBuilder > templateBuilders
std::stack< yoi::IRBuilder > IRBuilderStack
void pushIRBuilder(const yoi::IRBuilder &builder)
yoi::hoshiModule & getModuleAST()
void pushTemplateBuilder(IRTemplateBuilder &builder)
std::shared_ptr< yoi::compilerContext > compilerContext
std::vector< IRTemplateBuilder > & getTemplateBuilders()
std::map< yoi::wstr, std::shared_ptr< moduleContext > > referencedModules
std::shared_ptr< yoi::compilerContext > getCompilerContext()
yoi::hoshiModule * moduleAST
std::wstring wstr
Definition def.hpp:48