C 어휘 문법
토큰
token
:
keyword
identifier
constant
string-literal
punctuator
preprocessing-token
:
header-name
identifier
pp-number
character-constant
string-literal
punctuator
위의 항목에 속하지 않는 공백이 아닌 문자
키워드
keyword
: 다음 중 하나
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
inline
int
long
register
restrict
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
_Alignas
_Alignof
_Atomic
_Bool
_Complex
_Generic
_Imaginary
_Noreturn
_Static_assert
_Thread_local
추가 Microsoft 전용 키워드 목록을 확인하고 싶다면 C 키워드를 참조하세요.
식별자
identifier
:
identifier-nondigit
identifier
identifier-nondigit
identifier
digit
identifier-nondigit
:
nondigit
universal-character-name
기타 구현 시 정의되는 문자
nondigit
: 다음 중 하나
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
digit
: 다음 중 하나
0
1
2
3
4
5
6
7
8
9
universal-character-name
:
\u
hex-quad
\U
hex-quad
hex-quad
hex-quad
:
hexadecimal-digit
hexadecimal-digit
hexadecimal-digit
hexadecimal-digit
상수
constant
:
integer-constant
floating-constant
enumeration-constant
character-constant
integer-constant
:
decimal-constant
integer-suffix
opt
binary-constant
1integer-suffix
opt
octal-constant
integer-suffix
opt
hexadecimal-constant
integer-suffix
opt
decimal-constant
:
nonzero-digit
decimal-constant
digit
binary-constant
:1
binary-prefix
binary-digit
binary-constant
binary-digit
binary-prefix
1: one of
0b
0B
binary-digit
1: one of
0
1
octal-constant
:
0
octal-constant
octal-digit
hexadecimal-constant
:
hexadecimal-prefix
hexadecimal-digit
hexadecimal-constant
hexadecimal-digit
hexadecimal-prefix
: 다음 중 하나
0x
0X
nonzero-digit
: 다음 중 하나
1
2
3
4
5
6
7
8
9
octal-digit
: 다음 중 하나
0
1
2
3
4
5
6
7
hexadecimal-digit
: 다음 중 하나
0
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
A
B
C
D
E
F
integer-suffix
:
unsigned-suffix
long-suffix
opt
unsigned-suffix
long-long-suffix
opt
long-suffix
unsigned-suffix
opt
long-long-suffix
unsigned-suffix
opt
unsigned-suffix
: 다음 중 하나
u
U
long-suffix
: 다음 중 하나
l
L
long-long-suffix
: 다음 중 하나
ll
LL
floating-constant
:
decimal-floating-constant
hexadecimal-floating-constant
decimal-floating-constant
:
fractional-constant
exponent-part
optfloating-suffix
opt
digit-sequence
exponent-part
floating-suffix
opt
hexadecimal-floating-constant
:
hexadecimal-prefix
hexadecimal-fractional-constant
binary-exponent-part
optfloating-suffix
opt
hexadecimal-prefix
hexadecimal-digit-sequence
binary-exponent-part
floating-suffix
opt
fractional-constant
:
digit-sequence
opt.
digit-sequence
digit-sequence
.
exponent-part
:
e
sign
optdigit-sequence
E
sign
optdigit-sequence
sign
: 다음 중 하나
+
-
digit-sequence
:
digit
digit-sequence
digit
hexadecimal-fractional-constant
:
hexadecimal-digit-sequence
opt.
hexadecimal-digit-sequence
hexadecimal-digit-sequence
.
binary-exponent-part
:
p
sign
optdigit-sequence
P
sign
optdigit-sequence
hexadecimal-digit-sequence
:
hexadecimal-digit
hexadecimal-digit-sequence
hexadecimal-digit
floating-suffix
: 다음 중 하나
f
l
F
L
enumeration-constant
:
identifier
character-constant
:
'
c-char-sequence
'
L'
c-char-sequence
'
c-char-sequence
:
c-char
c-char-sequence
c-char
c-char
:
작은 따옴표('
), 백슬래시(\
) 또는 줄 바꿈 문자를 제외한 소스 문자 집합의 모든 멤버
escape-sequence
escape-sequence
:
simple-escape-sequence
octal-escape-sequence
hexadecimal-escape-sequence
universal-character-name
simple-escape-sequence
: 다음 중 하나
\a
\b
\f
\n
\r
\t
\v
\'
\"
\\
\?
octal-escape-sequence
:
\
octal-digit
\
octal-digit
octal-digit
\
octal-digit
octal-digit
octal-digit
hexadecimal-escape-sequence
:
\x
hexadecimal-digit
hexadecimal-escape-sequence
hexadecimal-digit
문자열 리터럴
string-literal
:
encoding-prefix
"
s-char-sequence
opt"
encoding-prefix
:
u8
u
U
L
s-char-sequence
:
s-char
s-char-sequence
s-char
s-char
:
큰 따옴표("
), 백슬래시(\
) 또는 줄 바꿈 문자를 제외한 소스 문자 집합의 모든 멤버
escape-sequence
문장 부호
punctuator
: 다음 중 하나
[
]
(
)
{
}
.
->
++
--
&
*
+
-
~
!
/
%
<<
>>
<
>
<=
>=
==
!=
^
|
&&
||
?
:
;
...
=
*=
/=
%=
+=
-=
<<=
>>=
&=
^=
|=
,
#
##
<:
:>
<%
%>
%:
%:%:
헤더 이름
header-name
:
<
h-char-sequence
>
"
q-char-sequence
"
h-char-sequence
:
h-char
h-char-sequence
h-char
h-char
:
줄 바꿈 문자와 >
를 제외한 소스 문자 집합의 모든 멤버
q-char-sequence
:
q-char
q-char-sequence
q-char
q-char
:
줄 바꿈 문자와 "
를 제외한 소스 문자 집합의 모든 멤버
숫자 전처리
pp-number
:
digit
.
digit
pp-number
digit
pp-number
identifier-nondigit
pp-number
e
sign
pp-number
E
sign
pp-number
p
sign
pp-number
P
sign
pp-number
.
1binary-constant
, binary-prefix
및 binary-digit
는 Microsoft 전용 확장명입니다.
참조
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기