docs: update visitor demo
This commit is contained in:
parent
24dee75dfe
commit
f6bc7594e1
@ -180,8 +180,9 @@ class MyVisitor extends AbstractParseTreeVisitor<Result> implements MySqlParserV
|
||||
console.log('SelectElements', selectElements);
|
||||
return '';
|
||||
}
|
||||
visitProgram(ctx) {
|
||||
return 'Return by program node'
|
||||
visitProgram(ctx) { // program 是根规则
|
||||
this.visitChildren(ctx);
|
||||
return 'Return by program context'
|
||||
}
|
||||
}
|
||||
const visitor = new MyVisitor();
|
||||
|
@ -187,8 +187,9 @@ class MyVisitor extends AbstractParseTreeVisitor<Result> implements MySqlParserV
|
||||
console.log('SelectElements:', selectElements);
|
||||
return '';
|
||||
}
|
||||
visitProgram(ctx) {
|
||||
return 'Return by program node'
|
||||
visitProgram(ctx) { // program is root rule
|
||||
this.visitChildren(ctx);
|
||||
return 'Return by program context'
|
||||
}
|
||||
}
|
||||
const visitor = new MyVisitor();
|
||||
|
Loading…
Reference in New Issue
Block a user