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 Numeric Types Representing Real Numbers

WiP.OutputFormatsForNumericTypesRepresentingRealNumbers History

Hide minor edits - Show changes to output

2010-01-28 13:41 by benjk -
Added lines 141-143:

newline :
    <runtime host dependent ASCII control sequence for new line> ;
2010-01-28 13:35 by benjk -
Changed lines 16-17 from:
   defaultListSeparator | userDefinedListSeparator ;
to:
   defaultListSeparator | userDefinedListSeparator | newline ;
Changed line 29 from:
    newline | character whitespace? ;
to:
   character whitespace? ;
2010-01-28 13:34 by benjk -
Changed line 29 from:
   character whitespace? ;
to:
    newline | character whitespace? ;
2010-01-28 13:31 by benjk -
Changed line 140 from:
   <any printable ASCII character>
to:
   <any printable ASCII character> ;
2010-01-28 13:26 by benjk -
Changed lines 147-148 from:
* in decimal point mode, @@decimalPoint@@ is shown instead of @@decimalComma@@, @@decimalPointModePartSeparator@@ is shown instead of @@decimalCommaModePartSeparator@@ and @@decimalPointModeDigitSeparator@@ is shown instead of @@decimalCommaModeDigitSeparator@@.
* in decimal comma mode,
@@decimalComma@@ is shown instead of @@decimalPoint@@, @@decimalCommaModePartSeparator@@ is shown instead of @@decimalPointModePartSeparator@@ and @@decimalCommaModeDigitSeparator@@ is shown instead of @@decimalPointModeDigitSeparator@@.
to:
* in decimal point mode, @@decimalPoint@@ is shown instead of @@decimalComma@@ and @@decimalPointModeDigitSeparator@@ is shown instead of @@decimalCommaModeDigitSeparator@@.
* in decimal comma mode,
@@decimalComma@@ is shown instead of @@decimalPoint@@ and @@decimalCommaModeDigitSeparator@@ is shown instead of @@decimalPointModeDigitSeparator@@.
2010-01-28 13:25 by benjk -
Changed lines 144-145 from:
* @@separator@@ and @@decimalPoint@@ never both use the same symbol.
to:
* all values in a list are shown in the same notation.
* all values in a list are shown with identical formatting
.
Added lines 147-148:
* in decimal point mode, @@decimalPoint@@ is shown instead of @@decimalComma@@, @@decimalPointModePartSeparator@@ is shown instead of @@decimalCommaModePartSeparator@@ and @@decimalPointModeDigitSeparator@@ is shown instead of @@decimalCommaModeDigitSeparator@@.
* in decimal comma mode, @@decimalComma@@ is shown instead of @@decimalPoint@@, @@decimalCommaModePartSeparator@@ is shown instead of @@decimalPointModePartSeparator@@ and @@decimalCommaModeDigitSeparator@@ is shown instead of @@decimalPointModeDigitSeparator@@.
2010-01-28 13:21 by benjk -
Changed line 92 from:
   ' ' | '+' | '-' ;
to:
   whitespace | '+' | '-' ;
2010-01-28 13:00 by benjk -
Changed line 140 from:
   <any printable ASCII character except single quotation mark>
to:
   <any printable ASCII character>
2010-01-28 12:59 by benjk -
Changed line 137 from:
   ''' character* ''' ;
to:
   character* ;
2010-01-28 12:57 by benjk -
Added lines 124-126:
digitGroup :
    decimalDigit decimalDigit decimalDigit ;

Deleted lines 131-133:

digitGroup :
    decimalDigit decimalDigit decimalDigit ;
2010-01-28 12:56 by benjk -
Added lines 115-123:
digitSeparator :
    decimalPointModeDigitSeparator | decimalCommaModeDigitSeparator ;

decimalPointModeDigitSeparator :
    whitespace | ',' ;

decimalCommaModeDigitSeparator :
    whitespace | '.' ;

Deleted lines 128-130:

separator :
    ' ' | '.' | ',' ;
2010-01-28 12:54 by benjk -
Changed lines 101-102 from:
   decimalDigit decimalDigit? decimalDigit? ( separator? digitGroup )* ;
to:
   decimalDigit decimalDigit? decimalDigit? ( digitSeparator? digitGroup )* ;
Changed lines 104-105 from:
   ( ( ( decimalDigit separator? )? decimalDigit )? decimalDigit )? decimalDigit ;
to:
   ( ( ( decimalDigit digitSeparator? )? decimalDigit )? decimalDigit )? decimalDigit ;
Changed line 107 from:
   ( decimalDigit ( decimalDigit ( decimalDigit separator )? )? )* decimalDigit ;
to:
   ( decimalDigit ( decimalDigit ( decimalDigit digitSeparator )? )? )* decimalDigit ;
2010-01-28 12:52 by benjk -
Changed lines 65-66 from:
   padding+ unpaddedRealNumberValue ;
to:
   whitespace+ unpaddedRealNumberValue ;
Changed lines 68-69 from:
   unpaddedRealNumberValue padding+ ;
to:
   unpaddedRealNumberValue whitespace+ ;

whitespace :
    ' '
;
Deleted lines 90-92:
padding :
    ' ' ;

Changed line 98 from:
   ' ' | '*' | '0' ;
to:
   whitespace | '*' | '0' ;
2010-01-28 11:01 by benjk -
Added lines 73-75:
simpleFormat :
    negativeSign? decimalDigit decimalPoint decimalDigit+ exponent ;

Deleted lines 78-80:
simpleFormat :
    negativeSign? decimalDigit '.' decimalDigit+ exponent ;

Changed lines 80-81 from:
   integralPart decimalPoint fractionalPart ;
to:
   integralPart ( decimalPoint | decimalComma ) fractionalPart ;
Changed lines 83-84 from:
   engIntegralPart decimalPoint fractionalPart engExponent ;
to:
   engIntegralPart ( decimalPoint | decimalComma ) fractionalPart engExponent ;
Changed lines 86-87 from:
   fixedFmtNumeral exponent ;
to:
   fixedFmtDecimal exponent ;
Changed lines 116-119 from:
   '.' | ',' ;
to:
   '.' ;

decimalComma :
 
',' ;
2010-01-28 10:48 by benjk -
Changed lines 10-11 from:
   unpaddedRealNumberValue | leftPaddedRealNumberValue | rightPaddedRealNumberValue ;
to:
   realNumberNotation ;
Added lines 61-63:
realNumberNotation :
    unpaddedRealNumberValue | leftPaddedRealNumberValue | rightPaddedRealNumberValue ;

2010-01-28 10:39 by benjk -
Added line 7:
!!!!!Values and Value Lists
Added lines 12-60:
realNumberValueList :
    realNumberValue ( listSeparator realNumberValue )* ;

listSeparator :
    defaultListSeparator | userDefinedListSeparator ;

defaultListSeparator :
    defaultListSeparatorForValuesWithCommas |
    defaultListSeparatorForValuesWithoutCommas ;

defaultListSeparatorForValuesWithCommas :
    ';' whitespace ;

defaultListSeparatorForValuesWithoutCommas :
    ',' whitespace ;

userDefinedListSeparator :
    character whitespace? ;
@]

!!!!!Arrays and Array Lists
[@
realNumberArray :
    openingArrayDelimiter realNumberValueList closingArrayDelimiter ;

realNumberArrayList :
    realNumberArray ( listSeparator realNumberArray )* ;

openingArrayDelimiter :
    ( defaultOpeningArrayDelimiter | userDefinedOpeningArrayDelimiter ) whitespace ;

closingArrayDelimiter :
    whitespace ( defaultClosingArrayDelimiter | userDefinedOpeningArrayDelimiter ) ;

defaultOpeningArrayDelimiter :
    '{' ;

defaultClosingArrayDelimiter :
    '}' ;

userDefinedOpeningArrayDelimiter :
    '(' | '[' ;

userDefinedClosingArrayDelimiter :
    ')' | ']' ;
@]

!!!!!Real Number Notation
[@
Changed lines 71-72 from:
   sign? fillChar* ( fixedFmtNumeral | engFmtNumeral | expFmtNumeral ) suffix? ;
to:
   sign? fillChar* ( fixedFmtDecimal | engFmtDecimal | expFmtDecimal ) suffix? ;
Changed line 76 from:
fixedFmtNumeral :
to:
fixedFmtDecimal :
Changed line 79 from:
engFmtNumeral :
to:
engFmtDecimal :
Changed line 82 from:
expFmtNumeral :
to:
expFmtDecimal :
Changed lines 132-133 from:
* @@separator@@ and @@decimalPoint@@ must never both use the same symbol.
* the numeric value represented by @@engExponent@@ must always be divisible by three.
to:
* @@separator@@ and @@decimalPoint@@ never both use the same symbol.
* the numeric value represented by @@engExponent@@ is always divisible by three.
2010-01-24 08:56 by benjk -
Changed lines 12-13 from:
   padding+ unPaddedRealNumberValue ;
to:
   padding+ unpaddedRealNumberValue ;
Changed line 15 from:
   unPaddedRealNumberValue padding+ ;
to:
   unpaddedRealNumberValue padding+ ;
2010-01-24 08:48 by benjk -
Added lines 1-3:
!!!Types
@@REAL@@, @@LONGREAL@@, @@BCD@@, @@LONGBCD@@

2010-01-24 08:46 by benjk -
Changed line 75 from:
   <any printable ASCII character>
to:
   <any printable ASCII character except single quotation mark>
2010-01-24 08:45 by benjk -
Changed line 80 from:
* the numeric value represented by @@`engExponent@@ must always be divisible by three.
to:
* the numeric value represented by @@engExponent@@ must always be divisible by three.
2010-01-24 08:45 by benjk -
Changed line 79 from:
* @@separator@@ and @@`decimalPoint@@ must never both use the same symbol.
to:
* @@separator@@ and @@decimalPoint@@ must never both use the same symbol.
2010-01-24 08:44 by benjk -
Changed lines 79-80 from:
* @@`decimalPoint@@ and @@`separator@@ must never both use the same symbol
* the numeric value represented by @@`engExponent@@ must always be divisible by three. *)
to:
* @@separator@@ and @@`decimalPoint@@ must never both use the same symbol.
* the numeric value represented by @@`engExponent@@ must always be divisible by three.
2010-01-24 08:43 by benjk -
Added line 1:
!!!Syntax
Changed lines 78-81 from:
   Static semantics are as follows:

    decimalPoint and separator must never both use the same symbol
    the numeric value represented by engExponent
must always be divisible by three. *)
to:
!!!Static Semantics
* @@`decimalPoint@@ and @@`separator@@ must never both use the same symbol
* the numeric value represented by @@`engExponent@@
must always be divisible by three. *)
2010-01-24 08:41 by benjk -
Changed lines 4-13 from:
bcdValue :
    unpaddedBCDValue | leftPaddedBCDValue | rightPaddedBCDValue ;

leftPaddedBCDValue :
    padding+ unPaddedBCDValue ;

rightPaddedBCDValue :
    unPaddedBCDValue padding+ ;

unPaddedBCDValue :
to:
realNumberValue :
    unpaddedRealNumberValue | leftPaddedRealNumberValue | rightPaddedRealNumberValue ;

leftPaddedRealNumberValue :
    padding+ unPaddedRealNumberValue ;

rightPaddedRealNumberValue :
    unPaddedRealNumberValue padding+ ;

unpaddedRealNumberValue :
2010-01-24 08:39 by benjk -
Added line 6:
Added line 9:
Added line 12:
Added line 15:
Added line 18:
Added line 21:
Added line 24:
Added line 27:
Added line 30:
Added line 33:
Added line 36:
Added line 39:
Added line 42:
Added line 45:
Added line 48:
Added line 51:
Added line 54:
Added line 57:
Added line 60:
Added line 63:
Added line 66:
Added line 69:
Added line 72:
2010-01-24 08:38 by benjk -
Added lines 1-57:
The EBNF for the textual representation of values of types that represent real numbers is

[@
bcdValue :
    unpaddedBCDValue | leftPaddedBCDValue | rightPaddedBCDValue ;
leftPaddedBCDValue :
    padding+ unPaddedBCDValue ;
rightPaddedBCDValue :
    unPaddedBCDValue padding+ ;
unPaddedBCDValue :
    simpleFormat | otherFormats ;
otherFormats :
    sign? fillChar* ( fixedFmtNumeral | engFmtNumeral | expFmtNumeral ) suffix? ;
simpleFormat :
    negativeSign? decimalDigit '.' decimalDigit+ exponent ;
fixedFmtNumeral :
    integralPart decimalPoint fractionalPart ;
engFmtNumeral :
    engIntegralPart decimalPoint fractionalPart engExponent ;
expFmtNumeral :
    fixedFmtNumeral exponent ;
padding :
    ' ' ;
sign :
    ' ' | '+' | '-' ;
negativeSign :
    '-' ;
fillChar :
    ' ' | '*' | '0' ;
integralPart :
    decimalDigit decimalDigit? decimalDigit? ( separator? digitGroup )* ;
engIntegralPart :
    ( ( ( decimalDigit separator? )? decimalDigit )? decimalDigit )? decimalDigit ;
fractionalPart :
    ( decimalDigit ( decimalDigit ( decimalDigit separator )? )? )* decimalDigit ;
exponent :
    'E' ( '+' | '-' ) decimalDigit decimalDigit+ ;
engExponent :
    exponent ;
decimalPoint :
    '.' | ',' ;
separator :
    ' ' | '.' | ',' ;
digitGroup :
    decimalDigit decimalDigit decimalDigit ;
decimalDigit  :
    '0' .. '9' ;
suffix :
    ''' character* ''' ;
character :
    <any printable ASCII character>
@]

  Static semantics are as follows:

    decimalPoint and separator must never both use the same symbol
    the numeric value represented by engExponent must always be divisible by three. *)