Skip to content

Language Specification (D) : Syntax Diagrams

Benjamin Kowarsch edited this page Oct 1, 2020 · 26 revisions

Appendix D — Syntax Diagrams

Non-Terminals

Start Symbol

compilationUnit

Compilation Unit

Definition Module Syntax

definitionModule

Definition Module

moduleIdent

Module Identifier

import

Import

libIdent

Library Identifier

reExport

Library Identifier

definition

Definition

constDefinition

Constant Definition

constantBinding

Constant Binding

constDeclaration

Constant Declaration

ident

Identifier

constExpression

Constant Expression

typeDefinition

Type Definition

aliasType

Alias Type

typeIdent

Type Identifier

qualident

Qualified Identifier

derivedType

Derived Type

subrangeType

Subrange Type

constRange

Constant Range

lowerBound, upperBound

Lower Bound

countableType

Ordinal Or Scalar Type

enumType

Enumeration Type

enumTypeToExtend

Enumeration Type To Extend

enumTypeIdent

Enumeration Type Identifier

identList

Identifier List

setType

Set Type

arrayType

Array Type

valueCount

Value Count

recordType

Record Type

recTypeToExtend

Record Type To Extend

fieldList

Field List

pointerType

Pointer Type

opaqueType

Opaque Type

allocSize

Allocation Size

procedureType

Procedure Type

formalType

Formal Type

nonAttrFormalType

Non-Attributed Formal Type

returnedType

Formal Type

simpleFormalType

Simple Formal Type

castingFormalType

Casting Formal Type
 △ Syntax enabled by import of moule UNSAFE

variadicFormalType

Variadic Formal Type

procedureHeader

Procedure Header

bindingSpecifier

Binding Specifier

argListFlag

Argument List Flag

capacityFlag

Capacity Flag

allocFlag

Allocation Flag

formatFlag

Format Flag

bindableIdent

Bindable Ident

procedureSignature

Procedure Signature

formalParams

Formal Parameters

Implementation and Program Module Syntax

programModule

Program Module

privateImport

Private Import

block

Block

implementationModule

Implementation Module

possiblyEmptyBlock

Possibly Empty Block

declaration

Declaration

typeDeclaration

Type Declaration

octetSeqType

Octet Sequence Type

privatePointerType

Private Pointer Type

determinateTarget

Determinate Type

indeterminateTarget

Indeterminate Type

indeterminateField

Indeterminate Field

capacityField

Capacity Field

varDeclaration

Variable Declaration

aliasDeclaration

Alias Declaration

nameSelector

Name Selector

wildcard

Wildard

Statements

statementSequence

Statement Sequence

statement

Statement

memMgtOperation

Memory Management Operation

newStatement

NEW Statement

retainStatement

RETAIN Statement

releaseStatement

RELEASE Statement

updateOrProcCall

Update Or Procedure Call

incOrDecSuffix

Increment Or Decrement Suffix

returnStatement

RETURN Statement

copyStatement

COPY Statement

readStatement

READ Statement

writeStatement

WRITE Statement

inputArg

Input Argument

outputArgs

Output Arguments

formattedArgs

Formatted Arguments

fmtStr

Format String

unformattedArg

Unformatted Argument

chan

Channel

ifStatement

IF Statement

boolExpression

Boolean Expression

caseStatement

CASE Statement

case

Case

caseLabels

Case Labels

loopStatement

LOOP Statement

whileStatement

WHILE Statement

repeatStatement

REPEAT Statement

forStatement

FOR Statement

forLoopVariants

FOR Loop Variants

accessor, value

Accessor

descender

Descender

iterableExpr

Iterable Expr

collectionOrType

Collection Or Type

valueRange

Value Range

firstValue, lastValue

First Value/Last Value

designator

Designator

derefTail

Dereferenced Designator Tail

subscriptTail

Subscripted Designator Tail

targetDesignator

Target Designator

derefTargetTail

Dereferenced Target Designator Tail

bracketTargetTail

Bracketed Target Designator Tail

deref

Dereference

Expressions

expressionList

Expression List

expression

Expression

operL1

Level-1 Operator

simpleExpression

Simple Expression

operL2

Level-2 Operator

concatOp

Concatenation Operator

setDiffOp

Set Difference Operator

term

Term

operL3

Level-3 Operator

simpleTerm

Simple Term

factor

Factor

typeConvOp

Type Conversion Operator

simpleFactor

Simple Factor

sourceDesignator

Source Designator

derefSourceTail

Dereferenced Source Designator Tail

bracketSourceTail

Bracketed Source Designator Tail

functionCallTail

Function Call Tail

structuredValue

Structured Value

valueComponent

Value Component

runtimeExpression

Runtime Expression

Technical Debt Management

toDoList

TO DO List

trackingRef

Tracking Reference

taskToDo

Task To Do

issueId, Severity, estimatedTime

Issue ID

timeUnit

Time Unit
 △ By convention, timeUnit identifiers should be w for weeks, d for days, and h for hours

description

Description

wholeNumber

Whole Number

Terminals

StdIdent

Standard Identifier

LetterOrDigit

Letter Or Digit

Qualident

Qualified Identifier

Pervasive

Pervasive Identifier

Primitive

Primitive Identifier

NumberLiteral

Number Literal

DecimalNumberTail

Decimal Number Tail

RealNumberTail

Real Number Tail

DigitSeq

Digit Sequence

DigitGroup

Digit Group

Base2DigitSeq

Base-2 Digit Sequence

Base2DigitGroup

Base-2 Digit Group

Base16DigitSeq

Base-16 Digit Sequence

Base16DigitGroup

Base-16 Digit Group

Digit

Digit

Base2Digit

Base-2 Digit

Base16Digit

Base-16 Digit

StringLiteral

String Literal

SingleQuotedString

Single-Quoted String

DoubleQuotedString

Double-Quoted String

QuotableCharacter

Quotable Character

Letter

Letter

NonAlphaNumQuotable

Non-Alpha-Numeric Quotable 1 Non-Alpha-Numeric Quotable 2 Non-Alpha-Numeric Quotable 3

EscapedCharacter

Escaped Character

Ignore Symbols

Whitespace

Whitespace

LineComment

Line Comment

BlockComment

Block Comment

CommentCharacter

Comment Character

EndOfLine

End Of Line Marker

Pragmas

inlinePragma

INLINE Pragma

deprecatedPragma

DEPRECATED Pragma

privatetoPragma

PRIVATETO Pragma

ffiPragma

FFI Pragma

ffidentPragma

FFIDENT Pragma

implDefPragma

Implementation Defined Pragma

ctMsgMode

Compile-Time Message Mode

implPrefix

Implementation Prefix

pragmaSymbol

Pragma Symbol
 △ Implementation defined implPrefix and pragmaSymbol symbols follow the syntax of StdIdent

Debugging Aid

Not strictly part of the language, should be implemented nevertheless

DisabledCodeSection

Disabled Code Section

AnyPrintable

Any Printable Character

Clone this wiki locally