Module 3: Basic Semantics and Pointer Semantics Flashcards
What is semantics concerned with?
Semantics is concerned with what the parse tree means.
What are the properties that we want from language semantics definitions? (Select all that apply)
a. Preciseness
b. Acceptability
c. Predictability
d. Complete
a. Preciseness
c. Predictability
d. Complete
What are the ways that language semantics can be specified?
a. English specification
b. Reference implementation
c. Formal Language
d. All of the above
d. All of the above
Given the line of code below, is this an explicit or implicit declaration?
int i;
This is an explicit declaration. We are saying that i is that name of the variable explicitly
What does the following represent?
target = test_value + 10
a. explicit declaration
b. implicit declaration
b. implicit declaration
What does scope cover in semantics?
a. How long is the name valid?
b. How to resolve the name?
c. What is the name?
d. What declaration is the name mapped to
a. How long is it valid
b. How to resolve the name
d. What declaration is the name mapped to
What kind of scoping does the C programming language use?
a. Block-level
b. Function-level
c. None
a. Block-level
What is used to map the name to the declaration in scoping?
a. Variable table
b. Nothing
c. Declaration table
d. Symbol table
d. Symbol table
What are the two types of scoping?
a. Static Scoping
b. Dynamic Scoping
How can function calls be resolved to appropriate functions?
a. Names
b. Names + return type?
c. Names + parameter number?
d. Names + parameter number + parameter types
e. All of the above
e. All of the above
Using a box and circle diagram what does the x represent?
a. Name
b. Binding
c. Location
d. Value
a. Name
Using a box and circle diagram what does the box represent?
a. Name
b. Binding
c. Location
d. Value
c. Location
Using a box and circle diagram what does the circle represent?
a. Name
b. Binding
c. Location
d. Value
d. Value
Using a box and circle diagram what does the line represent?
a. Name
b. Binding
c. Location
d. Value
b. Binding
What are the two operations with pointers?
The address operator (&) and the deference operator (*)