Chapter 5 Flashcards

Names, Bindings & Scopes (44 cards)

1
Q

___ ___ in programming languages are used to make programs more readable by naming actions to be performed.

A

Special words

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

A ___ ___ is a special word of a programming language that cannot be used as a name.

A

Reserved word

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

A program ___ is an abstraction of a computer memory cell or collection of cells.

A

variable

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

A variable is characterized by 6 attributes. What are they?

A
Name
Address
Value
Type
Lifetime
Scope
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The address of a variable is the ___ ___ address with which it is associated.

A

machine memory

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

When more than one variable name can be used to access the same memory location, the variables are called ___.

A

Aliases

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

The ___ of a variable determines the range of values the variable can store and the set of operations that are defined for values of the that ___.

A

Type

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

The ___ of a variable is the contents of the memory cell or cells associated with the variable

A

value

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

a variable’s value is sometimes called its ___ because it is what is required when the name of the variable appears in the right side of an assignment statement.

A

r-value

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

A ___ is an association between an attribute and an entity, such as between a variable and its type or value, or between an operation and a symbol.

A

binding

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

The time in which the associations with a variable are made are called its ___ time.

A

binding

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

IN: count = count + 5;

The type of count is bound at ___ time.

A

compile

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

IN: count = count + 5;

The set of possible values of count is bound at ___ ___ time.

A

compiler design

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

IN: count = count + 5;

The meaning of the operator symbol + is bound at ___ time, when the types of its operands have been determined.

A

compile

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

IN: count = count + 5;

The internal representation of the literal 5 is bound at ___ ___ time

A

compiler design

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

IN: count = count + 5;

The value of count is bound at ___ time with this statement.

A

execution

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

A binding is ___ if it first occurs before run time begins and remains unchanged through program execution.

A

static

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

If the binding first occurs during run time or can change in the course of program execution, it is called ___

19
Q

An ___ ___ is a statement in a program that lists variable names and specifies that they are a particular type.

A

explicit declaration

20
Q

An ___ ___ is a means of associating variables with types through default conventions, rather than declaration statements.

A

implicit declaration

21
Q

The memory cell to which a variable is bound somehow must be taken from a pool of available memory; this process is called ___

22
Q

___ is the process of placing a memory cell that has been unbound from a variable back into the pool of available memory.

23
Q

The ___ of a variable is the time during which the variable is bound to a specific memory location.

24
Q

A ___ ___ is one that is bound to a memory cell before program execution begins and remains bound to that same memory cell until program execution terminates.

A

static variable

25
___-___ variables are those whose storage binding are created when their declaration statements are elaborated, but whose types are statically bound.
stack-dynamic
26
___ refers to the storage allocation and binding process indicated by the variable's declaration, which takes place when execution reaches the code to which the declaration is attached.
Elaboration
27
An advantage of __ variables is efficiency; addressing can be direct and no run-time overhead is incurred for allocation and deallocation.
static
28
A disadvantage of ___ binding is reduced flexibility; a language that has only static variables cannot support recursive subprograms.
static binding
29
An advantage of ___-___ variables is it allows for recursive subprograms by creating dynamic local storage for each active copy of the local variable.
stack-dynamic
30
A disadvantage of ___-___ is the overhead required for allocation and deallocation.
stack-dynamic
31
___ ___-___ variables are nameless (abstract) memory cells that are allocated and deallocated by explicit run-time instructions written by the programmer.
explicit heap-dynamic
32
The ___ is a collection of storage cells whose organization is highly disorganized due to the unpredictability of its use.
heap
33
___ ___-___ variables are often used to construct dynamic structures, such as linked lists and tress, that need to grow and/or shrink during execution.
Explicit heap-dynamic
34
The disadvantages of ___ ___-___ variables are the difficulty of using pointer and reference variables correctly, the cost of references to the variables and the complexity of the required storage management implementation.
explicit heap-dynamic
35
___ ___-___ variables are bound to heap storage only when they are assigned values.
Implicit heap-dynamic
36
The advantage of ___ ___-___ variables is that they have the highest degree of flexibility, allowing highly generic code to be written.
Implicit heap-dynamic
37
One disadvantage of ___ ___-___ variables is the run-time overhead of maintaining all the dynamic attributes, which could include array subscript types and ranges among others
Implicit heap-dynamic
38
The ___ of a variable is the range of statements in which the variable is visible.
scope
39
A variable is ___ in a statement if it can be referenced or assigned in that statement.
visible
40
___ scoping is when the scope of a variable can be determined prior to execution.
static
41
___ scoping is based on the calling sequence of subprograms, not on their spatial relationship to each other and can only be determined at run time.
Dynamic
42
The ___ ___ of a statement is the collection of all variables that are visible in the statement.
referencing environment
43
A ___ ___ is a variable that is bound to a value only once.
named constant
44
A binding of a variable to a value at the time it is bound to storage is called ___.
initialization