in Compiler Design
643 views
0 votes
0 votes
the no of tokens in the following exp.

x+++++y
in Compiler Design
643 views

5 Comments

apply the Maximal munch rule. Here, $x+++++y$ will be interpreted as $x++\; ++ \;\;+\; y$. So, no. of tokens are 5.

3
3
but ++ operator operates only on the variable then why not x++ + ++y?
0
0

@Anirban Chand scan left to right and apply maximal munch. check here

 

your question is discussed in Prof. Alex Aiken's compiler course but I am not getting the link now.

1
1

@ankitgupta.1729

then here token are

x

++

++

+

y

5 tokens

rt?

1
1
yes.
1
1

Please log in or register to answer this question.

Related questions