PLEASE USING C++ for this assignment
CPSC 3383 HW 2 (I) (). Give an unambiguous grammar for the language of ail positive even integers. (For example, the string 341134256 is in this language, but the string 43 is not.) (b). Give a syntax diagram for this language. Hint: For both parts (a) and (b), you can proceed "from scratc" or you can build upon the work alreedy done in class on grammars and syntax diagrams for the language of all positive integers. (2). Consider the grammar The terminal symbols here are in small letters, Le, a and b) (a). Precisely what language does this grammar generate? (A succinct answer wil suffice.) (b). Show that this grammar is ambiguous. (c). Find an unambiguous grammar for this language. (d). Give a syntax diagram for this language. (3). (A "difficuk" language!) Consider the grammar: It is easy to see that this grammar is ambiguous, but I do not lnow if there is an unambiguous grammar which generates the same language. Furthermore, precisely describing the language this grammar generates (and proving that the description is correot) requires a detailed mathematical argument (which will be supplied as a hand-out at a later time)l Nevertheloss, it is not difficuit to decide whether or not spectfic strings are in this language; rcall that, to show that a string is in the language, you need merely provide a parse tree or series of production rules for generating it, and, to show that a speaific string is not in the language, it suffices to find some condition that a string MUST satisfy in order for it to be in the language but which the specific string in question fails to meet. In particular, please decide which of the following strings are in this language, and justify your claims! (For convenience, algebraic notation is used below to sborten the description of the strings.) (a). a?bel7dedc7 (c). a'bedc'dc (c). a^be1001de999 CPSC 3383 HW 2 (I) (). Give an unambiguous grammar for the language of ail positive even integers. (For example, the string 341134256 is in this language, but the string 43 is not.) (b). Give a syntax diagram for this language. Hint: For both parts (a) and (b), you can proceed "from scratc" or you can build upon the work alreedy done in class on grammars and syntax diagrams for the language of all positive integers. (2). Consider the grammar The terminal symbols here are in small letters, Le, a and b) (a). Precisely what language does this grammar generate? (A succinct answer wil suffice.) (b). Show that this grammar is ambiguous. (c). Find an unambiguous grammar for this language. (d). Give a syntax diagram for this language. (3). (A "difficuk" language!) Consider the grammar: It is easy to see that this grammar is ambiguous, but I do not lnow if there is an unambiguous grammar which generates the same language. Furthermore, precisely describing the language this grammar generates (and proving that the description is correot) requires a detailed mathematical argument (which will be supplied as a hand-out at a later time)l Nevertheloss, it is not difficuit to decide whether or not spectfic strings are in this language; rcall that, to show that a string is in the language, you need merely provide a parse tree or series of production rules for generating it, and, to show that a speaific string is not in the language, it suffices to find some condition that a string MUST satisfy in order for it to be in the language but which the specific string in question fails to meet. In particular, please decide which of the following strings are in this language, and justify your claims! (For convenience, algebraic notation is used below to sborten the description of the strings.) (a). a?bel7dedc7 (c). a'bedc'dc (c). a^be1001de999