Skip to content
Discussion options

You must be logged in to vote

You'll have to leave the grammar as is when parsing your input because changing the lexing rule for whitespace will break everything in the parser. Lexing occurs first and it is not guided at all by the parser. If you made this change, you would have a huge task of modifying the parser grammar to optionally recognize a newline between everything else. There is a better way.

After parsing, what you will need is to first identify which methods you want to line count. You can do this with an Antlr Listener. You can then grab the text for the methods and just count newlines in the text.

A Trash script can perform essentially what you want. Trash automates the generation of a standardized driv…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@julianbass
Comment options

Answer selected by julianbass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants