4 votes 4 votes Is the given answer correct? Compiler Design made-easy-test-series compiler-design compiler-tokenization lexical-analysis + – Lucky sunda asked Jan 6, 2017 • edited Mar 6, 2019 by adeebafatima1 Lucky sunda 1.7k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply saurabh rai commented Feb 7, 2017 i edited by saurabh rai Feb 7, 2017 reply Follow Share it is 34 "printf("%d%d%d,a,b,c")" is 14 tokens 1 votes 1 votes bad_engineer commented Feb 7, 2017 reply Follow Share 21???? 0 votes 0 votes Ashwani Kumar 2 commented Feb 7, 2017 i reshown by Ashwani Kumar 2 Feb 7, 2017 reply Follow Share I also write 21 but made easy people counted each token of that statement individually I think their solution is wrong..!! 0 votes 0 votes Please log in or register to add a comment.
Best answer 7 votes 7 votes Total 34 "printf("%d%d%d,a,b,c")" will be considered as "printf(" % d % d % d , a , b , c ")" NOT as 1 token but as 14 token Smriti012 answered Feb 7, 2017 • selected Feb 7, 2017 by saurabh rai Smriti012 comment Share Follow See all 14 Comments See all 14 14 Comments reply Show 11 previous comments srestha commented Apr 24, 2017 reply Follow Share Where do u got that concept of 6 token? Any reference? 0 votes 0 votes LeenSharma commented Apr 25, 2017 reply Follow Share srestha may be i am wrong here but i think anything come between " " is a token.Please correct me i am wrong. 0 votes 0 votes srestha commented Apr 25, 2017 reply Follow Share yes, then how u divide inside "...." and considered it separately? Even in the selected ans of this question also considered 14 token, how? 0 votes 0 votes Please log in or register to add a comment.
10 votes 10 votes Yes 34 is correct. Gate Mission 1 answered Jan 6, 2017 Gate Mission 1 comment Share Follow See 1 comment See all 1 1 comment reply Lucky sunda commented Jan 6, 2017 reply Follow Share Thanku very much :) 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes Tokens: 1:: int 2:: main 3,4:: ( ) 5,6::{ } 7::int 8,9,10:: a,a,a 11,12,13:: b,b,b 14,15,16::c,c,c 17-24::=,,,,,;;; 25-30:: %%%ddd 31:: = 32:: + 33:: "printf(" 34:: ")" Source: http://www.personal.kent.edu/~rmuhamma/Compilers/MyCompiler/chapter3.htm Coreect me if I'm wrong! smartmeet answered Feb 7, 2017 smartmeet comment Share Follow See all 0 reply Please log in or register to add a comment.