Deck 10: Compilers and Language Translation

ملء الشاشة (f)
exit full mode
سؤال
The code a compiler produces should be efficient and concise.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
If a parser cannot produce a parse tree for a high-level language statement, then that statement is not correctly formed.
سؤال
The goal symbol is the highest-level nonterminal.
سؤال
A lexical analyzer is more commonly known as a scanner.
سؤال
The output of a scanner is a list of all the tokens contained in a high-level language statement, as well as the classification number of each token found.
سؤال
Performing local optimization is much more difficult than performing global optimization.
سؤال
One of the possible local optimizations is eliminating unnecessary operations.
سؤال
A high-level language statement is translated into a single machine language instruction.
سؤال
Nonterminals must appear on the left-hand side of one or more BNF rules.
سؤال
The right-hand side of a BNF rule is the name of a single grammatical category.
سؤال
In addition to building tokens, a scanner must classify them by type.
سؤال
Parsing is the first phase of the compilation process.
سؤال
All high-level programming language statements are translated into machine language code, whether or not they are semantically correct.
سؤال
The single goal of compilers is correctness.
سؤال
A grammar that allows the construction of two or more distinct parse trees for the same statement is called a recursive grammar.
سؤال
The BNF language's syntax is specified as a series of grammars.
سؤال
High-level languages must be translated into machine language before they can be executed.
سؤال
The input to a scanner is the machine language statement from the source program.
سؤال
The output of a parser is either a parse tree or an error message.
سؤال
On-line debuggers help programmers locate and correct errors in programs.
سؤال
In BNF, the ____ is used to separate two alternative definitions of a nonterminal.

A) forward slash
B) vertical bar
C) backward slash
D) asterisk
سؤال
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
سؤال
Grammars for high-level languages like C++ or Java are very large.
سؤال
A(n) ____ definition defines a nonterminal symbol in terms of itself.

A) ambiguous
B) recursive
C) local
D) global
سؤال
If a parser can convert the sequence of tokens into the goal symbol, then the sequence is an invalid statement.
سؤال
The English-language sentence, "The orange artichoke flew through the elephant" is syntactically incorrect, but semantically meaningful.
سؤال
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
سؤال
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
سؤال
A high-level language program is called a(n) ____ program.

A) object
B) source
C) lexical
D) token
سؤال
A BNF rule is also known as a production.
سؤال
____ 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
سؤال
____ 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
سؤال
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
سؤال
In the ____ phase, the compiler determines whether the machine language translation that it had produced can be made more efficient.

A) code optimization
B) parsing
C) lexical analysis
D) semantic analysis and code generation
سؤال
BNF metasymbols are symbols of BNF that are used to describe BNF symbols.
سؤال
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
سؤال
Following ____, the compiler makes a second pass over the parse tree to produce the code.

A) semantic analysis
B) lexical analysis
C) code optimization
D) code generation
سؤال
In BNF, a ____ is an intermediate grammatical category used to help explain and organize the language.

A) production
B) rule
C) terminal
D) nonterminal
سؤال
In the ____ phase, the compiler analyzes the meaning of the tokens making up a programming language statement and tries to understand the actions they perform.

A) semantic analysis and code generation
B) parsing
C) lexical analysis
D) code optimization
سؤال
During the compilation process, ____ is the next step after the code generation step.

A) semantic analysis
B) code optimization
C) lexical analysis
D) parsing
سؤال
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
سؤال
What is the format of a BNF rule?

A) left-hand side := right-hand side
B) left-hand side ::= "definition"
C) grammar = rule
D) grammar | rule
سؤال
____, the replacement of an arithmetic operation with a faster one is an example of a possible local optimization.

A) Strength reduction
B) Constant evaluation
C) Eliminating unnecessary operations
D) Parse tree construction
سؤال
____ 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
سؤال
Which factor plays the biggest role in code efficiency?

A) compilation process
B) code optimization
C) algorithm selected
D) code conciseness
سؤال
The ____ represents the empty nonterminal.

A) zero
B) null string
C) asterisk
D) vertical line
سؤال
In BNF, ____ are not defined any further by other rules of the grammar.

A) terminals
B) nonterminals
C) constants
D) variables
سؤال
The ____ of a statement is its grammatical structure.

A) syntax
B) semantics
C) correctness
D) grammar
سؤال
The collection of all statements that can be successfully parsed is called the ____ defined by a grammar.

A) language
B) syntax
C) grammar
D) rule
سؤال
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 Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 10: Compilers and Language Translation
1
The code a compiler produces should be efficient and concise.
True
2
If a parser cannot produce a parse tree for a high-level language statement, then that statement is not correctly formed.
True
3
The goal symbol is the highest-level nonterminal.
True
4
A lexical analyzer is more commonly known as a scanner.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
The output of a scanner is a list of all the tokens contained in a high-level language statement, as well as the classification number of each token found.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
Performing local optimization is much more difficult than performing global optimization.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
One of the possible local optimizations is eliminating unnecessary operations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
A high-level language statement is translated into a single machine language instruction.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
Nonterminals must appear on the left-hand side of one or more BNF rules.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
The right-hand side of a BNF rule is the name of a single grammatical category.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
In addition to building tokens, a scanner must classify them by type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
Parsing is the first phase of the compilation process.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
All high-level programming language statements are translated into machine language code, whether or not they are semantically correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
The single goal of compilers is correctness.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
A grammar that allows the construction of two or more distinct parse trees for the same statement is called a recursive grammar.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
The BNF language's syntax is specified as a series of grammars.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
High-level languages must be translated into machine language before they can be executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
The input to a scanner is the machine language statement from the source program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
The output of a parser is either a parse tree or an error message.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
On-line debuggers help programmers locate and correct errors in programs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
In BNF, the ____ is used to separate two alternative definitions of a nonterminal.

A) forward slash
B) vertical bar
C) backward slash
D) asterisk
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
Grammars for high-level languages like C++ or Java are very large.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
A(n) ____ definition defines a nonterminal symbol in terms of itself.

A) ambiguous
B) recursive
C) local
D) global
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
If a parser can convert the sequence of tokens into the goal symbol, then the sequence is an invalid statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
The English-language sentence, "The orange artichoke flew through the elephant" is syntactically incorrect, but semantically meaningful.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
A high-level language program is called a(n) ____ program.

A) object
B) source
C) lexical
D) token
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
A BNF rule is also known as a production.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
____ 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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
____ 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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
In the ____ phase, the compiler determines whether the machine language translation that it had produced can be made more efficient.

A) code optimization
B) parsing
C) lexical analysis
D) semantic analysis and code generation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
BNF metasymbols are symbols of BNF that are used to describe BNF symbols.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Following ____, the compiler makes a second pass over the parse tree to produce the code.

A) semantic analysis
B) lexical analysis
C) code optimization
D) code generation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
In BNF, a ____ is an intermediate grammatical category used to help explain and organize the language.

A) production
B) rule
C) terminal
D) nonterminal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
In the ____ phase, the compiler analyzes the meaning of the tokens making up a programming language statement and tries to understand the actions they perform.

A) semantic analysis and code generation
B) parsing
C) lexical analysis
D) code optimization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
During the compilation process, ____ is the next step after the code generation step.

A) semantic analysis
B) code optimization
C) lexical analysis
D) parsing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
What is the format of a BNF rule?

A) left-hand side := right-hand side
B) left-hand side ::= "definition"
C) grammar = rule
D) grammar | rule
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
____, the replacement of an arithmetic operation with a faster one is an example of a possible local optimization.

A) Strength reduction
B) Constant evaluation
C) Eliminating unnecessary operations
D) Parse tree construction
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
____ 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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
Which factor plays the biggest role in code efficiency?

A) compilation process
B) code optimization
C) algorithm selected
D) code conciseness
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
The ____ represents the empty nonterminal.

A) zero
B) null string
C) asterisk
D) vertical line
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
In BNF, ____ are not defined any further by other rules of the grammar.

A) terminals
B) nonterminals
C) constants
D) variables
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
The ____ of a statement is its grammatical structure.

A) syntax
B) semantics
C) correctness
D) grammar
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
The collection of all statements that can be successfully parsed is called the ____ defined by a grammar.

A) language
B) syntax
C) grammar
D) rule
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.