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 Format For Type OCTET

Types

OCTET

Syntax

The EBNF for the textual representation of values of type octet is

Values and Value Lists
octetValue :
    octetNotation;

octetValueList :
    octetValue ( listSeparator octetValue )* ;

listSeparator :
    defaultListSeparator | userDefinedListSeparator | newline ;

defaultListSeparator :
    ',' whitespace ;

userDefinedListSeparator :
    character whitespace? ;
Arrays and Array Lists
octetArray :
     openingArrayDelimiter octetValueList closingArrayDelimiter ;

octetArrayList :
    octetArray ( listSeparator octetArray )* ;

openingArrayDelimiter :
    ( defaultOpeningArrayDelimiter | userDefinedOpeningArrayDelimiter ) whitespace ;

closingArrayDelimiter :
    whitespace ( defaultClosingArrayDelimiter | userDefinedOpeningArrayDelimiter ) ;

defaultOpeningArrayDelimiter :
    '{' ;

defaultClosingArrayDelimiter :
    '}' ;

userDefinedOpeningArrayDelimiter :
    '(' | '[' ;

userDefinedClosingArrayDelimiter :
    ')' | ']' ;
Octet Notation
octetNotation :
    unpaddedOctetValue | leftPaddedOctetValue | rightPaddedOctetValue ;

leftPaddedOctetValue :
    whitespace+ unpaddedOctetValue ;

rightPaddedOctetValue :
    unpaddedOctetValue whitespace+ ;

whitespace :
    ' ' ;

unpaddedOctetValue :
    simpleFormat | otherFormats ;

simpleFormat :
    base16DigitUppercase base16DigitUppercase ;

otherFormats :
    base16CLiteralFmt | base16M2LiteralFmt | binaryM2LiteralFmt ;

base16CLiteralFmt :
    '0' 'x' base16DigitLowercase base16DigitLowercase ;

base16M2LiteralFmt :
    '0' base16DigitUppercase base16DigitUppercase 'H' ;

binaryM2LiteralFmt :
    binaryDigitGroup binaryDigitGroup "B" ;

binaryDigit  :
    '0' | '1' ;

binaryDigitGroup :
    binaryDigit binaryDigit binaryDigit binaryDigit ;

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

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

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.