سؤال

In each of the following statements, what are the tokens?

a. x = y +++ 3;
x, =, y, ++, +, 3, ; 7 tokens
b. a+=c*=(d+-2)>>5&3;
a, +=, c, *=, (, d, +, -, 2, ), >>, 5, &, 3, ; 15 tokens

For each, state whether it is a syntactically correct expression.

a. x+++y
x, ++, +, y. Yes.
b. x+++++y
x, ++, ++, +, y. No.

Just wondering if I'm counting tokens the right way. I wasn't sure if parenthesis are counted as separate tokens or not.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top