Files
cppdraft_translate/cppdraft/lex/operators.md
2025-10-25 03:02:53 +03:00

35 lines
1.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[lex.operators]
# 5 Lexical conventions [[lex]](./#lex)
## 5.8 Operators and punctuators [lex.operators]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lex.tex#L774)
The lexical representation of C++ programs includes a number of
preprocessing tokens that are used in the syntax of the preprocessor or
are converted into tokens for operators and punctuators:
[preprocessing-op-or-punc:](#nt:preprocessing-op-or-punc "5.8Operators and punctuators[lex.operators]")
[*preprocessing-operator*](#nt:preprocessing-operator "5.8Operators and punctuators[lex.operators]")
[*operator-or-punctuator*](#nt:operator-or-punctuator "5.8Operators and punctuators[lex.operators]")
[preprocessing-operator:](#nt:preprocessing-operator "5.8Operators and punctuators[lex.operators]") one of
# ## %: %:%:
[operator-or-punctuator:](#nt:operator-or-punctuator "5.8Operators and punctuators[lex.operators]") one of
{ } [ ] ( ) [: :]
<% %> <: :> ; : ...
? :: . .* -> ->* ^^ ~
! + - * / % ^ & |
= += -= *= /= %= ^= &= |=
== != < > <= >= <=> && ||
<< >> <<= >>= ++ -- ,
and or xor not bitand bitor compl
and_eq or_eq xor_eq not_eq
Each [*operator-or-punctuator*](#nt:operator-or-punctuator "5.8Operators and punctuators[lex.operators]") is converted to a single token
in translation phase 7 ([[lex.phases]](lex.phases "5.2Phases of translation"))[.](#1.sentence-2)