Apply cpp naming to files

This commit is contained in:
IlyaShurupov 2024-03-23 12:09:51 +03:00 committed by Ilya Shurupov
parent 89eec0e329
commit 9d01ba2c8a
73 changed files with 160 additions and 160 deletions

View file

@ -0,0 +1,46 @@
#pragma once
#include "core/Object.hpp"
#include "Map.hpp"
namespace obj {
struct Scope {
typedef tp::Map<std::string, obj::Object*> ObjDict;
typedef tp::List<obj::Object*> ObjList;
ObjDict mLocals;
ObjList mTemps;
bool mChildReachable = true;
~Scope();
};
class ScopeStack {
enum : tp::alni {
MAX_STACK_SIZE = 1024 * 4
};
public:
Scope* mBuff;
tp::ualni mIdx;
tp::ualni mIterIdx;
ScopeStack();
void enterScope(bool aChildReachable);
void leaveScope();
void addLocal(obj::Object* local, const std::string& id);
void addTemp(obj::Object* tmp);
void popTemp();
void addTempReturn(obj::Object* ret);
obj::Object* getLocal(const std::string& str);
Scope* getCurrentScope();
~ScopeStack();
private:
obj::Object* getLocalUtil(Scope& scope, const std::string& id);
};
};