PLANC

PLANC

PLANC (pronounced as "plank") is a high level computer programming language.

PLANC is an acronym that stands for Programming LAnguage for Nd Computers

Compilers were developed by Norsk Data for several architectures, including the Motorola 68000, 88000, x86, and the Norsk Data NORD-10 minicomputer architecture and ND-500 supermini.

It was mainly used internally at ND for writing high level systems software such as the upper parts of the operating systems and compilers.

It was designed to be platform independent.

PLANC basic structure

PLANC programs are structured into modules and routines.

A very simple example of a PLANC program is as follows:

MODULE mod INTEGER ARRAY : stack (0:100) PROGRAM : mprog INTEGER : i, j,k, m INISTACK stack 1 =: i 2 =: j i+j =: k =: m ENDROUTINE ENDMODULE

The most visible difference from other popular programming languages is that the assignment operator goes from left to right: First you compute the value, then you store it. The assignment operator also returns the stored value, so you could store it multiple times: 5 =: a =: b would store 5 into both the A and B variables. It shares this direction with Mary, another little known programming language developed in Norway.

Compile-time initialization of variables, on the other hand, went from right to left.

PLANC data types

As with all high level languages PLANC uses variables as can be seen in the previous sample, here are the allowed data types within PLANC:

* Simple types
*: INTEGER, REAL, BOOLEAN, LABEL, VOID, ENUMERATION, POINTER
* Composite types
*: ARRAY, RECORD, SET, ROUTINE
* User defined types: declared by TYPE T = .....;

An enumeration was declared thusly: ENUMERATION (Winter, Spring, Summer, Autumn) : Seasons := Summer

This defines an enumeration of the seasons and sets the default value to Summer.

LABEL is a little different from your normal data type, this is used to pre-define a label within code and is used in conjunction with a GO statement (very much like GOTO in BASIC).

Access modifiers can be applied to make them READ or WRITE only.

For string data several predefined datatypes are used, they are:

#. BYTE Contains a single character
#. BYTES Contains character strings
#. BITS Contains BIT strings

Array pointers were 3-word constructs that included both the base address, the lower bound and the higher bound of the array; this made it possible to do reliable run-time checking of array boundaries, and made the kind of "pointer arithmetic" that makes C such an "interesting" language much less tempting to write.

Some PLANC statements

PLANC was a language in the PASCAL family. However, it lacked the generic BEGIN END construct often found in PASCAL and preferred instead forms like ROUTINE..ENDROUTINE or DO..ENDDO etc.

One feature that set it apart from some other languages was how loops were constructed.

You had the following types of loops:

DO .... loop statements... ENDDO

Hopefully one or more of the loop statements would be WHILE condition that allowed you to break out of the loop.

For example:

DO WHILE test ..... ENDDO

Was similar to a C while (test) { ... } loop.

Another example:

DO ...... WHILE test ENDDO

Was similar to a C do { .... } while (test). loop.

Some times you could see:

DO WHILE test1 ..... WHILE test2 ENDDO

In C you would have to write something like while (test1) { .... if (! test2) break; } or some such.

For loops had the following structure:

FOR var IN low:high DO .... loop statements.... ENDDO

You could also specify a step by low:high:step. Alternatively you could specify a type (enumeration or integer ranged type) to specify a loop over a range of values or a set to loop over all elements of the set or you could specify an array to loop over an array. You could also specify a pointer:next to walk through a list. For example if you had defined:

TYPE node = RECORD node POINTER : next T : some_data ENDRECORD

You could write:

FOR p IN first:next DO ..... ENDFOR

to loop over the list.

As a for loop was a loop you could also have WHILE statements inside it. This gave you two possible manners of exiting a for loop, either because the list of values are exhausted or because the test failed. Thus, you could write blocks to catch each of those:

routine void,node pointer (node pointer : list) for p in first:next do while p.val >< 20 exitfor return nil endfor return endroutine

This would return nil if you have exhausted the list but if you exited due to while you just ended up after the loop and returned the pointer to the element found. Alternatively you could have placed that in an exitwhile block which is identical except you would end up there if and only if the while test failed. If you have more than one while statement in the loop you could not tell those apart, they would all make a jump to the same exitwhile block.

ources

Sample code and details of the PLANC programming language have been taken directly from the Norsk Data PLANC Reference Manual [ND-60.117.03]

ee also

*NPL
*BLISS (programming language)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • planc — var. planh …   Useful english dictionary

  • PLANC — Plancianae …   Abbreviations in Latin Inscriptions

  • planctònic — planc|tò|nic Mot Pla Adjectiu variable …   Diccionari Català-Català

  • plàncton — plànc|ton Mot Pla Nom masculí …   Diccionari Català-Català

  • plancto- — plànc·to conf. TS biol. plancton, relativo al plancton {{line}} {{/line}} ETIMO: da plancton …   Dizionario italiano

  • plancton — plànc·ton s.m.inv. TS biol. complesso di organismi animali o vegetali microscopici, privi di moto proprio, che vivono sospesi nelle acque dolci o marine e che costituiscono il nutrimento principale di molti pesci e mammiferi marini {{line}}… …   Dizionario italiano

  • planctonico — planc·tò·ni·co agg. TS biol. relativo al plancton, che costituisce il plancton {{line}} {{/line}} DATA: 1935 …   Dizionario italiano

  • ПЛАНЦИИ —    • Plancĭi,          сюда принадлежат:        1. Cn. Planc., римский всадник из Атины, вступился с большой энергией за свое сословие относительно уменьшения арендной платы, 59 г. до Р. X. Он сам брал на откуп акциз и поддерживал позже своего… …   Реальный словарь классических древностей

  • ЮВЕНЦИИ —    • Iuventii,          ок. 380 г. до Р. X. переселились из Тускулума в Рим, где они скоро достигли большого значения:        1. Iuventius, курульный эдил. Cic. Planc. 24, 58;        2. Т. Iuventius Thalna и С. Juv. Labeo, пали в битве с галлами… …   Реальный словарь классических древностей

  • Norsk Data — The characteristic ND dotted logo used from 1973 Norsk Data was a (mini )computer manufacturer located in Oslo, Norway. Existing from 1967 to 1992, it had its most active period in the years from the early 1970s to the late 1980s. At the company… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”