Re: Required Real/Integer Syntax for TextMapper.Scanner?

From: Bernhard Treutwein <"Bernhard>
Date: Sun, 15 Sep 2002 13:46:00 +0200

----boundary-LibPST-iamunique-442232992_-_-
Content-type: text/plain

Hi Marc,
>
> I've been using the TextMapper.Scanner to read some datafiles, and I
noticed
> that the string "-0" returns TextMappers.invalid, instead of an integer
zero
> (which is what I would have preferred it to do).
> When I then looked through
> the documentation, I couldn't find anything that indicated what the
required
>
> syntax is for a valid integer or a valid
> read number.
do you mean real or really read ?

> Is this documented somewhere and I missed it?
>

as far as I know there is no special documentation of the format for
TextMappers, but I guess that is is the same as the definition of numbers
in the report. I cite the report:

number = integer | real.
integer = digit {digit} | digit {hexDigit} ( "H" | "L" ).
real = digit {digit} "." {digit} [ScaleFactor].
ScaleFactor = "E" ["+" | "-"] digit {digit}.
hexDigit = digit | "A" | "B" | "C" | "D" | "E" | "F".

reading that EBNF it appears to me that signed (esp. negative) numbers
are not really included, it seems that they are handled by means of
arithmetic operators for the language. If so that may be a problem
for TextMappers, which should be tested/cured (support{([at]})nowhere.xy
are you listening ?).

On the other hand I don't really know if -0 is really useful ...
see: http://www.fourmilab.ch/documents/univac/minuszero.html
AFAIK, -0 has a clear meaning for IEEE floating point, but I'm not shure
for integers.
--
    Bernhard Treutwein
    BdT{([at]})nowhere.xy    Bernhard.Treutwein{([at]})nowhere.xy--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xyCurrent posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-442232992_-_-
Content-type: application/rtf
Content-transfer-encoding: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