Question 2: Now, Apple is planning to introduce conventions for all class names. According to this new convention, Z* compiler will only allow those names that start with a set of consonants followed by a set of vowels and end with a consonant set. These names are read the same backward as forward. Thus, the two consonant sets must have elements. On the other hand, the vowel set has no such constrains Now, develop the Context-Free Grammar, which only identifies such class names.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Answer question 2

CASE: Assume that you've been hired by Apple Inc. to write a compiler for Z., a new programming language
for iOS environment, which is quite similar to the C++. Moreover, Apple keeps the authority to add any new
feature in 2 without the trouble of going through any standardization body.
Transcribed Image Text:CASE: Assume that you've been hired by Apple Inc. to write a compiler for Z., a new programming language for iOS environment, which is quite similar to the C++. Moreover, Apple keeps the authority to add any new feature in 2 without the trouble of going through any standardization body.
Question 1:
Apple has introduced the following variable naming conventions in Z.
Variable's name can start with any Capital Letter English Alphabet.
The name for a variable cannot start with any decimal digit, however, usage of the decimal
digit is allowed elsewhere
A name can also start with an underscore. However, apart from underscore, no other special
symbol is allowed to be used as part of the variable name.
Considering the above conditions, prepare an NFA that accepts all legit variables in Z*.
Question 2:
Now, Apple is planning to introduce conventions for all class names. According to this new
convention, Z* compiler will only allow those names that start with a set of consonants followed by a
set of vowels and end with a consonant set. These names are read the same backward as forward. Thus,
the two consonant sets must have elements. On the other hand, the vowel set has no such constrains.
Now, develop the Context-Free Grammar, which only identifies such class names.
Transcribed Image Text:Question 1: Apple has introduced the following variable naming conventions in Z. Variable's name can start with any Capital Letter English Alphabet. The name for a variable cannot start with any decimal digit, however, usage of the decimal digit is allowed elsewhere A name can also start with an underscore. However, apart from underscore, no other special symbol is allowed to be used as part of the variable name. Considering the above conditions, prepare an NFA that accepts all legit variables in Z*. Question 2: Now, Apple is planning to introduce conventions for all class names. According to this new convention, Z* compiler will only allow those names that start with a set of consonants followed by a set of vowels and end with a consonant set. These names are read the same backward as forward. Thus, the two consonant sets must have elements. On the other hand, the vowel set has no such constrains. Now, develop the Context-Free Grammar, which only identifies such class names.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY