Skip to content

Syntax Diagrams

M2SF Project Administrator edited this page May 22, 2017 · 6 revisions

Non-Terminals

compilationUnit

Compilation Unit

definitionModule

Definition Module

moduleIdent

Module Identifier

import (PIM)

Import
 △ PIM dialects only

import (Extended)

Import
 △ Extended dialect only

qualifiedImport

Qualified Import

moduleList

Module List

unqualifiedImport

Unqualified Import
 △ PIM dialects only

identList

Identifier List

definition

Definition

varDefinition

Variable Definition

constDefinition

Constant Definition

constExpression

Constant Expression

typeDefinition (PIM)

Type Definition
 △ PIM dialects only

typeDefinition (Extended)

Type Definition
 △ Extended dialect only

type

Type

derivedOrSubrangeType (PIM)

Derived Type Or Subrange Type
 △ PIM dialects only

derivedOrSubrangeType (Extended)

Derived Type Or Subrange Type
 △ Extended dialect only

typeIdent

Type Identifier

qualident

Qualified Identifier

range

Range

enumType

Enumeration Type

setType

Set Type

countableType

Countable Type

arrayType

Array Type

recordType (PIM)

Record Type
 △ PIM dialects only

recordType (Extended)

Record Type
 △ Extended dialect only

variantRecordType

Variant Record Type
 △ PIM dialects only

variantFieldListSeq

Variant Record Field List Sequence
 △ PIM dialects only

variantFieldList

Variant Record Field List
 △ PIM dialects only

variantFields

Variant Fields
 △ PIM dialects only

variant

Variant
 △ PIM dialects only

caseLabelList

Case Label List

caseLabels

Case Labels

extensibleRecordType

Extensible Record Type
 △ Extended dialect only

baseType

Base Type
 △ Extended dialect only

fieldListSequence

Field List Sequence

fieldList

Field List

pointerType

Pointer Type

procedureType

Procedure Type

formalType

Formal Type

simpleFormalType (PIM)

Case Labels
 △ PIM dialects only

simpleFormalType (Extended)

Case Labels
 △ Extended dialect only

attributedFormalType (PIM)

Attributed Formal Type
 △ PIM dialects only

attributedFormalType (Extended)

Attributed Formal Type
 △ Extended dialect only

returnedType

Returned Type

procedureHeader

Procedure Header

procedureSignature

Procedure Signature

formalParams

Formal Parameters

simpleFormalParams

Simple Formal Parameters

attribFormalParams (PIM)

Attributed Formal Parameters
 △ PIM dialects only

attribFormalParams (Extended)

Attributed Formal Parameters
 △ Extended dialect only

implementationModule

Implementation Module

programModule (PIM)

Program Module
 △ PIM dialects only

programModule (Extended)

Program Module
 △ Extended dialect only

modulePriority

Module Priority
 △ PIM dialects only

block

Block

declaration (PIM)

Declaration
 △ PIM dialects only

declaration (Extended)

Declaration
 △ Extended dialect only

typeDeclaration (PIM)

Type Declaration
 △ PIM dialects only

typeDeclaration (Extended)

Type Declaration
 △ Extended dialect only

varSizeRecordType

Variable Size Record Type
 △ Extended dialect only

indeterminateField

Indeterminate Field
 △ Extended dialect only

sizeFieldIdent

Size Field Identifier
 △ Extended dialect only

variableDeclaration

Variable Declaration

procedureDeclaration

Procedure Declaration

moduleDeclaration

Module Declaration
 △ PIM dialects only

export

Export
 △ PIM dialects only

statementSequence

Statement Sequence

statement (PIM)

Statement
 △ PIM dialects only

statement (Extended)

Statement
 △ Extended dialect only

assignmentOrProcCall (PIM)

Assignment Or Procedure Call
 △ PIM dialects only

assignmentOrProcCall (Extended)

Assignment Or Procedure Call
 △ Extended dialect only

incOrDecSuffix

Actual Parameters
 △ Extended dialect only

actualParameters

Actual Parameters

expressionList

Expression List

returnStatement

RETURN Statement

withStatement

WITH Statement
 △ PIM dialects only

ifStatement

IF Statement

boolExpression

Boolean Expression

caseStatement (PIM)

CASE Statement
 △ PIM dialects only

caseStatement (Extended)

CASE Statement
 △ Extended dialect only

case

Case

loopStatement

LOOP Statement

whileStatement

WHILE Statement

repeatStatement

REPEAT Statement

forStatement

FOR Statement

forLoopVariant

FOR Loop Variant

startValue

Start Value

endValue

End Value

ordinalExpression

Ordinal Expression

stepValue

Step Value

designator

Designator

selector

selector

expression

Expression

operL1

Level-1 Operator

simpleExpression

Simple Expression

operL2 (PIM)

Level-2 Operator
 △ PIM dialects only

operL2 (Extended)

Level-2 Operator
 △ Extended dialect only

setDiffOp

Set Difference Operator
 △ Extended dialect only

term

Term

operL3

Level-3 Operator

simpleTerm

Simple Term

factor

Factor

designatorOrFuncCall

Designator Or Function Call

setValue

Set Value

element

element

runtimeExpression

Runtime Expression

Terminals

Ident (default)

Identifier
 △ Extended dialect only

Ident (with option --lowline-identifiers)

Identifier
 △ Extended dialect only

M2Ident

Modula-2 Identifier

LetterOrDigit

Letter or Digit

ForeignIdent

Foreign Identifier
 △ Extended dialect only

AlphaNumSeq

Alpha-Numeric Sequence

NumberLiteral (PIM)

Number Literal
 △ PIM dialects only

NumberLiteral (Extended)

Number Literal
 △ Extended dialect only

DecimalNumberTail

Decimal Number Tail

RealNumberTail

Real Number Tail

Base2DigitSeq

Base-2 Digit Sequence
 △ Extended dialect only

Base8DigitSeq

Base-8 Digit Sequence
 △ PIM dialects only

Base16DigitSeq

Base-16 Digit Sequence

Digit

Digit

Base2Digit

Base-2 Digit

Base8Digit

Base-8 Digit

Base16Digit

Base-16 Digit

StringLiteral

String Literal

SingleQuotedString

Single-Quoted String

DoubleQuotedString

Double-Quoted String

QuotableCharacter (PIM)

Quotable Character
 △ PIM dialects only

QuotableCharacter (Extended)

Quotable Character
 △ Extended dialect only

Letter

Letter

NonAlphaNumQuotable

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

EscapedCharacter

Escaped Character
 △ Extended dialect only

Pragmas

pragma

Pragma
 △ Extended dialect only

pragmaBody

Pragma Body
 △ Extended dialect only

ffiPragma (M2C)

FFI Pragma
 △ M2C only

ffiPragma (M2J)

FFI Pragma
 △ M2J only

ffiPragma (M2Sharp)

FFI Pragma
 △ M2Sharp only

ffidentPragma

FFIDENT Pragma
 △ Extended dialect only

Clone this wiki locally