- •BlackBox
- •Component Pascal Language Report
- •1. Introduction
- •5. Constant Declarations
- •6.1 Basic Types
- •6.2 Array Types
- •6.3 Record Types
- •6.4 Pointer Types
- •6.5 Procedure Types
- •6.6 String Types
- •7. Variable Declarations
- •8. Expressions
- •8.1 Operands
- •8.2 Operators
- •8.2.1 Logical operators
- •8.2.2 Arithmetic operators
- •8.2.3 Set operators
- •8.2.4 String operators
- •8.2.5 Relations
- •9. Statements
- •9.1 Assignments
- •9.2 Procedure Calls
- •9.3 Statement Sequences
- •9.4 If Statements
- •9.5 Case Statements
- •9.6 While Statements
- •9.7 Repeat Statements
- •9.8 For Statements
- •9.9 Loop Statements
- •9.10 Return and Exit Statements
- •9.11 With Statements
- •10. Procedure Declarations
- •10.2 Methods
- •10.3 Predeclared Procedures
- •Function procedures
- •Proper procedures
- •10.4 Finalization
- •11. Modules
- •Appendix a: Definition of Terms
- •Array compatible
- •Parameter compatible
- •Expression compatible
- •Appendix b: Syntax of Component Pascal
- •Appendix c: Domains of Basic Types
- •Appendix d: Mandatory Requirements for Environment
- •Object Lesson 1 - objects and inheritance
- •Introduction
- •Course Aims - Creating Beautiful Systems
- •Why Design?
- •Design methods
- •Objects
- •How do objects relate to other concepts in design methods?
- •Inheritance
- •The big deal about inheritance
- •Clarity
- •Delegation
- •Relationships
- •One to one relationships
- •One to many relationships
- •Many to many relationships
- •Object Models
- •Exercises
- •Object Lesson 3 Analysis - the rudiments of an approach
- •Removing synonyms and/or generalising
- •Look for attributes
- •Irrelevant objects
- •The process of development
- •Prototyping
- •Evolutionary development
- •Charters
- •Why object modelling lends itself to iterative methods
- •Lesson 4 - Dynamic Modelling - Event traces Dynamic Modelling
- •Event traces - building scenarios
- •Progressing the analysis with event traces
- •What do you do with the event traces?
- •Dynamic modelling - state diagrams
- •An example of an object model for a simple computer
- •An object model for genetic algorithms.
- •Business Activity Modelling - a Starting Point for Software Development Applied to The Functional Specification of a System for Planning Elderly Care in the European Community (planec)
- •Abstract
- •Functional modelling - data flows
- •Use Cases
- •Opening up the use-case requirements model
- •Conclusion
- •Business Process Reengineering
- •Conclusion
10.3 Predeclared Procedures
The following table lists the predeclared procedures. Some are generic procedures, i.e. they apply to several types of operands. v stands for a variable, x and y for expressions, and T for a type.
Function procedures
Name |
Argument type |
Result type |
Function |
ABS(x) |
numeric type |
type of x |
absolute value |
ASH(x, y) |
x, y: integer type |
INTEGER |
arithmetic shift (x * 2^y) |
BITS(x) |
INTEGER |
SET |
{i | ODD(x DIV 2^i)} |
CAP(x) |
character type |
type of x |
x is a Latin-1 letter: corresponding capital letter |
CHR(x) |
integer type |
CHAR |
character with ordinal number x |
ENTIER(x) |
real type |
LONGINT |
largest integer not greater than x |
LEN(v, x) |
v: array; x: integer constant |
INTEGER |
length of v in dimension x (first dimension = 0) |
LEN(v) |
array type |
INTEGER |
equivalent to LEN(v, 0) |
|
String |
INTEGER |
length of string (not counting 0X) |
LONG(x) |
BYTE |
SHORTINT |
identity |
|
SHORTINT |
INTEGER |
identity |
|
INTEGER |
LONGINT |
identity |
|
SHORTREAL |
REAL |
identity |
|
SHORTCHAR |
CHAR |
identity |
|
Shortstring |
String |
identity |
MAX(T) |
T = basic type |
T |
maximum value of type T |
|
T = SET |
INTEGER |
maximum element of a set |
MAX(x, y) |
integer type |
INTEGER |
the larger of x and y |
|
real type |
REAL |
the larger of x and y |
MIN(T) |
T = basic type |
T |
minimum value of type T |
|
T = SET |
INTEGER |
0 |
MIN(x, y) |
integer type |
INTEGER |
the smaller of x and y |
|
real type |
REAL |
the smaller of x and y |
ODD(x) |
integer type |
BOOLEAN |
x MOD 2 = 1 |
ORD(x) |
CHAR |
INTEGER |
ordinal number of x |
|
SHORTCHAR |
SHORTINT |
ordinal number of x |
|
SET |
INTEGER |
(SUM i: i IN x: 2^i) |
SHORT(x) |
LONGINT |
INTEGER |
identity |
|
INTEGER |
SHORTINT |
identity |
|
SHORTINT |
BYTE |
identity |
|
REAL |
SHORTREAL |
identity (truncation possible) |
|
CHAR |
SHORTCHAR |
projection |
|
String |
Shortstring |
projection |
SIZE(T) |
any type |
INTEGER |
number of bytes required by T |
SIZE cannot be used in constant expressions because its value depends on the actual compiler implementation.
Proper procedures
Name |
Argument types |
Function |
ASSERT(x) |
x: Boolean expression |
terminate program execution if not x |
ASSERT(x, n) |
x: Boolean expression; n: integer constant |
terminate program execution if not x |
DEC(v) |
integer type |
v := v - 1 |
DEC(v, n) |
v, n: integer type |
v := v - n |
EXCL(v, x) |
v: SET; x: integer type |
v := v - {x} |
HALT(n) |
integer constant |
terminate program execution |
INC(v) |
integer type |
v := v + 1 |
INC(v, n) |
v, n: integer type |
v := v + n |
INCL(v, x) |
v: SET; x: integer type |
v := v + {x} |
NEW(v) |
pointer to record or fixed array |
allocate v ^ |
NEW(v, x0, ..., xn) |
v: pointer to open array; xi: integer type |
allocate v ^ with lengths x0.. xn |
In ASSERT(x, n) and HALT(n), the interpretation of n is left to the underlying system implementation.