The input is a <specification>, whose BNF is:
<specification> ::= <letter>(<cspec_value>) <value> <letter> ::= c | d | e | E | f | g | G | i | o | s | u | x | X <cspec_value> ::= <value> <cspec> , <value> <cspec> ::= <parameters> "<flags>" "<flags>" , <parameters> <parameters> ::= <integer> <integer> , <integer> <flag> ::= - | + | <space> | 0 | # <flags> ::= <flag> <flag> <flags> <value> ::= <number> <string>Four entries are provided:
transforms <specification> into output <format_string> and <value>.
Note that the input <value> may be converted to an output <value> so as to be
consistent with the <specification> <letter>. Errors are displayed.
@X = 776
@c_output#prepare("E"("+", 10, 20, X?), Format^, Value^)
produces output:
Value = 776.0 Format = %+10.20E
is just like 1, except that <errors> is a (possibly empty) stream of diagnostics.
e.g.
@X = 1234567.89
@c_output#sprint('G'('+', 10, 5, X?), FO^)
produces output:
@FO = +1.2346E+06
where lt;specification_list> is a (square-bracketed) list of <specification>,
<formatted_output_list> is the corresponfing list of <formatted_output>, and
<errors_list> is the correspoding list of <errors>.
Possible items in the <errors> stream are largely self-explanatory:
unrecognised_specification
unrecognised_flag(<character>)
invalid_parameter(<term>)
cannot_convert(<term>(<term>))
This document is licensed under: Gnu General Public License - Version 3