Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

Please do this JH-lisp Question.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions