2 votes 2 votes The number of tokens in the following C code fragment is ________ int main() { int x = 1, y = 5, z=4; x = y, x++; y *= ++x * -z--; printf("The value is :%d",y); return 0; } Compiler Design go2025-mockgate-2 numerical-answers lexical-analysis + – gatecse asked Jan 17, 2021 • retagged Jan 17, 2021 by Lakshman Bhaiya gatecse 578 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Number of tokens here is $45.$ gatecse answered Jan 17, 2021 • edited Jan 18, 2021 by Lakshman Bhaiya gatecse comment Share Follow See all 14 Comments See all 14 14 Comments reply Show 11 previous comments Arjun commented Jan 25, 2022 reply Follow Share yes. Line 6 is having 7 tokens. 1 votes 1 votes Sunnidhya Roy commented Dec 29, 2022 reply Follow Share @gatecse @Arjun Sir longest prefix matching is done for every operator and variable names right? Hence *= is considered as a single token, One followup question is suppose the given expression was something like this :a - = b * = a; Spaces will be removed by LA phase and then it will result in a–=b*= a; and so 6 tokens right Sir? 0 votes 0 votes Genius_007 commented Jan 16 reply Follow Share @Sachin Mittal 1 pls verify it. 4 votes 4 votes Please log in or register to add a comment.