Develop Java or C++ programs to do the following tasks:
1- Building an NFA from a given regular expression.
2- Converting a giving NFA into a DFA.
3- Building a DFA from a given regular expression directly without going through an NFA. (8 marks)
b- For the following grammar write a Java or C++ program that uses the LR(1) method to decide whether a given string can be derived in the grammar. If the sentence is derivable, your program should output the derivation of the sentence. (7 marks)
c- Write an implementation for the type system rules included in the type checking slides. (5 marks)