Supporting new languages
Six steps to support new languages in SonarQube Community Build.
Last updated
Was this helpful?
Six steps to support new languages in SonarQube Community Build.
SonarQube ServerThe steps to cover a new programming language are:
Write the grammar. This is the hardest part.
Write a parser (a parser simply parses an input based on your grammar to yield a parse tree).
Test your grammar, to ensure it is able to parse real-life language files.
Write a few parse tree visitors. Some visitors will compute metrics such as Executable lines, while others will enforce Adding coding rules. A dozen or so visitors are sufficient for an initial release.
Write a scanner Sensor, in a SonarQube Community Build plugin, to launch the visitors.
Compute
issues
raw measures
code duplications
syntax highlighting
symbol table
coverage information (lines/branches to cover, line/branch hits)
In fulfilling these steps, the Sonar Language Recognizer (SSLR) can be an important resource.
Last updated
Was this helpful?
Was this helpful?

