Unit 4 - Chapter 11 Flashcards

1
Q

The program that performs lexical analysis is called a

A

lexical analyzer or more commonly, a scanner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

tokens

A

are syntactical units that are treated as single, indivisible entities for the purposes of translations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

every scanner performs virtually the same set of operations:

A

(1) it discards blanks and other nonessential characters and looks for the beginning of a token; (2) when it finds the beginning, it puts characters together until (3) it detects the end of the token, at which point it classifies the token and begins looking for the next one. This algorithm works properly regardless of what tokens look like.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

parsing phase

A

a compiler determines whether the tokens are syntactically legal statement of the programming language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

parse tree

A

It starts from the individual tokens in the statement, a,=,b,+,and c, and show how these tokens can be grouped into predefined grammatical categories such as , , and until the desired goal is reaches - in this case, . The successful constructions of a parse tree is proof that this statement is correctly formed according to the rules of the language. If a parser cannot produce such a parse tree, then the statement is not correctly formed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In the field of compiler design, the process of diagramming a high-level language statement is called

A

parsing. and it is done by a program called a parser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The parser must be given a formal description of the syntax - the grammatical structure - of the language that it is going to analyze. The most widely used notations for representing the syntax of a programming language is called

A

BNF, and acronym for Backus-Naur Form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In BNF

A

the syntax of a language is specified as a set of rules, also called productions. The entire collections of rules is called a grammar.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Terminals

A

are the actual tokens of the language recognized and returned by a scanner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

nonterminal

A

A nonterminal is not an actual element of the language but an intermediate grammatical category used to help explain and organize the language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Goal symbol

A

This is the final nonterminal, and it is the nonterminal object that the parser is trying to produce as it builds the parse tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

lambda λ represents

A

the null string - nothing at all. It is possible that a nonterminal can be “empty”, and the symbol λ is used to indicate this.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

look-ahead parsing algorithms

A

These algorithms “ look down the road” a few tokens to see what would happen if a certain choice is made.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Recursive definition

A

defines the nonterminal symbol in terms of itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Grammar that allows the construction of two or more distinct parse trees for the same statement is said to be

A

ambiguous.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A semantic record is

A

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

17
Q

Code generation

A

The compiler must determine how that transformation can be accomplished in machine language.

18
Q

Optimization

A

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

19
Q

Visual development environments

A

use graphics and video to let the programmer see what is happening

20
Q

Online debuggers

A

help programmers locate and correct errors.

21
Q

Reusable code libraries

A

contain a large collection of prewritten program units.

22
Q

When a compiler is embedded within a collection of supporting software development routines such as debuggers, editors, toolkits, and libraries, it is called

A

an integrated development environment (IDE).

23
Q

Local optimization

A

the compiler looks at a very small block of instructions, typically from one to five. It tries to determine how it can improve the efficiency of this local code block without regard for what instructions come before or after.

24
Q

Global optimization

A

the compiler looks at large segments of the program, not just small pieces, to determine how to improve performance.