COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following statement is correct-S1-Lexical analysis phase is responsible for eliminating void space character.S2-Semantic analyzer help in giving error message by giving row number and column number.
A
Only SI is TRUE
B
Only S2 is TRUE
C
Both are TRUE
D
Both are FALSE
Explanation: 

Detailed explanation-1: -Lexical analysis is the starting phase of the compiler. It gathers modified source code that is written in the form of sentences from the language preprocessor. The lexical analyzer is responsible for breaking these syntaxes into a series of tokens, by removing whitespace in the source code.

Detailed explanation-2: -Explanation: Lexical analyzer is used in the compiler for removing the Whitespace and comments. It is also used in breaking the syntaxes into the set of tokens.

Detailed explanation-3: -The lexical token is a string containing a unit of grammar used in the programming language expressed as a series of characters, and it is generated by the lexical analyzer. The Lexical Analyzer’s job and procedure is to tokenize the programme by dividing it into valid tokens and deleting all white space characters.

There is 1 question to complete.