Get token information along with line number

I have a multi line document and I need a function that will take input as numberOfLines and will return the same information returned by getLineTokens from line 0 upto the numberOfLines along with lineNumber at which the token is present.
Thanks in advance.