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.cpp

38 lines
725 B
C++
Raw Normal View History

2023-09-09 22:03:28 +00:00
#include "StaticPass.hpp"
namespace jk
{
/*explicit*/ StaticPass::StaticPass(std::shared_ptr<SymTable> sym,
Logger& logger)
: m_sym { sym }
, m_logger { logger }
{
}
/*virtual*/ StaticPass::~StaticPass()
{
}
void StaticPass::pass(std::shared_ptr<Node> node)
{
switch (node->type())
{
case NODE_PROG: {
for (size_t i=0; i<node->size(); i++)
{
pass(node->child(i).lock());
}
} break;
case NODE_FUNCALL: {
} break;
default:
std::cerr << "cannot static_pass unknown node '"
<< NodeTypeStr[node->type()] << "'" << std::endl;
abort();
}
}
}