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