Loading ...
Sorry, an error occurred while loading the content.

Specification of `is_xxx' in STRING

Expand Messages
  • Emmanuel STAPF [ISE]
    Just wanted to check something. In the BNF grammar we provided for the `is_XXX features in the STRING class. Did we incontiously accept white spaces before
    Message 1 of 4 , Apr 24, 2002
    • 0 Attachment
      Just wanted to check something. In the BNF grammar we provided for the
      `is_XXX' features in the STRING class. Did we incontiously accept white
      spaces before the Sign, between the sign and the number and after the
      number? My reading says no, but I just wanted to double check. We could
      also add that in the specification.

      Regards,
      Manu
    • Roger Browne
      ... No, whitespace is not accepted. We decided that stripping whitespace and parsing numbers are completely orthogonal. One reason is that the definition of
      Message 2 of 4 , Apr 24, 2002
      • 0 Attachment
        Manu wrote:
        > ... In the BNF grammar we provided for the
        > `is_XXX' features in the STRING class. Did we incontiously accept white
        > spaces before the Sign, between the sign and the number and after the
        > number? ...

        No, whitespace is not accepted.

        We decided that stripping whitespace and parsing numbers are completely
        orthogonal. One reason is that the definition of "whitespace" may vary for
        different applications, or difference character sets. Therefore, whitespace
        stripping should be implemented in one place, not all over the features of
        many classes.

        Regards,
        Roger
      • Arno Wagner
        ... I think I did these (at least the initial versions). My understanding of BNF says that whitespace has to be written explicitely, e.g. like this: SPACE or
        Message 3 of 4 , Apr 24, 2002
        • 0 Attachment
          On Wed, Apr 24, 2002 at 08:19:53AM -0700, Emmanuel STAPF [ISE] wrote:
          > Just wanted to check something. In the BNF grammar we provided for the
          > `is_XXX' features in the STRING class. Did we incontiously accept white
          > spaces before the Sign, between the sign and the number and after the
          > number? My reading says no, but I just wanted to double check. We could
          > also add that in the specification.

          I think I did these (at least the initial versions).

          My understanding of BNF says that whitespace has to be written
          explicitely, e.g. like this: SPACE or " ".

          Or more precisely:

          Whitespace = [Whitespace] Whitespace_Character
          Whitespace_Character = SPACE|TAB|CR|LF
          SPACE = <ASCII SP, space>
          TAB = <ASCII TAB, tabulator>
          CR = <ASCII CR, carriage return>
          LF = <ASCII LF, linefeed>

          With possibly additional symbols in there. (This is in the
          spirit as e.g. RFC822 does it.)

          So the BNF does not allow whitespace anywhere.

          However I seem to rememberwe did not manage to make a good definition
          of whitespace, so we could not have specified any, even if we had
          wanted it. I don't remember what the opinions where about this.

          The SE implementation, e.g., allows leading and trailing "seperators",
          but no whitespace within the number. My personal preference would be
          no whitespace anywhere in these features, but instead the presence of
          a function/procedure that allows the removal of all whitespace from a
          string so the effect of whitespace allowing is_XXX features could be
          easily emulated.

          Regards,
          Arno
          --
          Arno Wagner, Communication Systems Group, ETH Zuerich, wagner@...
          GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F

          A modern US Navy cruiser now requires 26 tons of manuals. This is enough to
          affect the vessel's performance. -- New Scientist on the paperless office
        Your message has been successfully submitted and would be delivered to recipients shortly.