Share
K Christian, K. Christian, Kaare Christian, Kaare (The Rockefeller Univ. The Rockerfeller Univ. The Rockerfeller Univ. The Rockerfeller Univ. The Rockerfeller Univ. The Rockefeller Univ. The Rockefeller Univ.) Christian, CHRISTIAN KAARE
A Guide to Modula-2
English · Hardback
Description
Modula-2 is a simple yet powerful programming language that is suitable for a wide variety of applications. It is based on Pascal, a successful programming language that was introduced in 1970 by Niklaus Wirth. During the 1970's Pascal became the most widely taught programming language and it gained acceptance in science and industry. In 1980 Dr. Wirth released the Modula-2 program ming language. Modula-2 is an evolution of Pascal. It improves on the successes of Pascal while adding the MODULE - a tool for ex pressing the relations between the major parts of programs. In ad dition Modula-2 contains low-level features for systems program ming and coroutines for concurrent programming. Programming languages are important because they are used to express ideas. Some programming languages are so limited that certain ideas can't be easily expressed. For example languages that lac k floating point arithmetic are inappropriate for scientific com putations. Languages such as Basic and Fortran that lack recur sion are unsuitable for text processing or systems programming. Sometimes a programming language is useable for a certain appli cation but it is far from ideal. A good example is the difficulty of writing large programs in pure Pascal. Pascal is a poor language for large jobs because it lacks facilities for partitioning a program viii Preface 6 ; ~~~~er 0 Sheet Metal Tube /" 0 (to Affix Eraser to Shaft) ~ Hollow Wooden Shaft A Lead Core Figure 1. An exploded diagram. into separate pieces that can be developed independently.
List of contents
I Moving to Modula-2.- 1 Modula-2 and Pascal.- 1.1 Modula-2 and Pascal.- 1.2 Modules.- 1.3 IMPORT and EXPORT.- 1.4 An Overview of the InOut global MODULE.- 1.5 Example - The Underline Filter.- 1.6 Syntax Diagrams.- 1.6.1 Sequence.- 1.6.2 Optional Paths.- 1.6.3 Alternative Paths.- 1.6.4 Repetitive Paths.- 1.7 The Elements of a Modula-2 Program.- 1.7.1 Identifiers.- 1.7.2 Modula-2 Reserved Words and Standard Identifiers.- 2 Data in Modula-2.- 2.1 Declarations and Variables.- 2.2 Eight Useful Data TYPES.- 2.2.1 Boolean.- 2.2.2 Integer.- 2.2.3 Cardinal.- 2.2.4 Char.- 2.2.5 Real.- 2.2.6 Long Data TYPES.- 2.3 TYPE Compatibility and TYPE Transfer Functions.- 2.3.1 INTEGERS and CARDINALS.- 2.3.2 REALS and CARDINALS.- 2.3.3 CHARS and CARDINALS.- 2.4 Assignments, Expressions, and Precedence.- 2.5 Constants.- 2.5.1 Named Constants.- 3 Control Flow in Modula-2.- 3.1 The IF Statement.- 3.2 The CASE Statement.- 3.3 The WHILE Statement.- 3.4 The REPEAT Statement.- 3.5 The FOR Statement.- 3.6 The LOOP and EXIT Statements.- 4 Procedures.- 4.1 MODULES and PROCEDURES.- 4.2 Procedures.- 4.3 Variable and Value Parameters.- 4.4 Ordinary and Function PROCEDURES.- 4.5 The RETURN Statement.- 4.6 N Factorial.- 4.7 PROCEDURE Scope.- 4.8 Recursion.- 4.9 Example - A Desk Calculator.- 5 Arrays.- 5.1 TYPE Declarations.- 5.2 ARRAYS as PROCEDURE Parameters.- 5.3 Open ARRAY Parameters.- 5.4 Multiple ARRAY Dimensions.- 5.5 Subranges.- 5.6 String Variables.- 5.7 Example - Long Arithmetic.- II Modules.- 6 Local MODULES.- 6.1 Local MODULE Bodies.- 6.2 Static Variables.- 6.3 Example - The Sieve of Eratosthenes.- 7 Definition Modules.- 7.1 Definitions.- 7.1.1 Constant and Variable Definitions.- 7.1.2 TYPE Definitions.- 7.1.3 PROCEDURE Definitions.- 7.2 Hiding PROCEDURES - String Utilities Definition.- 7.3 Hiding Data - A Circular Buffer.- 8 Implementation Modules.- 8.1 Compilation.- 8.2 Strings Implementation.- 8.3 Circular Buffer Implementation.- 9 Common Global MODULES.- 9.1 InOut.- 9.2 RealInOut.- 9.3 Terminal.- 9.4 Streams.- 9.5 Files.- 9.6 MathLibO.- 9.7 LineDrawing.- 10 Desk Calculator with Variables and Assignments.- 10.1 Adding Variables to the Desk Calculator Program.- 10.2 Organizing the Desk Calculator.- 10.3 The CalcVariables MODULE.- 10.4 The CalcInput MODULE.- 10.5 The CalcStatement MODULE.- 10.6 The Calc2 Program.- III Advanced Data Types.- 11 Enumerations.- 11.1 VAL.- 11.1.1 Example - the Months Global MODULE.- 11.2 Example - Running a Maze.- 12 Sets.- 12.1 Bitsets.- 12.2 SET Operations.- 12.3 INCL and EXCL.- 12.4 Example - Packed BOOLEANS and the Sieve Revisited.- 13 Records.- 13.1 The WITH Statement.- 13.2 Example - Linked Lists.- 13.3 Variant RECORDS.- 13.4 Example - Breadth First Maze Search.- 14 Dynamic Data.- 14.1 Pointers.- 14.1.1 POINTER Assignment.- 14.1.2 Dereferencing.- 14.1.3 POINTER Comparison.- 14.2 ALLOCATE and DEALLOCATE.- 14.3 Example - Binary Trees.- 15 Procedure Variables.- 15.1 Example - The Quicksort.- IV Systems Programming.- 16 TYPE Relaxation.- 16.1 The SYSTEM MODULE.- 16.2 Word.- 16.3 Address.- 16.3.1 SIZE, TSIZE, and ADR.- 16.3.2 A Stack Storage System.- 16.4 TYPE Names as TYPE Transfer Functions.- 16.5 Example - Generic Quicksort.- 17 Programming Hardware.- 17.1 Located Variables.- 17.2 MODULE Priorities.- 18 Coroutines.- 18.1 Coroutines and Subroutines.- 18.2 PROCESS, NEWPROCESS, and TRANSFER.- 18.3 Example - The Polling Term Program.- 19 Device Drivers.- 19.1 Iotransfer.- 19.2 Example - A Clock Driver.- 19.3 Example - Timing a Spike Train.- 19.4 Example - The Interrupt driven Term Program.- Appendices.- I. Modula-2's Reserved Words.- II. Modula-2's Standard Identifiers.- III. Modula-2's Standard Functions.- IV. Standard PROCEDURES from SYSTEM.- V. Standard Coroutine PROCEDURES.- VI. Legal Modula-2 Operations.- VII. Strict TYPE Compatibility.- VIII. Assignment TYPE Compatibility.- IX. The ASCII Character Set.- X. Implementation Notes.- XI. Syntax Diagrams.- Modules.- Procedures.- Types.- Declarations.- Constants.- Variabl
Product details
Authors | K Christian, K. Christian, Kaare Christian, Kaare (The Rockefeller Univ. The Rockerfeller Univ. The Rockerfeller Univ. The Rockerfeller Univ. The Rockerfeller Univ. The Rockefeller Univ. The Rockefeller Univ.) Christian, CHRISTIAN KAARE |
Publisher | Springer, Berlin |
Languages | English |
Product format | Hardback |
Released | 05.12.2012 |
EAN | 9780387962429 |
ISBN | 978-0-387-96242-9 |
No. of pages | 436 |
Weight | 800 g |
Illustrations | 11 SW-Abb. |
Series |
Monographs in Computer Science Texts & Monographs in Computer Monographs in Computer Science |
Subject |
Natural sciences, medicine, IT, technology
> IT, data processing
> Programming languages
|
Customer reviews
No reviews have been written for this item yet. Write the first review and be helpful to other users when they decide on a purchase.
Write a review
Thumbs up or thumbs down? Write your own review.