Pearson eText for Concepts of Programming Languages -- Instant Access (Pearson+)
Pearson eText for Concepts of Programming Languages -- Instant Access (Pearson+)
12th Edition
ISBN: 9780135102268
Author: Robert Sebesta
Publisher: PEARSON+
Expert Solution & Answer
Book Icon
Chapter 3, Problem 15PS

Explanation of Solution

Consider the following BNF:

<program> -> begin <stmt_list> end

<stmt_list> -> <stmt>

  | <stmt> ; <stmt_list>

<stmt> -> <var> = <expression>

<var>- A | B | C

<expression> - <var> + <var>

  |<var> - <var>

  |<var>

Conversion of the given BNF into the EBNF is as follow:

Enclosing an entity in curly braces indicates that it can be used indefinitely or left altogether as stated in section 3.3.2 of the book.

  • So <stmt_list> can be defined as <stmt> or {<stmt>} use indefinitely after a <stmt>.
  • Therefore, write the first two productions as:

<program> -> begin <stmt_list> end

<stmt_list> -> <stmt>{<stmt>}

  • The next two productions are same as given since no EBNF rule applies to them...

Blurred answer
Students have asked these similar questions
A strongly-typed data type implementation supports strongly-typed data, whereas a loosely-typed data type implementation supports loosely-typed data.
Define pseudodirect.
Using the functional dependencies of Exercise 7.6, compute the canonicalcover Fc.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education