Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5. (21 pts) Consider the following grammar for a declaration list: decl list decl ; decl-list | decl specifier type name-list specifier | static Etype
5. (21 pts) Consider the following grammar for a declaration list: decl list decl ; decl-list | decl specifier type name-list specifier | static Etype double | int name list- name | name , name list name - id args args--( decl-list ) | const (4 pts) Indicate whether each of the following strings belongs to the language described by the grammar. int a (int b); int c (int d (int e;);); double f, g (static int h;); static int i; const double j; (b) (7 pts) Show a leftmost derivation of the string static int f); under this grammar. (c) (10 pts) Rewrite the grammar so that arguments are separated by commas (similar to the function arguments in C). For instance, each of the following should be a valid string under the new grammar: int f D int f (double x); int f (double x, int y)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started