The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
60 views
the no of tokens in the following exp.

x+++++y
in Compiler Design by (17 points) | 60 views
+3

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

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

@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

@ankitgupta.1729

then here token are

x

++

++

+

y

5 tokens

rt?

+1
yes.

Please log in or register to answer this question.

Related questions

0 votes
1 answer
7
asked Oct 23, 2018 in Compiler Design by Balaji Jegan Active (4.8k points) | 40 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,896 questions
55,153 answers
190,577 comments
85,319 users