HPlogo System Debug Reference Manual > Chapter 2 User Interface

Operand Lookup Precedence

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

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:
  1. Test for a string literal or a numeric literal in the current input base.

  2. Test for a predefined variable.

  3. Test for a user-defined variable.

  4. Test for a predefined function.

  5. Test for a macro.

  6. Test for a procedure name symbol in the current mode, subject to the search path in effect.

  7. 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.




Procedure Name: Symbols


Command Line Substitutions