Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Output Formats For SYSTEM Types

Types

BYTE, WORD, ADDRESS, MACHINEBYTE, MACHINEADDRESS

Syntax

The EBNF for the textual representation of values of system types is

Values and Value Lists
systemUnitValue :
    systemUnitNotation;

systemUnitValueList :
    systemUnitValue ( listSeparator systemUnitValue )* ;

listSeparator :
    defaultListSeparator | userDefinedListSeparator | newline ;

defaultListSeparator :
    ',' whitespace ;

userDefinedListSeparator :
    character whitespace? ;
Arrays and Array Lists
systemUnitArray :
     openingArrayDelimiter systemUnitValueList closingArrayDelimiter ;

systemUnitArrayList :
    systemUnitArray ( listSeparator systemUnitArray )* ;

openingArrayDelimiter :
    ( defaultOpeningArrayDelimiter | userDefinedOpeningArrayDelimiter ) whitespace ;

closingArrayDelimiter :
    whitespace ( defaultClosingArrayDelimiter | userDefinedOpeningArrayDelimiter ) ;

defaultOpeningArrayDelimiter :
    '{' ;

defaultClosingArrayDelimiter :
    '}' ;

userDefinedOpeningArrayDelimiter :
    '(' | '[' ;

userDefinedClosingArrayDelimiter :
    ')' | ']' ;
System Unit Notation
systemUnitNotation :
    unpaddedSystemUnitValue | leftPaddedSystemUnitValue | rightPaddedSystemUnitValue ;

leftPaddedSystemUnitValue :
    whitespace+ unpaddedSystemUnitValue ;

rightPaddedSystemUnitValue :
    unpaddedSystemUnitValue whitespace+ ;

whitespace :
    ' ' ;

unpaddedSystemUnitValue :
    simpleFormat | otherFormats ;

simpleFormat :
    digitGroup ( digitGroupSeparator digitGroup )* ;

otherFormats :
    base16CLiteralFmt | base16M2LiteralFmt ;

base16CLiteralFmt :
    '0' 'x' base16DigitLowercase+ ;

base16M2LiteralFmt :
    '0' base16DigitUppercase+ 'H' ;

base16DigitLowercase :
    '0' .. '9' | 'a' .. 'f' ;

base16DigitUppercase :
    '0' .. '9' | 'A' .. 'F' ;

digitGroup :
    base16DigitUppercase+ ;

digitGroupSeparator :
    whitespace | '.' | ':' ;

newline :
    <runtime host dependent ASCII control sequence for new line> ;

Static Semantics

  • all values in a list are shown in the same notation.
  • all values in a list are shown with identical formatting.
  • the number of digits shown is always the maximum required for the type