retagged by
2,662 views

3 Answers

Best answer
8 votes
8 votes

It is not done during compilation- rather just before it. This is done as by macro processor which is before any of the compilation phase. You can see the output of macro expansion by using "-E" option in gcc. 

gcc -E file.c
selected by
0 votes
0 votes
As per Compiler Book by AHO

If the source program uses a macro-preprocessor, the expansion of macros may also be performed by the lexical analyzer.

Related questions

1 votes
1 votes
1 answer
2
rahul sharma 5 asked Apr 28, 2018
1,442 views
int a = b+*/c;Which phase will give the error?Lexical or syntax?
1 votes
1 votes
2 answers
3
Souvik33 asked Jan 12, 2023
577 views
What is the earliest stage compiler error for the following C code snippet:int x = @33;Lexical ErrorSyntax ErrorSemantic ErrorNone
1 votes
1 votes
2 answers
4