Using Java and ANTLR4, build and implement a grammar application of an interface in the C# programming language. Your program should read a text file such as interfaceparser.cs and give the parse tree output.
It should handle the errors as well, i.e. if the syntax of the source code is not correct it should give the related error message. For example, if the file contains fields in an interface file, your program should warn the user about this error.
First, you need to design your grammar as BNF or EBNF. Then, you should build your grammar in the ANTLR4 environment (g file).
Here is an example of a C# interface:
public interface ITransactions
{
// interface members
void showTransaction();
double getAmount();
}
Some facts about an interface you should know:
• An interface cannot include fields.
• An interface can include only the definitions of methods, properties, events and delegates.
• Interface names are prefixed with capital I.
You can explore more facts about an interface by yourself.
Please do everything on your own and submit your project in a zip file. Your zip folder should include BNF (or EBNF file), G file (your grammar file), source codes, and a manual file consisting of some information and instructions of how to use your program. If you want, you can include some sample input text files as well but remember that your program should work with any implemented C# interface.