Currently error messages return byte index of the error, and we don't provide a method to semantic actions for getting the current locations.
With error messages we should also (in addition to byte index) return the line and column number, and we should provide a method to get the current line and column number.
To allow attaching location information to tokens, we should also return the start and end locations of lexemes when calling semantic actions.
Currently error messages return byte index of the error, and we don't provide a method to semantic actions for getting the current locations.
With error messages we should also (in addition to byte index) return the line and column number, and we should provide a method to get the current line and column number.
To allow attaching location information to tokens, we should also return the start and end locations of lexemes when calling semantic actions.