2023-08-30 18:06:26 +00:00
|
|
|
#ifndef roza_STATICPASS_HPP
|
|
|
|
#define roza_STATICPASS_HPP
|
|
|
|
|
|
|
|
#include "commons.hpp"
|
|
|
|
#include "StatusLog.hpp"
|
|
|
|
#include "Node.hpp"
|
2023-08-31 09:07:03 +00:00
|
|
|
#include "Type.hpp"
|
2023-08-31 19:25:00 +00:00
|
|
|
#include "SymTable.hpp"
|
2023-08-30 18:06:26 +00:00
|
|
|
|
|
|
|
namespace roza
|
|
|
|
{
|
|
|
|
class StaticPass
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit StaticPass(StatusLog& log);
|
2023-08-31 19:25:00 +00:00
|
|
|
explicit StaticPass(StatusLog& log, SymTable const& sym_table);
|
2023-08-30 18:06:26 +00:00
|
|
|
virtual ~StaticPass();
|
|
|
|
|
|
|
|
void check(std::shared_ptr<Node> root);
|
2023-08-31 09:07:03 +00:00
|
|
|
void check_children(std::shared_ptr<Node> root);
|
2023-08-30 18:06:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
StatusLog& m_log;
|
2023-08-31 19:25:00 +00:00
|
|
|
SymTable m_sym;
|
2023-09-01 20:38:12 +00:00
|
|
|
std::shared_ptr<Node> m_outer_fun_ret;
|
2023-08-31 09:07:03 +00:00
|
|
|
|
|
|
|
void check_types(std::shared_ptr<Node> root,
|
|
|
|
std::shared_ptr<Type> lhs,
|
|
|
|
std::shared_ptr<Type> rhs);
|
|
|
|
|
|
|
|
void check_types(std::shared_ptr<Node> root,
|
|
|
|
std::shared_ptr<Type> lhs,
|
|
|
|
std::vector<std::shared_ptr<Type>> const& rhs);
|
2023-08-30 18:06:26 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|