summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/ASTInspector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Sencha-lang/ASTInspector.cpp')
-rw-r--r--Sencha-lang/ASTInspector.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/Sencha-lang/ASTInspector.cpp b/Sencha-lang/ASTInspector.cpp
index ac710dd..04506fd 100644
--- a/Sencha-lang/ASTInspector.cpp
+++ b/Sencha-lang/ASTInspector.cpp
@@ -34,6 +34,10 @@ void ASTInspector::visit(Visitable * node)
{
visit(static_cast<BasicExpression *>(node));
}
+ else if (node->type == "UnaryExpression")
+ {
+ visit(static_cast<UnaryExpression *>(node));
+ }
else if (node->type == "PostfixExpression")
{
visit(static_cast<PostfixExpression *>(node));
@@ -118,6 +122,20 @@ void ASTInspector::visit(BasicExpression * basic_expression)
depth_level--;
}
+void ASTInspector::visit(UnaryExpression * unary_expression)
+{
+ this->occurences["UnaryExpression"]++;
+ depth_level++;
+ std::string visit_notes = "";
+ visit_notes += "Unary expression:\n";
+ visit_notes += "Executing " + unary_expression->get_operator() + " on:\n";
+ write_report(visit_notes);
+ unary_expression->children[0]->accept(this);
+
+ write_report("End of UnaryExpression\n");
+ depth_level--;
+}
+
void ASTInspector::visit(PostfixExpression * postfix_expression)
{
this->occurences["PostfixExpression"]++;