SYNTAX ANALYSIS
ROLE OF THE PARSER
|
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
|
Lexical analysis
|
|
|
Syntax analysis
|
|
|
Compilation
|
|
|
Run time
|
Detailed explanation-1: -During the lexical analysis phase this type of error can be detected. Lexical error is a sequence of characters that does not match the pattern of any token. Lexical phase error is found during the execution of the program.
Detailed explanation-2: -Explanation: Spelling error, exceeding length of identifier or numeric constants, Appearance of illegal characters all of these will comes under Lexical Error.
Detailed explanation-3: -Syntax errors are mistakes in the source code, such as spelling and punctuation errors, incorrect labels, and so on, which cause an error message to be generated by the compiler.
Detailed explanation-4: -Issues in Lexical Analysis 1) Simpler design is the most important consideration. The separation of lexical analysis from syntax analysis often allows us to simplify one or the other of these phases. 2) Compiler efficiency is improved. 3) Compiler portability is enhanced.