This repository has been archived on 2023-09-10. You can view files and clone it, but cannot push or open issues/pull-requests.
joko/lib/StaticPass.hpp

32 lines
610 B
C++

#ifndef jk_STATICPASS_HPP
#define jk_STATICPASS_HPP
#include "commons.hpp"
#include "SymTable.hpp"
#include "Node.hpp"
namespace jk
{
class StaticPass
{
public:
explicit StaticPass(std::shared_ptr<SymTable> sym, Logger& logger);
virtual ~StaticPass();
void pass(std::shared_ptr<Node> node);
void add_static(std::string const& name);
private:
std::shared_ptr<SymTable> m_sym;
Logger& m_logger;
std::vector<std::shared_ptr<Type>> m_types;
std::vector<std::string> m_statics;
void push(std::shared_ptr<Type> type);
std::shared_ptr<Type> pop();
};
}
#endif