Deck 11: Compilers and Language Translation

Full screen (f)
exit full mode
Question
____________________ for high-level languages like C++ or Java are very large.
Use Space or
up arrow
down arrow
to flip the card.
Question
A BNF rule is also known as a production.
Question
High-level languages must be translated into hybrid language before they can be executed._________________________
Question
Parsing is the first phase of the compilation process._________________________
Question
The output of a parser is a(n) complete ____________________, or an error message if one cannot be constructed.
Question
In BNF, the syntax of a language is specified as a series of grammars._________________________
Question
The goal symbol is the final nonterminal.
Question
The input to a scanner is the machine language statement from the source program.
Question
The code a compiler produces should be reasonably efficient and concise.
Question
The English-language sentence, "The orange artichoke flew through the pink eight-legged elephant" is semantically meaningful._________________________
Question
A grammar that allows the construction of two or more distinct parse trees for the same statement is called a recursive grammar.
Question
Online debuggers help programmers locate and correct errors in programs.
Question
One of the possible local ____________________ is eliminating unnecessary operations.
Question
Performing local optimization is much more difficult than performing global optimization.
Question
Building two parse trees implies that the parser has demonstrated correctness in two different ways._________________________
Question
The output of a(n) ____________________ is a list of all the tokens contained in a high-level language statement, as well as the classification number of each token found.
Question
The righthand side of a BNF rule is the name of a single grammatical category.
Question
A high-level language statement is translated into a single machine language instruction.
Question
The singular goal of compilers is correctness.
Question
If a parser can convert the sequence of input tokens into the goal symbol, then that sequence of tokens is a syntactically ____________________ statement of the language.
Question
____ is where the compiler polishes and fine-tunes the translation so that it runs a little faster or occupies a little less memory.

A) Compilation
B) Generation
C) Optimization
D) Efficiency
Question
____ parsing algorithms examine several tokens "down the road" to see what would happen if a certain choice was made.

A) Look-ahead
B) Token prediction
C) Down-the-road
D) Recursive
Question
A high-level language program is called a(n) ____ program.

A) object
B) source
C) lexical
D) token
Question
A(n) ____ is a compiler embedded with a collection of supporting software.

A) debugger
B) reusable code library
C) visual development library
D) integrated development environment
Question
During parsing, a compiler deals only with the ____ of a statement.

A) semantics
B) syntax
C) grammar
D) rules
Question
The collection of all statements that can be successfully parsed is called the ____ defined by a grammar.

A) language
B) terminal
C) nonterminal
D) rule
Question
____ is the replacement of slow arithmetic operations with faster ones.

A) Strength reduction
B) Constant evaluation
C) Eliminating unnecessary operations
D) Parse tree construction
Question
In the ____ phase, the compiler examines the individual characters in the source program and groups them into tokens.

A) semantic analysis and code generation
B) parsing
C) lexical analysis
D) code optimization
Question
____ is the ability to write highly optimized programs that contain no wasted time or unnecessary memory cells.

A) Conciseness
B) Ambiguity
C) Code-aware
D) Efficiency
Question
____ begins at the productions in the tree that are nearest to the original input tokens.

A) Code generation
B) Parsing
C) Lexical analysis
D) Semantic analysis
Question
Following ____, the compiler makes a second pass over the parse tree to produce the translated code.

A) semantic analysis
B) lexical analysis
C) code optimization
D) code generation
Question
A ____ is a data structure that stores information about a nonterminal, such as the actual name of the object and its data type.

A) rule
B) production
C) parse tree
D) semantic record
Question
In ____ optimization, the compiler looks at large segments of the program to decide how to improve performance.

A) local
B) global
C) semantic
D) syntactical
Question
The Greek character lambda represents ___.

A) zero
B) the null string
C) the defined string
D) the unknown string
Question
In BNF, the ____ is used to separate two alternative definitions of a nonterminal.

A) forward slash
B) vertical bar
C) backward slash
D) asterisk
Question
During the ____ phase, the sequence of tokens formed by the scanner is checked to see whether it is syntactically correct according to the rules of the programming language.

A) lexical analysis
B) parsing
C) code optimization
D) semantic analysis and code generation
Question
A(n) ____ definition defines a nonterminal symbol in terms of itself.

A) ambiguous
B) recursive
C) local
D) global
Question
A ____ shows how individual tokens can be grouped into predefined grammatical categories until the desired goal is reached.

A) parse tree
B) scanner
C) parser
D) compiler
Question
In BNF, a ____ is an intermediate grammatical category used to help explain and organize the language.

A) production
B) rule
C) terminal
D) nonterminal
Question
In the ____ phase, the compiler takes the generated code and sees whether it can be made more efficient, either by making it run faster or having it occupy less memory.

A) code optimization
B) parsing
C) lexical analysis
D) semantic analysis and code generation
Question
What is the fundamental rule of parsing?
Question
What does this BNF rule say?
::= +
Question
Explain what metasymbols are and discuss their use as part of BNF rules.
Question
List three possible local optimizations.
Question
Present what each individual BNF rule looks like, and briefly explain its components.
Question
Explain what the goal in compiler design today is.
Question
Regardless of which programming language is being analyzed, every scanner performs virtually the same set of operations.What are they?
Question
If a parser is analyzing a statement in a language and it sees exactly the same sequence of objects that appears on the right-hand side of a BNF rule, what is it allowed to do?
Question
Explain what the goal symbol is, and explain what its significance is.
Question
What are the four phases of compilation?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 11: Compilers and Language Translation
1
____________________ for high-level languages like C++ or Java are very large.
Grammars
2
A BNF rule is also known as a production.
True
3
High-level languages must be translated into hybrid language before they can be executed._________________________
False
- machine
4
Parsing is the first phase of the compilation process._________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
The output of a parser is a(n) complete ____________________, or an error message if one cannot be constructed.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
In BNF, the syntax of a language is specified as a series of grammars._________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
The goal symbol is the final nonterminal.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
The input to a scanner is the machine language statement from the source program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The code a compiler produces should be reasonably efficient and concise.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
The English-language sentence, "The orange artichoke flew through the pink eight-legged elephant" is semantically meaningful._________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
A grammar that allows the construction of two or more distinct parse trees for the same statement is called a recursive grammar.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
Online debuggers help programmers locate and correct errors in programs.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
One of the possible local ____________________ is eliminating unnecessary operations.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Performing local optimization is much more difficult than performing global optimization.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
Building two parse trees implies that the parser has demonstrated correctness in two different ways._________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The output of a(n) ____________________ is a list of all the tokens contained in a high-level language statement, as well as the classification number of each token found.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The righthand side of a BNF rule is the name of a single grammatical category.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A high-level language statement is translated into a single machine language instruction.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
The singular goal of compilers is correctness.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
If a parser can convert the sequence of input tokens into the goal symbol, then that sequence of tokens is a syntactically ____________________ statement of the language.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
____ is where the compiler polishes and fine-tunes the translation so that it runs a little faster or occupies a little less memory.

A) Compilation
B) Generation
C) Optimization
D) Efficiency
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
____ parsing algorithms examine several tokens "down the road" to see what would happen if a certain choice was made.

A) Look-ahead
B) Token prediction
C) Down-the-road
D) Recursive
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
A high-level language program is called a(n) ____ program.

A) object
B) source
C) lexical
D) token
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
A(n) ____ is a compiler embedded with a collection of supporting software.

A) debugger
B) reusable code library
C) visual development library
D) integrated development environment
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
During parsing, a compiler deals only with the ____ of a statement.

A) semantics
B) syntax
C) grammar
D) rules
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The collection of all statements that can be successfully parsed is called the ____ defined by a grammar.

A) language
B) terminal
C) nonterminal
D) rule
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
____ is the replacement of slow arithmetic operations with faster ones.

A) Strength reduction
B) Constant evaluation
C) Eliminating unnecessary operations
D) Parse tree construction
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
In the ____ phase, the compiler examines the individual characters in the source program and groups them into tokens.

A) semantic analysis and code generation
B) parsing
C) lexical analysis
D) code optimization
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
____ is the ability to write highly optimized programs that contain no wasted time or unnecessary memory cells.

A) Conciseness
B) Ambiguity
C) Code-aware
D) Efficiency
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
____ begins at the productions in the tree that are nearest to the original input tokens.

A) Code generation
B) Parsing
C) Lexical analysis
D) Semantic analysis
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Following ____, the compiler makes a second pass over the parse tree to produce the translated code.

A) semantic analysis
B) lexical analysis
C) code optimization
D) code generation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
A ____ is a data structure that stores information about a nonterminal, such as the actual name of the object and its data type.

A) rule
B) production
C) parse tree
D) semantic record
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
In ____ optimization, the compiler looks at large segments of the program to decide how to improve performance.

A) local
B) global
C) semantic
D) syntactical
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
The Greek character lambda represents ___.

A) zero
B) the null string
C) the defined string
D) the unknown string
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
In BNF, the ____ is used to separate two alternative definitions of a nonterminal.

A) forward slash
B) vertical bar
C) backward slash
D) asterisk
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
During the ____ phase, the sequence of tokens formed by the scanner is checked to see whether it is syntactically correct according to the rules of the programming language.

A) lexical analysis
B) parsing
C) code optimization
D) semantic analysis and code generation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
A(n) ____ definition defines a nonterminal symbol in terms of itself.

A) ambiguous
B) recursive
C) local
D) global
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
A ____ shows how individual tokens can be grouped into predefined grammatical categories until the desired goal is reached.

A) parse tree
B) scanner
C) parser
D) compiler
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
In BNF, a ____ is an intermediate grammatical category used to help explain and organize the language.

A) production
B) rule
C) terminal
D) nonterminal
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
In the ____ phase, the compiler takes the generated code and sees whether it can be made more efficient, either by making it run faster or having it occupy less memory.

A) code optimization
B) parsing
C) lexical analysis
D) semantic analysis and code generation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
What is the fundamental rule of parsing?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
What does this BNF rule say?
::= +
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
Explain what metasymbols are and discuss their use as part of BNF rules.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
List three possible local optimizations.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
Present what each individual BNF rule looks like, and briefly explain its components.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
Explain what the goal in compiler design today is.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
Regardless of which programming language is being analyzed, every scanner performs virtually the same set of operations.What are they?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
If a parser is analyzing a statement in a language and it sees exactly the same sequence of objects that appears on the right-hand side of a BNF rule, what is it allowed to do?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
Explain what the goal symbol is, and explain what its significance is.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
What are the four phases of compilation?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.