THE LANGUAGE PASCALINE

REPORT VERSION 0.2

Contents

1       Introduction. 10

2       Summary of Pascaline extensions to Pascal 13

3       EBNF and syntax used in this document 17

4       Relationship to ISO 7185. 19

4.1        Pascaline as a series of extensions. 19

4.2        Additional reserved word-symbols. 19

4.3        Character escapes. 19

4.4        Compliance with ISO 7185. 19

4.5        ISO 7185 level 0 only. 20

4.6        Extensions to Pascaline. 20

4.7        Compliance statement 20

4.8        Compliance switch. 20

4.9        Similarities with the ISO 7185 standard document 21

5       Relationship to the Pascal-P6 series compiler 22

6       Language extensions for pascaline. 23

6.1        Word-symbols. 23

6.2        Special symbols. 23

6.3        Comments. 23

6.4        Identifiers. 23

6.5        Labels. 24

6.6        Numeric constants. 25

6.7        Constant expressions. 26

6.8        Boolean integer operations. 26

6.9        View and out parameters. 28

6.10     Extended case statements. 30

6.11     Variant record case ranges. 32

6.12     Array type shorthand. 33

6.13     Container arrays. 33

6.14     Parameterized Variables. 37

6.15     Extended write/writeln statements. 39

6.16     Extended read/readln statements. 40

6.17     Type converters/restrictors. 51

6.18     Fixed objects. 53

6.19     Extended file procedures and functions. 53

6.20     Added program header standard bindings. 62

6.21     Redeclaration of forwarded procedures and functions. 63

6.22     Anonymous function result 63

6.23     Extended Function results. 65

6.24     Overloading of procedures and functions. 66

6.25     Operator overloads. 68

6.26     Static procedures and functions. 71

6.27     Relaxation of declaration order 72

6.28     Exception handling. 72

6.29     Assert Procedure. 76

6.30     Extended range types. 77

6.31     Extended real types. 79

6.32     Real Limit Determination. 80

6.33     Character limit determination. 80

6.34     Matrix mathematics. 80

6.35     Properties. 85

6.36     Modularity. 87

6.36.1    Definition vs. implementation modules. 91

6.36.2    Overrides. 92

6.36.3    Parallel modules. 94

6.36.4    Monitor signaling. 97

6.37     Channels. 101

6.38     Classes. 103

6.38.1    Static objects. 105

6.38.2    Dynamic objects. 105

6.38.3    Classes as parameters. 107

6.38.4    Class parameters. 107

6.38.5    Inheritance. 111

6.38.6    Overrides for objects. 113

6.38.7    Self referencing. 114

6.38.8    Constructors and destructors. 117

6.38.9    Operator overloads in classes. 118

6.38.10    Derivation vs. composition. 120

6.38.11    Parallel classes. 121

A      Annex A: Collected syntax. 129

B      Annex B: Standard exceptions. 139

C      Annex C: Undefined program parameter binding. 143

D      Annex D: Character sets. 145

D.1       ISO 8859-1 Character Set Encodings. 145

D.2       ISO 10646 Character Set Encodings. 145

D.3       Unicode text file I/O.. 145

D.4       Use of different character sets. 146

E       Annex E: Character escapes. 147

F       Annex F: Overview of standard libraries and modularity. 153

F.1        Basic Language Support 153

F.1.1    services. 153

F.1.2    strings. 153

F.2        Advanced User I/O and Presentation Management 153

F.2.1    Naming. 155

F.3        Advanced device libraries. 156

F.3.1    sound. 156

F.3.2    network. 156

F.4        Classes. 156

F.5        Library procedure and function notation. 156

G      Annex G: System Services Library. 157

G.1       Filenames and Paths. 157

G.2       Predefined paths. 158

G.3       Time and Date. 158

G.4       Directory Structures. 160

G.5       File Attributes and Permissions. 161

G.6       Environment Strings. 161

G.7       Executing Other Programs. 162

G.8       Error Return Code. 163

G.9       Creating or Removing Paths. 163

G.10         Option Character 163

G.11         Path Character 163

G.12         Location. 163

G.13         Internationalization. 167

G.14         Exceptions. 169

G.15         Functions and procedures in services. 171

H      Annex H: String Library. 179

H.1       Conventions. 179

H.2       Words. 179

H.3       Format Strings. 179

H.4       Recycling. 181

H.5       Exceptions. 181

H.6       Procedures and functions in strings. 182

I        Annex I: Extended mathematics library. 195

I.1         Functions. 195

I.2         Further trancendentals. 196

I.3         Hyperbolics. 196

I.4         Special floating point values. 197

I.5         NaN functions. 197

I.6         Utility functions. 197

I.7         Exceptions in the math library. 197

I.8         Functions, procedures and constants in the math library. 198

J        Annex J: Terminal Interface Library. 203

J.1         ISO 7185 Pascal Compatible Mode. 203

J.2         Basic Cursor Positioning. 203

J.3         Automatic Mode. 204

J.4         Tabbing. 204

J.5         Scrolling. 204

J.6         Colors. 204

J.7         Attributes. 205

J.8         Multiple Surface Buffering. 205

J.9         Advanced Input 206

J.10      Event callbacks. 209

J.11      Timers. 211

J.12      The Frame Timer 212

J.13      Mouse. 212

J.14      Joysticks. 213

J.15      Function Keys. 213

J.16      Automatic “hold” Mode. 213

J.17      Direct Writes. 214

J.18      Printers. 214

J.19      Metafiles. 214

J.20      Remote display. 215

J.21      Terminal objects. 215

J.22      Exceptions. 219

J.23      Procedures, functions and methods in terminal 220

J.24      Events and Callbacks In terminal 228

K      Annex K: Graphical Interface Library. 235

K.1       Terminal model 235

K.2       Graphics Coordinates. 235

K.3       Character Drawing. 235

K.4       String Sizes and Kerning. 237

K.5       Justification. 237

K.6       Effects. 237

K.7       Tabs. 237

K.8       Colors. 237

K.9       Drawing Modes. 238

K.10         Drawing Graphics. 238

K.11         Figures. 239

K.12         Predefined Pictures. 239

K.13         Scrolling. 240

K.14         Clipping. 240

K.15         Mouse Graphical Position. 240

K.16         Animation. 240

K.17         Copy between buffers. 241

K.18         Printers. 241

K.19         Metafiles. 241

K.20         Remote display. 241

K.21         Declarations. 241

K.22         Event callbacks. 244

K.23         Graphical Terminal Objects. 244

K.24         Exceptions. 249

K.25         Procedures and functions in graphics. 251

K.26         Events and Callbacks In graphics. 262

L       Annex L: Windows Management Library. 263

L.1        Screen Appearance. 263

L.2        Window Modes. 263

L.3        Buffered Mode. 263

L.4        Unbuffered Mode. 264

L.5        Defacto transparency. 265

L.6        Delayed Window Display. 265

L.7        Window Frames. 265

L.8        Scroll Bars. 265

L.9        Multiple Windows. 266

L.10     Parent/Child Windows. 266

L.11     Moving and Sizing Windows. 267

L.12     Z Ordering. 267

L.13     Class Window Handling. 268

L.14     Parallel Windows. 268

L.15     Menus. 269

L.16     Setting Menu Active. 270

L.17     Setting Menu States. 270

L.18     Standard Menus. 270

L.19     Menu Sublisting. 271

L.20     Advanced Windowing. 272

L.21     Events. 272

L.22     Event callbacks. 275

L.23     Window Objects. 275

L.24     Exceptions. 283

L.25     Procedures and Functions in windows. 285

L.26     Events and Callbacks In windows. 292

M     Annex M: Widget Library. 295

M.1      Tiles, Layers and Looks. 295

M.2      Background colors and placement 295

M.3      Sizes. 296

M.4      Logical Widget Identifiers. 296

M.5      Killing, Selecting, Enabling and Getting Text to and from Widgets. 296

M.6      Resizing and repositioning a widget 297

M.7      Types of widgets. 297

M.8      Z ordering. 297

M.9      Controls. 297

M.10        Components. 301

M.11        Dialogs. 302

M.12        Events. 304

M.13        Event callbacks. 307

M.14        Widget Classes. 308

M.15        exceptions. 317

M.16        Procedures and functions in widgets. 318

M.17        Events and Callbacks In widgets. 338

N      Annex N: Sound Library. 341

N.1       Ports. 341

N.2       Channels and Instruments. 343

N.3       Volume. 349

N.4       Time and the Sequencer 349

N.5       Effects. 350