2 votes 2 votes I think answer should be 13. We got 13 tokens printf ( "string" ++ & & * * * a ) ; Compiler Design testbook-test-series compiler-design lexical-analysis compiler-tokenization numerical-answers + – Akash Kanase asked Jan 19, 2016 • retagged Jun 29, 2022 by Lakshman Bhaiya Akash Kanase 1.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 6 votes 6 votes printf ( "string" , ++ & & * * * a ) ; 12 tokens sonu answered Jan 19, 2016 • selected Dec 19, 2016 by Aboveallplayer sonu comment Share Follow See all 2 Comments See all 2 2 Comments reply Akash Kanase commented Jan 20, 2016 reply Follow Share Well you can not take && as single lexeme, because in this statement logical And is not there, instead it is dereference operator, which is single symbol ! It should be '&' '&' two different lexemes ! 0 votes 0 votes Sumit1311 commented Jan 20, 2016 reply Follow Share I think operators are identified as lexemes in lexical analysis, don't they? As per this link : http://fresh2refresh.com/c-programming/c-tokens-identifiers-keywords/ There are six types of tokens in C language. So, if we take the longest sequence to match then both && and ++ would be considered as operator in lexical analysis phase. 1 votes 1 votes Please log in or register to add a comment.
3 votes 3 votes My answer is shivanisrivarshini answered Jan 19, 2016 • edited Jan 19, 2016 by shivanisrivarshini shivanisrivarshini comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments shivanisrivarshini commented Jan 20, 2016 reply Follow Share @sumit1311 ?? 0 votes 0 votes Sumit1311 commented Jan 20, 2016 reply Follow Share Yes. exactly. 0 votes 0 votes shivanisrivarshini commented Jan 20, 2016 reply Follow Share @ sumit1311 Are these not lexemes ? you mean ?? 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes answer is 11 abhishek14893 answered Oct 19, 2016 abhishek14893 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes 11 is the correct answer bcz when two consecutive ** are present then count as a ^ pritambiswas000007 answered Jun 9, 2020 pritambiswas000007 comment Share Follow See all 2 Comments See all 2 2 Comments reply shaurabhpatel47 commented Sep 26, 2020 reply Follow Share NO, each * considered as separately. 0 votes 0 votes shaurabhpatel47 commented Sep 26, 2020 reply Follow Share 12 is the right answer. 0 votes 0 votes Please log in or register to add a comment.