Site Menu Project Specification Implementation Recommendations Reference Needs Updating Work in Progress Wastebasket Wiki Manual |
Output Formats For Numeric Types Representing Complex NumbersTypes
SyntaxThe EBNF for the textual representation of values of types that represent complex numbers is Values and Value ListscomplexNumberValue : compactNotation | expandedNotation | pairNotation ; complexNumberValueList : complexNumberValue ( listSeparator complexNumberValue )* ; listSeparator : defaultListSeparator | userDefinedListSeparator | newline ; defaultListSeparator : defaultListSeparatorForValuesWithCommas | defaultListSeparatorForValuesWithoutCommas ; defaultListSeparatorForValuesWithCommas : ';' whitespace ; defaultListSeparatorForValuesWithoutCommas : ',' whitespace ; userDefinedListSeparator : character whitespace? ; Arrays and Array ListscomplexNumberArray : openingArrayDelimiter complexNumberValueList closingArrayDelimiter ; complexNumberArrayList : complexNumberArray ( listSeparator complexNumberArray )* ; openingArrayDelimiter : ( defaultOpeningArrayDelimiter | userDefinedOpeningArrayDelimiter ) whitespace ; closingArrayDelimiter : whitespace ( defaultClosingArrayDelimiter | userDefinedOpeningArrayDelimiter ) ; defaultOpeningArrayDelimiter : '{' ; defaultClosingArrayDelimiter : '}' ; userDefinedOpeningArrayDelimiter : '(' | '[' ; userDefinedClosingArrayDelimiter : ')' | ']' ; Mathematical NotationcompactNotation : compactNotationAllPartsZero | compactNotationImaginaryPartZero | compactNotationRealPartZero | compactNotationAllPartsNonZero ; compactNotationAllPartsZero : '0' ; compactNotationImaginaryPartZero : compactRealPart ; compactNotationRealPartZero ; simpleSign? compactImaginaryPart ; compactNotationAllPartsNonZero : compactRealPart simpleSign compactImaginaryPart ; compactRealPart : simpleSign? simpleNonZeroDecimalRealNumber ; compactImaginaryPart : simpleNonZeroDecimalRealNumber imaginaryPartDesignator; simpleSign : '+' | '-' ; imaginaryPartDesignator : 'i' | 'j' ; simpleNonZeroDecimalRealNumber : decimalDigit+ ( decimalPoint | decimalComma ) decimalDigit+ ; expandedNotation : expandedRealPart simpleSign expandedImaginaryPart ; expandedRealPart : '0' | simpleNonZeroDecimalRealNumber ; expandedImaginaryPart : ( '0' | simpleNonZeroDecimalRealNumber ) imaginaryPartDesignator ; Pair NotationpairNotation : unpaddedComplexPair | leftPaddedComplexPair | rightPaddedComplexPair ; leftPaddedComplexPair : whitespace+ unpaddedComplexPair ; rightPaddedComplexPair : unpaddedComplexPair whitespace+ ; whitespace : ' ' ; unpaddedComplexPair : '(' realPart partSeparator imaginaryPart ')' ; realPart : formattedRealNumber ; imaginaryPart : formattedRealNumber ; partSeparator : decimalPointModePartSeparator | decimalCommaModePartSeparator ; decimalPointModePartSeparator : ',' whitespace ; decimalCommaModePartSeparator : ';' whitespace ; formattedRealNumber : realNumberSimpleFormat | realNumberOtherFormats ; realNumberSimpleFormat : negativeSign? decimalDigit decimalPoint decimalDigit+ exponent ; realNumberOtherFormats : sign? fillChar* ( fixedFmtDecimal | engFmtDecimal | expFmtDecimal ) ; fixedFmtDecimal : integralPart ( decimalPoint | decimalComma ) fractionalPart ; engFmtDecimal : engIntegralPart ( decimalPoint | decimalComma ) fractionalPart engExponent ; expFmtDecimal : fixedFmtDecimal exponent ; sign : whitespace | '+' | '-' ; negativeSign : '-' ; fillChar : whitespace | '*' | '0' ; integralPart : decimalDigit decimalDigit? decimalDigit? ( digitSeparator? digitGroup )* ; engIntegralPart : ( ( ( decimalDigit digitSeparator? )? decimalDigit )? decimalDigit )? decimalDigit ; fractionalPart : ( decimalDigit ( decimalDigit ( decimalDigit digitSeparator )? )? )* decimalDigit ; exponent : 'E' ( '+' | '-' ) decimalDigit decimalDigit+ ; engExponent : exponent ; digitSeparator : decimalPointModeDigitSeparator | decimalCommaModeDigitSeparator ; decimalPointModeDigitSeparator : whitespace | ',' ; decimalCommaModeDigitSeparator : whitespace | '.' ; digitGroup : decimalDigit decimalDigit decimalDigit ; decimalPoint : '.' ; decimalComma : ',' ; decimalDigit : '0' .. '9' ; character : <any printable ASCII character> ; newline : <runtime host dependent ASCII control sequence for new line> ; Static Semantics
|