D language morphology (2)

xiaoxiao2021-03-06  47

Character string

String text quantity:

What you have obtained is string

Alternative to the desired string

Dual quotation string

Escape sequence

Hexadecimal string

WYSIWYNG:

R "Multiple Wanwen Your Character"

Alternative to the desired string:

`Multiple Watch Your Character`

What you have come here:

character

Row

Double quotation marking string:

"Multiple Double Quotes"

Double quotes characters:

character

Escape sequence

Row

Side sequence:

/ '

/ "

/?

//

/ a

/ B

/ f

/ N

/ r

/ t

/ v

/ File end

/ x heel credit digital hexadecimal number

/ Octal number

/ Octal digital octal number

/ Octal digital octal digital eight reformed number

/ u heel credit digital hexadecimal number hexadecimal digital hexadecimal number

/ U heel credit digital hexadecimal digital hexadecimal digital hex digital hexadecimal number hex digital sixteen-binary number hexadecimal number

Hexadecimal string:

X "Multiple Sixteen British Characters"

Multiple hexadecimal string characters:

Hexadecimal number

blank

Row

Stringliteral:

Wysiwygstring

Alternatewysiwygstring

DoublequotedString

Escapesequence

HEXSTRING

Wysiwygstring:

R "wysiwygcharacters"

Alternatewysiwygstring:

`Wysiwygcharacters`

Wysiwygcharacter:

Character

Endofline

DoublequotedString:

Doublequotedcharacters

DoublequotedCharacter:

Character

Escapesequence

Endofline

Escapesequence:

/ '

/ "

/?

//

/ a

/ B

/ f

/ N

/ r

/ t

/ v

/ Endoffile

/ x hexdigit hexdigit

/ Octaldigit

/ Octaldigit Octaldigit

/ Octaldigit Octaldigit Octaldigit

/ u Hexdigit Hexdigit Hexdigit Hexdigit

/ U Hexdigit Hexdigit Hexdigit Hexdigit Hexdigit Hexdigit Hexdigit HEXDIGIT

HEXSTRING:

x "HexStringChars"

HEXStringChar

HEXDIGIT

WHITESPACE

Endofline

String text volume can be a dual quotation string, a newly obtained quotation marking string, a escape sequence, or a hex string.

The desired quotation string is surrounded by 'r "' and '"'. All characters located between 'R "' and '"' are part of the string, except for the end, and he is considered a '/ n' character. There is no escape sequence in R "":

R "Hello"

R "c: /root/foo.exe"

R "ab / n" // String consisting of four characters: 'a', 'b', '/', 'n'

Another form of what you have obtained is to use Director '`' instead of dual quotes. '`' Characters are not all on all keyboards, and sometimes it is difficult to distinguish between the other common characters' ''. Although '`' rarely uses, it will reflect its value when using a string containing '"'.

`hello`

`c: / root / foo.exe`

`ab / n` // String consisting of four characters: 'a', 'b', '/', 'N' Double Quotes String is a string surrounded by '" "'. A typical '/' marker can be embedded in the transfusion sequence.

The end is considered a '/ n' character.

"hello"

"c: //root/foo.exe"

"AB / N" // consists of three characters: 'a', 'b' and a new line

"ab

"// String consisting of three characters: 'a', 'b' and a new line

The escape string begins by '/', and he and its subsequent characters constitute a translucent character sequence. The adjacent escape character is connected together:

/ n // new line character

/ t // Table

/" // Double quotes

/ 012 // eight into

/ x1a // hex

/ u1234 // wchar character

/ U00101234 // dchar characters

/ R / N // Enter backhand

In addition to the above, other escape sequences are illegal.

Hexadecimal string uses hexadecimal data construct strings:

X "0A" // Equivalent to "/ x0a"

X "00 FBCD 32FD 0A" // Equivalent to "/ X00 / XFB / XCD / X32 / XFD / X0A"

Blank and new lines will be ignored, so it can be easily formatted. The number of hexadecimal characters must be a multiple of 2.

Adjacent strings should be used to connect, or can also be placed simply:

"Hello" ~ "world" ~ / n // constitutes a string: 'h', 'e', ​​'L', 'L', 'o', '', 'W', 'O', 'R' , 'l', 'd', string

The following form is equivalent:

"ab" "c"

R "ab" r "c"

R "a" "bc"

"a" ~ "b" ~ "c"

/ x61 "BC"

Character text

Character text:

'Single quotes characters'

Single quotes characters

character

Escape sequence

Characterliteral:

'SingleQuotedCharacter'

SinglequotedCharacter

Character

Escapesequence

Character text is a single character or a single-necked escape sequence, ''.

Integer number of characters

Integer text quantity:

Integer

Integer integer suffix

Integer:

Decimal

Binary number

Estimate

Hexadecimal number

Integer_

Integer suffix:

l

L

U

U

Lu

Lu

Lu

Lu

UL

UL

UL

UL

Decimal:

0

Non-zero

Non-zero digital decimal

Non-zero digital

Binary number:

0B binary number

0B binary number

Eight counts:

0 octave

Hexadecimal number:

0x hexadecimal number

0x hexadecimal number

IntegerLiteral:

Integer

Integer Integerseuffix

Integer:

Decimal

Binary

Octal

HEXADECIMAL

INTEGER _

IntegerseUffix:

l

L

U

U

Lu

Lu

Lu

Lu

UL

UL

UL

UL

Decimal:

0

Nonzerodigit

Nonzerodigit Decimal

Nonzerodigit_Decimal

Binary:

0b binarydigits

0b binarydigits

Octal:

0 Octaldigits

HEXADECIMAL:

0x HEXDIGITS

0x HEXDIGITS

Integers can adopt decimal, binary, octal or hexadecimal.

The decimal integer is a sequence of decimal numbers.

The binary integer is a sequence of binary numbers and prefixed with '0b'.

The octal integer is the sequence of octal numbers, prefixed with '0'.

The hexadecimal integer is a sequence of hexadecimal numbers, with '0x' prefix, or uses 'h' as ​​a suffix.

Integers can embed '_' characters, they will be ignored. Embedded '_' can be used to format longer text volume, such as a thousand separator:

123_456 // 123456

1_2_3_4_5_6_ // 123456

After the integer, you can follow a 'L' or a 'u' or both.

The type of integer is determined by the following rules:

If it is decimal, it is ulong, long, and the first first found in INT can represent its type. If it is not a decimal, it is ulong, long, uint, and the first found in INT, which can be found before, can represent its type. If it has suffix 'u', it is ulong, and the first found in the UINT can represent its type. If it has suffix 'L', it is ulong, and the first found from the lastwes can represent its type. If it has suffix 'u' and 'L', it is a Ulong type.

Floating point number text

Floating point text quantity:

Floating point number

Floating point floating point numerical suffix

Floating point number false suffix

Floating point floating point number suffixes

Floating point:

Decoction floating point

Hexadecimal floating point

Floating point _

Floating point numerical suffix:

fly

Fly

l

L

Imaginary suffix:

i

I

FLOATLITERAL:

Float

Float floatsuffix

Float ImaginarySuffix

Float Floatsuffix ImaginarySuffix

Float:

Decimalfloat

HEXFLOAT

Float_

FLOATSUFFIX:

fly

Fly

l

L

ImaginarySuffix:

i

I

The floating point number can be used in decimal or hexadecimal format, just like standard C.

The hexadecimal floating point number starts with 0x, the scales begin with P or P, followed by the step of 2 as the bottom.

The floating point text can be embedded '_' characters, they will be ignored. Embedded '_' is used to format lengthy characters to improve readability, such as using them as a thousand separators:

123_456.567_8 // 123456.5678

1_2_3_4_5_6 _._ 5_6_7_8 // 123456.5678

1_2_3_4_5_6 _._ 5e-6_ // 123456.5e-6

Floating point can be followed by one

f,

F,

l or

L suffix.

forth

F suffix indicates that this is a floating point number,

l or

L Description This is an extension format floating point number.

If the floating point text is followed by I or I, then it is an IREAL (imaginary) type.

Example:

0x1.ffffffffffffffp1023 // double.max

0x1p-52 // Double.epsilon

1.175494351e-38f // float.min

6.3i // iDouble 6.3

6.3fi // ifloat 6.3

6.3li // IREAL 6.3

If the volume is exceeded by this type of representation, it will be considered an error. If the volume is fetched, you can use this type of valid bit number to indicate, it is not an error. The amount of the plurality is not a mark, but is constructed with real numbers and imaginary expressions in semantic analysis:

4.5 6.2i // complex

Keyword keyword is a retained flag:

Keyword:

Abstract

Alias

Align

ASM

Assert

Auto

Bit

Body

Break

Byte

Case

CAST

Catch

Cent

charr

Class

cfloat

CDOUBLE

CREAL

Const

Continue

Dchar

Debug

DEFAULT

Delegate

Delete

Deprecated

DO

Double

Else

ENUM

Export

Extern

False

Final

Finally

Float

for

Foreach

FUNCTION

goto

iDouble

IF

ifloat

Import

in

inout

int

Interface

Invariant

IREAL

IS

Long

Mixin

Module

New

NULL

OUT

Override

Package

Pragma

Private

protected

public

REAL

Return

Short

Static

Struct

Super

Switch

SYNCHRONIZED

Template

THIS

Throw

True

Try

Typedef

Typeof

Ubyte

ucent

Uint

Ulong

union

UnitTest

Ushort

Version

Void

Volatile

Wchar

While

WITH

Special marker sequence special marker sequence is processed by the lexical analysis program, which can appear between other marks and does not affect syntax analysis.

There is currently only one special marker sequence, # line.

Special marker sequence

# line integer row

# LINE integer FileSpec

Specified file

"Character"

SpecialTokensequence

# line integer Endofline

# line integer filespec endofline

FILESPEC

"Characters"

It sets the line number of the source code to

The value of the integer, set the source code file name to optional

FileSpec's value, take effect from the next line of the source text. The code file name and the line number are used to print debug information, and are also used by the symbol debugger to map the generated code back source.

E.g:

Int #Line 6 "Foo / Bar"

X; / / This is the 6th line of FOO / BAR

note,

The backslash in the FileSpec string will not be treated specially.

转载请注明原文地址:https://www.9cbs.com/read-60274.html

New Post(0)