There are often many correct answers. a. The set of all strings consisting of zero or more as. b. The set of all strings consisting of an uppercase letter followed by zero or more additional characters, each of which is either an uppercase letter or one of the digits 0 through 9. c. The set of all strings consisting of one or more as. d. The set of all strings consisting of one or more digits. (Each digit is one of the characters 0 through 9.) e. The set of all strings consisting of zero or more as with a semicolon after each one. use only f. The set of all strings consisting of the keyword begin, followed by zero or more statements with a semicolon after each one, followed by the keyword end. Use the non-terminal for statements, and do not give pro- ductions for it. g. The set of all strings consisting of one or more as with a semicolon after each one. h. The set of all strings consisting of the keyword begin, followed by one or e more statements with a semicolon after each one, followed by the keyword end. Use the non-terminal for statements, and do not give pro- ductions for it. wu@fainie i. The set of all strings consisting of one or more as, with a comma between each a and the next. (There should be no comma before the first or after the last.)

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 4PP: (Useful utility) Modify the program written for Exercise 3 to search for the first occurrence of a...
icon
Related questions
Question

Give a BNF and an EBNF grammar for each of the languages:

Please do parts h,i,j

There are often many correct answers.
a. The set of all strings consisting of zero or more as.
e
b. The set of all strings consisting of an uppercase letter followed by zero or
20
more additional characters, each of which is either an uppercase letter or one
NUC of the digits 0 through 9.
c. The set of all strings consisting of one or more as.
d. The set of all strings consisting of one or more digits. (Each digit is one of the
characters 0 through 9.)
e. The set of all strings consisting of zero or more as with a semicolon after each
one.
al use only,
f. The set of all strings consisting of the keyword begin, followed by zero or
more statements with a semicolon after each one, followed by the keyword
end. Use the non-terminal <statement> for statements, and do not give pro-
ductions for it.
g. The set of all strings consisting of one or more as with a semicolon after each
one.
h. The set of all strings consisting of the keyword begin, followed by one or e
more statements with a semicolon after each one, followed by the keyword
end. Use the non-terminal <statement> for statements, and do not give p
ductions for it.
pro-10
i. The set of all strings consisting of one or more as, with a comma between
each a and the next. (There should be no comma before the first or after the
last.)
Transcribed Image Text:There are often many correct answers. a. The set of all strings consisting of zero or more as. e b. The set of all strings consisting of an uppercase letter followed by zero or 20 more additional characters, each of which is either an uppercase letter or one NUC of the digits 0 through 9. c. The set of all strings consisting of one or more as. d. The set of all strings consisting of one or more digits. (Each digit is one of the characters 0 through 9.) e. The set of all strings consisting of zero or more as with a semicolon after each one. al use only, f. The set of all strings consisting of the keyword begin, followed by zero or more statements with a semicolon after each one, followed by the keyword end. Use the non-terminal <statement> for statements, and do not give pro- ductions for it. g. The set of all strings consisting of one or more as with a semicolon after each one. h. The set of all strings consisting of the keyword begin, followed by one or e more statements with a semicolon after each one, followed by the keyword end. Use the non-terminal <statement> for statements, and do not give p ductions for it. pro-10 i. The set of all strings consisting of one or more as, with a comma between each a and the next. (There should be no comma before the first or after the last.)
Expert Solution
Step 1

Introduction

BNF:

A formal method of defining a languages and its grammar is the Backus-Naur Form (BNF). It is a method of notation used to represent a language's grammar, which is frequently described in terms of a collection of production rules.

BNF is a common notation that is used in numerous disciplines, including computer programming, linguistics, and mathematics, to explain the grammar of languages. Computer languages are frequently used to describe it as well. When describing a language's syntax using BNF, a set of production rules is used to describe how non-terminal symbols can be changed to terminal symbols.

EBNF:

Extended Backus-Naur Form, or EBNF, is a meta-notation for constructing formal languages. John Backus created it in 1959 as a way to describe a context-free grammar. In computer engineering and linguistics, the EBNF notation is frequently used to specify grammar rules for programming languages or natural languages. It is made up of a collection of guidelines known as production rules that can be applied to produce strings that are a component of the language under consideration.

Programming languages like C, Java, and Python as well as common languages like English have had their syntax defined using EBNF. It can be used to specify the syntax of complex languages because it is a highly strong and expressive notation.

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ASCII Codes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr