grammar

Generating, visiting and unit testing grammar using ANTLR4 with Java and Scala

Reading Time: 6 minutes “Quality is free, but only to those who are willing to pay heavily for it” – T. DeMarco Now unit testing is not that heavy to pay off so lets start the blog. In this blog we will be continuing the voyage to the kingdom of ANTLR4 RECAP In previous blog we discussed how to test whether a string is grammatically correct or not using Continue Reading

Creating a DSL (Domain Specific Language) using ANTLR ( Part-II) : Writing the Grammar file.

Reading Time: 3 minutes Earlier we discussed in our blog how to configure the ANTLR plugin for the intellij for getting started with our language. In this post we will discuss the basics of the ANTLR  and exactly how can we get started with our main goal. What is the lexer, parser and what are their roles and many other things. So lets get started, Antlr stands for ANother Continue Reading

Testing grammar using ANTLR4 TestRig (Grun)

Reading Time: 5 minutes “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” –Martin Golding Quotes like above tell us the importance of testing the modules that we develop. Testing for different languages is done using various tools for example JUNIT for java, FunSuite for scala and TestRig (grun on command line) for grammar(.g4). In this Continue Reading