F.3.1 Picture String Formation
{
AI05-0299-1}
A
well-formed picture String,
or simply
picture String, is a String value that conforms to the
syntactic rules, composition constraints, and character replication conventions
specified in this subclause.
Dynamic Semantics
This paragraph was
deleted.
picture_string ::=
fixed_$_picture_string
| fixed_#_picture_string
| floating_currency_picture_string
| non_currency_picture_string
fixed_$_picture_string ::=
[fixed_LHS_sign] fixed_$_char {direct_insertion} [zero_suppression]
number [RHS_sign]
| [fixed_LHS_sign {direct_insertion}] [zero_suppression]
number fixed_$_char {direct_insertion} [RHS_sign]
| floating_LHS_sign number fixed_$_char {direct_insertion} [RHS_sign]
| [fixed_LHS_sign] fixed_$_char {direct_insertion}
all_zero_suppression_number {direct_insertion} [RHS_sign]
| [fixed_LHS_sign {direct_insertion}] all_zero_suppression_number {direct_insertion}
fixed_$_char {direct_insertion} [RHS_sign]
| all_sign_number {direct_insertion} fixed_$_char {direct_insertion} [RHS_sign]
fixed_#_picture_string ::=
[fixed_LHS_sign] single_#_currency {direct_insertion}
[zero_suppression] number [RHS_sign]
| [fixed_LHS_sign] multiple_#_currency {direct_insertion}
zero_suppression number [RHS_sign]
| [fixed_LHS_sign {direct_insertion}] [zero_suppression]
number fixed_#_currency {direct_insertion} [RHS_sign]
| floating_LHS_sign number fixed_#_currency {direct_insertion} [RHS_sign]
| [fixed_LHS_sign] single_#_currency {direct_insertion}
all_zero_suppression_number {direct_insertion} [RHS_sign]
| [fixed_LHS_sign] multiple_#_currency {direct_insertion}
all_zero_suppression_number {direct_insertion} [RHS_sign]
| [fixed_LHS_sign {direct_insertion}] all_zero_suppression_number {direct_insertion}
fixed_#_currency {direct_insertion} [RHS_sign]
| all_sign_number {direct_insertion} fixed_#_currency {direct_insertion} [RHS_sign]
floating_currency_picture_string ::=
[fixed_LHS_sign] {direct_insertion} floating_$_currency number [RHS_sign]
| [fixed_LHS_sign] {direct_insertion} floating_#_currency number [RHS_sign]
| [fixed_LHS_sign] {direct_insertion} all_currency_number {direct_insertion} [RHS_sign]
non_currency_picture_string ::=
[fixed_LHS_sign {direct_insertion}] zero_suppression number [RHS_sign]
| [floating_LHS_sign] number [RHS_sign]
| [fixed_LHS_sign {direct_insertion}] all_zero_suppression_number {direct_insertion}
[RHS_sign]
| all_sign_number {direct_insertion}
| fixed_LHS_sign direct_insertion {direct_insertion} number [RHS_sign]
fixed_LHS_sign ::= LHS_Sign
LHS_Sign ::= + | – | <
fixed_$_char ::= $
direct_insertion ::= simple_insertion
simple_insertion ::= _ | B | 0 | /
zero_suppression ::= Z {Z | context_sensitive_insertion} | fill_string
context_sensitive_insertion ::= simple_insertion
fill_string ::= * {* | context_sensitive_insertion}
number ::=
fore_digits [radix [aft_digits] {direct_insertion}]
| radix aft_digits {direct_insertion}
fore_digits ::= 9 {9 | direct_insertion}
aft_digits ::= {9 | direct_insertion} 9
radix ::= . | V
RHS_sign ::= + | – | > | CR | DB
floating_LHS_sign ::=
LHS_Sign {context_sensitive_insertion} LHS_Sign {LHS_Sign | context_sensitive_insertion}
single_#_currency ::= #
multiple_#_currency ::= ## {#}
fixed_#_currency ::= single_#_currency | multiple_#_currency
floating_$_currency ::=
$ {context_sensitive_insertion} $ {$ | context_sensitive_insertion}
floating_#_currency ::=
# {context_sensitive_insertion} # {# | context_sensitive_insertion}
all_sign_number ::= all_sign_fore [radix [all_sign_aft]] [>]
all_sign_fore ::=
sign_char {context_sensitive_insertion} sign_char {sign_char | context_sensitive_insertion}
all_sign_aft ::= {all_sign_aft_char} sign_char
all_sign_aft_char ::= sign_char | context_sensitive_insertion
sign_char ::= + | – | <
all_currency_number ::= all_currency_fore [radix [all_currency_aft]]
all_currency_fore ::=
currency_char {context_sensitive_insertion}
currency_char {currency_char | context_sensitive_insertion}
all_currency_aft ::= {all_currency_aft_char} currency_char
all_currency_aft_char ::= currency_char | context_sensitive_insertion
currency_char ::= $ | #
all_zero_suppression_number ::= all_zero_suppression_fore [ radix [all_zero_suppression_aft]]
all_zero_suppression_fore ::=
zero_suppression_char {zero_suppression_char | context_sensitive_insertion}
all_zero_suppression_aft ::= {all_zero_suppression_aft_char} zero_suppression_char
all_zero_suppression_aft_char ::= zero_suppression_char | context_sensitive_insertion
zero_suppression_char ::= Z | *
The following composition
constraints apply to a picture String:
A floating_LHS_sign
does not have occurrences of different LHS_Sign
Character values.
If a picture String has '<' as fixed_LHS_sign,
then it has '>' as RHS_sign.
If a picture String has '<' in a floating_LHS_sign
or in an all_sign_number, then it has an occurrence
of '>'.
{
8652/0088}
{
AI95-00153}
If a picture String has '+' or '–' as
fixed_LHS_sign,
in a
floating_LHS_sign, or in an
all_sign_number,
then it has no
RHS_sign or '>' character.
An instance of all_sign_number
does not have occurrences of different sign_char
Character values.
An instance of all_currency_number
does not have occurrences of different currency_char
Character values.
An instance of all_zero_suppression_number
does not have occurrences of different zero_suppression_char
Character values, except for possible case differences between 'Z' and
'z'.
A replicable Character is a Character that,
by the above rules, can occur in two consecutive positions in a picture
String.
A Character replication
is a String
char & '(' & spaces & count_string & ')'
where char is a replicable Character, spaces
is a String (possibly empty) comprising only space Character values,
and count_string is a String of one or more decimal digit Character
values. A Character replication in a picture String has the same effect
as (and is said to be equivalent to) a String comprising n
consecutive occurrences of char, where n=Integer'Value(count_string).
An expanded picture String is a picture String
containing no Character replications.
Discussion: Since 'B' is not allowed
after a RHS sign, there is no need for a special rule to disallow "9.99DB(2)"
as an abbreviation for "9.99DBB"
NOTE Although a sign to the left
of the number can float, a sign to the right of the number is in a fixed
position.
Wording Changes from Ada 95
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe