HPlogo HP/DDE Debugger User's Guide: HP 9000 Series 700/800 Computers > Appendix B Language Managers

C++ Language Manager

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

Type Name

lang_c++

Title

C++

Description

In general, this manager supports the C++ expressions and declarations described in your C++ reference manual, and the debugger extensions listed under "Syntax."

Function overloading is permitted, and modules may contain identically named functions. Identically named functions are specified by name and parameters that identify them using the syntax

`amb(function_name,parameter_type,parameter_type,...)

where function_name is the name of the function and parameter_type is a list of the data types of the function's parameters, separated by commas. You may list all of the parameters; alternatively, you may list as many parameter_type arguments as you need to identify the function or functions you are referring to, and use ellipses () to indicate that the function may take additional parameters. Use

`amb(function_name)

to specify a version of the overloaded function that takes no parameters. Use

`amb(function_name,...)

to specify all versions of the overloaded function.

For example,

`amb(sum,int,int)

refers to a function sum in the current environment that takes two integer parameters.

`amb(sum,int,int,...)

refers to all functions named sum in the current environment that take at least two parameters, the first two being integers.

Also note that, in the examples above, the syntax relates to the use of `amb to specify a location. You can also use `amb as a part of a qualified name to identify objects or variables. An example of the syntax is:

\module\`amb(function_name,parameter_type,...)\object_name

The language manager implements overload resolution rules appropriate to C++ to resolve ambiguity. Overload resolution considers built-in type conversions but not user-defined type conversions.

The debugger does not execute implicit references to user-defined type-conversion operators.

The debugger supports standard operator syntax for user-defined operators (this does not include the new, delete, ++,,(), ->, and ->* operators). For example, if the user defines a + operator for a class, the command

print a + b

on two operands of that class invokes the user-defined + operator. However, you can also invoke the operator (including the new, delete, ++,,(), ->, and ->* operators ) using the following member function call syntax:

print a.operator+(b)

Syntax

  • declaration

    A declaration of a type or variable, restricted to the following syntax:

    • type_ref id,

    • type_ref id[bounds]

    • typedef type_ref id

      type_ref:    char
      wchar_t
      int
      long
      short
      float
      double
      long double
      void
      class id
      struct id
      union id
      enum id
      type_ref *
      typeof(identifier)
      unsigned
      signed
      id

      The following are also available with the HP ANSI CC compiler:

                 bool
      long long
  • expression

    A C++ expression constructed from the comments, operators, identifiers, constants, and extensions listed in this section.

    Comments

    /* comment */ // comment

    Operators

    Arithmetic

    +, -, *, /, %

    Increment/decrement

    ++,

    Relational

    <, <=, >, >=, ==, !=

    Logical

    &&, ||, !

    Bitwise logical

    &, ^, |, ~

    Shift

    <<, &>&>

    Assignment

    =, +=, -=, *=, /=, %=, |=, ^=, &=, &>&>=, <<=

    Address

    *, &

    Conditional

    ?:

    Sequential evaluation

    ,

    Size

    sizeof

    Type conversion

    (type) or simple_type(expr)

    Array indexing

    [,]

    Member reference

    ->, ., .*, ->*

    Grouping

    ()

    Scope resolution

    ::identifier

    The following operators are available with the HP ANSI CC compiler:

    Dynamic cast

    dynamic_cast<type>(expr)

    Type identification

    typeid(expr)

    Identifiers

    Identifiers are case sensitive and start with a letter (ISO Latin-1 decimal values 65-90 and 97-122), a dollar sign ($), a tilde (~), a colon (:), or an underscore (_); any additional characters can be a letter, digit (0-9), dollar sign ($), underscore (_), a tilde (~), a colon (:), or an operator symbol. Use of the dollar sign, tilde, and colon are extensions to C++.

    Constants

    Integer

    digits[L|l|U|u] (decimal)

    0xdigits[L|l|U|u] (hexadecimal)

    0digits[L|l|U|u] (octal)

    For example, 0xFu specifies an unsigned hexadecimal number.

    Float

    digits.digits[{E|e}[+|-]digits][F|f|L|l]

    digits.[{E|e}[+|-]digits][F|f|L|l]

    .digits[{E|e}[+|-]digits][F|f|L|l]

    For example, 2.0e4L specifies a number of type long double.

    String

    "string"
    `character' '\nnn'

    Wide string

    L"string"
    L'character' L'\nnn'

    Debugger Extensions

    location\identifierName identifier visible from the scope location
    `va(address) Virtual address address
    `amb(funct_name,
    parameter_type,
    parameter_type,...)
    Use the list of parameter types
    (parameter_type) to uniquely
    identify the overloaded function
    funct_name
    `long(expr) Cast the resulting value of expression to type long
    `short(expression) Cast the resulting value of expression to type short
    typeof(identifier) The type of identifier; can be used to refer to
    anonymous types
    Array slices In place of an array subscript, you
    can give a range of elements:
     * Lower bound to upper bound
     expression..expressionGiven range
     *..expressionLower bound to given expression
     expression..*Given expression to
    upper bound
     Example: print table [*, 100..110]

  • language_type

    {lang_c++|c++++|CC|ccxx}

  • manager_option

    None.

Startup File

None.

Related Managers

None.