- •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
Parameter compatible
An actual parameter a of type Ta is parameter compatible with a formal parameter f of type Tf if
Tf and Ta are equal types, or
f is a value parameter and Ta is assignment compatible with Tf, or
f is an IN or VAR parameter and Tf and Ta are record types and Ta is an extension of Tf, or
f is an OUT parameter and Tf and Ta are pointer types and Tf is an extension of Ta.
Expression compatible
For a given operator, the types of its operands are expression compatible if they conform to the following table. The first matching line gives the correct result type. Type T1 must be an extension of type T0:
Operator |
First operand |
Second operand |
Result type |
+ - * DIV MOD |
<= INTEGER |
<= INTEGER |
INTEGER |
|
integer type |
integer type |
LONGINT |
+ - * / |
numeric type |
numeric type |
REAL |
|
SET |
SET |
SET |
+ |
Shortstring |
Shortstring |
Shortstring |
|
string type |
string type |
String |
OR & ~ |
BOOLEAN |
BOOLEAN |
BOOLEAN |
= # < <= > >= |
numeric type |
numeric type |
BOOLEAN |
|
character type |
character type |
BOOLEAN |
|
string type |
string type |
BOOLEAN |
= # |
BOOLEAN |
BOOLEAN |
BOOLEAN |
|
SET |
SET |
BOOLEAN |
|
NIL, pointer type T0 or T1 |
NIL, pointer type T0 or T1 |
BOOLEAN |
|
procedure type T, NIL |
procedure type T, NIL |
BOOLEAN |
IN |
integer type |
SET |
BOOLEAN |
IS |
T0 type |
T1 |
BOOLEAN |
Appendix b: Syntax of Component Pascal
Module |
= |
MODULE ident ";" [ImportList] DeclSeq [BEGIN StatementSeq] [CLOSE StatementSequence] END ident ".". |
ImportList |
= |
IMPORT [ident ":="] ident {"," [ident ":="] ident} ";". |
DeclSeq |
= |
{ CONST {ConstDecl ";" } | TYPE {TypeDecl ";"} | VAR {VarDecl ";"}} {ProcDecl ";" | ForwardDecl ";"}. |
ConstDecl |
= |
IdentDef "=" ConstExpr. |
TypeDecl |
= |
IdentDef "=" Type. |
VarDecl |
= |
IdentList ":" Type. |
ProcDecl |
= |
PROCEDURE [Receiver] IdentDef [FormalPars] ["," NEW] ["," (ABSTRACT | EMPTY | EXTENSIBLE)] [";" DeclSeq [BEGIN StatementSeq] END ident]. |
ForwardDecl |
= |
PROCEDURE "^" [Receiver] IdentDef [FormalPars]. |
FormalPars |
= |
"(" [FPSection {";" FPSection}] ")" [":" Type]. |
FPSection |
= |
[VAR | IN | OUT] ident {"," ident} ":" Type. |
Receiver |
= |
"(" [VAR | IN] ident ":" ident ")". |
Type |
= |
Qualident | ARRAY [ConstExpr {"," ConstExpr}] OF Type | [ABSTRACT | EXTENSIBLE | LIMITED] RECORD ["("Qualident")"] FieldList {";" FieldList} END | POINTER TO Type | PROCEDURE [FormalPars]. |
FieldList |
= |
[IdentList ":" Type]. |
StatementSeq |
= |
Statement {";" Statement}. |
Statement |
= |
[ Designator ":=" Expr | Designator ["(" [ExprList] ")"] | IF Expr THEN StatementSeq {ELSIF Expr THEN StatementSeq} [ELSE StatementSeq] END | CASE Expr OF Case {"|" Case} [ELSE StatementSeq] END | WHILE Expr DO StatementSeq END | REPEAT StatementSeq UNTIL Expr | FOR ident ":=" Expr TO Expr [BY ConstExpr] DO StatementSeq END | LOOP StatementSeq END | WITH Guard DO StatementSeq {"|" Guard DO StatementSeq} [ELSE StatementSeq] END | EXIT | RETURN [Expr] ]. |
Case |
= |
[CaseLabels {"," CaseLabels} ":" StatementSeq]. |
CaseLabels |
= |
ConstExpr [".." ConstExpr]. |
Guard |
= |
Qualident ":" Qualident. |
ConstExpr |
= |
Expr. |
Expr |
= |
SimpleExpr [Relation SimpleExpr]. |
SimpleExpr |
= |
["+" | "-"] Term {AddOp Term}. |
Term |
= |
Factor {MulOp Factor}. |
Factor |
= |
Designator | number | character | string | NIL | Set | "(" Expr ")" | " ~ " Factor. |
Set |
= |
"{" [Element {"," Element}] "}". |
Element |
= |
Expr [".." Expr]. |
Relation |
= |
"=" | "#" | "<" | "<=" | ">" | ">=" | IN | IS. |
AddOp |
= |
"+" | "-" | OR. |
MulOp |
= |
" * " | "/" | DIV | MOD | "&". |
Designator |
= |
Qualident {"." ident | "[" ExprList "]" | " ^ " | "$" | "(" Qualident ")" | "(" [ExprList] ")"}. |
ExprList |
= |
Expr {"," Expr}. |
IdentList |
= |
IdentDef {"," IdentDef}. |
Qualident |
= |
[ident "."] ident. |
IdentDef |
= |
ident [" * " | "-"]. |