Create an EBNF specification for the following language as described below. Please note that the EBNF does not indicate WHAT the keywords do, simply the syntax of the language: (in this description, keywords are in bold.) The language has a very simple syntax in which you can assign values to variables, perform basic arithmetic operations on these variables, and print the values of variables. There is no string manipulation, but there is string output. All tokens must be separated by a space or whitespace. A variable is declared by using the keyword var and then the variable name. You may only declare one variable per line. Assignment statements are in the form of a variable name, and equal sign, and then an expression that evaluates to a numeric answer. For the sake of simplicity, assume only integers and floating-point numbers (in other words, you do not need to worry about scientific notation). Variables names must start with a letter and then may contain letters, numbers, or the character. Variable names must be no longer than 63 characters. To print something, use the. keyword followed by a variable, constant, or a list of variables or constants separated by commas or semicolons. A comma indicates that you want a space between the items in the output and a semicolon means no space between the two items. You may also include strings as constants by enclosing them in double quotes. The output will automatically go to the next line unless the line ends with a comma or semicolon. The input statement is the -> operator, followed by a space and then a single variable that will receive the input. Comments begin with // and proceed to the end of the line. They must be on a line by themselves. Math operators are +- */% (modulo) and ^ (exponent) Parentheses are allowed in math expressions and behave as you would expect. You may not define functions. A program must start with the keyword begin and must end with the keyword end. These keywords must appear on lines by themselves.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I would be really thankful if you could help me out with the details. I am really confused about this assignment. And please don't copy other answers to here.

 

 

 

Create an EBNF specification for the following language as described below. Please note that the EBNF does not
indicate WHAT the keywords do, simply the syntax of the language:
(in this description, keywords are in bold.)
The language has a very simple syntax in which you can assign values to variables, perform basic arithmetic operations
on these variables, and print the values of variables. There is no string manipulation, but there is string output.
All tokens must be separated by a space or whitespace.
A variable is declared by using the keyword var and then the variable name.
You may only declare one variable per line.
Assignment statements are in the form of a variable name, and equal sign, and then an expression that evaluates to a
numeric answer. For the sake of simplicity, assume only integers and floating-point numbers (in other words, you do not
need to worry about scientific notation). Variables names must start with a letter and then may contain letters, numbers,
or the character. Variable names must be no longer than 63 characters.
To print something, use the. keyword followed by a variable, constant, or a list of variables or constants separated by
commas or semicolons. A comma indicates that you want a space between the items in the output and a semicolon
means no space between the two items. You may also include strings as constants by enclosing them in double quotes.
The output will automatically go to the next line unless the line ends with a comma or semicolon.
The input statement is the -> operator, followed by a space and then a single variable that will receive the input.
Comments begin with // and proceed to the end of the line. They must be on a line by themselves.
Math operators are + - * / % (modulo) and ^ (exponent)
Parentheses are allowed in math expressions and behave as you would expect.
You may not define functions.
A program must start with the keyword begin and must end with the keyword end. These keywords must appear on
lines by themselves.
Example program to help you check your EBNF:
// Sample program in the tiny language
begin
var x
." Input your age:";
-> X
." You are", x, "years old."
var y
y = x + 10
." In 10 years, you will be", y, "years old."
end
As you can see, this language can't do much, but it's just for an exercise.
Transcribed Image Text:Create an EBNF specification for the following language as described below. Please note that the EBNF does not indicate WHAT the keywords do, simply the syntax of the language: (in this description, keywords are in bold.) The language has a very simple syntax in which you can assign values to variables, perform basic arithmetic operations on these variables, and print the values of variables. There is no string manipulation, but there is string output. All tokens must be separated by a space or whitespace. A variable is declared by using the keyword var and then the variable name. You may only declare one variable per line. Assignment statements are in the form of a variable name, and equal sign, and then an expression that evaluates to a numeric answer. For the sake of simplicity, assume only integers and floating-point numbers (in other words, you do not need to worry about scientific notation). Variables names must start with a letter and then may contain letters, numbers, or the character. Variable names must be no longer than 63 characters. To print something, use the. keyword followed by a variable, constant, or a list of variables or constants separated by commas or semicolons. A comma indicates that you want a space between the items in the output and a semicolon means no space between the two items. You may also include strings as constants by enclosing them in double quotes. The output will automatically go to the next line unless the line ends with a comma or semicolon. The input statement is the -> operator, followed by a space and then a single variable that will receive the input. Comments begin with // and proceed to the end of the line. They must be on a line by themselves. Math operators are + - * / % (modulo) and ^ (exponent) Parentheses are allowed in math expressions and behave as you would expect. You may not define functions. A program must start with the keyword begin and must end with the keyword end. These keywords must appear on lines by themselves. Example program to help you check your EBNF: // Sample program in the tiny language begin var x ." Input your age:"; -> X ." You are", x, "years old." var y y = x + 10 ." In 10 years, you will be", y, "years old." end As you can see, this language can't do much, but it's just for an exercise.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
ADT and Class
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education