|
|
When expressions are scanned and parsed, they are ultimately
broken down into a series of tokens, which represent either operators
or operands. The preceding sections of this chapter introduced all
the possibilities for operand tokens in expressions, thereby answering
the question, "What sorts of things can be used as operands?" This
section deals with the converse: "Given an operand, what sort of
thing is it?"
The process of evaluating an operand token can be modeled
by a list of possible interpretations of a token. The unknown token
is tested against each of the possibilities in the list, in the
specified order, with the first match determining the token's meaning.
The following list determines the interpretation of an operand token:
Test for a string literal or a numeric literal in the current
input base.
Test for a predefined variable.
Test for a user-defined variable.
Test for a predefined function.
Test for a macro.
Test for a procedure name symbol in the current mode, subject to
the search path in effect.
If still unresolved, fail.
There are two operand modifiers that, when prefixed to an
operand, alter the above search order for that operand. The exclamation
point (!) signals that the operand to which it is prefixed is not
to be treated as a numeric literal. This prevents the token from
being mistaken as a hex constant and initiates the operand search at step 2.
A question mark prefix (?) indicates that the operand is to
be treated as a procedure name symbol and that the entry point or
export stub address of the named procedure is being referenced instead
of its starting address. The search for such symbols begins with step 6.
|