Deck 7: Basic Semantics

Full screen (f)
exit full mode
Question
Locations are places where values can be stored.
Use Space or
up arrow
down arrow
to flip the card.
Question
A translator's symbol table stores the mappings between names and attributes.
Question
The declaration before use scoping rule in C allows any declaration to be used as long as it is declared within the current block.
Question
Names can be bound to attributes prior to translation time,as in the case of predefined identifiers.
Question
Each function call generates a region of allocated memory associated with the function; this is called an activation record.
Question
If an operator can be used to perform more than one operation,it is said to be shadowed.
Question
In C,blocks are called compound statements.
Question
Any scoping structure that can be referenced directly in a language must have its own symbol table.
Question
Declaration visibility includes only those regions of a program where the bindings of the declaration apply.
Question
When a nonlocal name is used in an expression,the declaration that applies to that name cannot be determined until execution time under dynamic scoping.
Question
A block consists of a sequence of declarations followed by a sequence of statements.
Question
In C++,declarations that bind all potential attributes are called prototypes.
Question
The lifetime of an object is the duration of its allocation in the environment.
Question
Declarations in surrounding blocks are called nonlocal declarations.
Question
A fundamental abstraction mechanism in any programming language is the use of names,or identifiers to denote language entities or constructs.
Question
The meaning of a name cannot be determined by the attributes associated with it.
Question
Binding time refers to when an attribute is computed and bound to a name.
Question
Static binding occurs during execution.
Question
Names can be reused within nested blocks by associating each declaration with a level number and an offset.
Question
Lexical scoping rules are sometimes called dynamic scoping.
Question
____ are generally bound at load time.

A) Global variables
B) Predefined identifiers
C) All variables
D) All attributes
Question
The bindings of ____ to storage locations is called the memory.

A) names
B) values
C) attributes
D) identifiers
Question
____ are any storable quantities,such as integers.

A) Data
B) Values
C) Locations
D) Identifiers
Question
The bindings of names to storage locations is called the ____.

A) translator
B) compiler
C) environment
D) symbol table
Question
In a block-structured language with heap allocation,there are three kinds of allocation: static (for global variables),automatic (for local variables),and dynamic (for heap allocation).
Question
The ____ is the level number and offset of a declared name.

A) lexical address
B) block address
C) compound address
D) explicit address
Question
____ binding occurs during execution.

A) Static
B) Rapid
C) Value
D) Dynamic
Question
The body of an externally defined function will not be bound until ____.

A) execution time
B) link time
C) translation time
D) load time
Question
If an operator performs more than one function it is said to be ____.

A) overloaded
B) shadowed
C) implicit
D) variable
Question
The scope of a binding is ____.

A) the region over which the binding is maintained
B) the precision of the binding
C) the time when the binding takes place
D) the magnitude of the binding
Question
Static constants are always computed at load time.
Question
In C++,declarations that bind all potential attributes are called ____.

A) prototypes
B) definitions
C) symbols
D) explicits
Question
Each call to a method is referred to as a(n)____.

A) invocation
B) execution
C) activation
D) branching
Question
In object-oriented languages such as Java and Smalltalk,the ____ is the only declaration that does not itself need to be inside another class declaration.

A) class
B) module
C) file
D) package
Question
____ declarations are associated with a specific block.

A) Global
B) Specific
C) Local
D) General
Question
Dangling references are locations that have been deallocated from the environment but can still be accessed by a program.
Question
Java requires manual deallocation of objects.
Question
Java uses assignment by cloning for all object variables.
Question
In C,the scope of a binding is limited to the block in which its associated declaration appears.This scoping rule is called ____ scope.

A) block
B) lexical
C) package
D) namespace
Question
A variable declared locally within a block is said to ____ a global variable of the same name.

A) occlude
B) override
C) mirror
D) shadow
Question
When a change in the value of a variable persists beyond the execution of a statement,a(n)____ has occurred.

A) side effect
B) persistent effect
C) error
D) compound change
Question
A ____ is an object whose stored value can change during execution.

A) variable
B) class
C) pointer
D) method
Question
Language systems that automatically reclaim garbage are said to perform ____.

A) memory reallocation
B) memory reclamation
C) recycling
D) garbage collection
Question
Dynamic allocation places variables ____.

A) on the stack
B) in the symbol table
C) in the pointer list
D) on the heap
Question
A pointer is an object whose stored value is a(n)____.

A) compound value
B) activation record
C) reference to another object
D) direction
Question
A(n)____ occurs when the same object is bound to two different names at the same time.

A) conflict
B) alias
C) multi-reference
D) duplicate
Question
Garbage is defined as ____.

A) a collection of unused constants
B) a collection of unused variables
C) variables with duplicate values
D) memory that has been allocated in the environment but that has become inaccessible to the program
Question
In C,the ____ operator retrieves the address of a variable as a pointer.

A) dereference
B) reference
C) address of
D) allocation
Question
A ____ constant is a name for a literal.

A) compile-time
B) static
C) manifest
D) symbolic
Question
Assignment by sharing works by ____.

A) copying the value to a new location
B) duplicating memory addresses
C) copying the location of the first variable to the second
D) accessing shared memory
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Basic Semantics
1
Locations are places where values can be stored.
True
2
A translator's symbol table stores the mappings between names and attributes.
True
3
The declaration before use scoping rule in C allows any declaration to be used as long as it is declared within the current block.
False
4
Names can be bound to attributes prior to translation time,as in the case of predefined identifiers.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Each function call generates a region of allocated memory associated with the function; this is called an activation record.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
If an operator can be used to perform more than one operation,it is said to be shadowed.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
In C,blocks are called compound statements.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
Any scoping structure that can be referenced directly in a language must have its own symbol table.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
Declaration visibility includes only those regions of a program where the bindings of the declaration apply.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
When a nonlocal name is used in an expression,the declaration that applies to that name cannot be determined until execution time under dynamic scoping.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
A block consists of a sequence of declarations followed by a sequence of statements.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
In C++,declarations that bind all potential attributes are called prototypes.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
The lifetime of an object is the duration of its allocation in the environment.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Declarations in surrounding blocks are called nonlocal declarations.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
A fundamental abstraction mechanism in any programming language is the use of names,or identifiers to denote language entities or constructs.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The meaning of a name cannot be determined by the attributes associated with it.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Binding time refers to when an attribute is computed and bound to a name.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
Static binding occurs during execution.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Names can be reused within nested blocks by associating each declaration with a level number and an offset.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
Lexical scoping rules are sometimes called dynamic scoping.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
____ are generally bound at load time.

A) Global variables
B) Predefined identifiers
C) All variables
D) All attributes
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
The bindings of ____ to storage locations is called the memory.

A) names
B) values
C) attributes
D) identifiers
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
____ are any storable quantities,such as integers.

A) Data
B) Values
C) Locations
D) Identifiers
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The bindings of names to storage locations is called the ____.

A) translator
B) compiler
C) environment
D) symbol table
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
In a block-structured language with heap allocation,there are three kinds of allocation: static (for global variables),automatic (for local variables),and dynamic (for heap allocation).
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ is the level number and offset of a declared name.

A) lexical address
B) block address
C) compound address
D) explicit address
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
____ binding occurs during execution.

A) Static
B) Rapid
C) Value
D) Dynamic
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
The body of an externally defined function will not be bound until ____.

A) execution time
B) link time
C) translation time
D) load time
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
If an operator performs more than one function it is said to be ____.

A) overloaded
B) shadowed
C) implicit
D) variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The scope of a binding is ____.

A) the region over which the binding is maintained
B) the precision of the binding
C) the time when the binding takes place
D) the magnitude of the binding
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Static constants are always computed at load time.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
In C++,declarations that bind all potential attributes are called ____.

A) prototypes
B) definitions
C) symbols
D) explicits
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
Each call to a method is referred to as a(n)____.

A) invocation
B) execution
C) activation
D) branching
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
In object-oriented languages such as Java and Smalltalk,the ____ is the only declaration that does not itself need to be inside another class declaration.

A) class
B) module
C) file
D) package
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
____ declarations are associated with a specific block.

A) Global
B) Specific
C) Local
D) General
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Dangling references are locations that have been deallocated from the environment but can still be accessed by a program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
Java requires manual deallocation of objects.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Java uses assignment by cloning for all object variables.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
In C,the scope of a binding is limited to the block in which its associated declaration appears.This scoping rule is called ____ scope.

A) block
B) lexical
C) package
D) namespace
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
A variable declared locally within a block is said to ____ a global variable of the same name.

A) occlude
B) override
C) mirror
D) shadow
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
When a change in the value of a variable persists beyond the execution of a statement,a(n)____ has occurred.

A) side effect
B) persistent effect
C) error
D) compound change
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
A ____ is an object whose stored value can change during execution.

A) variable
B) class
C) pointer
D) method
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
Language systems that automatically reclaim garbage are said to perform ____.

A) memory reallocation
B) memory reclamation
C) recycling
D) garbage collection
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
Dynamic allocation places variables ____.

A) on the stack
B) in the symbol table
C) in the pointer list
D) on the heap
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
A pointer is an object whose stored value is a(n)____.

A) compound value
B) activation record
C) reference to another object
D) direction
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
A(n)____ occurs when the same object is bound to two different names at the same time.

A) conflict
B) alias
C) multi-reference
D) duplicate
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
Garbage is defined as ____.

A) a collection of unused constants
B) a collection of unused variables
C) variables with duplicate values
D) memory that has been allocated in the environment but that has become inaccessible to the program
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
In C,the ____ operator retrieves the address of a variable as a pointer.

A) dereference
B) reference
C) address of
D) allocation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
A ____ constant is a name for a literal.

A) compile-time
B) static
C) manifest
D) symbolic
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
Assignment by sharing works by ____.

A) copying the value to a new location
B) duplicating memory addresses
C) copying the location of the first variable to the second
D) accessing shared memory
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.