IMP (programming language)
IMP is a defunct family of programming languages intended primarily for systems programming, although at least one IMP was extended enough to be a general-purpose programming language. Expressively, IMP is similar to FORTRAN II, while syntactically it looks more like ALGOL, although it lacks block structure, reserved keywords, and datatypes (it does support both integer and floating-point numbers). IMP allows the programmer to embed machine language instructions into the IMP source code.
IMP is expression-oriented: there is no distinction between common expressions and statements, even though sometimes an expression is only needed for its )s. For example, a read statement's value indicates whether and EOL (end-of-line) or an EOF (end-of-file) was encountered, although what's typically used is the expression's side effect of performing input.
IMP compilers were developed for the CDC-6600, PDP-10 and PDP-11 computers. IMP was used to implement the EMAS operating system.
Extensible syntax
Being an Extensible-syntax programming language, IMP it allows the programmer to extend its syntax, although no specific means are provided to add new datatypes or structures to it. To achieve its syntax-extensibility, IMP uses a powerful parse algorithm based on a syntax graph and several connectivity matrices. The programmer may add new BNF productions to the graph.
Basically, the syntax statement is an augmented BNF production. For example, to add the construct described by the following BNF:
<EXP> ::= INCREMENT <VBL>
with the intent that INCREMENT V
should translate to V ← V + 1
, the programmer would only need to insert the following IMP statement:
<EXP> ::= INCREMENT <VBL,A> ::= "A←A+1"