- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAst.cpp
More file actions
Latest commit
18 lines (18 loc) · 464 Bytes
/
Copy pathAst.cpp
File metadata and controls
18 lines (18 loc) · 464 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include"Ast.h"
#include"Ctx.h"
usingnamespaceyfpeg;
voidAstNode::walk(Ctx* ctx,int level) {
LOG("%s%s:%s",getIndent(level).c_str(),tag.c_str(),captured.c_str());
//if (this->scope) {
// ctx->scope.push(this->scope);
//}
ctx->trans.exec(tag,this,&ctx->vm,this->scope);
AstNodeVectorFor(children){
AstNode * child = *it;
int new_level = level + 1;
child->walk(ctx,new_level);
}
//if (this->scope) {
// ctx->scope.pop();
//}
}