Compiler Construction Introduction
- 58Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
58 questions
- 1A compiler translates source code into_____code.
Hint
Think of the low-level code produced from a high-level program.
Answer
machine object
- 2Source code is generally written in a_____-level language that is intended to be readable by humans.
Hint
Contrast this with the low-level language understood directly by the computer.
Answer
high
- 3Machine code is considered_____-level code because it is directly understood by the computer.
Hint
It is closer to the machine than human-oriented programming languages.
Answer
low
- 4One benefit of high-level languages is that they maximize programmer_____by hiding many machine-level details.
Hint
Think about how much work programmers can accomplish without managing hardware details.
Answer
productivity
- 5A compiler allows programmers to focus on the problem they are solving rather than on_____-level details.
Hint
These details include registers, memory addresses, and machine instructions.
Answer
machine
- 6The statement z=x+y is an example of an_____statement because the value of an expression is placed into a variable.
Hint
It gives the result of a computation to a named variable.
Answer
assignment
- 7To implement z=x+y on a typical machine, the compiler first loads x from memory into a_____.
Hint
This is a fast storage location used by the processor during computation.
Answer
register
- 8After loading x into one register and y into another, the machine performs an_____operation on the two registers.
Hint
The operation corresponds to the plus sign in x+y.
Answer
add
- 9After computing the sum in a register, the result must be stored back into the memory variable_____.
Hint
This is the destination variable in the original assignment.
Answer
z
- 10In actual assembly, a source-level variable name is replaced by a memory_____rather than being used as a symbolic variable name.
Hint
The machine needs a location identifying where the variable is stored.
Answer
address
- 11For a local variable stored on the stack, its location is represented by an_____relative to the activation record pointer.
Hint
This specifies the variable's position relative to the start of the function's activation record.
Answer
offset
- 12The activation record pointer points to the activation record of the function currently being_____.
Hint
It refers to the function whose code the compiler is processing.
Answer
compiled
- 13A program consisting of multiple source files generally produces one_____file for each source file.
Hint
These files contain translated code but are not necessarily executable by themselves.
Answer
object
- 14The_____combines object files into an executable program.
Hint
It performs the stage after compilation that joins separately translated pieces.
Answer
linker
- 15In addition to combining object files, the linker connects a program with required_____functions.
Hint
These are prewritten functions supplied by libraries such as the C library.
Answer
library
- 16A major responsibility of linking is resolving internal and_____references.
Hint
These references point outside the current source or object file.
Answer
external
- 17A compiler may apply code_____to make generated code more efficient.
Hint
These are transformations intended to improve code quality and performance.
Answer
optimizations
- 18Compiler optimization does not necessarily produce_____code every time.
Hint
The lecture distinguishes code that is good from code that is mathematically best.
Answer
optimal
- 19The main focus of an introductory compiler course is basic translation from a high-level language to_____code.
Hint
Optimization is covered, but it is not the central emphasis.
Answer
machine
- 20A compiler typically uses_____representations between the high-level source program and assembly code.
Hint
These representations occupy a stage between the input language and the target language.
Answer
intermediate
- 21An abstract syntax tree is a_____representation of a program.
Hint
Its structure is hierarchical, with operators and operands arranged as nodes.
Answer
tree
- 22For an expression containing two multiplications whose results are added, the abstract syntax tree places the addition_____the two multiplication subtrees.
Hint
The addition combines the results of the lower-level operations.
Answer
above
- 23The abstract syntax tree for an assignment places the assigned variable at the destination of the_____operation.
Hint
The tree must represent both the computed expression and the variable receiving its result.
Answer
assignment
- 24An optimizer transforms an intermediate representation to improve code quality and eliminate_____.
Hint
These are unnecessary repeated computations or structures.
Answer
redundancies
- 25The optimized result produced by the optimizer is called optimized_____.
Hint
This abbreviation means intermediate representation.
Answer
IR
- 26A compiler may use multiple intermediate representations; the abstract syntax tree is_____of them.
Hint
It is an example rather than the only possible intermediate representation.
Answer
one
- 27The compiler component that converts high-level code into a tree-like intermediate representation is the_____end.
Hint
It handles the earlier stages of compilation, before target-code generation.
Answer
front
- 28The compiler component responsible for generating assembly code is the_____end.
Hint
It operates after analysis and intermediate-representation processing.
Answer
back
- 29Selecting appropriate machine instructions for an intermediate representation is called instruction_____.
Hint
This process chooses which target instructions implement the code.
Answer
selection
- 30Determining the correct ordering of generated instructions is called instruction_____.
Hint
The key idea is arranging instructions in an effective sequence.
Answer
scheduling
- 31Deciding which variables should be placed in CPU registers is called register_____.
Hint
This process assigns limited registers to program variables.
Answer
allocation
- 32Register allocation is necessary because programs usually contain more variables than the CPU has available_____.
Hint
The compiler must decide which variables receive the limited fast storage locations.
Answer
registers
- 33Scanning divides a source program into_____or words.
Hint
Identifiers and operators are examples of these basic units.
Answer
tokens
- 34In scanning, a variable such as_____
xy23is treated as onerepresenting a variable name.Hint
Scanning groups the characters of an identifier into a single lexical unit.
Answer
token
- 35Scanning operates primarily at the_____level, while parsing operates at the sentence level.
Hint
Scanning forms words from characters.
Answer
word
- 36Parsing takes tokens and constructs_____out of them.
Hint
In a programming language, these correspond to complete syntactic structures or programs.
Answer
sentences
- 37Parsing is analogous to forming sentences from words, whereas scanning is analogous to forming words from_____.
Hint
These are the individual characters that make up tokens.
Answer
letters
- 38Semantic analysis checks whether syntactically formed programs are_____.
Hint
Syntax concerns grammatical form; semantics concerns meaning.
Answer
meaningful
- 39The term semantics refers to the_____of a program or sentence.
Hint
It answers what a syntactically valid construct represents or does.
Answer
meaning
- 40A program with correct syntax but incompatible operand and result types contains a_____error.
Hint
The program may look grammatically correct but does not make sense according to type rules.
Answer
semantic
- 41Expressions allow a program to_____values and represent computations.
Hint
They combine values, variables, and operators.
Answer
compute
- 42An assignment gives the result of an expression to a_____.
Hint
It is the named storage location on the left side of an assignment.
Answer
variable
- 43The conditional construct that chooses between alternatives is commonly written as_____.
Hint
It tests a condition and selects one of two branches.
Answer
if/else
- 44The construct used to repeat a group of instructions is a_____.
Hint
It allows instructions to execute repeatedly.
Answer
loop
- 45The basic compiler described in the lecture supports expressions, assignments, conditionals, and_____.
Hint
This construct provides repeated execution.
Answer
loops
- 46The basic compiler intentionally excludes advanced language features such as objects and_____.
Hint
This object-oriented feature allows classes to derive properties and methods from other classes.
Answer
inheritance
- 47Finite automata, regular expressions, and_____are theory-of-computation concepts applied in compiler construction.
Hint
This concept describes the rules used to form valid program structures.
Answer
grammars
- 48A_____is used in compiler construction to recognize patterns in the input during scanning.
Hint
It is a state-based computational model studied in theory of computation.
Answer
finite automaton
- 49A_____provides a notation for describing lexical patterns that can be recognized during scanning.
Hint
It describes patterns such as identifier forms.
Answer
regular expression
- 50A_____specifies structural rules for forming valid sentences in a programming language.
Hint
Parsing uses these rules to determine whether token sequences have valid structure.
Answer
grammar
- 51In compiler construction, concepts from theory of computation are used as an_____rather than studied only abstractly.
Hint
The compiler is a real system that puts theoretical concepts to practical use.
Answer
application
- 52The pumping lemma is an example of a theoretical topic that is_____the focus of this compiler course.
Hint
The course applies theory but does not concentrate on proving this result.
Answer
not
- 53The compiler course begins with an overview so students understand the_____picture of compiler structure.
Hint
This means the overall organization rather than implementation details.
Answer
big
- 54The stage that breaks source code into tokens is called_____.
Hint
It operates at the word or lexical level.
Answer
scanning
- 55The stage that constructs syntactic structures from tokens is called_____.
Hint
It operates at the sentence or grammatical-structure level.
Answer
parsing
- 56Context-sensitive analysis is another name used in the lecture for_____analysis.
Hint
This analysis checks meaning, types, and other context-dependent rules.
Answer
semantic
- 57Converting an abstract syntax tree into generic assembly is an example of basic code_____.
Hint
This is the process of producing target instructions from an intermediate representation.
Answer
generation
- 58The overall compiler process includes scanning, parsing, semantic analysis, intermediate representations, code generation, and code_____.
Hint
These transformations improve the generated code after or during translation.
Answer
optimizations

Ask anything
We've read this whole study set, so questions about it get the best answers.