What are considered operators in the programming language?

Asked

Viewed 90 times

3

I was wondering if a token is considered an operator when performing an action?

  • After the lexical analysis of a code, operators are one of the types of tokens that can be found... It remains to know what you mean by "perform an action", because the execution of the code comes well after this phase...

  • @fernandosavio The term "performs an action" was used to refer to a change of "state". Example: int x = 0; the state of x is "unknown", after the operator "performs its action" the state of x is 0, i.e., the operator (=) changed the "unknown" state from x to 0

1 answer

2


No, but the opposite is true. Everything that is written in a code ends up forming a token, inclusive tokens are usually formed by others tokens, then an operator, as well as any other language constructions, are tokens.

Token is a term within a taxonomy, so the same object can have several names hierarchically, and call it token is a generic form and may be sufficient in certain context and ambiguous in others, requiring a better qualification, so for example you may have a context that needs you to call that same object operator, because it is this.

The operator is one of the tokens possible and a language construction that determines an operation in values.

Hierarquia de tokens

  • I did not find any problem in this answer, could justify the negative?

  • In fact they are 2 different questions, what are tokens and what are operators, perhaps missing conceptualize the 2°, in the sense of its proper use, the operations common to all languages. Surely I’ve seen something around here. I could be wrong.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.