Zebra0

Learn to Program Step-by-Step

Compilers

After writing the source code (or a section of code), the programmer runs the program. When a programmer runs the program, several steps occurred before the programmer sees the output.

compilers
When source code is sent to the compiler, the preprocessor searches for any compiler directives or preprocessor commands. These are usually special lines of code at the beginning that tell the compiler to include external files, set options or restrictions, or give instructions to modify the code in some way.

Next, the compiler will translate the code into machine language. If there are any errors, they are reported to the programmer. Errors found by the compiler are syntax errors: a missing semicolon, a misspelled name, or using a command wrong.

The programmer must fix the syntax errors and send the program to the compiler again. Finally, when the compiler does not find any errors, the machine language instructions (object code) is created.

Next, the programmer must test the program for logical errors. The programmer may have logical errors even though it compiles and runs. The programmer must thoroughly test the program to guarantee that the results are correct and that the program runs without using unnecessary resources.

Like us on Facebook:


OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: April 14 2016 14:29:07.