DUP programming language

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
DUP
Paradigmfunctional, interpreted
First appeared1990s
OSSolaris, Linux
LicenseProprietary
Website{{#property:P856}}

DUP (DataUnit Processing language) is a special-purpose, interpreted and functional programming language. The DUP language looks like a mixture of C and ASN.1.[1] It borrows its structure from C, while the way of using variables comes from ASN.1. This makes it intuitive for a programmer used to C/C++ and ASN.1 to use the language. It was developed at Ericsson, and used in Ericsson Billing Gateway and Ericsson Multi Activation platform.[2]

Language

[edit | edit source]

Functions

[edit | edit source]

A function is declared as follows:

<return type> <function name> ( <argument list> )
{
  <function body>
}

The <return type> is one of the ASN.1 types supported by the application in which is used. It is possible to add CONST to the type which implies that the return value is constant and can not be changed. A function can also have the return type VOID which means that it does not return anything.

The <argument list> is a comma separated list of arguments. Each argument is declared as follows:

<argument name> <argument type>

The <argument type> is an ASN.1 data type. It is also possible to use the ANY type if the type is unknown. All return values and arguments are passed as reference.

An example of DUP code can be seen below:

CONST INTEGER add(a CONST INTEGER)
{
  declare result INTEGER;
  result ::= 10;
  result += a;
  return result;
}

Notes

[edit | edit source]
  1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).