in Compiler Design retagged by
721 views
1 vote
1 vote
1. macros are not considered as tokens in tokenizing.

2.#include considered as single token

2.stdio.h considered as single token.

 

Are the above statements true?
in Compiler Design retagged by
721 views

2 Comments

Only 1 is true
0
0
1 True.

Before sending source code to Lexical phase, pre-processor resolve the #include statements and #define statements.
2
2

1 Answer

3 votes
3 votes

Before sending the file for lexical analysis, it will be pre- processed, which will remove all the statements containting $#$.

To see what is actually sent to the lexer, use the command

cpp <input.cpp>

on Linux, to see a pre processed file.

Related questions