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

  Write a program that implements the linked list

Write a program that implements the linked list Include the Node struct, the typedef NodePtr statement, and the head_insert() function Then write a main() that does these steps: creates a head for the list.

  Calculations on rows and columns of an array

Make a menu bar with a document menu that includes a Perform Action command and an Exit command. The Perform Action command calculates either the sum or the average of rows or columns in array and displays result in a message box.

  Entity relationship diagrams

Discuss why are Entity Relationship Diagrams an important initial stage in developing databases? Who would be the initial parties interacting to develop the ERDs?

  Server of local hospital to support remote access

Explain the file system that will be installed in the server of your local hospital to support remote access of data through the hospital's doctors while they are using their mobile equipments such as cellular phones or PDAs.

  Write efficient pseudocode algorithm to determine record

Write the most efficient pseudocode algorithm you can to determine the record with specific customerID if every single customer ID from 101 to 500 is used and array has 400 elements.

  Use of primitives helps remove ambiguities in algorithm

Explain 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.

  Explain benefits of isdn

Sometimes ISDNs are used in locations that do not support DSL or cable modem connections. Your selections may be analog modems or an ISDN connection in those remote locations.

  Implementing ajax programming

In the AJAX scripts construct, refer to the DSN datasource as flamingo. Even though its not in your own folder or directory, it has been set up as SYSTEM DSN, so your AJAX script will have access to it.

  Karatsuba''s divide-and-conquer algorithm

In class we discussed Karatsuba's divide-and-conquer algorithm for integer multiplication, which multiplies n-bit numbers by recursively multiplying n bit numbers. We take two numbers X and Y and split them each into their most significant half a..

  Determine how long the specific algorithms take

Some problems can be theoretically solved (we can explain the algorithm solving problem). How long does the specific algorithms take?

  Write the selection sort algorithm

Write the selection sort algorithm

  Write algorithm to find schedule obtains maximum amount

Write down algorithm to find schedule which obtains maximum amount of profit, assuming that all processing times are integers between 1 and n. Determine running time of your algorithm.

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