0
0
Compiler Designknowledge~10 mins

Ambiguity in grammars in Compiler Design - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the sentence to define ambiguity in grammars.

Compiler Design
A grammar is ambiguous if it can generate a string with [1] parse trees.
Drag options to blanks, or click blank then click option'
Amultiple
Bone
Cno
Dinfinite
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'one' because a grammar usually has one parse tree per string.
2fill in blank
medium

Complete the sentence about ambiguity's effect on parsing.

Compiler Design
Ambiguity in a grammar makes it difficult to [1] the structure of sentences.
Drag options to blanks, or click blank then click option'
Aignore
Bsimplify
Crepeat
Ddetermine
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'simplify' because ambiguity actually complicates parsing.
3fill in blank
hard

Fix the error in the statement about ambiguous grammars.

Compiler Design
An ambiguous grammar has [1] parse trees for some string.
Drag options to blanks, or click blank then click option'
Azero
Bone
Cmultiple
Dno
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'one' because many grammars have one parse tree per string.
4fill in blank
hard

Fill both blanks to describe ambiguity in grammar rules.

Compiler Design
If a grammar allows [1] different parse trees for the same string, it is called [2].
Drag options to blanks, or click blank then click option'
Amultiple
Bunique
Cambiguous
Dsingle
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'unique' and 'ambiguous'.
5fill in blank
hard

Fill all three blanks to complete the explanation of ambiguity.

Compiler Design
Ambiguity can cause [1] in [2] and make [3] difficult.
Drag options to blanks, or click blank then click option'
Aconfusion
Bparsing
Ccompilation
Dexecution
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'execution' instead of 'compilation'.