Computer Science, asked by bidyarani3486, 1 year ago

Difference between macro processor and preprocessor in compiler

Answers

Answered by 4126
1
A macro processor is a program that copies a stream of text from one place to another, making a systematic set of replacements as it does so. ... A preprocessor is a program that processes its input data to produce output that is used as input to another program.Macro: a word defined by the #definepreprocessor directive that evaluates to some other expression.Preprocessor directive: a special #-keyword, recognized by thepreprocessor. preprocessor modifies the source file before handing it over the compiler. Consider preprocessoras a program that runs beforecompiler.
Answered by smartbrainz
2

Difference between macro processor and preprocessor in compiler:

In computer terminology both macro processors and preprocessors are programs or set of instructions that perform a specific task.

Macro processors:    

  • Macro processors are programs that perform 'systematic set of replacements of text' from one place to another.
  • Macro processors are programs embedded into other programs like assemblers or compilers, generally used for text re-formatting. These set of instructions can also be used as stand alone programs that are language independent.

Preprocessors:

  • Preprocessors are programs that process an input provided, to produce output which is further used as an input by another program.
  • So, in a way preprocessor programs provide a ‘preprocessed’ data input to other programs like the compiler.  

Similar questions