SonarQube and SSLR are not linked together.
SonarQube exposes an API (sonar-plugin-api) so that analyzers can feed it with analysis results. An analyzer typically needs to parse code for a given language: in a lot of cases, the analyzer transforms the analyzed code into an abstract syntax tree (AST) to work on it and produce some useful data (metrics, coding rule violations…) which can be fed to SonarQube API.
There are different ways to build an AST for a given language. One way is to use SSLR.
SonarQube plugins don’t have to use SSLR, and SSLR can be used for things than writing SonarQube plugins. SonarQube API and SSLR don’t depend on each other.
I suggest that you have a look at sonar-flex or sonar-lua.
To answer your question about LOC: your analyzer can use SSLR to parse code and identify which parts of the code are code and which parts are comments, and you should feed the metric to SonarQube API (see for example how sonar-flex feeds NCLOC).