From c5e9f890dab0e4595482301d77876793c8bceb8c Mon Sep 17 00:00:00 2001 From: Nagi5Yeq Date: Mon, 25 May 2020 00:53:57 +0800 Subject: finish function node. Parser.y: rename 'context' to 'ctx' to avoid conflict in new version bison. --- Context.hh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Context.hh') diff --git a/Context.hh b/Context.hh index 2bbcaa4..9a30721 100644 --- a/Context.hh +++ b/Context.hh @@ -1,21 +1,30 @@ #ifndef PCC_CONTEXT_H #define PCC_CONTEXT_H +#include + #include #include #include "TypeManager.hh" +#include "VariableList.hh" namespace pcc { class Context { public: Context(const char* name); TypeManager* GetTypeManager(); + VariableList GetGlobals(); llvm::Module* GetModule(); llvm::IRBuilder<>* GetBuilder(); + VariableList* GetCurrentScope(); + void PushScope(VariableList* scope); + void PopScope(); private: TypeManager TypeManager_; + VariableList globals_; + std::stack scopes_; llvm::IRBuilder<> builder_; llvm::Module module_; }; -- cgit