Question
CASE: Assume that you've been hired by Apple Inc. to write a compiler for Z*, a new programming language for iOS development, which is quite
CASE: Assume that you've been hired by Apple Inc. to write a compiler for Z*, a new programming language for iOS development, which is quite similar to C++. Moreover, Apple keeps the authority to add any new feature in Z* without the trouble of going through any standardization body.
1)Now, Apple is planning to introduce conventions for all class names. According to this new convention, Z* compiler will only allow those class names that start with a set of vowels followed by a set of consonants and end with a vowel set. The two vowel sets can have different elements, but the total elements in both vowel sets have to be equal. Besides, elements of the first vowel set are equal with the total elements of the other vowel set. On the other hand, the consonant set has no such constrains. Furthermore, these names are read the same backward as forward. Hence, develop Context Free Grammar, which only identifies such class names.
2)
Prepare the Non-Deterministic Push-Down Automaton to identify all class names that fall under the convention mentioned in question 1
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