Pergunta

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.

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top