0 votes 0 votes For the below SDT, what will be the output for the input string aaacb? S → aAa {print "0"} S → b {print "1"} A → Sc {print "2"} How to approach as S→ aAa then how we will get the string aaacb . Compiler Design syntax-directed-translation compiler-design test-series + – Akanksha Kesarwani asked Dec 20, 2015 edited Jul 18, 2022 by makhdoom ghaya Akanksha Kesarwani 1.5k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply ManojK commented Dec 20, 2015 reply Follow Share wrong qus string aaacb can not be generated i.e. you can,t generate odd no of a,s. 0 votes 0 votes LeenSharma commented Apr 24, 2017 reply Follow Share yes,aaacb can't be generated from this grammar. 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes String aaacb cannot be generated from the given Grammer Abhijit Borah answered Dec 27, 2015 Abhijit Borah comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Given input String is aaacb can't be generated from the above grammar since in the input string the number of a's are odd and according to the given grammar it can only produce even number of a's. Thus given input string is not generated from the above grammar. Shubhanshu answered Feb 27, 2017 Shubhanshu comment Share Follow See all 0 reply Please log in or register to add a comment.