Part 1 Flashcards

1
Q

Static Variable

A

Bound to memory cells before execution, begins and remains bound to the same memory cell throughout execution

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

Stack Dynamic

A

Storage bindings are created for variables when their declaration statements are elaborated

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

Explicit heap-Dynamic

A

Allocated and Deallocated by explicit directive, specified by the programmer, which take effect during execution

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

Implicit heap-Dynamic

A

Allocation and deallocation caused by assignment statements

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

Scope of a variable

A

Range of statements over which it is visible (can be referenced, used, or accessed)

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

Local Variables

A

Those that are declared in that unit

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

Nonlocal variables

A

those that are visible in the unit but not declared there

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

Global Variables

A

Special category of nonlocal variables

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

Scope rules

A

Determine how references to names are associated with variables

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

Lifetime of a Variable

A

The time during which it is bound to a particular memory cell

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

Static Scope

A

Known at compile time. Based on the physical structure of the program

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

Dynamic Scope

A

Determined at run time based on the calling sequence

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

Static Scope Search

A

First Locally, then in increasingly larger enclosing scopes, until one is found for the given name

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

Static Ancestors

A

Enclosing static scopes to a specific scope

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

Static Parent

A

Nearest static ancestor

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

Diff between Lifetime and Scope

A

Lifetime is the entire code, Scope is code that is accessed

17
Q

Ways of Declaration Order

A

1) All declarations of variables are at the top of the function and all variables must be declared
2) All variables must be declared but the scope begins at the declaration point and goes through to the end of the block
3) Regardless of where a variable is declared, it’s scope is the entire class

18
Q

Languages where variables can be declared in For statements

A

C++, Java, C#

19
Q

Referencing Environments

A

The collection of all names that are visible in the statement; in static scope, it is the local variables plus all the visible variables in all of the enclosing scopes

20
Q

A Subprogram

A

is active if its execution has begun but has not yet been terminated

21
Q

Named Constant

A

Variable that is bound to a value only when it is bound to storage

22
Q

Type Checking

A

Activity of ensuring that the operands of an operator are of compatible types

23
Q

Compatible Type

A

Either legal for the operator, or is allowed under language rules to be implicitly converted, by compiler-generated code, to a legal type

24
Q
A