preprocessor

preprocessor

[¦prē′prä‚ses·ər]

(computer science)

A program that converts data into a format suitable for computer processing.

McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

preprocessor

(programming)

A program that transforms input data in some way before it is read by the main program. In the case of a compiler, the input is source code. The main advantage of using a preprocessor is that it is possible to change the specification of the input data without changing the main program. The separation can also help to make the system's overall behaviour easier to understand. The disadvantage is that performance may be reduced by the extra input and output performed between the two programs.

For example, the C preprocessor, cpp, handles textual macro substitution (it acts as a "macro preprocessor"), conditional compilation and inclusion of other files.

A preprocessor may be used to transform a program into a simpler language, e.g. to transform C++ into C.

This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)