-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec1985b
commit c95810b
Showing
8 changed files
with
852 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
#include "ast_visitor.h" | ||
|
||
void ast_visitor::visit_expr(expr* node) { | ||
bool ast_visitor::visit_expr(expr* node) { | ||
node->accept(this); | ||
} | ||
|
||
void ast_visitor::visit_null_expr(null_expr* node) { | ||
node->accept(this); | ||
bool ast_visitor::visit_null_expr(null_expr* node) { | ||
return true; | ||
} | ||
|
||
void ast_visitor::visit_nil_expr(nil_expr* node) { | ||
node->accept(this); | ||
bool ast_visitor::visit_nil_expr(nil_expr* node) { | ||
return true; | ||
} | ||
|
||
void ast_visitor::visit_number_literal(number_literal* node) { | ||
node->accept(this); | ||
bool ast_visitor::visit_number_literal(number_literal* node) { | ||
return true; | ||
} | ||
|
||
void ast_visitor::visit_string_literal(string_literal* node) { | ||
node->accept(this); | ||
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
#include "nasal_new_ast.h" | ||
#include "ast_visitor.h" | ||
|
||
bool expr::accept(ast_visitor* visitor) { | ||
void expr::accept(ast_visitor* visitor) { | ||
visitor->visit_expr(this); | ||
return true; | ||
} | ||
|
||
bool null_expr::accept(ast_visitor* visitor) { | ||
void null_expr::accept(ast_visitor* visitor) { | ||
visitor->visit_null_expr(this); | ||
return true; | ||
} | ||
|
||
bool nil_expr::accept(ast_visitor* visitor) { | ||
void nil_expr::accept(ast_visitor* visitor) { | ||
visitor->visit_nil_expr(this); | ||
return true; | ||
} | ||
|
||
bool number_literal::accept(ast_visitor* visitor) { | ||
void number_literal::accept(ast_visitor* visitor) { | ||
visitor->visit_number_literal(this); | ||
return true; | ||
} | ||
|
||
bool string_literal::accept(ast_visitor* visitor) { | ||
void string_literal::accept(ast_visitor* visitor) { | ||
visitor->visit_string_literal(this); | ||
return true; | ||
} | ||
|
||
void identifier::accept(ast_visitor* visitor) { | ||
visitor->visit_identifier(this); | ||
} | ||
|
||
void bool_literal::accept(ast_visitor* visitor) { | ||
visitor->visit_bool_literal(this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.