Based on the following grammar, generate a sentence by derivation . The sentence
ID: 3744489 • Letter: B
Question
Based on the following grammar, generate a sentence by derivation. The sentence cannot be int x, y; int sum; char a, b, c, n;
<Var_Dcls> -> <Var_Dcl> | <Var_Dcls> <Var_Dcl>
<Var_Dcl> -> <Type> <Vars> ;
<Var> => <Var>, <Var> | <Var>
<Type> -> int | char
<Var> -> x | y | sum | a | b | c | n
Explanation / Answer
-> -> ; -> , ; -> , , ; -> , , , ; -> , , , n ; -> , , c, n ; -> , b, c, n ; -> a, b, c, n ; -> char a, b, c, n ; -> char a, b, c, n ; -> ; char a, b, c, n ; -> sum ; char a, b, c, n ; -> int sum ; char a, b, c, n ; -> int sum ; char a, b, c, n ; -> ; int sum ; char a, b, c, n ; -> , ; int sum ; char a, b, c, n ; -> , y ; int sum ; char a, b, c, n ; -> x, y ; int sum ; char a, b, c, n ; -> int x, y ; int sum ; char a, b, c, n ;Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.