[Home] [Prev] [Next] [Index]

2.10 Allowable Replacements of Characters

2.10 Allowable Replacements of Characters

1
The following replacements are allowed for the vertical bar, sharp, and quotation basic characters:

2 ·
A vertical bar character (|) can be replaced by an exclamation mark (!) where used as a delimiter.

3 ·
The sharp characters (#) of a based literal can be replaced by colons (:) provided that the replacement is done for both occurrences.

4 ·
The quotation characters (") used as string brackets at both ends of a string literal can be replaced by percent characters (%) provided that the enclosed sequence of characters contains no quotation character, and provided that both string brackets are replaced. Any percent character within the sequence of characters must then be doubled and each such doubled percent character is interpreted as a single percent character value.

5
These replacements do not change the meaning of the program.

Notes:

6
It is recommended that use of the replacements for the vertical bar, sharp, and quotation characters be restricted to cases where the corresponding graphical symbols are not available. Note that the vertical bar appears as a broken bar on some equipment; replacement is not recommended in this case.

7
The rules given for identifiers and numeric literals are such that lower case and upper case letters can be used indifferently; these lexical elements can thus be written using only characters of the basic character set. If a string literal of the predefined type STRING contains characters that are not in the basic character set, the same sequence of character values can be obtained by catenating string literals that contain only characters of the basic character set with suitable character constants declared in the predefined package ASCII. Thus the string literal "AB$CD" could be replaced by "AB" & ASCII.DOLLAR & "CD". Similarly, the string literal "ABcd" with lower case letters could be replaced by "AB" & ASCII.LC_C & ASCII.LC_D.

8
References:

*
ascii predefined package C

*
based literal 2.4.2

*
basic character 2.1

*
catenation operation 4.5.3

*
character value 3.5.2

*
delimiter 2.2

*
graphic character 2.1

*
graphical symbol 2.1

*
identifier 2.3

*
lexical element 2.2

*
lower case letter 2.1

*
numeric literal 2.4

*
string bracket 2.6

*
string literal 2.6

*
upper case letter 2.1



[Home] [Prev] [Next] [Index]

documentation@rational.com
Copyright © 1993-2000, Rational Software Corporation. All rights reserved.