Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
is preprocessor ia separate system software or whether its a part of compiler..??..
Posted
Comments
PIEBALDconsult 1-Jul-15 19:36pm    
That's implementation-specific, but it is often a separate executable.
[no name] 1-Jul-15 20:01pm    
What?
[no name] 1-Jul-15 20:01pm    
Preprocessor is a part of the Compiler! How otherwise can Compiler take the pre-compiled stuff into account...
PIEBALDconsult 1-Jul-15 20:11pm    
Not all of them; otherwise there wouldn't even be a name for them.
[no name] 1-Jul-15 20:14pm    
I don't get the Point. Most probably my bad english :( is my Problem not yours.

The question is not silly at all. The definition of the C language was made in a way, such that pre-processing could be done in a separate program. And many of the first generation compilers worked that way. They had a separate executable (program) that first did all the pre-processing and generated a temporary file, which was then processed by the compiler. The starting of this pre-processor was usually done by a batch-file or by the main compiler program itself.

Modern C/C++ compilers have the pre-processors usually built-in, although you can still have the compiler output the pre-processed source as a file, usually controlled by a command line switch.

Still, I would say that the pre-processor is part of the compiler, although it might reside in a separate program. And I would not denote it as "system software" as it does not belong to the operating system.
 
Share this answer
 
Comments
moyna coder 2-Jul-15 8:14am    
then another doubt..when the c program
is compiled..the preprocessor statements
in the c program will be executed by
preprocessor only know..then when we
compile frst preprocessor program will be
called then only compiler will compile the
errors ..is it?
nv3 2-Jul-15 9:07am    
I don't know if I understood your English correctly. The pre-processor looks exclusively at the pre-processor statements, i.e the # lines and expands them. It writes the expanded output to a temp file (or passes it to the compiler in another mode efficient way). Then the compiler reads that expanded source and does its job, including generating error messages.
moyna coder 2-Jul-15 10:36am    
yeah thank you...my english is little bad nly..haha..any way thankz for understanding
Conceptually the pre-processor is a separate program. Some 'compilers' have it built-in.
 
Share this answer
 
Comments
moyna coder 2-Jul-15 8:07am    
thank you..! cpallini..
moyna coder 2-Jul-15 8:13am    
then another doubt..when the c program is compiled..the preprocessor statements in the c program will be executed by preprocessor only know..then when we compile frst preprocessor program will be called then only compiler will compile the errors ..is it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900