Preprocessor Encyclopedia Article

Preprocessor

The following sections of this BookRags Literature Study Guide is offprint from Gale's For Students Series: Presenting Analysis, Context, and Criticism on Commonly Studied Works: Introduction, Author Biography, Plot Summary, Characters, Themes, Style, Historical Context, Critical Overview, Criticism and Critical Essays, Media Adaptations, Topics for Further Study, Compare & Contrast, What Do I Read Next?, For Further Study, and Sources.

(c)1998-2002; (c)2002 by Gale. Gale is an imprint of The Gale Group, Inc., a division of Thomson Learning, Inc. Gale and Design and Thomson Learning are trademarks used herein under license.

The following sections, if they exist, are offprint from Beacham's Encyclopedia of Popular Fiction: "Social Concerns", "Thematic Overview", "Techniques", "Literary Precedents", "Key Questions", "Related Titles", "Adaptations", "Related Web Sites". (c)1994-2005, by Walton Beacham.

The following sections, if they exist, are offprint from Beacham's Guide to Literature for Young Adults: "About the Author", "Overview", "Setting", "Literary Qualities", "Social Sensitivity", "Topics for Discussion", "Ideas for Reports and Papers". (c)1994-2005, by Walton Beacham.

All other sections in this Literature Study Guide are owned and copyrighted by BookRags, Inc.

Preprocessor

A preprocessor is a program that transforms data or a computer language into suitable input for another program or a compiler. A preprocessor performs preliminary operations on data, such as organization, formatting, and computation, before that data is passed on for further processing. For example, in the C programming language the line #define PI 3.14159 instructs the preprocessor to replace every occurrence of PI with the numerical value 3.14159. In the case of a computer program, a preprocessor may be used to transform a program into a simpler or less complete computer language, for example, transforming C++ into C. This processing operation can detect and correct problems in code before the compiler can reject them.

Preprocessor operations can be similar to macro expansions. Macro expansion replaces an instruction with a sequence of instructions prior to assembly or compiling. However, preprocessors differ from compilers. A compiler translates a high-level language into assembly or machine language. A preprocessor does not translate code into machine language, but transforms into suitable language for the compiler.

Preprocessing may require data or computer programs to be translated twice. The source data or program is inputted into the preprocessor. The preprocessor then passes the modified code to the compiler, which then translates it into machine code.