1. What are the advantages of grammars for compilers?
Performance of Compilers [25 pts.] In this question, we are given two different compilers with name Batman and Robin that are tested for 1 GHz. machine with 3 classes of instructions: Class Bane, Class Dent and Class Penguin that requires 1, 2 or 3 cycles respectively. We have a huge line of code and we will compare the performance of these compilers. Batman Robin Bane Instructions 10 million 20 million Dent Instructions 3 million 1 million Penguin Instructions 2 million...
Question 2 Performance of Compilers [25 pts.) In this question, we are given two different compilers with name Batman and Robin that are tested for 1 GHz. machine with 3 classes of instructions: Class Bane, Class Dent and Class Penguin that requires 1, 2 or 3 cycles respectively. We have a huge line of code and we will compare the performance of these compilers. Batman Robin Bane Instructions 10 million 20 million Dent Instructions 3 million 1 million Penguin Instructions...
What is are recursive grammars? What is direct left recursion? What is the Pairwise Disjointness Test? What is left factoring? Example all them with examples.
What is the relation of context-free grammars and a Deterministic Pushdown Automata? Can a Deterministic Pushdown Automata recognize a regular language?
Compilers can have a profound impact on the performance of an application. Assume that for a program, compiler A results in an instruction count of 1.0E9 and has an execution time of 1.1s, and compiler B results in an instruction count of 1.2E9 and 1.5s a. Find the average CPI for both compilers assuming a clock cycle time of 1ns. b. Another Compiler C creates for the same code on 6.0E8 instructions, and has an average CPI of 1.1. What...
1. Check if two regular grammars with the following sets of productions: are equivalent (i.e. if they generate the same languages) by finding equivalent minimal de- terministic automata and checking if they are isomorphic, i.e., is they are the same except of state names
1. Write grammars for: a. anb2n b. abna :n is multiple of 3 c. an b an+1 d. C proc def: <type> id ( param_list ) where a param_list is 0 or more declarations of form “<type> id ;”
1. [10 Points Convert the following grammars into Chomsky Normal Form. (a) S → AaB | BAC A AaB | BA B → ABaC BACC C → Cb CaА | 6C (b) S XSX a Ab | bAa A + XAXX X + ab
1. What are the disadvantages and what are the advantages of dynamic type-binding? 2. What are the disadvantages and what are the advantages of static type-binding?
2. (10 points) Use the pumping lemma for context free grammars
to show the following languages are not context-free.
(a) (5 points)
.
(b) (5 points)
L = {w ◦ Reverse(w) ◦ w | w ∈ {0,1}∗}.
I free grammar for this language L. lemma for context free grammars to show t 1. {OʻPOT<)} L = {w • Reverse(w) w we {0,1}*). DA+hattha follaurino lano