Macintosh Programmer's Workshop C++

Revision as of 00:37, 10 November 2020 by Netfreak (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

C++ is the latest object-oriented programming language available for use with the Macintosh Programmer's Workshop (MPW) development environment.

Apple's implementation fully supports the industry standard for object-oriented C as defined by AT&T's C++ Release 2.0. Apple has extended the language to support the Macintosh Toolbox and operating system, Object Pascal-based functions and procedures (such as those found in MacApp), and the Standard Apple Numerics Environment (SANE). MPW C++ can be de­bugged at the C++ source level using Apple's Symbolic Applica­tion Debugging Environment (SADE). Applications built using MPW C++ can be com­ piled to run on the complete line of Apple Macintosh personal computers, or to take advantage of the powerful hard­ ware found in the high-end Macintosh models.

MPW C++ provides full sup­port for object-oriented program­ming for C-based applications. The use of object-oriented pro­gramming techniques helps to reduce development time while increasing the reliability of the resulting applications.

  • Support for object-oriented programming
  • Based on AT&T Release 2.0 C++
  • Extensions for the Macintosh environment
  • CFront tool is integrated with MPW C

Details

Object-Oriented Language Extensions

The MPW C++ system offers object-oriented programming to programmers using C. Mul­tiple inheritance, operator overloading, and protected variables and members within classes are but a few of the object-oriented facilities of MPW C++.

C++ Translator

C++ source code is translated to C source code by the CFront tool. The resulting C source code is then compiled by MPW C. All of this is "automated" by CPlus, an MPW script provided with MPW C++. CPlus calls both CFront and MPW C, passing appropri­ate parameters. This results in a complete compilation of C++ source code.

MPW C++ uses the same preprocessor and scanner as MPW C. This allows MPW C++ to output tokenized C source code (as well as "standard" C source code), that reduces the build times typically associated with C++. MPW C is available from the Apple Programmers and Developers Association (APDA).

Source Level Debugging

MPW C++ works with Apple's Symbolic Application Debugging Environment (SADE). SADE can be used at either the source or the assembly level to debug applications and MPW tools. During com­pilation, MPW C++ can create the symbol files that are needed by SADE to debug C++ applications at the C++ source code level. This allows the powerful scripting lan­guage of SADE to be harnessed by C++ programmers during the development cycle, to further increase application relia­bility and decrease development time. SADE is available from APDA.

Libraries

MPW C++ includes libraries for complex math and I/O stream processing. Apple has completely redone the Complex library. It retains the functionality of AT&T's Complex library and expands on it, using SANE as the basis for superior numerical accuracy.

Unmangler

Error messages produced while linking C++-based files can be very cryptic. MPW C++ comes with a tool for converting these "mangled" error messages into messages that are much easier to read. Also included is a resource for use with the MacsBug that allows MacsBug debugger to unmangle C++ function names.

Sample Programs

Three sample programs are included with MPW C ++. Two of them are com­plete Macintosh applications and the third is a counting tool for MPW. These samples make excellent starting points for the development of other applica­tions and tools.

C++ and MacApp

MacApp provides an object-oriented framework that implements the standard Macintosh user interface, including scroll­able, resizable windows and multipage printing. MacApp fosters development of robust, professional-quality applications by providing you with extensive memory management support, exception-handling mechanisms, support for "undo" com­mands, and a large body of ready-to-use, high-quality code that can be inherited by your application.

A future release of MacApp will allow programmers to use C++ in place of Object Pascal. This will be accomplished through the use of special C++ interface files, since MPW C++ can call Object Pascal-based procedures and functions. These special interface files will be offered separately.

See Also