I’m currently trying to develop my own plugin for a new language and I’m trying to use SSLR in order to feed metrics to the SonarQube API. I have writter a Parser, a Lexer, and a very basic Grammar for my language.
I’m looking to execute the toolkit on a piece of code to see the AST that SSLR will build for it, but I don’t seem to understand how to launch the toolkit. Can someone help me a little ?
What’s your problem?
Do you have a problem writing a class like FlexToolkit or running it?
If you don’t manage to run it, how do you run it? Which message do you get?
I’m using VSCode to run the main from the toolkit.java, but it says that there is a classpath problem. I’m aware this probably wasn’t the best option to begin with, but I didn’t know how else I could go with this …
Thanks for your help, and sorry if I’m missing basic stuff.
Sorry, I’m not familiar with Java development in VSCode.
If you manage to compile your class, you should also be able to run it.
If you have a pom.xml file, it means that you’re using Maven.
Use Maven to build your project. You can then execute the class from your command line interface.
Thanks again for your help. In order to make sure my modifications didn’t alter the plugin, I redownloaded the original sslr-master folder. I compiled it using “mvn clean install” on the parent pom.
That’s where I seem to be stuck. How do I run the toolkit from there ?
Thanks a lot for your patience.
Edit : I tried to launch the toolkit from sonar-flex using java-jar but upon analyzing a flex file I got this error :
What you got on sonar-flex toolkit is the expected behavior. You got a parsing error because sonar-flex doesn’t parse XML files, it parses ActionScript files and you can find examples inside sonar-flex repository.