#include
#include "AST/ModuleNode.h"
#include "Sema/ASTVisitor.h"
ModuleNode::ModuleNode(String filename, SharedPtrVector childStmts) : filename(std::move(filename)), childStmts(std::move(childStmts)) {
}
bool ModuleNode::isEmpty() const {
return childStmts.empty();
}
void ModuleNode::accept(const SharedPtr &visitor) {
visitor->visit(staticPtrCast(shared_from_this()));
}
void ModuleNode::bindChildrenInversely() {
auto self = shared_from_this();
for (const SharedPtr &stmt: childStmts) {
stmt->parent = self;
}
}