Micro programming language
Encyclopedia
The Micro programming language is a very basic programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 used in teaching computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

 students principles of compiler construction
Compiler construction
Compiler construction is an area of computer science that deals with the theory and practice of developing programming languages and their associated compilers....

.

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
Pascal (programming language)
Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

, certain similarities can be seen in Micro source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

 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
Toy programs
Toy Programs are simplistic computer programs, typically written by novice programmers, that allow the programmer to gain a feel for the language they're working with...

.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK