Compiler Components Overview
- 67Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
67 questions
- 1The three conceptual phases of an optimizing compiler are the front end, the optimizer, and the_____.
Hint
This phase is responsible for producing target-machine code.
Answer
backend
- 2The compiler phase that converts high-level source code into an intermediate representation is the_____.
Hint
This phase occurs before optimization and target-specific code generation.
Answer
front end
- 3The backend of a compiler is also known as the_____.
Hint
It transforms an intermediate representation into machine-oriented instructions.
Answer
code generator
- 4The three-part division of a compiler into front end, optimizer, and backend is a_____view rather than a requirement that every compiler use the same design.
Hint
This view describes the main ideas without requiring a specific implementation.
Answer
conceptual
- 5A compiler may implement its front end, optimizer, and backend as separate executables connected by a compiler_____.
Hint
This component connects and wraps the separate compiler programs.
Answer
driver
- 6In computer science, the answer to the question of how a system performs a task is usually an_____.
Hint
It is a step-by-step method for solving a problem.
Answer
algorithm
- 7The front end produces an abstract syntax tree only if the program passes scanning, parsing, and_____analysis.
Hint
This analysis checks whether the program has meaningful relationships, such as compatible types.
Answer
semantic
- 8If a program fails one of the front-end phases, the compiler generates an_____message instead of continuing normally.
Hint
This message reports that the program violates a required language rule.
Answer
error
- 9An abstract syntax tree, or AST, is one type of compiler_____representation.
Hint
It lies between source code and final machine code.
Answer
intermediate
- 10An AST is not the only intermediate representation; a single compiler may use_____intermediate representations.
Hint
Compilers can use several representations during different stages of code generation.
Answer
multiple
- 11The AST for an assignment such as_____
X = A + Brepresents the addition and theoperation.Hint
This operation places the computed result into the variable on the left.
Answer
assignment
- 12The AST is a_____representation because it organizes an expression hierarchically according to its operations.
Hint
It reflects the structure and relationships of the computation.
Answer
logical
- 13Compilers generally use multiple steps to translate a high-level language into_____code rather than doing it in one step.
Hint
This code is closer to the machine than the source language but may still contain symbolic names.
Answer
assembly
- 14In conceptual assembly, names such as variable_____
Aand variableBare examples ofinformation.Hint
The information uses human-readable names rather than numeric locations.
Answer
symbolic
- 15Real assembly language for a specific processor generally replaces variable names with memory_____.
Hint
These identify locations where variables are stored.
Answer
addresses
- 16For local variables stored on the stack, a variable's location can be represented by an_____relative to a stack or frame base.
Hint
This value indicates how far the variable is from a reference location.
Answer
offset
- 17The stack frame for the currently executing function is also called an_____record.
Hint
It stores information associated with one function invocation.
Answer
activation
- 18Scanning is also called_____analysis or lexing.
Hint
This phase deals with the smallest meaningful units of source text.
Answer
lexical
- 19The scanner views the entire input program, regardless of its size, as one large_____of characters.
Hint
This is a sequence of characters that the scanner divides into meaningful units.
Answer
string
- 20The scanner divides the input string into tokens, which are also called_____.
Hint
These are the words or basic units identified by lexical analysis.
Answer
lexemes
- 21In the input_____
X12 = A3 + B45,X12,A3, andB45are identified as.Hint
They name variables in the program.
Answer
identifiers
- 22The scanner recognizes the equal sign in an assignment as an_____token.
Hint
It specifies an operation that relates the left and right sides of the assignment.
Answer
operator
- 23A variable-name rule may allow letters and numbers but exclude the_____sign.
Hint
This symbol is used as an assignment operator in the example.
Answer
equal
- 24The lexical rules that define what a variable name may contain are specified using regular_____.
Hint
This formal notation describes patterns in strings.
Answer
expressions
- 25The implementation of regular-expression-based scanning uses finite state_____.
Hint
These computational models recognize patterns by moving among states.
Answer
automata
- 26The parser is the second major phase of the compiler_____.
Hint
It follows scanning and precedes semantic analysis.
Answer
front end
- 27Parsing is also called_____analysis.
Hint
This analysis checks the structure of statements according to language rules.
Answer
syntactic
- 28A parser combines tokens, which are like words, into statements, which are like_____in human language.
Hint
A sentence is formed by arranging words according to grammatical rules.
Answer
sentences
- 29In a programming language, a token or lexeme corresponds most closely to a human-language_____.
Hint
It is a basic unit that can be combined with others to form larger structures.
Answer
word
- 30An identifier on the left side of an assignment statement is the identifier to which the expression is being_____.
Hint
The computed value is placed into this variable.
Answer
assigned
- 31The syntactic rules defining legal statements in a programming language are called_____.
Hint
They specify how tokens can be arranged into valid constructs.
Answer
grammars
- 32An expression containing an invalid sequence of operators fails because it does not match any rule in the language's_____.
Hint
This formal system describes valid syntactic structures.
Answer
grammar
- 33A statement that violates the rules of a programming-language grammar contains a_____error.
Hint
This type of error concerns the form or structure of the statement.
Answer
syntax
- 34Unlike scanners, which are built using regular expressions and finite automata, parsers are built using_____.
Hint
They describe how tokens combine into statements and larger constructs.
Answer
grammars
- 35Semantic analysis determines whether a syntactically valid statement is_____in the programming language.
Hint
A statement can have correct form but still fail to make sense.
Answer
meaningful
- 36A sentence can be grammatically correct but meaningless; in compiler terminology, this means it has correct syntax but incorrect_____.
Hint
This concerns the meaning of a construct rather than its form.
Answer
semantics
- 37An assignment involving integer variables is meaningful when the variables'_____are consistent.
Hint
Integers should be used with operations and destinations that support integer values.
Answer
types
- 38Adding incompatible objects and assigning the result to an incompatible destination is syntactically correct but semantically_____.
Hint
The statement has valid structure but no defined interpretation.
Answer
meaningless
- 39A compiler can generate code only for statements that are semantically_____.
Hint
The compiler must know what operation the statement represents before producing code.
Answer
meaningful
- 40Semantic analysis generally requires a deeper and more_____analysis than local syntax checking.
Hint
It may need information from declarations located far away in the program.
Answer
global
- 41To determine the type of a variable used in a statement, the compiler links that use to the variable's earlier_____.
Hint
This is where the variable is introduced and its properties are specified.
Answer
declaration
- 42The compiler stores information about declared variables in a_____table.
Hint
This table associates names with information needed during compilation.
Answer
symbol
- 43In addition to a variable's type, the symbol table records information such as its_____.
Hint
This describes the region of the program where the variable is visible.
Answer
scope
- 44The optimizer applies transformations to improve the_____of generated code.
Hint
The goal may include better speed or resource use.
Answer
quality
- 45Optimizations in the middle compiler phase are intended, in theory, to be independent of the target_____.
Hint
This is the processor or platform for which code will eventually be generated.
Answer
machine
- 46Common subexpression elimination identifies an expression that occurs more than once, such as_____
A + B, as a common.Hint
It is a smaller expression contained within larger expressions.
Answer
subexpression
- 47In common subexpression elimination, the compiler may compute a repeated expression once and store its result in a_____variable.
Hint
This compiler-created variable holds an intermediate result.
Answer
temporary
- 48An optimization is not guaranteed to improve performance because it may improve one aspect while making another aspect_____.
Hint
The transformation can introduce costs that outweigh its benefits.
Answer
worse
- 49Common subexpression elimination is most beneficial when the temporary result remains in a_____rather than being repeatedly loaded from memory.
Hint
This storage location is faster to access than cache or main memory.
Answer
register
- 50Loading a value from main memory is generally much slower than recomputing a simple addition because memory access may take orders of magnitude_____time.
Hint
The comparison concerns the number of cycles required.
Answer
more
- 51The storage location that is faster to access than the cache is a_____.
Hint
It is located directly in or very near the processor.
Answer
register
- 52Keeping a temporary in a register for a long time can prevent other variables from being stored in a register, thereby_____those variables.
Hint
The lecture uses this term for harming the performance of other variables.
Answer
victimizing
- 53Although the optimizer is intended to be machine independent, practical optimizations may depend on machine-specific parameters such as cache size and the number of_____.
Hint
These are limited fast storage locations used by instructions.
Answer
registers
- 54A compiler that generates code for many different processors, such as GCC, needs a complicated_____.
Hint
This phase must handle the differences among target processors.
Answer
backend
- 55The backend is the compiler phase that is truly_____dependent.
Hint
It must account for the actual instruction set and resources of the target processor.
Answer
machine
- 56Examples of target processors or architectures include Intel X86, ARM, GPUs, and_____processors.
Hint
These processors are designed for use within specialized devices or systems.
Answer
embedded
- 57The backend task of choosing an efficient sequence of actual machine instructions is called instruction_____.
Hint
It decides which target instructions implement an intermediate operation.
Answer
selection
- 58The backend task of assigning virtual registers to actual processor registers is called register_____.
Hint
It distributes a limited physical resource among computed values.
Answer
allocation
- 59The backend task of rearranging instructions to improve their execution order is called instruction_____.
Hint
It determines when individual instructions should execute.
Answer
scheduling
- 60Before register allocation, the compiler may assume that it has an_____number of registers.
Hint
This assumption simplifies earlier code-generation steps, although no real machine has this resource.
Answer
infinite
- 61Registers used before they are mapped to hardware registers are called_____registers.
Hint
They are abstract resources that do not yet correspond to physical processor locations.
Answer
virtual
- 62The register allocator maps virtual registers into_____registers.
Hint
These are the actual registers available on the target processor.
Answer
physical
- 63Some processors provide complex instructions that operate directly on memory_____.
Hint
These are the values or locations used by an instruction.
Answer
operands
- 64Instruction selection may replace separate load, load, and multiply operations with one complex instruction operating directly on_____operands.
Hint
These operands are located outside the processor's registers.
Answer
memory
- 65A generic assembly representation is lower level than an AST but is not yet actual_____code.
Hint
It has not yet been converted into instructions specific to a real processor.
Answer
machine
- 66A load instruction has a latency because its result may take several_____to become available.
Hint
This measures processor execution time.
Answer
cycles
- 67Instruction scheduling can improve performance by reordering instructions to hide_____.
Hint
These are delays before instruction results can be used.
Answer
latencies

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