COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Compiler can check ____
A
Logical error
B
Syntax error
C
Text error
D
Both logical and syntax error
Explanation: 

Detailed explanation-1: -Which of the following errors can a compiler check? Explanation: Compiler can only check syntax errors.

Detailed explanation-2: -Which phase of the compiler is Syntax Analysis? Explanation: It is Second Phase Of Compiler after Lexical Analyzer.

Detailed explanation-3: -A syntax error is also a type of compile error. A syntax error occurs as soon as you hit enter and VBA identifies that something is missing. A compilation error can also occur when VBA doesn’t find anything missing while typing the code, but it does when the code is compiled or executed.

Detailed explanation-4: -A compiler can check for syntax errors but cannot check for logical errors. This is because logical errors are not related to the syntax of the program but rather to its logic. Logical errors can only be identified by running the program and analyzing its output.

There is 1 question to complete.