Product SiteDocumentation Site

1.10.4. Tokens

A token is the unit of low-level syntax from which clauses are built. Programs written in Rexx are composed of tokens. Tokens can be of any length, up to an implementation-restricted maximum. They are separated by whitespace or comments, or by the nature of the tokens themselves. The classes of tokens are:

1.10.4.1. Literal Strings

A literal string is a sequence including any characters except line feed (X"10") and delimited by a single quotation mark (') or a double quotation mark ("). You use two consecutive double quotation marks ("") to represent one double quotation mark (") within a string delimited by double quotation marks. Similarly, you use two consecutive single quotation marks ('') to represent one single quotation mark (') within a string delimited by single quotation marks. A literal string is a constant and its contents are never modified when it is processed. Literal strings must be complete on a single line. This means that unmatched quotation marks can be detected on the line where they occur.
A literal string with no characters (that is, a string of length 0) is called a null string.
These are valid strings:

Example 1.6. Valid strings

"Fred"
"Don't Panic!"
'You shouldn''t'        /* Same as "You shouldn't" */
""                      /* The null string         */

A literal string has no upper bound on the number of characters, limited only by available memory.
Note that a string immediately followed by a left parenthesis is considered to be the name of a function. If immediately followed by the symbol X or x, it is considered to be a hexadecimal string. If followed immediately by the symbol B or b, it is considered to be a binary string.