Draw a parse tree for a sentence in the grammar

Assignment Help Computer Engineering
Reference no: EM131251069

I. Evaluate

a) + * 5 + * 4 7 2 3
b) * + 3 + * 2 4 7 9
c) + * + * 7 2 8 6 2

II. Given the BNF rules:

<S> ::= <NP> <VP> <DO> | <NP> <VP> <DO>
<NP> ::= <ART> <ADJ> <N> | <ART> <N>
<DO> ::= <ART><DO> | <ADJ><DO> | <N>
<VP> ::= <V> | <ADVP> <VP>
<ADVP> ::= <ADV> | <ADV> <ADVP>
<ART> ::= the | a | an
<N> ::= girl | dog | man | truck
<ADJ> ::= big | short | hairy | red
<ADV> ::= sadly | quickly | slowly
<V> ::= ran | fled | sank

a) Draw a parse tree for a sentence in this grammar which only uses a terminal once.

b) Draw a second tree which uses different options for at least two nonterminals.

The differences between this parse tree and the preceding one are shown in red pencil.

III. Write a LISP function COUNT that finds the number of times x occurs in a list of integers.

(COUNT 7 ‘(7 5 9 7 3 6 7)) returns 3.

IV. Write a LISP function (DIFFERENCE X Y) that returns all the elements in Y that are not in X. (DIFFERENCE ‘(3 5 7 9) ‘(1 3 5 6 8 9)) returns (1 6 8).

Reference no: EM131251069

Questions Cloud

Restaurant bill calculator : A restaurant wants an app that calculates a table's bill. The app should display all the menu items from Fig. 15.53 in four ComboBoxes. Each ComboBox should contain a category of food offered by the restaurant (Beverage, Appetizer, Main Course and..
Application-copyright and its various owner rights : The Internet has facilitated exposure for a multitude of industries, artists, and products. However, inherent challenges exist when attempting to protect ownership. If users have access to someone else's media and documents, should they be able to..
Application-jurisdictional aspects of cybercrime : You are using your wireless device to locate a restaurant. Suddenly, a large flashing skull-and-crossbones appears on your screen and a menacing laugh plays. Seconds later your device has been wiped clean. You are the victim of a cybercrime. If ca..
Assess the role of financial statements : Assess the role of financial statements in evaluating the overall performance of an organization. - Analyze business financial statements by using key financial performance indicators and industry benchmarks.
Draw a parse tree for a sentence in the grammar : Draw a parse tree for a sentence in this grammar which only uses a terminal once. Draw a second tree which uses different options for at least two nonterminals.
Issues of cloud based accounting information systems : The assessment task is to write a research report using academic journal articles that will address the issues of cloud based accounting information systems adoption in business organisations.
Average accounting performance : Using the information provided, calculate this firm's ROA, ROE, gross profit margin, and quick ratio. If this firm's WACC is 6.6% and the average firm in its industry has an ROA of 8%, is this firm earning above or below normal economic performance a..
Delivering business value with it at hefty hardware : Read the mini-case, Delivering Business Value with IT at Hefty Hardware, at the end of Section 1 of your textbook, then complete a well-written paper responding to the two discussion questions at the end of the mini-case.
Power plant on gilligans island is producing air pollution : Your power plant on Gilligan's Island is producing too much air pollution. -provide Excel document showing all calculation in appendixes choose the best option for Gilligan's Island.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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