volume_mute
Compiler Architecture Components
publish date: 2026/06/10 22:54:3.112489 UTC
volume_muteA general-purpose programming language compiler includes six key components. Match each component to its function.
To complete the line match
- Click on an item in the first group
- Click on the match in the second group
To delete a match, double click on a line
Component
Lexical analyzer
Syntax analyzer
Symbol table
Semantic analyzer
Syntax tree
Code generator
Function
Takes input language tokens and converts them to an internal form
Holds information about the names of entities (variables, class names, object names, etc.) used in the text being translated
Checks the syntax of the language being translated using a defined grammar and builds a syntax tree
An internal structure representing the program being compiled
Uses information from the syntax tree and the symbol table to check the semantic correctness of the input language text
Walks the syntax tree and generates abstract machine code
Correct Answer
(1) Lexical analyzer,Takes input language tokens and converts them to an internal form
(2) Symbol table,Holds information about the names of entities (variables, class names, object names, etc.) used in the text being translated
(3) Syntax analyzer,Checks the syntax of the language being translated using a defined grammar and builds a syntax tree
(4) Syntax tree,An internal structure representing the program being compiled
(5) Semantic analyzer,Uses information from the syntax tree and the symbol table to check the semantic correctness of the input language text
(6) Code generator,Walks the syntax tree and generates abstract machine code
Explanation
A compiler's six core components: (1) Lexical analyzer - tokenizes input; (2) Symbol table - stores entity names and attributes; (3) Syntax analyzer - parses and builds the syntax tree using the language grammar; (4) Syntax tree - internal program representation; (5) Semantic analyzer - checks meaning/type correctness; (6) Code generator - traverses the syntax tree to produce machine code.
Reference
Software Engineering, Ian Sommerville, 10th edition
