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

  Use a circular linked list to implement the queue

use a circular linked list to implement the queue data structure as described in java

  Creating java programming scripts

Discuss how does a programmer typically get access to a Graphics object when coding an applet?

  Program development cycle for algorithm using pseudocode

Illustrate all your work. Use modular approach to solving this problem. Give the following submodule. Calculations - module to compute gross pay. Using the Program Development Cycle, develop an algorithm using pseudocode for the following task.

  Describe ambiguity in proposed algorithm

Describe the distinction between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm. Describe how the use of primitives helps remove ambiguities in an algorithm's representation.

  Determine the values for m and l for the b+ tree

A B+-tree is to be stored on disk whose block size is 2048 bytes. The data records to be stored are 50 bytes, and their key is 4 bytes. Determine the values for M and L for the B+-tree. Assume pointers are 4 bytes each.

  Creating a method find ranks in java

Create a method findRanks in Java that accepts an unsorted array of integers vals, and starting and ending rank start and end, numbering ranks from 0,

  System analyst

A huge, well regarded supplier of key raw materials to your corporation's production process requires a year-end summary report of totals purchased from it.

  Returns true if a string contains properly nested

Give an algorithm that returns true if a string contains properly nested and balanced parentheses, and false if otherwise. Hint: At no time while scanning a legal string from left to right will you have encountered more right parentheses than left..

  Create algorithm which takes as inputs matrices

Create the algorithm which takes as inputs, matrices C, D, and vertex indices i and j, and returns minimum-cost path from vertex i to vertex j.

  Determine effective transfer rate

Assume a network transmits 1024 byte packets having a 128-byte header and a four byte checksum. If a workstation on the network is guaranteed to be able to transmit one packet every x time units,

  Tree walk algorithm

We know how the regular tree walk algorithm works. If you have some values in the tree then the tree walk algorithm prints everything in order

  Give algorithm-correctness proof-time complexity for tree

Determine the minimum number of nodes in tree to remove so that the tree is separated into subtrees of sizes at most k. Give the algorithm, the correctness proof and the time complexity.

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