MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Syntax analyzer can otherwise be called as
A
Scanner
B
Parser
C
Code generator
D
Code optimizer
Explanation: 

Detailed explanation-1: -The parser (syntax analyzer) receives the source code in the form of tokens from the lexical analyzer and performs syntax analysis, which create a tree-like intermediate representation that depicts the grammatical structure of the token stream. Syntax analysis is also called parsing.

Detailed explanation-2: -Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term parsing comes from Latin pars (orationis), meaning part (of speech).

Detailed explanation-3: -The parser is that phase of the compiler which takes a token string as input and with the help of existing grammar, converts it into the corresponding Intermediate Representation(IR). The parser is also known as Syntax Analyzer.

Detailed explanation-4: -Parser/Syntax Analyzer: A parser generally also known as Syntax Analyzer. Parser consists of A parsing table, an input buffer, and a stack.

Detailed explanation-5: -What is another name for Lexical Analyser? Explanation: Lexical Analyzer is also called “Linear Phase” or “Linear Analysis” or “Scanning“. Explanation: Individual Token is also Called Lexeme.

There is 1 question to complete.