This section describes the grammar required by the RWDecimal<T> stream input and string construction routines. The grammar provides a flexible and well-defined format for describing input.
For most users, the input format can be described as a one that lets you write any number in the conventional manner. For this discussion, "the conventional manner" allows commas as digit group separators, and permits leading dollar signs. It also allows you to indicate a negative number by appending a leading minus sign or surrounding the number with a pair of parentheses.
The grammar is described in terms of the following tokens, which are described using conventional regular expression notation:
<digit> := [0-9] <digitSep> := , <dec> := \. <leading> := \$<whiteSpace>* <trailing> := <never matched> <percent> := % <plus> := \+<whiteSpace>* <minus> := -<whiteSpace>* <lparen> := \(<whiteSpace>* <rparen> := <whiteSpace>*\) <null> := null <nan> := NaN <missing> := missing
Any string that can be described using the following grammar is acceptable as input:
start: nonum | num | perc num: led | signed | signed <trailing> perc: signed <percent> nonum: <lparen> anonum <rparen> anonum: <null> | <nan> | <missing> led: <leading> signed | <leading> signed <trailing> signed: frac | <plus> frac | <minus> frac | <lparen> frac <rparen> frac: digits | digits <dec> | digits <dec> digits | <dec> digits digits: <digit> | <digit> digits | <digit> <digitSep> digits
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.