A show how this grammar can be generalized to permit n


The following grammar generates declarations for a single identifier:

a) Show how this grammar can be generalized to permit n options Ai. I ≤: i es n. each of which can be either a, or bj

b) The above grammar permits redundant or contradictory declarations such as We could insist that the syntax of the language forbid such declarations. We are tbus left with a finite number of token sequences that are syntactically correct. Obviously these legal declarations form a context-free language. indeed a regular set. Write a grammar for declarations with n options, each option appearing at most once.

c) Show that a grammar for part (b) must have at least 2" symbols. d) What does (c) say about the feasibility of enforcing nonredundancy and noncontradiction among options in declarations via the syntactic definition of a language?

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: A show how this grammar can be generalized to permit n
Reference No:- TGS01477221

Expected delivery within 24 Hours