ANTLR is used to generate the lexer and parser for Luie based on its grammar. It can be downloaded from the official website. The website also contains information on how to install ANTLR and generate files for different languages.
The compiler is written in C# and uses .NET 8. For building the compiler, the .NET 8 SDK is required.
The following command can be used to generate the lexer and parser files for Luie:
antlr4 -Dlanguage=CSharp -listener Luie.g4
Alternatively, you can use the Visual Studio Code extension "ANTLR4 grammar syntax support" and set the settings in the settings.json
file to generate the files automatically. An example of the settings is shown below:
"antlr4.generation": {
"mode": "external",
"language": "CSharp",
"listeners": true,
"visitors": false
},