COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A grammar that produces more than one parse tree for some sentence is called as
A
Ambiguous
B
Unambiguous
C
Regular
D
All of these
Explanation: 

Detailed explanation-1: -A grammar that produces more than one parse tree for some sentence is called a) Ambiguous. b) Unambiguous. c) Regular. Explanation: ambiguous grammar has more than one parse tree.

Detailed explanation-2: -A grammar for which there are two different parse trees for the same terminal string is said to be ambiguous.

Detailed explanation-3: -A Grammar that makes more than one Leftmost Derivation (or Rightmost Derivation) for the similar sentence is called Ambiguous Grammar.

Detailed explanation-4: -A grammar is said to be ambiguous if there exists more than one leftmost derivation or more than one rightmost derivation or more than one parse tree for the given input string. If the grammar is not ambiguous, then it is called unambiguous.

Detailed explanation-5: -Explanation: A context free grammar is ambiguous if it has more than one parse tree generated or more than one leftmost derivations. An unambiguous grammar is a context free grammar for which every valid string has a unique leftmost derivation.

There is 1 question to complete.