Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 - Write A Context Free Grammar In BNF (15 points) You are designing the syntax for a new language. The language is object oriented

image text in transcribed

1 - Write A Context Free Grammar In BNF (15 points) You are designing the syntax for a new language. The language is object oriented and the following example presents the definition of a class. In this example "my_class_name" is the name of the class that can be created by the programmer and it can be any name consisting of alphanumeric characters and underscores. In the parentheses, the programmer can define multiple variables separated by commas. A variable name can consist of any combination of alphanumeric characters and underscores. In the curly brackets the programmer can write any statement from the language. At this point the requirement for statements are not ready yet. Therefore, we do not need to write grammar rules for the statements, we only use a non-terminal to indicate their existence. The word "defclass" is a keyword in the language. Variable names or class name can be of any length. Write BNF rules to specify the class definition in this language. Here is an example of such definition: defclass my_class_name (width, length) : { statements } 1 - Write A Context Free Grammar In BNF (15 points) You are designing the syntax for a new language. The language is object oriented and the following example presents the definition of a class. In this example "my_class_name" is the name of the class that can be created by the programmer and it can be any name consisting of alphanumeric characters and underscores. In the parentheses, the programmer can define multiple variables separated by commas. A variable name can consist of any combination of alphanumeric characters and underscores. In the curly brackets the programmer can write any statement from the language. At this point the requirement for statements are not ready yet. Therefore, we do not need to write grammar rules for the statements, we only use a non-terminal to indicate their existence. The word "defclass" is a keyword in the language. Variable names or class name can be of any length. Write BNF rules to specify the class definition in this language. Here is an example of such definition: defclass my_class_name (width, length) : { statements }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

Students also viewed these Databases questions

Question

What are the organizations task goals on this issue?

Answered: 1 week ago