Let G = (V,,R, hSTMTi) be the following grammar. G is a natural-looking grammar for a fragment
Question:
Let G = (V,,R, hSTMTi) be the following grammar.
G is a natural-looking grammar for a fragment of a programming language, but G is ambiguous.
a. Show that G is ambiguous.
b. Give a new unambiguous grammar for the same language.
Transcribed Image Text:
(STMT) → (ASSIGN) | (IF-THEN) | (IF-THEN-ELSE) (IF-THEN) if condition then (STMT) (IF-THEN-ELSE) → if condition then (STMT) else (STMT) (ASSIGN) → a:=1 E= {if, condition, then, else, a:=1} V = {{STMT), (IF-THEN), (IF-THEN-ELSE), (ASSIGN)}
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 50% (8 reviews)
Answered By
Ashington Waweru
I am a lecturer, research writer and also a qualified financial analyst and accountant. I am qualified and articulate in many disciplines including English, Accounting, Finance, Quantitative spreadsheet analysis, Economics, and Statistics. I am an expert with sixteen years of experience in online industry-related work. I have a master's in business administration and a bachelor’s degree in education, accounting, and economics options.
I am a writer and proofreading expert with sixteen years of experience in online writing, proofreading, and text editing. I have vast knowledge and experience in writing techniques and styles such as APA, ASA, MLA, Chicago, Turabian, IEEE, and many others.
I am also an online blogger and research writer with sixteen years of writing and proofreading articles and reports. I have written many scripts and articles for blogs, and I also specialize in search engine
I have sixteen years of experience in Excel data entry, Excel data analysis, R-studio quantitative analysis, SPSS quantitative analysis, research writing, and proofreading articles and reports. I will deliver the highest quality online and offline Excel, R, SPSS, and other spreadsheet solutions within your operational deadlines. I have also compiled many original Excel quantitative and text spreadsheets which solve client’s problems in my research writing career.
I have extensive enterprise resource planning accounting, financial modeling, financial reporting, and company analysis: customer relationship management, enterprise resource planning, financial accounting projects, and corporate finance.
I am articulate in psychology, engineering, nursing, counseling, project management, accounting, finance, quantitative spreadsheet analysis, statistical and economic analysis, among many other industry fields and academic disciplines. I work to solve problems and provide accurate and credible solutions and research reports in all industries in the global economy.
I have taught and conducted masters and Ph.D. thesis research for specialists in Quantitative finance, Financial Accounting, Actuarial science, Macroeconomics, Microeconomics, Risk Management, Managerial Economics, Engineering Economics, Financial economics, Taxation and many other disciplines including water engineering, psychology, e-commerce, mechanical engineering, leadership and many others.
I have developed many courses on online websites like Teachable and Thinkific. I also developed an accounting reporting automation software project for Utafiti sacco located at ILRI Uthiru Kenya when I was working there in year 2001.
I am a mature, self-motivated worker who delivers high-quality, on-time reports which solve client’s problems accurately.
I have written many academic and professional industry research papers and tutored many clients from college to university undergraduate, master's and Ph.D. students, and corporate professionals. I anticipate your hiring me.
I know I will deliver the highest quality work you will find anywhere to award me your project work. Please note that I am looking for a long-term work relationship with you. I look forward to you delivering the best service to you.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Let G be the following grammar: a. Show that L(G) = {w w contains equal numbers of as and bs}. Use a proof by induction on the length of w. b. Use the DK-test to show that G is a DCFG. c. Describe a...
-
Let G 1 be the following grammar that we introduced in Example 2.45. Use the DK-test to show that G 1 is not a DCFG. R S | T S aSb | ab T aT bb | abb
-
Let G = (V, , R, S) be the following grammar. V = {S, T, U}; = {0, #}; and R is the set of rules: S T T | U T 0T | T 0 | # U 0U00 | # a. Describe L(G) in English. b. Prove that L(G) is not...
-
Reid Corporation's balance sheet at January 1, 20X9 reflected the following balances: Cash & Receivables $ 30,000 Inventory $ 75,000 Land $125,00 Building & Equipment (net) $850,000 Common Stock...
-
A second employee of the computer store in Problem 57 is paid a base salary of $3,000 a month plus a 5% commission on all sales during the month. (A) How much must this employee sell in one month to...
-
What four fundamental factors affect the cost of money? AppendixLO1
-
1 Which team was right and why?
-
Daniel agreed to erect an apartment building for Steven for $12 million and that Daniel would suffer a deduction of $12,000 per day for every day of delay. Daniel was twenty days late in finishing...
-
The following information concerns production in the Baking Department for March. All direct materials are placed in process at the beginning of production. ACCOUNT Work in ProcessBaking Department...
-
In a list of 15 households, 9 own homes and 6 do not own homes. Four households are randomly selected from these 15 households. Find the probability that the number of households in these 4 who own...
-
Show that if G is a CFG in Chomsky normal form, then for any string w L(G) of length n 1, exactly 2n 1 steps are required for any derivation of w.
-
Give unambiguous CFGs for the following languages. a. {w| in every prefix of w the number of as is at least the number of bs} b. {w| the number of as and the number of bs in w are equal} c. {w| the...
-
Write a Lewis structure of the hydroxylamine molecule, H 2 NOH. Then, with data from Table 10.2, determine all the bond lengths. Table 10.2 TABLE 10.2 Some Average Bond Lengthsa Bond Length, pm 74.14...
-
Service provides commercial and industrial appraisals and feasibility studies. On January 1 , the assets and liabilities of the business were the following: Cash, \(\$ 8,700\); Accounts Receivable,...
-
Sketch the mapping of the value chain for: a A consulting firm b An airline c A trading firm d A corporate and investment bank e An internet-based platform (e.g. Airbnb, Netflix)?
-
Red River Banking Company has ten automatic i) AND teller machines (ATMs) spread throughout the city maintained by the ATM Department. You have been assigned the task of determining the cost of...
-
Super Day Spa provided \(\$ 120,000\) of services during 2012. All customers paid for the services with credit cards. Super submitted the credit card receipts to the credit card company immediately....
-
The following data represent the height of 26 statistics students as measured in inches: a. Create a frequency table for these data. b. Create a histogram for these data with an interval width of 1...
-
Draw a flowchart that corresponds to the program segment of Exercise 37. Data from Exercise Write pseudocode that will average a list of numbers input by the user. Use the following variables: ...
-
If the cylinder described in Problem 21.3 were initially heated to 500F, how long would it take for the center of the cylinder to cool to 240F if it were constructed of a. Copper? b. Brass? c. Nickel?
-
Write a comparator for nonnegative integers that determines order based on the number of 1s in each integers binary expansion, so that i < j if the number of 1s in the binary representation of i is...
-
Explain how the k largest elements from an unordered collection of size n can be found in time O(nlogk) using O(k) auxiliary space.
-
Tamarindo Airlines wants to give a first-class upgrade coupon to their top logn frequent flyers, based on the number of miles accumulated, where n is the total number of the airlines frequent flyers....
-
Required information [The following information applies to the questions displayed below.] Dain's Diamond Bit Drilling purchased the following assets this year. Asset Drill bits (5-year) Drill bits...
-
Which of the following partnership items are not included in the self-employment income calculation? Ordinary income. Section 179 expense. Guaranteed payments. Gain on the sale of partnership...
-
Phantom Consulting Inc. is a small computer consulting business. The company is organized as a corporation and provides consulting services, computer system installations, and custom program...
Study smarter with the SolutionInn App