mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-24 21:45:44 +08:00
48 lines
1017 B
C++
48 lines
1017 B
C++
#include "ast_visitor.h"
|
|
|
|
bool ast_visitor::visit_expr(expr* node) {
|
|
node->accept(this);
|
|
}
|
|
|
|
bool ast_visitor::visit_null_expr(null_expr* node) {
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_nil_expr(nil_expr* node) {
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_number_literal(number_literal* node) {
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_string_literal(string_literal* node) {
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_identifier(identifier* node) {
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_bool_literal(bool_literal* node) {
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_vector_expr(vector_expr* node) {
|
|
for(auto i : node->get_elements()) {
|
|
i->accept(this);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
bool ast_visitor::visit_hash_expr(hash_expr* node) {
|
|
for(auto i : node->get_members()) {
|
|
i->accept(this);
|
|
}
|
|
}
|
|
|
|
bool ast_visitor::visit_hash_pair(hash_pair* node) {
|
|
if (node->get_element()) {
|
|
node->get_element()->accept(this);
|
|
}
|
|
} |