UML 1.4 NO IDEA Avatar
  1. OMG Issue

UML14 — OCL: String literals

  • Key: UML14-975
  • Legacy Issue Number: 3146
  • Status: closed  
  • Source: OpenModeling ( Jos Warmer)
  • Summary:

    If, as I was told before, they are supposed to be similar to Java
    strings, the correct rule for string constants will be:

    string := "'" (
    (~["'","\\","\n","\r"] )

    ("
    "
    (
    ["n","t","b","r","f","\\","'","\""]
    ["0"-"7"]
    ( ["0"-"7"] ["0"-"7"]?)?
    )
    )
    )*
    "'"

    Allowing octal escapes only in the ASCII range is not really a part
    of syntax ­ it is a part of OCL semantics, and this is where it
    belongs.

    As a matter of fact, even that is not 100% right ­ because it doesn't
    allow for hexadecimal escape sequences ­ and allows to specify
    only ASCII characters (decimal codes 0..255), while in Java strings
    the hexadecimal escapes can be used to specify any UNICODE
    character.

    I am also wondering, why OCL insists that all strings should be
    ASCII strings? Is there a compelling reason for disallowing
    UNICODE strings (and thus having no support for international
    applications)?

  • Reported: UML 1.2 — Fri, 17 Dec 1999 05:00 GMT
  • Disposition: Resolved — UML 1.3
  • Disposition Summary:

    No Data Available

  • Updated: Fri, 6 Mar 2015 21:37 GMT