CS 310, Group Assignment #1 100 points Due: 10/8/2019
For the following 3 simple grammars write a recursive recognizer program for the language in Java. If the language give has a problem preventing it from being implemented recursively FIX it. You will be given a file of sample strings to test each language with. You should have 1 main program. A “tokenizer” class, a test method and one recursive recognizer method for EACH of the languages given below!!! Modularity is KEY. SUGGESTIONS: Your main program should prompt the user for which language they wish to test along with the name of the data file to test. Main should invoke the top level method for the appropriate class along and provide the name of the test file. The tokenizer class is used by each of the languages. It should have: oA constructor to create an instance of the tokenizer oA method to store the current string being tokenized oa method “getCurrentToken” to retrieve the current token from the string o a method to “getNextToken” (gets the next character and stores it as the current token). When we run out of tokens in the current string your group should select a special character from Unicode to represent the “end of string” token oa method to test if we are at the end of string oPerhaps a mechanism for resetting the tokenizer with a new string.. (to test the next one) oFOR ALL OF THE LANGUAGES tokens are always a single character oThere are NO spaces as part of the valid language Each language recognizer class should consist of a series of a series of (potentially) static methods oThere must be a “top-level” method that is given the file to process, sets and resets the tokenizer, and indicates whether or not a string is part of the given language. oAs each string is read it should call the start symbol for the language. oWhen the recursion ends this method should receive a “true” or “false” for each sentence, and should display an appropriate message to the screen. Remember a string is ONLY valid if the recognizer returns true and you are at end of string.