Write a context-free grammar for arithmetic expressions

Assignment Help Data Structure & Algorithms
Reference no: EM13327397

Write a context-free grammar for arithmetic expressions consisting of non-negative binary integer numbers defined in Activity 1 and four operators, + (addition), -(subtraction), * (multiplication), and / (division). No precedence or associativity need to be considered in the grammar. In addition, no parentheses can be used in expressions. For example, (10 - 1) * 101 is not acceptable. The regular grammar you have obtained in Activity 1 should be included as part of your solution. Turn in your solution by the date when Section 12.2 is finished.

Transform the context-free grammar obtained in Activity 5 to a pushdown automaton using the algorithm in Section 12.2.2. Turn in your solution by the date when Section 12.3 is finished.

Write parsers for arithmetic expressions. Transform your grammar into a LL(1) grammar. You may need to do a left-factoring of common prefix of productions, and/or to remove any left-recursive productions in the grammar for aritmetic

expressions using the algorithm in Section 12.3.1. Then write a recursive-descent parser for the context-free grammar for arithmetic expressions using the algorithm in Section 12.3.1.

Turn in your solution by the date when Section 12.4 is finished.

Reference no: EM13327397

Questions Cloud

Compute the company manufacture overhead budget : Constructure the company manufactureing overhead budget for the upcoming fiscal yr and i need to compute the company manufacture overhead budget rate include variable and fixed manufacturing overhead for the upcoming fiscal yr round off to the near..
For how much more time was the ball in flight : On the Apollo 14 mission to the moon, astronaut Alan Shepard hit a golf ball with a 6 iron. For how much more time was the ball in flight
Prepare a production budget for the third quarter : Prepare a production budget for the third quarter showing the number of units to be produced each month and for the quarter in total.
What is the new price of the stock : Construct a balance sheet after a two for one stock split. What will be the new price of the stock and construct a balance sheet after a 5% stock dividend. What is the new price of the stock?
Write a context-free grammar for arithmetic expressions : Transform the context-free grammar obtained in Activity 5 to a pushdown automaton using the algorithm in Section 12.2.2. Turn in your solution by the date when Section 12.3 is finished.
What is the magnitude of the velocity of the airplane : A jet airplane flying from Darwin, Australia, has an air speed of 256 m/s in a direction 5.0° south of west. What is the magnitude of the velocity of the airplane relative to earth
Identify the potential sales and department store : Identify the potential sales and department store transactions that can be stored within the database and design a database solution and the potential business rules that could be used to house the sales transactions of the department store.
Will the price paid by the consumer be reduced : What happens when supply is totally elastic or totally inelastic, and a subsidy is given by the government: Will the producer change the amount of units he’s supplying to the market? And will the price received by the producer be reduced
What is the impedance at the resonant frequency : A 190-?F capacitor and a 80m H inductor are in series with a 105 ? resistor. What is the impedance at the resonant frequency

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Design and implement an avl tree algorithm

Design and implement an AVL tree algorithm that searches a collection of documents. You will be provided with a set of 50 documents and a set of sample queries. First, you will process the documents and store their content (i.e. words / tokens) in..

  Creating the table showing decimal value

Assume if the last digit of a 2's complement binary number is 0, then number is even. If the last two digits of a 2's complement binary number are 00

  The binary search algorithm

- The "origin" of the Cartsian plane in math is the point where x and y are both zero. Declare a variable of type POINT named origin and set its data dields consistent with the mathematical notion of "origin".

  Analyze the time-space complexity of algorithms

How a vEB tree can be used to support these three operations and analyze the time/space complexity of your algorithms.

  Design and build a prototype data warehouse

Design and build a prototype data warehouse using the data on Spend over £500 in the Department of Energy and Climate Change for the financial year 2012-2013 (April 2012 to March 2013 inclusive).

  Creating flowchart to compute and print the total sale

A coorporation's salesman are selling toothpaste and tooth powder. The corporation having fifty salesman gives 10% commission on the sale of toothpaste and 20 percent commission on tooth powder.

  Pseudocode for divide-and-conquer algorithm

Write a pseudocode for a divide-and-conquer algorithm for finding the position of the largest element in an array of n numbers.

  Algorithm-find schedule to obtain maximum amount of profit

Give an algorithm to find schedule which obtains maximum amount of profit, assuming that all processing times are integers between 1 and n.

  Creating an interactive java program

Create an interactive Java program that illustrates the use of constructors, methods, loops and arrays.

  An undirected graph g is called bipartite

An undirected graph G is called bipartite if its vertices can be partitioned into two sets X and Y such that every edge in G has one end vertex in X and one end vertex in Y

  Sketch dynamic programming tables for knapsack problem

Sketch Dynamic Programming Tables (one for calculating optimal value and one for keeping track of items used in getting optimal value) for 0/1 Knapsack Problem given below and illustrate your final result.

  Implement the boyer-moore algorithm using any program

Implement the Boyer-Moore algorithm using any programming language you prefer.

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd