[solved]-Answer Following Use One Answer Second Part Need Double Check Work Q39023886
answer the following use one to answer the second part i need todouble check my work

3. (20 points) Assume you have designed a programming language that allows the implementation of a straight-line program (SLP), that is, the instructions in a program are made up of only statements and expressions, but no loops or if-statements (See the sample program, P1, shown below. Note that the print function will take an expression list as its arguments). Program P1: a := 2 + 5; b := (print (a, a – 1), 7 * a); print (b) Execution of this program will yield output 7 6 49 The sentence in the language of this grammar can be specified with the following token symbols for (a) the terminals in the grammar: id print num, + () * := ; (b) the nonterminals (Statement, Expression, and List): S, E, L id := num = num; id := ( print (id, id – num), num * id ); print (id) (Note that names a and b and the numbers 2, 5, 1, 7 are semantic values associated with some of the tokens) a) Provide a description of the syntax of the SLP language and the program P1 above, at the lexical syntax, concrete syntax, and abstract syntax levels. b) Explain what grammar you are using to specify this language. 4. (25 points) Outline the major steps a parser (syntactic analyzer) needs to do from taking a stream of tokens and checking with the given production rules of the grammar to define algorithms of the methods that are necessary to parse the given sentence. Use the SLP grammar (Problem 3) to illustrate the steps Show transcribed image text 3. (20 points) Assume you have designed a programming language that allows the implementation of a straight-line program (SLP), that is, the instructions in a program are made up of only statements and expressions, but no loops or if-statements (See the sample program, P1, shown below. Note that the print function will take an expression list as its arguments). Program P1: a := 2 + 5; b := (print (a, a – 1), 7 * a); print (b) Execution of this program will yield output 7 6 49 The sentence in the language of this grammar can be specified with the following token symbols for (a) the terminals in the grammar: id print num, + () * := ; (b) the nonterminals (Statement, Expression, and List): S, E, L id := num = num; id := ( print (id, id – num), num * id ); print (id) (Note that names a and b and the numbers 2, 5, 1, 7 are semantic values associated with some of the tokens) a) Provide a description of the syntax of the SLP language and the program P1 above, at the lexical syntax, concrete syntax, and abstract syntax levels. b) Explain what grammar you are using to specify this language. 4. (25 points) Outline the major steps a parser (syntactic analyzer) needs to do from taking a stream of tokens and checking with the given production rules of the grammar to define algorithms of the methods that are necessary to parse the given sentence. Use the SLP grammar (Problem 3) to illustrate the steps
Expert Answer
Answer to answer the following use one to answer the second part i need to double check my work … . . .
OR

