COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
lexical analysis
|
|
syntax analysis
|
|
preprocessing
|
|
code optimization
|
Detailed explanation-1: -Lexical analysis is the first phase of a compiler. It takes modified source code from language preprocessors that are written in the form of sentences. The lexical analyzer breaks these syntaxes into a series of tokens, by removing any whitespace or comments in the source code.
Detailed explanation-2: -Roles of the Lexical analyzer Removes white spaces and comments from the source program.
Detailed explanation-3: -The lexical analyzer removes the white spaces by ignoring them. When the compiler scans the whole code, it groups the entire code into tokens. While this process is going on it skips the white space symbols.
Detailed explanation-4: -The lexical analyzer is responsible for removing the white spaces and comments from the source program. It corresponds to the error messages with the source program. It helps to identify the tokens. The input characters are read by the lexical analyzer from the source code.