0
0
Compiler Designknowledge~10 mins

Compiler construction tools overview 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 code to identify the tool used for lexical analysis.

Compiler Design
The tool used for lexical analysis in compiler construction is called [1].
Drag options to blanks, or click blank then click option'
ALex
BBison
CYacc
DMake
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing Lex with Yacc or Bison, which are parser generators.
2fill in blank
medium

Complete the code to identify the tool used for syntax analysis.

Compiler Design
The tool used for syntax analysis or parsing in compiler construction is [1].
Drag options to blanks, or click blank then click option'
ALex
BMake
CGCC
DYacc
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up Lex and Yacc roles.
3fill in blank
hard

Fix the error in the statement about compiler tools.

Compiler Design
The tool [1] is used to generate parsers from grammar specifications.
Drag options to blanks, or click blank then click option'
AMake
BGCC
CYacc
DLex
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Lex instead of Yacc for parser generation.
4fill in blank
hard

Fill both blanks to complete the dictionary comprehension describing compiler tools.

Compiler Design
tools = {name: [1] for name, type in compiler_tools.items() if type [2] 'parser'}
Drag options to blanks, or click blank then click option'
Atype.upper()
Btype.lower()
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' causes wrong filtering.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension filtering lexical tools with names in uppercase.

Compiler Design
lex_tools = [1]: [2].upper() for [3], t in compiler_tools.items() if t == 'lexical'
Drag options to blanks, or click blank then click option'
Aname
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'type' as a variable name shadows Python's built-in type() function.