This assumes that you use IntelliJ Idea as specified in the course.
Make sure your IntelliJ ANTLR plugin supports the ANTLR .jar version you have.
- Use Maven to download the dependencies
- Generate the ANTLR classes with the use of the IntelliJ plugin
- Right-click the lexer file
- Configure ANTLR...
- Make sure the following are selected:
- generate parse tree listener
- generate parse tree visitor
- Right-click the lexer file
- Generate ANTLR Recognizer
- Right-click the parser file
- Generate ANTLR Recognizer
- Mark the
gendirectory as "Generated sources root"
You should be good to go.