CS105 Chapter 11

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

35. ______________ begins at the productions in the tree that are nearest to the original input tokens.

Code generation

37. ______________ is the ability to write highly optimized programs that contain no wasted time or unnecessary memory cells.

Efficiency

11. A high-level language statement is translated into a single machine language instruction. T/F

False

12. The singular goal of compilers is correctness. T/F

False

14. The input to a scanner is the machine language statement from the source program. T/F

False

15. A BNF rule is also known as a token. T/F

False

16. The right-hand side of a BNF rule is the name of a single grammatical category. T/F

False

18. A grammar that allows the construction of two or more distinct parse trees for the same statement is called a recursive grammar. T/F

False

2. Parsing is the first phase of the compilation process. T/F

False

20. Performing local optimization is much more difficult than performing global optimization. T/F

False

5. The English-language sentence, "The orange artichoke flew through the pink eight-legged elephant" is semantically meaningful. T/F

False

9. ____________ for high-level languages like C++ or Java are very large.

Grammars

48. The goal in compiler design today is to provide a wide array of tools - such as a visual development environment and reusable code libraries, usually as part of a(n) ___________ - that simplifies the programmer's task and increase his or her productivity.

IDE

38. A(n) _________________________ is a compiler embedded with a collection of supporting software.

Integrated Development Environment

30. _____________ parsing algorithms examine several tokens "down the road" to see what would happen if a certain choice was made.

Look-ahead

36. ________________ is where the compiler polishes and fine-tunes the translation so that it runs a little faster or occupies a little less memory.

Optimization

39. _____________ is the replacement of slow arithmetic operations with faster ones.

Strength reduction

21. During the parsing phase, the sequence of tokens formed by the scanner is checked to see whether it is _______________ correct according to the rules of the programming language.

Syntactically

13. The code a compiler produces should be reasonably efficient and concise. T/F

True

17. The goal symbol is the final nonterminal. T/F

True

19. Online debuggers help programmers locate and correct errors in programs. T/F

True

3. In BNF, the syntax of a language is specified as a series of rules. T/F

True

4. Building two parse trees implies that the parser has demonstrated correctness in two different ways. T/F

True

High-level languages must be translated into machine language before they can be executed. T/F

True

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

code optimization

45. The fundamental rule of parsing is that if, by repeated applications of the rules of the grammar, a parser can convert the sequence of input tokens into the __________ symbol, then that sequence of tokens is a syntactically valid statement of the language.

goal

44. 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, it is allowed to replace them with the one _______________ object on the left-hand side of that rule.

grammatical

43. The format of a BNF (Backus-Naur Form) rule (or production)—left-hand side ::= "definition"—where the left-hand side is the name of a single grammatical category, the BNF operator ::= means "___________," and the "definition" specifies the grammatical structure of the symbol appearing on the left-hand side.

is defined as

27. The collection of all statements that can be successfully parsed is called the _____________ defined by a grammar.

language

40. In global optimization, the compiler looks at __________ segments of the program to decide how to improve performance.

large

22. In the ______________ phase, the compiler examines the individual characters in the source program and groups them into tokens.

lexical analysis

42. In the ___________ phase of the compilation process the compiler (1) looks for the beginning of a token, (2) puts characters together until the end of the token, (3) classifies the token and begins looking for the next one.

lexical analysis

10. One of the possible _________ optimizations is eliminating unnecessary operations.

local

47. The three symbols used as part of BNF rules (<, >, and ::=) are termed ______________, symbols of one language that are being used to describe the characteristics of another.

metasymbols

46. The goal symbol of every grammar is a special (and final) ________________ which the parser is trying to produce as it builds the parse tree.

nonterminal

25. A ___________ shows how individual tokens can be grouped into predefined grammatical categories until the desired goal is reached.

parse tree

7. The output of a parser is a(n) complete _______________, or an error message if one cannot be constructed.

parse tree

26. In __________ a nonterminal is an intermediate grammatical category used to help explain and organize the language.

parsing

31. A(n) ________ definition defines a nonterminal symbol in terms of itself.

recursive

41. The four phases of compilation: (1) lexical analysis (or ____________), (2) parsing, (3) semantics analysis and code generation, and (4) code optimization.

scanning

34. Following _______________, the compiler makes a second pass over the parse tree to produce the translated code.

semantic analysis

33. A ________________ is a data structure that stores information about a nonterminal, such as the actual name of the object and its data type.

semantic record

24. A high-level language program is called a(n) _________ program

source

32. During parsing, a compiler deals only with the ___________ of a statement.

syntax

28. The Greek character lambda represents ____________________

the null string

6. The output of a scanner is a list of all the ____________ contained in a high-level language statement as well as the classification number of each token found.

tokens

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

valid

29. In BNF, the ____________ is used to separate two alternative definitions of a nonterminal.

vertical bar


Set pelajaran terkait

Silent Animation: Fleischer and Disney

View Set

Chapter 5 Organizational Behavior

View Set

Ch 27 - safety, security, and emergency preparedness

View Set

three Evolutionary Faunas; standardization; early experimentation

View Set