4 votes 4 votes The number of tokens in the following expression is what? + * * * < = & > { - + + + } ( >> ) + & & Compiler Design compiler-design + – Arnabi asked Jan 19, 2017 Arnabi 587 views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply Tendua commented Jan 19, 2017 reply Follow Share i think 17 4 votes 4 votes Arnabi commented Jan 19, 2017 reply Follow Share this is the solution they have given. The number of tokens in the expression is = 16. I have a doubt we could have taken *,*, * instead of ** and *? 0 votes 0 votes sudsho commented Jan 19, 2017 reply Follow Share ^ ** is not defined in C..they will be treated as 2 different tokens 2 votes 2 votes Rahul Jain25 commented Jan 19, 2017 reply Follow Share @sudhsho what about &&?? 0 votes 0 votes sudsho commented Jan 19, 2017 reply Follow Share its defined ..hence one token whatever operators are defined in C they will be treated as one single token..unless they say we are designing a compiler for java or somethig else..by default we assume C only.. 3 votes 3 votes Arnabi commented Jan 19, 2017 reply Follow Share okay sudhso thank you..:) 1 votes 1 votes Aboveallplayer commented Jan 19, 2017 reply Follow Share why not ** defined. a pointer to a pointer can be assigned in this way..but in normal.it is not 0 votes 0 votes sudsho commented Jan 19, 2017 reply Follow Share ^ is ** defined in operator table? http://www.difranco.net/compsci/C_Operator_Precedence_Table.htm 1 votes 1 votes Arnabi commented Jan 19, 2017 reply Follow Share Sudsho if it was ++++ we would have taken ++ and ++ as two tokens and not +.am I right or wrong? 0 votes 0 votes sudsho commented Jan 19, 2017 reply Follow Share yes right..longest matching rule is followed everytime....why this happening? because we give all the regular expressions for keywords,identifiers,operators etc in the beginning itself to our lexical analyser...it will do patttern matching thereafter... 3 votes 3 votes Arnabi commented Jan 19, 2017 reply Follow Share okay..:) 1 votes 1 votes Please log in or register to add a comment.