diff --git a/README-zh_CN.md b/README-zh_CN.md index f7f0fc3..11d30ac 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -180,8 +180,9 @@ class MyVisitor extends AbstractParseTreeVisitor 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(); diff --git a/README.md b/README.md index 4e951c5..21e3895 100644 --- a/README.md +++ b/README.md @@ -187,8 +187,9 @@ class MyVisitor extends AbstractParseTreeVisitor 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();