VMS Help  —  MACRO  /ALPHA  Lexical Operators, %TYPE
    Lexical operator for obtaining information about a name.

    Format

      %TYPE  (name)

1  –  Argument

 name

    The single argument is of type name. Information is returned
    about the name specified in the argument.

2  –  Description

    %TYPE is modeled after the OpenVMS DCL lexical function
    F$TYPE. %TYPE is used to obtain information about a name. The
    value returned is a numeric value with certain bit positions,
    either 0 or 1, depending on whether the specified name has the
    corresponding attribute. As described elsewhere, the decimal
    digits of the numeric value are substituted for the %TYPE lexical
    operator. %TYPE Attributes shows the symbolic names that are
    predefined for each attribute.

    Table 5 %TYPE Attributes

    Symbolic Name          Attribute

    MACRO64$TYPE_SYMBOL    Name is a numeric symbol name.
    MACRO64$TYPE_PROC_     Name is a procedure descriptor name.
    DESC
    MACRO64$TYPE_LABEL     Name is a label.
    MACRO64$TYPE_EXTERN    Name is an external name.
    MACRO64$TYPE_WEAK      Name is a weak name.
    MACRO64$TYPE_PSECT     Name is a psect.
    MACRO64$TYPE_MACRO     Name is a macro name.
    MACRO64$TYPE_STRING    Name is a lexical string symbol name.
    MACRO64$TYPE_OPCODE    Name is an opcode.
    MACRO64$TYPE_DIR       Name is a directive.
    MACRO64$TYPE_GENREG    Name is a general register.
    MACRO64$TYPE_FLTREG    Name is a floating register.

    A given name may have zero, one, or several attributes.

3  –  Example

             .macro IS_GR ARG
               .IF equal, %TYPE(ARG) & <MACRO64$TYPE_GENREG>
                .PRINT "ARG is not a general register"
               .ENDC
             .endm IS_GR
             IS_GR F11

      Initially, the first line of the IS_GR macro expands as the
      following:

             .IF equal, <%TYPE(F11) & MACRO64$TYPE_GENREG>

      After lexical processing, the statement appears as:

             .IF equal, <8192 & MACRO64$TYPE_GENREG>

      In this example, 8192 is the attribute value for a floating-
      point register. This value could change in subsequent releases.
      Use only the predefined attribute masks described in %TYPE
      Attributes. Since the attribute for a general register
      MACRO64$TYPE_GENREG is 4096, the expression evaluates as 0.

             <8192 & MACRO64$TYPE_GENREG>
Close Help