A syntax-Directed Translation scheme that takes of a's, b's and c's as input and produces as output the number of substr
Posted: Mon May 09, 2022 6:12 am
A syntax-Directed Translation scheme that takes of a's, b's and
c's as input and produces as output the
number of substrings in the input string that correspond to the
pattern a(a|b)*c+(alb)*b. For
example the translation of the input string "abbcabcababc" is
"3"
a) Write a context-free grammar that generate all strings a's, b's
and c's
b) Give the semantic attributes for the grammar symbols
c) For each production of the grammar present a set of rules for
evaluation of the semantic
attributes.
c's as input and produces as output the
number of substrings in the input string that correspond to the
pattern a(a|b)*c+(alb)*b. For
example the translation of the input string "abbcabcababc" is
"3"
a) Write a context-free grammar that generate all strings a's, b's
and c's
b) Give the semantic attributes for the grammar symbols
c) For each production of the grammar present a set of rules for
evaluation of the semantic
attributes.