Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a context-free grammar. Please ignore the first question. Please do this JH-lisp Question. Give context-free grammars that generate the following languages. In all parts, the
a context-free grammar.
Please ignore the first question.
Please do this JH-lisp Question.
Give context-free grammars that generate the following languages. In all parts, the alphabet is {0,1} Aa. {w w contains at least three 15) b. {W w starts and ends with the same symboly C. {w the length of w is odd; Ad. {w/ the length wis odd and its middle symbollis ap} e.{ww = vam that is, w is a palindrome) f. Tbe empty set NO (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,o,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. Give context-free grammars that generate the following languages. In all parts, the alphabet is {0,1} Aa. {w w contains at least three 15) b. {W w starts and ends with the same symboly C. {w the length of w is odd; Ad. {w/ the length wis odd and its middle symbollis ap} e.{ww = vam that is, w is a palindrome) f. Tbe empty set NO (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,o,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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started