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?
Argue that the following prob is NP Complete. Given list of positive integers, u1,u2,...un (in binary representation) and asked if there is partition of this set into 3 subsets, each of which has same sum.
Suppose f is a function that returns the result of reversing the string of symbols given as its input, and g. What ambiguity exists in the statement x?
Find out its grammatical structure with respect to given formal grammar. You are needed to create a parser which will check expression for allowable form.
I have noticed that there are several languages, is this because no one language has all the main elements needed to be a perfect programming Language?
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.
Consider a logic function with three outputs, A , B , and C , and three inputs, D , E , and F . The function is defined as follows: A is true if at least one input is true, B is true
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.
Use undecidability of ALLCFG to illustrate that following problem is also undecidable: Given PDA M1 and FA M2, is L(M1) = L(M2)?
Design in JFLAP a Truing machine that takes as input a tape containing a series of n 1s, Where n >= 0, terminated by an = sign.
Construct a DFA that recognizes each of the following languages. Unless otherwise noted we are assuming that ω ∈ {0,1}*. (A drawing of a state diagram is sufficient.)
Prove that L is not regular. (Be particularly careful if you use the Pumping Theorem. You must choose a w that is actually in L.)
Design a syntactic analyzer for the language specified by the grammar
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