Assignment 3 ------------- Student no. 3789261 and 3222774 Total: 85 Email: JLAVA066@uottawa.ca, EYU079@uottawa.ca *Organized submission: (+5) 1. Propose your own set of production rules LL(1) that compirses an unambigious grammar : 10 points > 2. Calculate FIRST FOLLOW for non-terminals of the new grammar; calculate FIRST sets rules for all alternatives, and show that the grammar is LL (1). : 15+ 5 points > (-5) the proof not included 3. Build a table of analysis. :20 points > 4. Defining the rules for valuing attributes to achieve a static evaluation of expressions (e.g. phrase "5> (2 + 3 * 5)" should be evaluated by the compiler). There should be documentation and the realization of these rules in the Java program : 20 points > 5. Write a program in Java, C / C + + or C # program that reads (Pascal simplified) in a file named input.txt, is the parsing of the program, and (if the program is syntactically correct) evaluates expressions that may statically be evaluated. This program (compiler) should print in a file called output.txt syntactic rules in the order in which they are applied during parsing LL (1). It should also print the value of an expression in an assignment statement or statement while when the expression is fully analyzed. In a phrase that can not be evaluated statistically, the text does not allow static evaluation "is to be printed in the output file. : 20 points > -5 > Numerous compiler errors in the code, for example this code is wrong: > XXXX terminalNum = terminalNum*10 + (Integer.valueOf(c)-48); XXXXX Wrong, will not work > Correct form would be , terminalNum = terminalNum*10 + (Integer.parseInt(String.valueOf(c))-48); > -10 > While, if etc are not implemented 6. A lexical analyzer is required to perform this duty. You have two options: (a) write a lexical analyzer in the same programming language, which will be a component of the analysis program, or (b) using Lex to produce a lexical analyzer, which reads the file and produce a input.txt intermediate file that contains the sequence of lexical units of the programme; this file will then be used as the input file parsing program. :10 points >