Protel

Last updated

Protel stands for "Procedure Oriented Type Enforcing Language". It is a programming language created by Nortel Networks and used on telecommunications switching systems such as the DMS-100. [1] [2] Protel-2 is the object-oriented version of Protel. [3] [4]

Contents

The PROTEL language was designed to meet the needs of digital telephony and is the basis of the DMS-100 line of switching systems PROTEL is a strongly typed, block-structured language which is based heavily on PASCAL and ALGOL 68 with left-to-right style of variable assignment, variable-sized arrays, and extensible structures. The designers of PROTEL significantly extended PASCAL of the day by adding external compilation and extending the data structures available in the language. [3]

The PROTEL compiler is tightly integrated with the operating system (SOS), application (CALLP), the development environment (PLS) and originally the processor (NT40). PLS, SOS, CALLP and the compiler itself are all written in PROTEL. Any description of the PROTEL language can't help but include some aspects of the other components.

PROTEL has very strict type enforcement but the tight coupling of the components creates opportunities to bypass some type checking for skilled coders by using internal compiler features directly.

PROTEL is considered 'wordy', containing a large number of reserved words with some statements reading like english.

PROTEL source code is case insensitive but by convention upper case is used for reserved words.

Variables and Assignment

Most global and all local variables are declared using the DECL reserved word.

Variables can be initialized using INIT keyword.

Constants use IS keyword, hexadecimal uses #.

Global variables can also use PROTECTED, or PRIVATE declarations to define write protected data or thread local data respectively. Writes to protected data requires the use of builtin primitives that alter protected data in a safe way. Protected data survives all restarts short of a system image reload.

Note WRITE_PROTECTED_STORE arguments are type agnostic as long as the types of both arguments match.

PRIVATE provides a private copy of the data for each process that uses it. There is no COW functionality, each process is allocated its own copy and optionally initializes it at creation.

Note Local variables defined using DECL are naturally private.

GAZINTA

Gazinta is the colloquial name used for the assignment operator '->'. Its name comes from 'goes into' meaning expression gazinta (goes into) variable. Expressions are evaluated in strict left to right order with no operator precedence. Lack of operator precedence is a legacy of the NT40 processor which used a stack based ALU using RPN logic. Parentheses are used to prioritize subexpressions.

Pointers

The pointer operator is @ and is placed after the ptr. A NULL pointer is a predefined value that is guaranteed not to point to a mapped address. It is not 0 nor -1 nor another the predefined uninitialzed memory pattern (#FDFD). In other words a pointer is not NULL by default, it must be set in the code. Pointer arithmetic is not supported.

Note Dereferencing a NULL pointer will cause a data access trap.

Descriptors

The descriptor 'DESC' is a compiler defined structure containing a pointer to an array and the array upperbound. A descriptorized array is indexed using simple array syntax 'MY_DESC[I]' and the UPB operator can be used to access the upperbound 'UPB MYDESC'. A TDSIZE operator also exists as a legacy of the descriptor implementation on NT40: TDSIZE = UPB+1. Descriptors have automatic run time bounds checking on dynamically allocated arrays. Indexing a descriptor out of bounds or indexing a NULL descriptor will cause a descriptor range check trap. UPB is generally used by application software to more gracefully handle index out of range.

Note NULL can be used for pointers and descriptors.

Strings use descriptors extensively. Strings are of a defined length with no NULL character terminator.

Blocks

Block scope is defined by BLOCK and ENDBLOCK statements, which are analogous to BEGIN END in Pascal or { } in C. Blocks can optionally be labeled for enhanced compiler checking and functionality.

Procedures

Procedures and functions are only differentiated by the presence of the RETURNS clause and the requirement to include a RETURN statement. A RETURN statement may be inserted anywhere in a function or procedure.

Declaration

Implementation

Structures

The TABLE is the basic array structure. TABLE is only used for arrays whose size is known at compile time. Descriptors are the preferred way to reference arrays. Indexing a table out of range will cause a table range check trap. UPB and TDSIZE operators also apply to tables.

Unions

The OVERLAY is the basic union structure. It is declared and used in a manner similar to Pascal-descended languages.

AREAs

Areas are memory blocks that could be cast to TABLES and OVERLAYS. They are declared in bytes and typically are declared large enough to allow for future expansion. This is due to the desire to upgrade DMS software 'live' without requiring a restart. The modular nature of PROTEL allows relatively small chunks of code to be swapped into a load; if AREAs were planned smartly, this would not affect the placement of modules in memory, thereby avoiding a restart.

SUBSYSTEMs, MODULEs, and SECTIONs

A SECTION is a text file containing source code and directives to manage the different section types and their position in the module hierarchy. A SECTION is the smallest unit of compilation. A MODULE is the smallest unit of linkage and loading and contains one or more sections. A SUBSYSTEM is the smallest unit of packaging and contains one or more modules.

Control Flow

There are 2 forms of the case (switch) statement. Using the CASE keyword uses a jump table and SELECT uses sequential if-then-else logic. Cases are exclusive, they don't fall through as in C.

Related Research Articles

C (programming language) General-purpose programming language

C is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems, device drivers, protocol stacks, though decreasingly for application software. C is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems.

The Cyclone programming language is intended to be a safe dialect of the C language. Cyclone is designed to avoid buffer overflows and other vulnerabilities that are possible in C programs, without losing the power and convenience of C as a tool for system programming.

Mary is a programming language designed and implemented by RUNIT at Trondheim, Norway in the 1970s. It borrowed many features from ALGOL 68 but was designed for systems programming.

Oberon (programming language)

Oberon is a general-purpose programming language first published in 1987 by Niklaus Wirth and the latest member of the Wirthian family of ALGOL-like languages. Oberon was the result of a concentrated effort to increase the power of Modula-2, the direct successor of Pascal, and simultaneously to reduce its complexity. Its principal new feature is the concept of type extension of record types. It permits constructing new data types on the basis of existing ones and to relate them, deviating from the dogma of strictly static typing of data. Type extension is Wirth's way of inheritance reflecting the viewpoint of the parent site. Oberon was developed as part of the implementation of an operating system, also named Oberon at ETH Zurich in Switzerland. The name is from the moon of the planet Uranus, named Oberon.

Pascal (programming language) Programming language

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named in honour of the French mathematician, philosopher and physicist Blaise Pascal.

Oberon-2

Oberon-2 is an extension of the original Oberon programming language that adds limited reflection and object-oriented programming facilities, open arrays as pointer base types, read-only field export, and reintroduces the FOR loop from Modula-2.

C syntax Set of rules defining correctly structured programs

The syntax of the C programming language is the set of rules governing writing of software in the C language. It is designed to allow for programs that are extremely terse, have a close relationship with the resulting object code, and yet provide relatively high-level data abstraction. C was the first widely successful high-level language for portable operating-system development.

Pointer (computer programming) Object which stores memory addresses in a computer program

In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.

In computer programming, run-time type information or run-time type identification (RTTI) is a feature of some programming languages that exposes information about an object's data type at runtime. Run-time type information may be available for all types or only to types that explicitly have it. Run-time type information is a specialization of a more general concept called type introspection.

ALGOL 68 Programming language

ALGOL 68 is an imperative programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously defined syntax and semantics.

xHarbour is a free multi-platform extended Clipper compiler, offering multiple graphic terminals (GTs), including console drivers, GUIs, and hybrid console/GUIs. xHarbour is backward-compatible with Clipper and supports many language syntax extensions, greatly extended run-time libraries, and extensive third party support.

The computer programming languages C and Pascal have similar times of origin, influences, and purposes. Both were used to design their own compilers early in their lifetimes. The original Pascal definition appeared in 1969 and a first compiler in 1970. The first version of C appeared in 1972.

In computer programming, the term hooking covers a range of techniques used to alter or augment the behaviour of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a hook.

A class in C++ is a user-defined type or data structure declared with keyword class that has data and functions as its members whose access is governed by the three access specifiers private, protected or public. By default access to members of a C++ class is private. The private members are not accessible outside the class; they can be accessed only through methods of the class. The public members form an interface to the class and are accessible outside the class.

sizeof is a unary operator in the programming languages C and C++. It generates the storage size of an expression or a data type, measured in the number of char-sized units. Consequently, the construct sizeof (char) is guaranteed to be 1. The actual number of bits of type char is specified by the preprocessor macro CHAR_BIT, defined in the standard include file limits.h. On most modern computing platforms this is eight bits. The result of sizeof has an unsigned integer type that is usually denoted by size_t.

C++11 is a version of the ISO/IEC 14882 standard for the C++ programming language. C++11 replaced the prior version of the C++ standard, called C++03, and was later replaced by C++14. The name follows the tradition of naming language versions by the publication year of the specification, though it was formerly named C++0x because it was expected to be published before 2010.

In computer programming, the dereference operator or indirection operator, sometimes denoted by "*", is a unary operator found in C-like languages that include pointer variables. It operates on a pointer variable, and returns an l-value equivalent to the value at the pointer address. This is called "dereferencing" the pointer. For example, the C code

This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.

This article compares a large number of programming languages by tabulating their data types, their expression, statement, and declaration syntax, and some common operating-system interfaces.

In computer science, an array type is a data type that represents a collection of elements, each selected by one or more indices that can be computed at run time during program execution. Such a collection is usually called an array variable, array value, or simply array. By analogy with the mathematical concepts vector and matrix, array types with one and two indices are often called vector type and matrix type, respectively. More generally, a multidimensional array type can be called a tensor type.

References

  1. Krishna, Sundeep Sahay, Brian Nicholson, S. (2003). Global IT outsourcing : software development across borders . Cambridge: Cambridge University Press. p.  7. ISBN   978-0521816045.
  2. Telesis (3), 1989{{citation}}: Missing or empty |title= (help)
  3. 1 2 “Experience with a modular typed language: PROTEL”, ICSE '81 Proceedings of the 5th international conference on Software engineering
  4. Dini, P.; Boutaba, R.; Logrippo, L., eds. (1997). Feature interactions in telecommunications networks IV. Amsterdam: IOS Press. p. 23. ISBN   978-9051993479.