A.1.5 Constants

(6.4.4)

constant:

integer-constant

floating-constant

enumeration-constant

character-constant

(6.4.4.1)

integer-constant:

decimal-constant integer-suffixopt

octal-constant integer-suffixopt

hexadecimal-constant integer-suffixopt

(6.4.4.1)

decimal-constant:

nonzero-digit

decimal-constant digit

(6.4.4.1)

octal-constant:

0

octal-constant octal-digit

(6.4.4.1)

hexadecimal-constant:

hexadecimal-prefix hexadecimal-digit

hexadecimal-constant hexadecimal-digit

(6.4.4.1)

hexadecimal-prefix: one of

0x 0X

(6.4.4.1)

nonzero-digit: one of

1 2 3 4 5 6 7 8 9

(6.4.4.1)

octal-digit: one of

0 1 2 3 4 5 6 7

(6.4.4.1)

hexadecimal-digit: one of

0 1 2 3 4 5 6 7 8 9

a b c d e f

A B C D E F

(6.4.4.1)

integer-suffix:

unsigned-suffix long-suffixopt

unsigned-suffix long-long-suffix

long-suffix unsigned-suffixopt

long-long-suffix unsigned-suffixopt

(6.4.4.1)

unsigned-suffix: one of

u U

(6.4.4.1)

long-suffix: one of

l L

(6.4.4.1)

long-long-suffix: one of

ll LL

(6.4.4.2)

floating-constant:

decimal-floating-constant

hexadecimal-floating-constant

(6.4.4.2)

decimal-floating-constant:

fractional-constant exponent-partopt floating-suffixopt

digit-sequence exponent-part floating-suffixopt

(6.4.4.2)

hexadecimal-floating-constant:

hexadecimal-prefix hexadecimal-fractional-constant

binary-exponent-part floating-suffixopt

hexadecimal-prefix hexadecimal-digit-sequence

binary-exponent-part floating-suffixopt

(6.4.4.2)

fractional-constant:

digit-sequenceopt . digit-sequence

digit-sequence .

(6.4.4.2)

exponent-part:

e signopt digit-sequence

E signopt digit-sequence

(6.4.4.2)

sign: one of

+ -

(6.4.4.2)

digit-sequence:

digit

digit-sequence digit

(6.4.4.2)

hexadecimal-fractional-constant:

hexadecimal-digit-sequenceopt .

hexadecimal-digit-sequence

hexadecimal-digit-sequence .

(6.4.4.2)

binary-exponent-part:

p signopt digit-sequence

P signopt digit-sequence

(6.4.4.2)

hexadecimal-digit-sequence:

hexadecimal-digit

hexadecimal-digit-sequence hexadecimal-digit

(6.4.4.2)

floating-suffix: one of

f l F L

(6.4.4.3)

enumeration-constant:

identifier

(6.4.4.4)

character-constant:

c-char-sequence

L’ c-char-sequence

(6.4.4.4)

c-char-sequence:

c-char

c-char-sequence c-char

(6.4.4.4)

c-char:

any member of the source character set except the single-quote 

, backslash 

\

, or 

new-line

 character 

escape-sequence

(6.4.4.4)

escape-sequence:

simple-escape-sequence

octal-escape-sequence

hexadecimal-escape-sequence

universal-character-name

(6.4.4.4)

simple-escape-sequence: one of

\’ \” \? \\

\a \b \f \n \r \t \v

(6.4.4.4)

octal-escape-sequence:

\ octal-digit

\ octal-digit octal-digit

\ octal-digit octal-digit octal-digit

(6.4.4.4)

hexadecimal-escape-sequence:

\x hexadecimal-digit

hexadecimal-escape-sequence hexadecimal-digit