1. Home
  2. Explore
  3. Computer Science
  4. Compiler Components Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Compiler Components Overview

  • 67Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Compiler Architecture
The three conceptual phases of an optimizing compiler are the front end, the optimizer, and the
.

67 questions

  1. 1
    The 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

  2. 2
    The 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

  3. 3
    The backend of a compiler is also known as the
    _____
    .
    Hint

    It transforms an intermediate representation into machine-oriented instructions.

    Answer

    code generator

  4. 4
    The 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

  5. 5
    A 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

  6. 6
    In 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

  7. 7
    The 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

  8. 8
    If 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

  9. 9
    An abstract syntax tree, or AST, is one type of compiler
    _____
    representation.
    Hint

    It lies between source code and final machine code.

    Answer

    intermediate

  10. 10
    An 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

  11. 11
    The AST for an assignment such as X = A + B represents the addition and the
    _____
    operation.
    Hint

    This operation places the computed result into the variable on the left.

    Answer

    assignment

  12. 12
    The 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

  13. 13
    Compilers 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

  14. 14
    In conceptual assembly, names such as variable A and variable B are examples of
    _____
    information.
    Hint

    The information uses human-readable names rather than numeric locations.

    Answer

    symbolic

  15. 15
    Real assembly language for a specific processor generally replaces variable names with memory
    _____
    .
    Hint

    These identify locations where variables are stored.

    Answer

    addresses

  16. 16
    For 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

  17. 17
    The stack frame for the currently executing function is also called an
    _____
    record.
    Hint

    It stores information associated with one function invocation.

    Answer

    activation

  18. 18
    Scanning is also called
    _____
    analysis or lexing.
    Hint

    This phase deals with the smallest meaningful units of source text.

    Answer

    lexical

  19. 19
    The 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

  20. 20
    The 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

  21. 21
    In the input X12 = A3 + B45, X12, A3, and B45 are identified as
    _____
    .
    Hint

    They name variables in the program.

    Answer

    identifiers

  22. 22
    The 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

  23. 23
    A 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

  24. 24
    The lexical rules that define what a variable name may contain are specified using regular
    _____
    .
    Hint

    This formal notation describes patterns in strings.

    Answer

    expressions

  25. 25
    The implementation of regular-expression-based scanning uses finite state
    _____
    .
    Hint

    These computational models recognize patterns by moving among states.

    Answer

    automata

  26. 26
    The parser is the second major phase of the compiler
    _____
    .
    Hint

    It follows scanning and precedes semantic analysis.

    Answer

    front end

  27. 27
    Parsing is also called
    _____
    analysis.
    Hint

    This analysis checks the structure of statements according to language rules.

    Answer

    syntactic

  28. 28
    A 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

  29. 29
    In 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

  30. 30
    An 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

  31. 31
    The syntactic rules defining legal statements in a programming language are called
    _____
    .
    Hint

    They specify how tokens can be arranged into valid constructs.

    Answer

    grammars

  32. 32
    An 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

  33. 33
    A 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

  34. 34
    Unlike 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

  35. 35
    Semantic 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

  36. 36
    A 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

  37. 37
    An 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

  38. 38
    Adding 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

  39. 39
    A 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

  40. 40
    Semantic 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

  41. 41
    To 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

  42. 42
    The compiler stores information about declared variables in a
    _____
    table.
    Hint

    This table associates names with information needed during compilation.

    Answer

    symbol

  43. 43
    In 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

  44. 44
    The optimizer applies transformations to improve the
    _____
    of generated code.
    Hint

    The goal may include better speed or resource use.

    Answer

    quality

  45. 45
    Optimizations 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

  46. 46
    Common 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

  47. 47
    In 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

  48. 48
    An 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

  49. 49
    Common 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

  50. 50
    Loading 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

  51. 51
    The 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

  52. 52
    Keeping 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

  53. 53
    Although 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

  54. 54
    A 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

  55. 55
    The 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

  56. 56
    Examples 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

  57. 57
    The 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

  58. 58
    The 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

  59. 59
    The backend task of rearranging instructions to improve their execution order is called instruction
    _____
    .
    Hint

    It determines when individual instructions should execute.

    Answer

    scheduling

  60. 60
    Before 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

  61. 61
    Registers 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

  62. 62
    The register allocator maps virtual registers into
    _____
    registers.
    Hint

    These are the actual registers available on the target processor.

    Answer

    physical

  63. 63
    Some processors provide complex instructions that operate directly on memory
    _____
    .
    Hint

    These are the values or locations used by an instruction.

    Answer

    operands

  64. 64
    Instruction 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

  65. 65
    A 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

  66. 66
    A load instruction has a latency because its result may take several
    _____
    to become available.
    Hint

    This measures processor execution time.

    Answer

    cycles

  67. 67
    Instruction scheduling can improve performance by reordering instructions to hide
    _____
    .
    Hint

    These are delays before instruction results can be used.

    Answer

    latencies

1 of 67
Question 1 of 67

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent