Complete the code to identify the tool used for lexical analysis.
The tool used for lexical analysis in compiler construction is called [1].
Lex is a tool used to generate lexical analyzers, which break input text into tokens.
Complete the code to identify the tool used for syntax analysis.
The tool used for syntax analysis or parsing in compiler construction is [1].
Yacc is a parser generator that helps analyze the syntax of the input based on grammar rules.
Fix the error in the statement about compiler tools.
The tool [1] is used to generate parsers from grammar specifications.
Yacc generates parsers from grammar rules, while Lex generates lexical analyzers.
Fill both blanks to complete the dictionary comprehension describing compiler tools.
tools = {name: [1] for name, type in compiler_tools.items() if type [2] 'parser'}This comprehension selects tools whose type exactly matches 'parser' and uses type.lower() as the value.
Fill all three blanks to create a dictionary comprehension filtering lexical tools with names in uppercase.
lex_tools = [1]: [2].upper() for [3], t in compiler_tools.items() if t == 'lexical'
The comprehension creates a dictionary with tool names as keys and their uppercase names as values, filtering only lexical tools.