Question: Please answer question 6 Please answer question 6 Please answer question 6 6. The following is a description for JH-Lisp2, which is a modified version
Please answer question 6
Please answer question 6
Please answer question 6

6. The following is a description for JH-Lisp2, which is a modified version of the language previously described in homework 3, problem 6: (a) The alphabet of JH-Lisp2 consists of the open '[' and close ']'square brackets, the digits 0-9, the underscore character ' _", and the letters {a,b,d,i,1,m,0,s,u,v} (b) An operator is a substring in JH-Lisp2 containing one of the following strings: {add, sub, mul, div, mod}. (c) A number is a substring in JH-Lisp2 containing one or more of the digits 0-9 (d) An expression is defined as either a number or a list expression (e) A list expression is defined by the following, in order: i. An open bracket: '[' ii. An operator iii. An underscore:) iv. An expression V. An underscore: '' vi. An expression vii. A close bracket: ']' (f) A string in the JH-Lisp2 language is a single list expression. An example string in this language might be [add_[mod_4_3] _21] Give a context-free grammar for JH-Lisp2. 6. The following is a description for JH-Lisp2, which is a modified version of the language previously described in homework 3, problem 6: (a) The alphabet of JH-Lisp2 consists of the open '[' and close ']'square brackets, the digits 0-9, the underscore character ' _", and the letters {a,b,d,i,1,m,0,s,u,v} (b) An operator is a substring in JH-Lisp2 containing one of the following strings: {add, sub, mul, div, mod}. (c) A number is a substring in JH-Lisp2 containing one or more of the digits 0-9 (d) An expression is defined as either a number or a list expression (e) A list expression is defined by the following, in order: i. An open bracket: '[' ii. An operator iii. An underscore:) iv. An expression V. An underscore: '' vi. An expression vii. A close bracket: ']' (f) A string in the JH-Lisp2 language is a single list expression. An example string in this language might be [add_[mod_4_3] _21] Give a context-free grammar for JH-Lisp2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
