Created
October 16, 2019 17:52
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var QuerySeparationGrammarListener = require('./QuerySeparationGrammarListener').QuerySeparationGrammarListener; | |
| var CustomListener = function(result) { | |
| this.result = result; | |
| QuerySeparationGrammarListener.call(this); // inherit default listener | |
| return this; | |
| }; | |
| // continue inheriting default listener | |
| CustomListener.prototype = Object.create(QuerySeparationGrammarListener.prototype); | |
| CustomListener.prototype.constructor = CustomListener; | |
| // override default listener behavior | |
| CustomListener.prototype.exitStatement = function(ctx) { | |
| this.result.push([ctx.start.start, ctx.stop.stop]); // storing the start and stop indices of every statement | |
| }; | |
| exports.CustomListener = CustomListener; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment