Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Compiler Design
Q1. Sometimes it is necessary to modify the syntax of a programming language. This is done by changing the CFG that the language uses. What changes would have to be made to ac's CFG (Figure) to implement the following changes?
(a) All ac programs must contain at least one statement.(b) All integer declarations must precede all float declarations.(c) The first statement in any ac program must be an assignment statement. Q2. Extend the ac scanner (Figure) in the following ways:
(a) A floatdcl can be represented as either f or float, allowing a more Java-like syntax for declarations.(b) A intdcl can be represented as eitheri or int.(c) A num may be entered in exponential (scientific) form. That is, an ac num may be suffixed with an optionally signed exponent (1.0e10, 123e-22 or 0.31415926535e1). Q3. Figure scans an input stream for an inum or fnum based on the regular expressions for those patterns shown in Figure. The code in Figure does not check for errors.
(a) Where could errors occur in Figure?(b) For each error, what action would you take should the error occur?
Create a Mealy Machine which produces the output of 1 whenever discrepancy in above pattern is detected, and produces the output of 0 otherwise. Write states meaningful names.
Create the Mealy type state machine with input X and output Y. Y must be 1 whenever sequence 110 or 101 has been detected on X on last 3 consecutive rising clock edges.
Give a construction that assumes you are given a DFA for L and show how to construct an NFA (with or without ε-moves) to recognize sort(L).
We know by rice's theorem that none of the following problems are decidable. However,are they recursively enumerable,or non-RE? IS L(M) infinite?
SSB has an advantage over AM with respect to efficiency and power gain. Why, then, is AM commercial broadcast being replaced with SSB transmission?
Create and DFA or LR(0) items for this grammar. Is this grammar LR(0) parsing table? If not, explain LR(0) conflict. If so create LR(0) parsing table.
Create a standard 1-tape Turing machine M to calculate the function sub3. Specifically, calculate sub3 of a natural number represented in binary.
Write down the algorithm for finding useless/productive nonterminals. Describe how this gives you the algorithm for whether language generated by grammar is empty.
Write a program would read two numbers and then print all numbers between the first and the second, inclusive. Design unambiguous grammar to parse expressions
Write a grammar for the language consisting of strings that have n copies of the letter a followed by same number of copies of the letter b, where n>0
What does the term solvable mean to you? What does it mean to say that "you solved a problem"? Determine examples of problems for which you believe there are no solutions.
Describe why every nonempty propositional clause, by itself, is satisfiable. Prove rigorously that every set of five 3-SAT clause is satisfiable, given that each clause mentions exactly three distinct variables.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd