Micro programming language

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The Micro programming language is a very basic programming language used in teaching computer science students principles of compiler construction.

The language itself is built on top of an even more basic language called Tiny, which is also used in compiler construction courses. Among the features present in Micro, but not in Tiny, are IF statements, WHILE statements, variable declarations, floating point numbers, and the multiplication and division operators.

For those familiar with Pascal, certain similarities can be seen in Micro source code and also in how the language is handled by a compiler. These similarities include the fact that Pascal, Micro, and Tiny all use the same assignment operator, with the operator being the string ":=". Variable declarations in Micro are identical in structure to Pascal declarations, with the notable exception that Micro only supports two data types, namely INTEGER and REAL (the latter for floating point numbers).

Micro also follows a number of compilation rules that are utilised by Pascal. These include case-insensitivity ("Temp", "TEMP", and "temp" are all considered the same) and type-compatibility. The type-compatibility rules can be summed up in saying that an arithmetic expression will only evaluate to type INTEGER if all operands are of type INTEGER and no operators are '/' (division). Unless these two conditions are met, an arithmetic operation will return a value of type REAL.

While Micro provides a reasonable challenge to computer science students attempting to write a compiler (and it is certainly possible to write the front end of the compiler in a semester), the language itself is far too simplistic to be used for writing anything more complex than toy programs.

External links[edit]