Tokens are the smallest distinct entities of the ARexx language and may be a single or a series of characters. There are five categories of tokens:
Comments
A comment is any group of characters beginning with a /* and ending with a */. Every ARexx program must begin with a comment. Each /* must have a */ closing statement.
Inserting commentws throught your program not only helps you in keeping track of waht you do, but gives other an idea of waht you where thinking when creating your program.
Example: /* This is a comment*?
Symbols
A symbol is any group of the characters a-z, A-Z. 0-9, and period, exclamation point, question mark, dollar sign, and underscore. Symbols are translated to uppercase as the interpreter scans the program, so the symbol "Arexx" is the same as "AREXX". The four recognized symbols are as follows:
Fixed Symbols
Stem Symbols
Compound Symbols
Simple stem and compound symbols are called variables and may be assigned a value during the course of the program execution. If a variable has not yet been assigned a value, it is uninitialized. The value for an uninitilized variable is the variable name itself.
Stems and compound symbols have special properties that make them useful for building arrays and lists. Stem symbols provide a way to initialize a whole class of compound symbols.
When an assignment is made to a stem symbol, it assigns that value to all possible compound symbols derived from the stem. thus, the value of a compound symbol depends on the prior assignments made to itself or its associated stem.
When ever a compound symbol appears in a program, its name is expanded by replacing each node with its current value. The value string may consist of any characters, including embedded blanks, and will not be converted to uppercase. The result of the expansion is a new name that is used in place of the compound symbol.
Compound symbols can be regarded as a form of associative or content-addressable memory. they can also be used as a conventional indexed arrays, with added convenience that only a single assignment is required to initialize the entire array.
Strings
A string is any group of characters beginning and ending with a quote or double quote delimiter. The same delimiter must be used at both ends of the string. To have a delimiter character included in your string use a double delimiter sequence.
For Example:
"This is a normal string," - This is a normal string.
'Can"t you see?' - this is a double-delimiter sequence.
The value of a string is the string itself. The number of characters in the string is called its length. If the string does not contain any characters, it is called a null string.
Hex and binary strings are strings that are followed by a X or B and must be compose of hexadecimal digits or binary digits.
Blanks are permnited at byte boundries to improve readability. Hex anbd binary strings are convenient for specifying non-ASCII characters and machine specific information, like addresses.
Operators
Operators are a combination of the following characters: ~ + - * / + >< & | ^. The four types of operators are:
Arathmetic operators require on or two numeric operands and produce a numeric result.